123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674 |
- {extend name="common/base"/}
- <!-- 主体 -->
- {block name="body"}
- <div class="p-3">
- <div class="gg-form-bar border-t border-x">
- <form id="taskForm" class="layui-form" lay-filter="barsearchform">
- <div class="layui-input-inline" style="width:100px;">
- <select name="project_status" lay-filter="status">
- <option value="">项目状态</option>
- <option value="1">立项中</option>
- <option value="2">审批中</option>
- <option value="3">待接收</option>
- <option value="4">分配中</option>
- <option value="5">作业中</option>
- <option value="6">归档中</option>
- <option value="7">退审中</option>
- <option value="8">已归档</option>
- <option value="9">已退审</option>
- </select>
- </div>
- <div class="layui-input-inline">
- <select id="province" lay-filter="province" name="province">
- <option value="">省</option>
- </select>
- </div>
- <div class="layui-input-inline">
- <select id="city" lay-filter="city" name="city">
- <option value="">市</option>
- </select>
- </div>
- <div class="layui-input-inline">
- <select id="area" lay-filter="area" name="area">
- <option value="">县</option>
- </select>
- </div>
- <div id="time_date" class="layui-input-inline">
- <div class="layui-input-inline">
- <input type="text" id="start_time" name="project_start_time" readonly placeholder="请选择" class="layui-input" value="">
- </div>
- <div class="layui-input-inline">-</div>
- <div class="layui-input-inline">
- <input type="text" id="end_time" name="project_end_time" readonly placeholder="请选择" class="layui-input" value="">
- </div>
- </div>
- <div class="layui-input-inline" style="width:200px;">
- <input type="text" name="review_unit_name" placeholder="评审机构" class="layui-input" autocomplete="off" />
- </div>
- <div class="layui-input-inline" style="width:200px;">
- <input type="text" name="entrust_unit_name" placeholder="委托单位" class="layui-input" autocomplete="off" />
- </div>
- <div class="layui-input-inline" style="width:200px;">
- <input type="text" name="keyword" placeholder="关键字" class="layui-input" autocomplete="off" />
- </div>
- <div class="layui-input-inline" style="width:150px;">
- <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform"><i class="layui-icon layui-icon-search mr-1"></i>搜索</button>
- <button class="layui-btn layui-btn-reset" lay-submit="" lay-filter="reset1">清空</button>
- </div>
- </form>
- </div>
- <table class="layui-hide" id="cost_project" lay-filter="cost_project"></table>
- </div>
- <script type="text/html" id="toolbarDemo">
- <div class="layui-btn-container">
- <span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加造价项目">+ 添加造价项目</span>
- </div>
- </script>
- <script type="text/html" id="barDemo">
- </script>
- {/block}
- <!-- /主体 -->
- <!-- 脚本 -->
- {block name="script"}
- <script>
- const moduleInit = ['tool','oaTool'];
- const field = '<?=json_encode($field)?>';
- function gouguInit() {
- var table = layui.table, tool = layui.tool, form = layui.form, oaTool = layui.oaTool;
- layui.laydate.render({
- elem: '#time_date',
- range: ['#start_time', '#end_time'],
- rangeLinked: true
- });
- var allcount;
- layui.pageTable = table.render({
- elem: '#cost_project',
- title: '造价项目列表',
- toolbar: '#toolbarDemo',
- url: '/admin/project.cost_proprietor/datalist',
- page: true,
- limit: 20,
- cellMinWidth: 100,
- parseData: function (res) { // 数据解析回调函数
- // 在这里可以获取数据总数
- allcount = res.count;
- return {
- code: res.code, // 数据状态码
- msg: res.msg, // 状态信息
- count: res.count, // 数据总数
- data: res.data // 当前页数据
- };
- },
- cols: [
- [
- {
- fixed: 'left', field: 'id', title: '编号', align: 'center', width: 80,
- templet: function (d) {
- return allcount - (d.LAY_NUM - 1);
- }
- },
- {
- fixed: 'left',
- field: 'project_status',
- title: '项目状态',
- align: 'center',
- width: 100,
- hide: field.project_status,
- templet: function (item) {
- var html = '';
- if (item.project_status === 1) {
- html = '<span class="layui-badge layui-bg-orange" style="background-color: #ffb800">立项中</span> ';
- } else if (item.project_status === 2) {
- html = '<span class="layui-badge layui-bg-blue" style="background-color: #b30095">审批中</span> ';
- } else if (item.project_status === 3) {
- html = '<span class="layui-badge layui-bg-green" style="background-color: #d37000">待接收</span> ';
- } else if (item.project_status === 4) {
- html = '<span class="layui-badge" style="background-color: #005fa8">分配中</span> ';
- } else if (item.project_status === 5) {
- html = '<span class="layui-badge layui-bg-blue" style="background-color: #1e9fff">作业中</span> ';
- } else if (item.project_status === 6) {
- html = '<span class="layui-badge" style="background-color: #007244">归档中</span> ';
- } else if (item.project_status === 7) {
- html = '<span class="layui-badge" style="background-color: #881f1f">退审中</span> ';
- } else if (item.project_status === 8) {
- html = '<span class="layui-badge" style="background-color: #16b777">已归档</span> ';
- } else if (item.project_status === 9) {
- html = '<span class="layui-badge" style="background-color: #d81e06">已退审</span> ';
- }else if(item.project_status === 0){
- if(item.proprietor_status===0){
- html = '<span class="layui-badge layui-bg-orange" style="background-color: #ffb800">立项中</span> '
- }else if(item.proprietor_status===1){
- html = '<span class="layui-badge layui-bg-orange" style="background-color: #ffb800">审核中</span> '
- }else if(item.proprietor_status===2){
- html = '<span class="layui-badge layui-bg-orange" style="background-color: #ffb800">待接收</span> '
- }
-
- }
- return html;
- }
- },
- {
- fixed: 'left',
- field: 'report_status',
- title: '报告状态',
- align: 'center',
- width: 100,
- hide: false,
- templet: function (item) {
- var html;
- if (item.report_status === 0) {
- html = '<span>初稿中</span> ';
- } else if (item.report_status === 1) {
- html = '<span>对数中</span> ';
- } else if (item.report_status === 2) {
- html = '<span>审定中</span> ';
- } else {
- html = '<span >未知</span> ';
- }
- return html;
- }
- },
- {
- fixed: 'left',
- field: 'project_name',
- title: '项目名称',
- align: 'center',
- width: 400,
- hide: field.project_name,
- templet: function (d) {
- var html = "";
- if (d.red) {
- //判断是否有新消息,有就有new
- html = '<a class="side-a" lay-event="read" lay-event="read">' + d.project_name + ' <span class="layui-badge-dot hongdian"></span></a>';
- } else {
- html = '<a class="side-a" lay-event="read" lay-event="read">' + d.project_name + '</a>';
- }
- return '<div style="text-align:left;">' + html + '</div>'
- }
- },
- {
- field: 'project_num', title: '项目编号', align: 'center', width: 150, hide: field.project_num,
- templet: function (d) {
- return '<div style="text-align:left">' + d.project_num + '</div>'
- }
- },
- {
- field: 'project_time', title: '项目周期', align: 'center', width: 250, hide: field.project_time,
- templet: function (item) {
- let outcome = Math.round(new Date().getTime() / 1000).toString();
- var advent_time = item.project_end_time - outcome
- var time = getDuration(advent_time);
- var timestr = "<span style='color: green'>" + "剩余" + time + "</span>";
- if (advent_time < 0) {
- advent_time = -advent_time;
- time = getDuration(advent_time);
- timestr = "<span style='color: red'>" + "逾期" + time + "</span>";
- }
- var html;
- html =
- "<div>" +
- layui.util.toDateString(item.project_start_time * 1000, 'yyyy-MM-dd') +
- "至" +
- layui.util.toDateString(item.project_end_time * 1000, 'yyyy-MM-dd') +
- " " + timestr +
- "</div>";
- function getDuration(second) {
- var duration
- var days = Math.floor(second / 86400);
- var hours = Math.floor((second % 86400) / 3600);
- if (days > 0) duration = days + "天";
- else if (hours > 0) duration = "不足一天";
- else if (hours == 0) duration = "不足一天";
- return duration;
- }
- return html;
- }
- },
- {
- field: 'review_unit_name',
- title: '评审机构',
- align: 'center',
- width: 150,
- hide: field.review_unit
- },
- {
- field: 'review_head_name',
- title: '评审机构负责人',
- align: 'center',
- width: 150,
- hide: field.review_head
- },
- {
- field: 'review_head_phone',
- title: '评审机构负责人电话',
- align: 'center',
- width: 150,
- hide: field.review_head_phone,
- },
- {
- field: 'sent_review_unit_name',
- title: '送审单位',
- align: 'center',
- width: 150,
- hide: field.sent_review_unit
- },
- {
- field: 'sent_review_head_name',
- title: '送审单位负责人',
- align: 'center',
- width: 150,
- hide: field.sent_review_head
- },
- {
- field: 'sent_review_phone',
- title: '送审单位负责人电话',
- align: 'center',
- width: 150,
- hide: field.sent_review_phone
- },
- {
- field: 'construction_unit',
- title: '施工单位',
- align: 'center',
- width: 150,
- hide: field.construction_unit
- },
- {
- field: 'construction_head',
- title: '施工单位负责人',
- align: 'center',
- width: 150,
- hide: field.construction_head
- },
- {
- field: 'construction_phone',
- title: '施工单位负责人电话',
- align: 'center',
- width: 150,
- hide: field.construction_phone
- },
- {field: 'project_scale', title: '项目规模', align: 'center', width: 150, hide: field.project_scale},
- {
- field: 'engineering_category',
- title: '工程类别',
- align: 'center',
- width: 150,
- hide: field.engineering_category
- },
- {
- field: 'engineering_type',
- title: '项目类型',
- align: 'center',
- width: 150,
- hide: field.engineering_type
- },
- {
- field: 'project_region',
- title: '项目区域',
- align: 'center',
- width: 150,
- hide: field.project_region
- },
- {field: 'fiscal_nature', title: '财政性质', align: 'center', width: 150, hide: field.fiscal_nature},
- {
- field: 'sent_review_cost',
- title: '送审服务费',
- align: 'center',
- width: 100,
- hide: field.sent_review_cost
- },
- {
- field: 'sent_review_approver_amount',
- title: '送审单位承担审核费',
- align: 'center',
- width: 150,
- hide: field.sent_review_approver_amount
- },
- {
- field: 'construction_approver_amount',
- title: '施工单位负责核减超5%评审费部分',
- align: 'center',
- width: 230,
- hide: field.construction_approver_amount
- },
- {
- field: 'sent_review_amount',
- title: '送审金额',
- align: 'center',
- width: 150,
- hide: field.sent_review_amount
- },
- {
- field: 'authorize_amount',
- title: '审定金额',
- align: 'center',
- width: 150,
- hide: field.authorize_amount
- },
- {
- field: 'review_add_amount',
- title: '审增额',
- align: 'center',
- width: 150,
- hide: field.review_add_reduce_amount
- },
- {
- field: 'review_reduce_amount',
- title: '审减额',
- align: 'center',
- width: 150,
- hide: field.review_add_reduce_amount
- },
- {
- field: 'review_add_reduce_rate',
- title: '审增减率',
- align: 'center',
- width: 150,
- hide: field.review_add_reduce_rate
- },
- {
- field: 'report_time',
- title: '报告时间',
- align: 'center',
- width: 150,
- hide: field.report_time,
- templet: function (d) {
- if (d.report_time) {
- return layui.util.toDateString(d.report_time * 1000, "yyyy-MM-dd")
- } else {
- return "";
- }
- }
- },
- {
- field: 'charge_standard',
- title: '收费标准',
- align: 'center',
- width: 150,
- hide: field.charge_standard
- },
- {
- field: 'operate_head_name',
- title: '作业负责人',
- align: 'center',
- width: 150,
- hide: field.operate_name
- },
- {
- field: 'operate_team_names',
- title: '作业成员',
- align: 'center',
- width: 300,
- hide: field.operate_team_names
- },
- {
- field: 'create_time',
- title: '项目创建日期',
- align: 'center',
- width: 120,
- hide: field.create_time,
- templet: function (d) {
- if (d.create_time) {
- return layui.util.toDateString(d.create_time * 1000, "yyyy-MM-dd")
- } else {
- return "";
- }
- }
- },
- {
- field: 'project_dead_time',
- title: '项目归档日期',
- align: 'center',
- width: 120,
- hide: field.project_dead_time,
- templet: function (d) {
- if (d.project_dead_time) {
- return layui.util.toDateString(d.project_dead_time * 1000, "yyyy-MM-dd")
- } else {
- return "";
- }
- }
- },
- {
- fixed: 'right', field: 'right', title: '操作', width: 136, align: 'center',
- templet: function (a) {
- var h = '';
- // 1全部-可查看可编辑,2全部-可查看,0与我有关
- if (a.self_id == 1) {
- if (a.project_status == 1) {
- h = '<div class="layui-btn-group"><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>'
- } else {
- h = '<div class="layui-btn-group"><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a></div>'
- }
- } else if (a.self_id == 2) {
- h = '<div class="layui-btn-group"><a class="layui-btn layui-btn-xs layui-bg-blue" lay-event="read">查看</a></div>'
- } else if (a.self_id == 0 || a.self_id == 3) {
- if (a.project_status == 1) {
- h = '<div class="layui-btn-group"><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>'
- } else {
- h = '<div class="layui-btn-group"><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a></div>'
- }
- }
- return h;
- }
- }
- ]
- ]
- });
- //监听表格行工具事件
- table.on('tool(cost_project)', function (obj) {
- var data = obj.data;
- if (obj.event === 'read') {
- tool.side('/admin/project.cost_proprietor/read?id=' + obj.data.id);
- }else if(obj.event === "edit"){
- tool.side('/admin/project.cost_proprietor/edit?id=' + obj.data.id);
- }
- return false;
- });
- //监听搜索提交
- form.on('submit(webform)', function (data) {
- console.log(data.field)
- layui.pageTable.reload({ where: data.field });
- return false;
- });
- form.on('submit(reset1)', function () {
- $(".layui-form").reset();
- layui.pageTable.reload();
- return false;
- });
- //监听表头工具栏事件
- table.on('toolbar(cost_project)', function (obj) {
- if (obj.event === 'add') {
- tool.side("/admin/project.cost_proprietor/add");
- return false;
- }
- });
- layui.use(['form', 'jquery'], function () {
- var form = layui.form;
- const $ = layui.jquery;
- let adress;
- $.ajax({
- type: "get", //使用get方式
- url: "/static/assets/layui/adress.json", //json文件相对于这个HTML的路径
- dataType: "json",
- async: false,
- success: function (data) {
- //这个data就是json数据
- adress = data
- var province = Object.keys(adress)
- var proStrs= '<option value="">省</option>';
- for (var i=0; i<province.length;i++){
- proStrs += '<option value="' + province[i] + '">' + province[i] + '</option>';
- }
- $("#province").html(proStrs);
- layui.form.render("select")
- },
- error: function () {
- layer.alert("地址请求失败!! ");
- }
- });
- function getFirstAttr(obj) {
- for (var k in obj) return k;
- }
- function selectOption(selectedProvince, selectedCity='', selectedArea='') {
- var proStr = '<option value="">省</option>', cityStr = '<option value="">市</option>', areaStr = '<option value="">县</option>';
- var pro = adress[selectedProvince], ci = adress[selectedProvince][selectedCity];
- for (var province in adress) {
- if (province == selectedProvince) proStr += '<option value="' + province + '" selected>' + province + '</option>';
- else proStr += '<option value="' + province + '">' + province + '</option>';
- }
- $("#province").html(proStr);
- for (var city in pro) {
- if (city == selectedCity) cityStr += '<option value="' + city + '" selected>' + city + '</option>';
- else cityStr += '<option value="' + city + '">' + city + '</option>';
- }
- $("#city").html(cityStr);
- for (var area in ci) {
- if (area == "remove") {
- continue;
- }
- if (ci[area] == selectedArea) areaStr += '<option value="' + ci[area] + '" selected>' + ci[area] + '</option>';
- else areaStr += '<option value="' + ci[area] + '">' + ci[area] + '</option>';
- }
- $("#area").html(areaStr);
- form.render();
- }
- /*selectOption(1,2, 3);*/
- form.on('select(province)', function (data) {
- let thisProvince = data.value;
- let thisCity = getFirstAttr(adress[thisProvince]);
- selectOption(data.value);
- });
- form.on('select(city)', function (data) {
- selectOption($("#province").val(), data.value, getFirstAttr(data.value));
- });
- })
- }
- </script>
- <!--<script src="/static/assets/layui/adress.json"></script>-->
- {/block}
- <!-- /脚本 -->
|