tdj 5 сар өмнө
parent
commit
5be6cbf65e

+ 725 - 0
app/admin/view/project/cost/follow_project.html

@@ -0,0 +1,725 @@
+{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" style="width:100px;">
+                <select id="province" lay-filter="province" name="province">
+                    <option value="">省</option>
+                </select>
+
+            </div>
+            <div class="layui-input-inline" style="width:100px;">
+                <select id="city" lay-filter="city" name="city">
+                    <option value="">市</option>
+                </select>
+
+            </div>
+            <div class="layui-input-inline" style="width:100px;">
+                <select id="area" lay-filter="area" name="area">
+                    <option value="">县</option>
+                </select>
+
+            </div>
+
+
+            <div id="time_date" class="layui-input-inline" style="margin: 0;">
+                <div class="layui-input-inline" style="width:150px;">
+                    <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" style="width:150px;">
+                    <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="sent_review_unit_name" placeholder="送审单位" class="layui-input"
+                       autocomplete="off"/>
+            </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="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'];
+  
+    function gouguInit() {
+        var table = layui.table, tool = layui.tool, form = layui.form, oaTool = layui.oaTool;
+
+        var allcount;
+        layui.laydate.render({
+            elem: '#time_date',
+            range: ['#start_time', '#end_time'],
+            rangeLinked: true
+        });
+
+        layui.pageTable = table.render({
+            elem: '#cost_project',
+            id: "demo",
+            title: '造价项目列表',
+            toolbar: '#toolbarDemo',
+            url: '/admin/project.cost/followProject',
+            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,
+                       
+                        templet: function (item) {
+
+                            var html = '';
+                            if (item.project_status === 1) {
+                                html = '<span class="layui-badge layui-bg-orange" style="background-color: #ffb800 !important">立项中</span> ';
+                            } else if (item.project_status === 2) {
+                                html = '<span class="layui-badge layui-bg-blue" style="background-color: #b30095 !important">审批中</span> ';
+                            } else if (item.project_status === -1) {
+                                html = '<span class="layui-badge layui-bg-red" style="background-color: #5825aa !important">待修改</span> ';
+                            } else if (item.project_status === 3) {
+                                html = '<span class="layui-badge layui-bg-green" style="background-color: #d37000 !important">待接收</span> ';
+                            } else if (item.project_status === 4) {
+                                html = '<span class="layui-badge" style="background-color: #005fa8 !important">分配中</span> ';
+                            } else if (item.project_status === 5) {
+                                html = '<span class="layui-badge layui-bg-blue" style="background-color: #1e9fff !important">作业中</span> ';
+                            } else if (item.project_status === 6) {
+                                html = '<span class="layui-badge" style="background-color: #007244 !important">归档中</span> ';
+                            } else if (item.project_status === 7) {
+                                html = '<span class="layui-badge" style="background-color: #881f1f !important">退审中</span> ';
+                            } else if (item.project_status === 8) {
+                                html = '<span class="layui-badge" style="background-color: #16b777 !important">已归档</span> ';
+                            } else if (item.project_status === 9) {
+                                html = '<span class="layui-badge" style="background-color: #d81e06 !important">已退审</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 if (item.report_status === 3) {
+                                html = '<span>已审定</span> ';
+                            }else {
+                                html = '<span >未知</span> ';
+                            }
+                            return html;
+                        }
+                    },
+
+
+                    {
+                        fixed: 'left',
+                        field: 'project_name',
+                        title: '项目名称',
+                        align: 'center',
+                        width: 400,
+                       
+                        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,
+                        templet: function (d) {
+                            return '<div style="text-align:left">' + d.project_num + '</div>'
+                        }
+                    },
+
+
+                    {
+                        field: 'project_time', title: '项目周期', align: 'center', width: 250,
+                        templet: function (item) {
+                            if(!item.project_end_time && !item.project_start_time){
+                                return "";
+                            }
+                            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;
+
+                            if (item.project_status == 8 || item.project_status == 9 ){
+                                 html =
+                                "<div>" +
+                                layui.util.toDateString(item.project_start_time * 1000, 'yyyy-MM-dd') +
+                                "至" +
+                                layui.util.toDateString(item.project_end_time * 1000, 'yyyy-MM-dd') +
+
+                                "</div>";
+                            }else{
+                                html =
+                                "<div>" +
+                                layui.util.toDateString(item.project_start_time * 1000, 'yyyy-MM-dd') +
+                                "至" +
+                                layui.util.toDateString(item.project_end_time * 1000, 'yyyy-MM-dd') +
+                                "&nbsp;&nbsp;" + 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,
+                       
+                    },
+
+
+                    {
+                        field: 'review_head_name',
+                        title: '评审机构负责人',
+                        align: 'center',
+                        width: 150,
+                       
+                    },
+
+
+                    {
+                        field: 'review_head_phone',
+                        title: '评审机构负责人电话',
+                        align: 'center',
+                        width: 150,
+                        
+                    },
+
+
+                    {
+                        field: 'sent_review_unit_name',
+                        title: '送审单位',
+                        align: 'center',
+                        width: 150,
+                       
+                    },
+
+
+                    {
+                        field: 'sent_review_head_name',
+                        title: '送审单位负责人',
+                        align: 'center',
+                        width: 150,
+                       
+                    },
+
+
+                    {
+                        field: 'sent_review_phone',
+                        title: '送审单位负责人电话',
+                        align: 'center',
+                        width: 150,
+                       
+                    },
+
+
+                    {
+                        field: 'construction_unit',
+                        title: '施工单位',
+                        align: 'center',
+                        width: 150,
+                        
+                    },
+
+
+                    {
+                        field: 'construction_head',
+                        title: '施工单位负责人',
+                        align: 'center',
+                        width: 150,
+                        
+                    },
+
+
+                    {
+                        field: 'construction_phone',
+                        title: '施工单位负责人电话',
+                        align: 'center',
+                        width: 150,
+                        
+                    },
+
+
+                    {field: 'project_scale', title: '项目规模', align: 'center', width: 150, },
+
+
+                    {
+                        field: 'engineering_category',
+                        title: '工程类别',
+                        align: 'center',
+                        width: 150,
+                        
+                    },
+
+
+                    {
+                        field: 'engineering_type',
+                        title: '项目类型',
+                        align: 'center',
+                        width: 150,
+                       
+                    },
+
+
+                    {
+                        field: 'project_region',
+                        title: '项目区域',
+                        align: 'center',
+                        width: 150,
+                       
+                    },
+
+
+                    {field: 'fiscal_nature', title: '财政性质', align: 'center', width: 150,},
+
+
+                    {
+                        field: 'sent_review_cost',
+                        title: '送审服务费',
+                        align: 'center',
+                        width: 100,
+                        
+                    },
+
+
+                    {
+                        field: 'sent_review_approver_amount',
+                        title: '送审单位承担审核费',
+                        align: 'center',
+                        width: 150,
+                        
+                    },
+
+
+                    {
+                        field: 'construction_approver_amount',
+                        title: '施工单位负责核减超5%评审费部分',
+                        align: 'center',
+                        width: 230,
+                        
+                    },
+
+
+                    {
+                        field: 'sent_review_amount',
+                        title: '送审金额',
+                        align: 'center',
+                        width: 150,
+                       
+                    },
+
+
+                    {
+                        field: 'authorize_amount',
+                        title: '审定金额',
+                        align: 'center',
+                        width: 150,
+                        
+                    },
+
+
+                    {
+                        field: 'review_add_amount',
+                        title: '审增额',
+                        align: 'center',
+                        width: 150,
+                        
+                    },
+                    {
+                        field: 'review_reduce_amount',
+                        title: '审减额',
+                        align: 'center',
+                        width: 150,
+                       
+                    },
+
+
+                    {
+                        field: 'review_add_reduce_rate',
+                        title: '审增减率',
+                        align: 'center',
+                        width: 150,
+                       
+                    },
+
+
+                    {
+                        field: 'report_time',
+                        title: '报告时间',
+                        align: 'center',
+                        width: 150,
+                        
+                        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,
+                        
+                    },
+
+
+                    {
+                        field: 'operate_head_name',
+                        title: '作业负责人',
+                        align: 'center',
+                        width: 150,
+                        
+                    },
+
+
+                    {
+                        field: 'operate_team_names',
+                        title: '作业成员',
+                        align: 'center',
+                        width: 300,
+                        
+                    },
+                    
+                    {
+                        field: 'creator',
+                        title: '创建人',
+                        align: 'center',
+                        width: 150,
+
+                    },
+
+
+                    {
+                        field: 'create_time',
+                        title: '项目创建日期',
+                        align: 'center',
+                        width: 180,
+                        
+                      
+                    },
+
+
+                    {
+                        field: 'project_dead_time',
+                        title: '项目归档日期',
+                        align: 'center',
+                        width: 120,
+                        
+                        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('toolbar(cost_project)', function (obj) {
+            if (obj.event === 'add') {
+                tool.side("/admin/project.cost/add");
+                return false;
+            }
+        });
+
+        //监听表格行工具事件
+        table.on('tool(cost_project)', function (obj) {
+            var data = obj.data;
+            if (obj.event === 'read') {
+                tool.side('/admin/project.cost/read?id=' + obj.data.id);
+            } else if (obj.event === 'edit') {
+                if (obj.data.project_status < 6) {
+
+                    tool.side('/admin/project.cost/edit?id=' + obj.data.id);
+                } else {
+                    layer.msg("已归档/已退审")
+                }
+
+            } else if (obj.event === 'del') {
+                layer.confirm('确定要删除该记录吗?', {
+                    icon: 3,
+                    title: '提示'
+                }, function (index) {
+
+
+                    if (data.project_status == 1) {
+                        let callback = function (e) {
+                            layer.msg(e.msg);
+                            if (e.code == 0) {
+                                obj.del();
+                            }
+                        }
+                        tool.delete("/admin/project.cost/del", {id: data.id}, callback);
+                        layer.close(index);
+
+                    } else {
+                        layer.msg("已审核,无法删除");
+                    }
+
+                });
+            }
+            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;
+        });
+
+
+        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));
+            });
+
+            window.hongdianselect = function () {
+                let num = $(document).find('.hongdian').length
+                console.log(num, '我是数量')
+                if (num === 0) {
+                    parent.showhongdian()
+                    console.log('2执行了')
+                }
+            }
+
+
+        })
+    }
+</script>
+{/block}
+<!-- /脚本 -->

+ 853 - 0
app/admin/view/project/cost_company/follow_project.html

@@ -0,0 +1,853 @@
+123{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" style="width:100px;">
+                <select id="province" lay-filter="province" name="province">
+                    <option value="">省</option>
+                </select>
+
+            </div>
+            <div class="layui-input-inline" style="width:100px;">
+                <select id="city" lay-filter="city" name="city">
+                    <option value="">市</option>
+                </select>
+
+            </div>
+            <div class="layui-input-inline" style="width:100px;">
+                <select id="area" lay-filter="area" name="area">
+                    <option value="">县</option>
+                </select>
+
+            </div>
+
+
+            <div id="time_date" class="layui-input-inline" style="margin: 0;">
+                <div class="layui-input-inline" style="width:150px;">
+                    <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" style="width:150px;">
+                    <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="sent_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">-->
+<!--    <div class="layui-btn-group">-->
+<!--        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>-->
+<!--        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="finish">归档</a>-->
+<!--        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="dismissal">退审</a>-->
+<!--    </div>-->
+<!--</script>-->
+
+<script type="text/html" id="barDemo">
+    {{#  if(d.project_status==4 || d.project_status==5){ }}
+    <div class="layui-clear-space">
+        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
+        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="more">
+            更多
+            <i class="layui-icon layui-icon-down"></i>
+        </a>
+    </div>
+    {{#  } else { }}
+    <div class="layui-btn-group">
+    </div>
+    {{#  } }}
+</script>
+
+{/block}
+<!-- /主体 -->
+
+<!-- 脚本 -->
+{block name="script"}
+
+<script>
+
+    const moduleInit = ['tool'];
+
+
+    function gouguInit() {
+        var table = layui.table, tool = layui.tool, form = layui.form;
+        var dropdown = layui.dropdown;
+        var allcount;
+        layui.laydate.render({
+            elem: '#time_date',
+            range: ['#start_time', '#end_time'],
+            rangeLinked: true
+        });
+        layui.pageTable = table.render({
+            elem: '#cost_project',
+            title: '造价项目',
+            toolbar: '#toolbarDemo',
+            url: '/admin/project.cost_company/followProject',
+            page: true,
+            limit: 20,
+            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,
+
+                        templet: function (item) {
+                            var html;
+                            if (item.project_status === 5) {
+                                html = '<span class="layui-badge layui-bg-blue" style="background-color: #1e9fff !important">作业中</span> ';
+                            } else if (item.project_status === 4) {
+                                html = '<span class="layui-badge" style="background-color: #005fa8 !important">分配中</span> ';
+                            } else if (item.project_status === 6) {
+                                html = '<span class="layui-badge layui-bg-orange"  style="background-color: #007244 !important">归档中</span> ';
+                            } else if (item.project_status === 8) {
+                                html = '<span class="layui-badge layui-bg-green" style="background-color: #16b777 !important">已归档</span> ';
+                            } else if (item.project_status === 7) {
+                                html = '<span class="layui-badge layui-bg-orange" style="background-color: #881f1f !important">退审中</span> ';
+                            } else if (item.project_status === 9) {
+                                html = '<span class="layui-badge layui-bg-green" style="background-color: #d81e06 !important">已退审</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 if (item.report_status === 3) {
+                                html = '<span>已审定</span> ';
+                            }else {
+                                html = '<span >未知</span> ';
+                            }
+                            return html;
+                        }
+                    },
+
+                    {
+                        fixed: 'left',
+                        field: 'project_name',
+                        title: '项目名称',
+                        align: 'center',
+                        width: 400,
+                       
+                        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,
+                    },
+
+
+                    {
+                        field: 'project_time',
+                        title: '项目周期',
+                        align: 'center',
+                        width: 270,
+                        
+                        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;
+                            if (item.project_status == 8 || item.project_status == 9 ){
+                                 html =
+                                "<div>" +
+                                layui.util.toDateString(item.project_start_time * 1000, 'yyyy-MM-dd') +
+                                "至" +
+                                layui.util.toDateString(item.project_end_time * 1000, 'yyyy-MM-dd') +
+                                
+                                "</div>";
+                            }else{
+                                html =
+                                "<div>" +
+                                layui.util.toDateString(item.project_start_time * 1000, 'yyyy-MM-dd') +
+                                "至" +
+                                layui.util.toDateString(item.project_end_time * 1000, 'yyyy-MM-dd') +
+                                "&nbsp;&nbsp;" + 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: 'entrust_unit_name',
+                        title: '委托单位',
+                        align: 'center',
+                        width: 150,
+                       
+                    },
+
+
+                    {
+                        field: 'entrust_maker_name',
+                        title: '委托单位负责人',
+                        align: 'center',
+                        width: 150,
+                        
+                    },
+
+
+                    {
+                        field: 'entrust_phone',
+                        title: '委托单位负责人电话',
+                        align: 'center',
+                        width: 150,
+                       
+                    },
+
+
+                    {
+                        field: 'sent_review_unit_name',
+                        title: '送审单位',
+                        align: 'center',
+                        width: 150,
+                       
+                    },
+
+
+                    {
+                        field: 'sent_review_head_name',
+                        title: '送审单位负责人',
+                        align: 'center',
+                        width: 150,
+                       
+                    },
+
+
+                    {
+                        field: 'sent_review_phone',
+                        title: '送审单位负责人电话',
+                        align: 'center',
+                        width: 150,
+                        
+                    },
+
+
+                    {
+                        field: 'project_scale',
+                        title: '项目规模',
+                        align: 'center',
+                        width: 150,
+                      },   
+
+
+                    {
+                        field: 'engineering_category',
+                        title: '工程类别',
+                        align: 'center',
+                        width: 150,
+                       
+                    },
+
+
+                    {
+                        field: 'engineering_type',
+                        title: '项目类型',
+                        align: 'center',
+                        width: 150,
+                       
+                    },
+
+
+                    {
+                        field: 'project_region',
+                        title: '项目区域',
+                        align: 'center',
+                        width: 150,
+                       
+                    },
+
+
+                    {
+                        field: 'fiscal_nature',
+                        title: '财政性质',
+                        align: 'center',
+                        width: 150,
+                       
+                    },
+
+
+                    {
+                        field: 'sent_review_cost',
+                        title: '送审服务费',
+                        align: 'center',
+                        width: 100,
+                       
+                    },
+
+
+                    {
+                        field: 'sent_review_amount',
+                        title: '送审金额',
+                        align: 'center',
+                        width: 150,
+                        
+                    },
+
+
+                    {
+                        field: 'authorize_amount',
+                        title: '审定金额',
+                        align: 'center',
+                        width: 150,
+                       
+                    },
+
+
+                    {
+                        field: 'review_add_amount',
+                        title: '审增额',
+                        align: 'center',
+                        width: 150,
+                        
+                    },
+                    {
+                        field: 'review_reduce_amount',
+                        title: '审减额',
+                        align: 'center',
+                        width: 150,
+                        
+                    },
+
+
+                    {
+                        field: 'review_add_reduce_rate',
+                        title: '审增减率',
+                        align: 'center',
+                        width: 150,
+                       
+                    },
+
+
+                    {
+                        field: 'report_time',
+                        title: '报告时间',
+                        align: 'center',
+                        width: 150,
+                        
+                        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,
+                        
+                    },
+
+
+                    {
+                        field: 'operate_head_name',
+                        title: '作业负责人',
+                        align: 'center',
+                        width: 150,
+                        
+                    },
+
+
+                    {
+                        field: 'operate_team_names',
+                        title: '作业成员',
+                        align: 'center',
+                        width: 300,
+                        
+                    },
+                    
+                    {
+                        field: 'creator',
+                        title: '创建人',
+                        align: 'center',
+                        width: 150,
+
+                    },
+
+
+                    {
+                        field: 'create_time',
+                        title: '项目创建日期',
+                        align: 'center',
+                        width: 180,
+                        
+                        
+                    },
+
+
+                    {
+                        field: 'project_dead_time',
+                        title: '项目归档日期',
+                        align: 'center',
+                        width: 120,
+                        
+                        templet: function (d) {
+                            if (d.project_dead_time) {
+                                return layui.util.toDateString(d.project_dead_time * 1000, "yyyy-MM-dd")
+                            } else {
+                                return "";
+                            }
+                        }
+                    },
+
+                    {fixed: 'right', title: '操作', align: 'center', width: 170, toolbar: '#barDemo'},
+
+                ]
+            ]
+        });
+
+        //监听表头工具栏事件
+        table.on('toolbar(cost_project)', function (obj) {
+            if (obj.event === 'add') {
+                tool.side("/admin/project.cost_company/add");
+                return false;
+            }
+        });
+
+        //监听表格行工具事件
+        table.on('tool(cost_project)', function (obj) {
+            var data = obj.data;
+            if (obj.event === 'read') {
+                tool.side('/admin/project.cost_company/read?id=' + obj.data.id);
+            } else if (obj.event === 'edit') {
+
+                if (obj.data.project_status < 6) {
+                    tool.side('/admin/project.cost_company/edit?id=' + obj.data.id);
+                } else {
+                    layer.msg("已归档/已退审")
+                }
+
+            } else if (obj.event === 'finish') {
+
+                if (obj.data.project_status == 5 || obj.data.project_status == 4) {
+                    var ttxx = layer.prompt({
+                        title: '请输入<span style="color: red">归档</span>原因',
+                        formType: 2,
+                        area: ['35vw', '15vw']
+                    }, function (text, index) {
+
+                        let callback = function (e) {
+                            window.location.reload()
+                            layer.msg(e.msg);
+                            setTimeout(function () {
+                                layer.close(index);
+                            }, 2000)
+                        }
+
+                        if (text !== "") {
+                            tool.post("/admin/project.cost_company/finish", {
+                                id: data.id,
+                                finish_reason: text
+                            }, callback);
+                        } else {
+                            layer.msg("归档原因不能为空")
+                        }
+                    });
+                } else {
+                    layer.msg("已归档/已退审")
+                }
+
+            } else if (obj.event === 'dismissal') {
+                if (obj.data.project_status == 5 || obj.data.project_status == 4) {
+                    var ttxx = layer.prompt({
+                        title: '请输入<span style="color: red">退审</span>原因',
+                        formType: 2,
+                        area: ['35vw', '15vw']
+                    }, function (text, index) {
+                        let callback = function (e) {
+                            window.location.reload()
+                            layer.msg(e.msg);
+                            setTimeout(function () {
+                                layer.close(index);
+                            }, 2000)
+                        }
+
+
+                        if (text !== "") {
+                            tool.post("/admin/project.cost_company/dismissal", {
+                                id: data.id,
+                                dismissal_reason: text,
+                            }, callback);
+                        } else {
+                            layer.msg("退审原因不能为空")
+                        }
+
+                    });
+                } else {
+                    layer.msg("已归档/已退审")
+                }
+
+            } else if (obj.event === 'more') {
+                // 更多 - 下拉菜单
+                dropdown.render({
+                    elem: this, // 触发事件的 DOM 对象
+                    show: true, // 外部事件触发即显示
+                    data: [
+                        {
+                            title: '状态',
+                            id: 'set_status',
+                            templet: function () {
+                                return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="set_status" class="dropbtn">状态</button>';
+                            }
+                        },{
+                            title: '归档',
+                            id: 'finish',
+                            templet: function () {
+                                return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="finish" class="dropbtn">归档</button>';
+                            }
+                        }, {
+                            title: '退审',
+                            id: 'dismissal',
+                            templet: function () {
+                                return '<button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="dismissal" class="dropbtn">退审</button>';
+                            }
+                        }
+                    ],
+                    click: function (menudata) {
+                        if (menudata.id === 'finish') {
+                            if (obj.data.project_status == 5 || obj.data.project_status == 4) {
+                                var ttxx = layer.prompt({
+                                    title: '请输入<span style="color: red">归档</span>原因',
+                                    formType: 2,
+                                    area: ['35vw', '15vw']
+                                }, function (text, index) {
+
+                                    let callback = function (e) {
+                                        window.location.reload()
+                                        layer.msg(e.msg);
+                                        setTimeout(function () {
+                                            layer.close(index);
+                                        }, 2000)
+                                    }
+
+                                    if (text !== "") {
+                                        tool.post("/admin/project.cost_company/finish", {
+                                            id: data.id,
+                                            finish_reason: text
+                                        }, callback);
+                                    } else {
+                                        layer.msg("归档原因不能为空")
+                                    }
+                                });
+                            } else {
+                                layer.msg("已归档/已退审")
+                            }
+                        } else if (menudata.id === 'dismissal') {
+                            if (obj.data.project_status == 5 || obj.data.project_status == 4) {
+                                var ttxx = layer.prompt({
+                                    title: '请输入<span style="color: red">退审</span>原因',
+                                    formType: 2,
+                                    area: ['35vw', '15vw']
+                                }, function (text, index) {
+                                    let callback = function (e) {
+                                        window.location.reload()
+                                        layer.msg(e.msg);
+                                        setTimeout(function () {
+                                            layer.close(index);
+                                        }, 2000)
+                                    }
+
+
+                                    if (text !== "") {
+                                        tool.post("/admin/project.cost_company/dismissal", {
+                                            id: data.id,
+                                            dismissal_reason: text,
+                                        }, callback);
+                                    } else {
+                                        layer.msg("退审原因不能为空")
+                                    }
+
+                                });
+                            } else {
+                                layer.msg("已归档/已退审")
+                            }
+                        }else if (menudata.id === 'set_status') {
+                            setStatus(data.id);
+
+                        }
+                    },
+                    align: 'center', // 右对齐弹出
+                    style: 'min-width: 0px' // 设置额外样式
+                })
+            }
+            return false;
+        });
+
+        function setStatus(project_id) {
+            layer.open({
+                title: '选择状态',
+                type:1,
+                area: ['480px', '336px'],
+                content: '<div class="picker-table"><div id="boxselect"></div></div>',
+                success: function() {
+                    table_a = table.render({
+                        elem: '#boxselect',
+                        cols: [
+                            [{
+                                type: 'radio',
+                                title: '选择',
+                                width: 100
+                            }, {
+                                field: 'title',
+                                title: '状态'
+                            }]
+                        ],
+                        data: [{
+                            "type": "0",
+                            "title": "初稿中"
+                        },{
+                            "type": "1",
+                            "title": "对数中"
+                        }, {
+                            "type": "2",
+                            "title": "审定中"
+                        }]
+                    });
+                },
+                btn:['确定'],
+                yes: function(index) {
+                    var checkStatus = table.checkStatus(table_a.config.id);
+                    var data = checkStatus.data;
+                    console.log(checkStatus,data);
+                    if (data.length > 0) {
+                        let callbacl = function (e) {
+                            layui.pageTable.reload();
+                            layer.msg(e.msg)
+                        }
+                        data = {project_id:project_id,report_status:data[0].type}
+                        tool.post("/admin/project.api/set_status",data,callbacl);
+                        layer.close(index);
+                    }
+                    else{
+                        layer.msg('选择合同性质');
+                    }
+                }
+            })
+        }
+
+
+        //监听搜索提交
+        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;
+        });
+
+
+        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 () {
+                    layui.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));
+            });
+
+            window.hongdianselect = function () {
+                let num = $(document).find('.hongdian').length
+                console.log(num, '我是数量')
+                if (num === 0) {
+                    parent.showhongdian()
+                    console.log('2执行了')
+                }
+            }
+
+
+        })
+    }
+</script>
+{/block}
+<!-- /脚本 -->