浏览代码

Merge branch 'master' of http://192.168.1.41:3000/maixinrong/Calculation

TonyKang 5 年之前
父节点
当前提交
59486600ac

+ 14 - 14
app/const/spread.js

@@ -21,7 +21,7 @@ const withCl = {
             {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 185, formatter: '@'},
             {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 50, formatter: '@', cellType: 'unit'},
             {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number'},
-            {title: '设计数量|数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
+            {title: '项目节数量|数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
             {title: '|数量2',  colSpan: '|1', rowSpan: '|1', field: 'dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
             {title: '经济指标',  colSpan: '1', rowSpan: '2', field: 'dgn_price', hAlign: 2, width: 60, type: 'Number', readOnly: true},
             {title: '设计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'sgfh_qty', hAlign: 2, width: 60, type: 'Number'},
@@ -67,7 +67,7 @@ const withoutCl = {
             {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 185, formatter: '@'},
             {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 50, formatter: '@', cellType: 'unit'},
             {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number'},
-            {title: '设计数量|数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
+            {title: '项目节数量|数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
             {title: '|数量2',  colSpan: '|1', rowSpan: '|1', field: 'dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
             {title: '经济指标',  colSpan: '1', rowSpan: '2', field: 'dgn_price', hAlign: 2, width: 60, type: 'Number', readOnly: true},
             {title: '设计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'sgfh_qty', hAlign: 2, width: 60, type: 'Number'},
@@ -120,10 +120,10 @@ const stageTz = {
             {title: '截止本期完成计量|数量', colSpan: '3|1', rowSpan: '1|1', field: 'end_gather_qty', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_gather_tp', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '|完成率(%)', colSpan: '1', rowSpan: '|1', field: 'end_gather_percent', hAlign: 2, width: 80, readOnly: true, type: 'Number'},
-            {title: '合同|设计数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'deal_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
-            {title: '|设计数量2',  colSpan: '|1', rowSpan: '|1', field: 'deal_dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
-            {title: '变更|设计数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'c_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
-            {title: '|设计数量2',  colSpan: '|1', rowSpan: '|1', field: 'c_dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
+            {title: '合同|项目节数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'deal_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
+            {title: '|项目节数量2',  colSpan: '|1', rowSpan: '|1', field: 'deal_dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
+            {title: '变更|项目节数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'c_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
+            {title: '|项目节数量2',  colSpan: '|1', rowSpan: '|1', field: 'c_dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
             {title: '经济指标',  colSpan: '1', rowSpan: '2', field: 'final_dgn_price', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '本期批注', colSpan: '1', rowSpan: '2', field: 'postil', hAlign: 0, width: 100, formatter: '@', cellType: 'autoTip'},
             {title: '图(册)号', colSpan: '1', rowSpan: '2', field: 'drawing_code', hAlign: 0, width: 80, formatter: '@', readOnly: true},
@@ -182,10 +182,10 @@ const stageCl = {
             {title: '截止本期完成计量|数量', colSpan: '3|1', rowSpan: '1|1', field: 'end_gather_qty', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_gather_tp', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '|完成率(%)', colSpan: '1', rowSpan: '|1', field: 'end_gather_percent', hAlign: 2, width: 80, readOnly: true, type: 'Number'},
-            {title: '合同|设计数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'deal_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
-            {title: '|设计数量2',  colSpan: '|1', rowSpan: '|1', field: 'deal_dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
-            {title: '变更|设计数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'c_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
-            {title: '|设计数量2',  colSpan: '|1', rowSpan: '|1', field: 'c_dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
+            {title: '合同|项目节数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'deal_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
+            {title: '|项目节数量2',  colSpan: '|1', rowSpan: '|1', field: 'deal_dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
+            {title: '变更|项目节数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'c_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
+            {title: '|项目节数量2',  colSpan: '|1', rowSpan: '|1', field: 'c_dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
             {title: '经济指标',  colSpan: '1', rowSpan: '2', field: 'final_dgn_price', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '本期批注', colSpan: '1', rowSpan: '2', field: 'postil', hAlign: 0, width: 100, formatter: '@', cellType: 'autoTip'},
             {title: '图(册)号', colSpan: '1', rowSpan: '2', field: 'drawing_code', hAlign: 0, width: 80, formatter: '@', readOnly: true},
@@ -248,10 +248,10 @@ const stageNoCl = {
             {title: '截止本期完成计量|数量', colSpan: '3|1', rowSpan: '1|1', field: 'end_gather_qty', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_gather_tp', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '|完成率(%)', colSpan: '1', rowSpan: '|1', field: 'end_gather_percent', hAlign: 2, width: 80, readOnly: true, type: 'Number'},
-            {title: '合同|设计数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'deal_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
-            {title: '|设计数量2',  colSpan: '|1', rowSpan: '|1', field: 'deal_dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
-            {title: '变更|设计数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'c_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
-            {title: '|设计数量2',  colSpan: '|1', rowSpan: '|1', field: 'c_dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
+            {title: '合同|项目节数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'deal_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
+            {title: '|项目节数量2',  colSpan: '|1', rowSpan: '|1', field: 'deal_dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
+            {title: '变更|项目节数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'c_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
+            {title: '|项目节数量2',  colSpan: '|1', rowSpan: '|1', field: 'c_dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
             {title: '经济指标',  colSpan: '1', rowSpan: '2', field: 'final_dgn_price', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '本期批注', colSpan: '1', rowSpan: '2', field: 'postil', hAlign: 0, width: 100, formatter: '@', cellType: 'autoTip'},
             {title: '图(册)号', colSpan: '1', rowSpan: '2', field: 'drawing_code', hAlign: 0, width: 80, formatter: '@', readOnly: true},

+ 41 - 0
app/controller/change_controller.js

@@ -308,11 +308,18 @@ module.exports = app => {
                         const auditList3 = [];
                         for (let time = 1; time <= change.times; time++) {
                             const auditTimeList = [];
+                            let max_sort = 1;
                             for (const al of auditList2) {
                                 if (al.times === time) {
                                     auditTimeList.push(al);
+                                    if (al.usite > max_sort) {
+                                        max_sort = al.usite;
+                                    }
                                 }
                             }
+                            for (const i in auditTimeList) {
+                                auditTimeList[i].max_sort = max_sort;
+                            }
                             auditList3.push(auditTimeList);
                         }
                         renderData.auditList3 = auditList3;
@@ -359,11 +366,18 @@ module.exports = app => {
                     const auditList3 = [];
                     for (let time = 1; time <= change.times; time++) {
                         const auditTimeList = [];
+                        let max_sort = 1;
                         for (const al of auditList) {
                             if (al.times === time) {
                                 auditTimeList.push(al);
+                                if (al.usite > max_sort) {
+                                    max_sort = al.usite;
+                                }
                             }
                         }
+                        for (const i in auditTimeList) {
+                            auditTimeList[i].max_sort = max_sort;
+                        }
                         auditList3.push(auditTimeList);
                     }
                     renderData.auditList3 = auditList3;
@@ -397,6 +411,33 @@ module.exports = app => {
                     }
                     renderData.auditList2 = auditList2;
                 } else if (auditStatus === 6) {
+                    // 展示页左侧审批流程列表和清单审批列表数据
+                    const auditList2 = await ctx.service.changeAudit.getListGroupByTimes(change.cid, change.times);
+                    renderData.auditList2 = auditList2;
+                    const auditList4 = await ctx.service.changeAudit.getListByStatus(change, 7);
+                    // 展示页右侧审批流程列表
+                    const auditList3 = [];
+                    for (let time = 1; time < change.times; time++) {
+                        const auditTimeList = [];
+                        let max_sort = 1;
+                        for (const al of auditList4) {
+                            if (al.times === time) {
+                                auditTimeList.push(al);
+                                if (al.usite > max_sort) {
+                                    max_sort = al.usite;
+                                }
+                            }
+                        }
+                        for (const i in auditTimeList) {
+                            auditTimeList[i].max_sort = max_sort;
+                        }
+                        auditList3.push(auditTimeList);
+                    }
+                    renderData.auditList3 = auditList3;
+                    for (const i in auditList) {
+                        auditList[i].max_sort = auditList2.length - 1;
+                    }
+                    renderData.auditList = auditList;
                     renderData.changeList = changeList.sort();
                     let ototalCost = 0;
                     let ctotalCost = 0;

+ 1 - 1
app/lib/stage_im.js

@@ -523,7 +523,7 @@ class StageIm {
                     bw: bw,
                     peg: peg ? this._getPegStr(peg.name) : '',
                     xm: node.name,
-                    drawing_code: this._getDrawingCode(node),
+                    drawing_code: this._getDrawingCode(p),
                     changes: [],
                 };
                 im.calc_memo = '本期计量:' + im.jl + ' ' + im.unit;

+ 2 - 0
app/public/js/change_approval.js

@@ -74,6 +74,7 @@ $(document).ready(() => {
 
             if(returnflag) {
                 $('input[name="w_code"]').val($('#w_code').val());
+                $('#success-approval').find('textarea').val(sdesc.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' '));
                 $('#success-approval').submit();
             }
         } else {
@@ -88,6 +89,7 @@ $(document).ready(() => {
                 returnflag = false;
             }
             if(returnflag) {
+                $('#fail-approval').find('textarea').val(sdesc.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' '));
                 $('input[name="w_code"]').val($('#w_code').val());
                 $('#fail-approval').submit();
             }

+ 23 - 4
app/public/js/change_set.js

@@ -261,15 +261,26 @@ $(document).ready(() => {
 
                 // 重新上报时。令其它的审批人流程图标转换
                 $('#shenpi-audit-list li i').removeClass('fa-stop-circle').addClass('fa-chevron-circle-down');
+                $('#shenpi-audit-list2 li i').removeClass('fa-stop-circle').addClass('fa-chevron-circle-down');
                 // 添加新审批人
-                const addhtml2 = '<li class="list-group-item" data-auditid="' + accountInfo.id + '" >' +
-                    '<i class="fa fa-stop-circle"></i>' +
+                const addhtml1 = '<li class="list-group-item" data-auditid="' + accountInfo.id + '" >' +
+                    '<i class="fa fa-stop-circle"></i> ' +
                     accountInfo.name + ' <small class="text-muted">' + accountInfo.role + '</small><span class="pull-right">终审</span>' +
                     '</li>';
+                const addhtml2 = '<li class="list-group-item" data-auditid="' + accountInfo.id + '" >' +
+                    '<h5 class="card-title"><i class="fa fa-stop-circle"></i> ' +
+                    accountInfo.name + ' <small class="text-muted">' + accountInfo.role + '</small><span class="pull-right">终审</span>' +
+                    '</h5></li>';
                 for (let i = 0; i < $('#shenpi-audit-list li').length; i++) {
-                    $('#shenpi-audit-list li').eq(i).find('.pull-right').text(transFormToChinese(i+1) + '审');
+                    $('#shenpi-audit-list li').eq(i).find('.pull-right').text(transFormToChinese(i) + '审');
+                    $('#shenpi-audit-list2 li').eq(i).find('.pull-right').text(transFormToChinese(i) + '审');
                 }
-                $('#shenpi-audit-list').append(addhtml2);
+                $('#shenpi-audit-list li').eq(0).find('.pull-right').text('原报');
+                $('#shenpi-audit-list2 li').eq(0).find('.pull-right').text('原报');
+                $('#shenpi-audit-list li i').eq(0).removeClass('fa-chevron-circle-down').addClass('fa-play-circle');
+                $('#shenpi-audit-list2 li i').eq(0).removeClass('fa-chevron-circle-down').addClass('fa-play-circle');
+                $('#shenpi-audit-list').append(addhtml1);
+                $('#shenpi-audit-list2').append(addhtml2);
             } else {
                 toastr.error('审批流程中已存在该用户!');
             }
@@ -292,13 +303,21 @@ $(document).ready(() => {
         // 重新上报时。移除审批流程
         // 令最后一个图标转换
         $('#shenpi-audit-list li[data-auditid="' + uid + '"]').remove();
+        $('#shenpi-audit-list2 li[data-auditid="' + uid + '"]').remove();
         if ($('#shenpi-audit-list li').length !== 0 && !$('#shenpi-audit-list li i').hasClass('fa-stop-circle')) {
             $('#shenpi-audit-list li').eq($('#shenpi-audit-list li').length-1).children('i')
                 .removeClass('fa-chevron-circle-down').addClass('fa-stop-circle');
+            $('#shenpi-audit-list2 li').eq($('#shenpi-audit-list2 li').length-1).children('i')
+                .removeClass('fa-chevron-circle-down').addClass('fa-stop-circle');
         }
         for (let i = 0; i < $('#shenpi-audit-list li').length; i++) {
             $('#shenpi-audit-list li').eq(i).find('.pull-right').text((i+1 === $('#shenpi-audit-list li').length ? '终' : transFormToChinese(i+1)) + '审');
+            $('#shenpi-audit-list2 li').eq(i).find('.pull-right').text((i+1 === $('#shenpi-audit-list2 li').length ? '终' : transFormToChinese(i+1)) + '审');
         }
+        $('#shenpi-audit-list li').eq(0).find('.pull-right').text('原报');
+        $('#shenpi-audit-list2 li').eq(0).find('.pull-right').text('原报');
+        $('#shenpi-audit-list li i').eq(0).removeClass('fa-chevron-circle-down').addClass('fa-play-circle');
+        $('#shenpi-audit-list2 li i').eq(0).removeClass('fa-chevron-circle-down').addClass('fa-play-circle');
     });
 
     // 打开签约清单modal并删除之前的操作

+ 12 - 8
app/public/js/div_resizer.js

@@ -71,18 +71,22 @@
                 mouseMoveCount += moveSize;
                 //当累计移动超过5个像素时,才刷新,减少刷新次数
                 if(Math.abs(mouseMoveCount) >= 5){
-                    const min = obj.attr('min') ? obj.attr('min') : parseInt(((orgSize1 + orgSize2) / 10).toFixed(0));
-                    const max = orgSize1 + orgSize2 - min;
-
-                    // 判断拖动范围不能超出
-                    newSize1 = Math.min(Math.max(orgSize1 + moveSize, min), max);
-                    newSize2 = Math.min(Math.max(orgSize2 - moveSize, min), max);
                     if (aType === 'percent') {
-                        const percent1 =  (orgSize1 + moveSize) / (orgSize1 + orgSize2) * 100;
+                        const min = obj.attr('min') ? obj.attr('min') : 10;
+                        const max = 100 - min;
+
+                        const percent1 = Math.min(Math.max((orgSize1 + moveSize) / (orgSize1 + orgSize2) * 100, min), max);
                         $(obj.attr('div1')).css(rType, percent1 + '%');
-                        const percent2 = (orgSize2 - moveSize) / (orgSize1 + orgSize2) * 100;
+                        const percent2 = Math.min(Math.max((orgSize2 - moveSize) / (orgSize1 + orgSize2) * 100, min), max);
                         $(obj.attr('div2')).css(rType, percent2 + '%');
                     } else {
+                        const min = obj.attr('min') ? obj.attr('min') : parseInt(((orgSize1 + orgSize2) / 10).toFixed(0));
+                        const max = orgSize1 + orgSize2 - min;
+
+                        // 判断拖动范围不能超出
+                        newSize1 = Math.min(Math.max(orgSize1 + moveSize, min), max);
+                        newSize2 = Math.min(Math.max(orgSize2 - moveSize, min), max);
+
                         $(obj.attr('div1'))[rType](newSize1);
                         $(obj.attr('div2'))[rType](newSize2);
                     }

+ 1 - 1
app/public/js/ledger.js

@@ -621,7 +621,7 @@ $(document).ready(function() {
             }
             const hint = [];
             if (bParentHint) hint.push('含有子项的清单,不可粘贴数量、单价、金额');
-            if (bGclHint) hint.push('工程量清单,不可粘贴设计数量');
+            if (bGclHint) hint.push('工程量清单,不可粘贴项目节数量');
             if (bQtyHint) hint.push('含有计量单元的清单,不可粘贴数量');
             if (bCodeHint) hint.push('含有计量单元的清单,清单编号不可粘贴空值');
             if (bNumHint) hint.push('单价、数量等应输入数字或可计算的表达式');

+ 6 - 0
app/public/js/ledger_audit.js

@@ -250,3 +250,9 @@ $(document).ready(() => {
         });
     })('a[name=showLevel]', ledgerSpread.getActiveSheet());
 });
+// texterea换行
+function auditCheck() {
+    const opinion = $('textarea[name="opinion"]').val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' ');
+    $('textarea[name="opinion"]').val(opinion);
+    return true;
+}

+ 6 - 0
app/public/js/material_audit.js

@@ -156,3 +156,9 @@ function checkAuditorFrom () {
     }
     $('#hide-all').show();
 }
+// texterea换行
+function auditCheck() {
+    const opinion = $('textarea[name="opinion"]').val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' ');
+    $('textarea[name="opinion"]').val(opinion);
+    return true;
+}

+ 2 - 10
app/public/js/stage.js

@@ -542,7 +542,7 @@ $(document).ready(() => {
 
                 if (col.field.indexOf('_dgn_') > 0) {
                     if (node.b_code && node.b_code !== '') {
-                        toastr.error('仅项目节可输入设计数量');
+                        toastr.error('仅项目节可输入项目节数量');
                         SpreadJsObj.reLoadRowData(info.sheet, info.row);
                         return;
                     }
@@ -1403,14 +1403,6 @@ $(document).ready(() => {
             build: function ($trigger, e) {
                 const target = SpreadJsObj.safeRightClickSelection($trigger, e, spSpread);
                 return target.hitTestType === spreadNS.SheetArea.viewport || target.hitTestType === spreadNS.SheetArea.rowHeader;
-            },
-            items: {
-                'debug': {
-                    name: 'debug',
-                    callback: function (key, opt) {
-                        console.log(SpreadJsObj.getSelectObject(spSpread.getActiveSheet()));
-                    }
-                }
             }
         })
     }
@@ -1866,7 +1858,7 @@ $(document).ready(() => {
                                     const updateData = {lid: data.lid};
                                     if (data.uuid) {
                                         updateData.uuid = data.uuid;
-                                        updateData.doc_code = null;
+                                        updateData.doc_code = '';
                                         datas.push(updateData);
                                     }
                                 }

+ 6 - 0
app/public/js/stage_audit.js

@@ -156,3 +156,9 @@ function checkAuditorFrom () {
     }
     $('#hide-all').show();
 }
+// texterea换行
+function auditCheck() {
+    const opinion = $('textarea[name="opinion"]').val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' ');
+    $('textarea[name="opinion"]').val(opinion);
+    return true;
+}

+ 3 - 3
app/public/js/stage_im.js

@@ -496,7 +496,7 @@ const stageIm = (function () {
         for (const p of posterity) {
             if (p.children && p.children.length > 0 ) { continue; }
             if (!p.b_code || p.b_code === '') { continue }
-            if (!p.gather_qty || p.gather_qty === 0 ) { continue; }
+            if (!p.gather_tp || p.gather_tp === 0) { continue; }
             let im = nodeImData.find(function (d) {
                 return d.lid === node.id &&
                     d.code === p.b_code && p.name === d.name && p.unit === d.unit && checkZero(ZhCalc.sub(p.unit_price, d.unit_price));
@@ -573,7 +573,7 @@ const stageIm = (function () {
                     bw: bw,
                     peg: peg ? getPegStr(peg.name) : '',
                     xm: node.name,
-                    drawing_code: getDrawingCode(node),
+                    drawing_code: getDrawingCode(p),
                     changes: [],
                 };
                 im.calc_memo = '本期计量:' + im.jl + ' ' + im.unit;
@@ -659,7 +659,7 @@ const stageIm = (function () {
             }
             if (imData) {
                 _.assignInWith(imData, d, function (oV, sV, key) {
-                    return imFields.indexOf(key) > -1 && !_.isUndefined(sV) ? sV : oV;
+                    return imFields.indexOf(key) > -1 && !_.isUndefined(sV) && !_.isNull(sV) ? sV : oV;
                 });
             }
         }

+ 1 - 1
app/public/js/tender_list_progress.js

@@ -256,7 +256,7 @@ function getProgressHtml(total, pre, cur) {
     if (total !== 0) {
         let preP = ZhCalc.mul(ZhCalc.div(pre, total, 2), 100, 0);
         let curP = ZhCalc.mul(ZhCalc.div(cur, total, 2), 100, 0);
-        let other = Math.max(ZhCalc.div(ZhCalc.div(total, pre), cur), 0);
+        let other = Math.max(ZhCalc.sub(ZhCalc.sub(total, pre), cur), 0);
         let otherP = Math.max(100 - preP - curP, 0);
         const html = '<div class="progress">' +
             '<div class="progress-bar bg-success" style="width: ' + preP + '%;" data-placement="bottom" data-toggle="tooltip" data-original-title="截止上期完成:¥' + pre + '">' + preP + '%</div>' +

+ 7 - 4
app/service/change_audit.js

@@ -157,10 +157,13 @@ module.exports = app => {
                     sqlParam = [this.tableName, change.cid];
                     break;
                 case 6: // 审批中
-                    sql = 'SELECT * FROM (SELECT MAX(usort) as ust FROM ?? ' +
-                        'WHERE cid = ? and times = ? GROUP BY usite ) as b ' +
-                        'JOIN ?? as a ON a.usort = b.ust WHERE cid = ? and times = ? ORDER BY usite';
-                    sqlParam = [this.tableName, change.cid, change.times, this.tableName, change.cid, change.times];
+                    // sql = 'SELECT * FROM (SELECT MAX(usort) as ust FROM ?? ' +
+                    //     'WHERE cid = ? and times = ? GROUP BY usite ) as b ' +
+                    //     'JOIN ?? as a ON a.usort = b.ust WHERE cid = ? and times = ? ORDER BY usite';
+                    // sqlParam = [this.tableName, change.cid, change.times, this.tableName, change.cid, change.times];
+                    sql = 'SELECT * FROM ?? WHERE ' +
+                        'cid = ? AND times = ? ORDER BY usort';
+                    sqlParam = [this.tableName, change.cid, change.times];
                     break;
                 default:// 无权限查看此变更令
                     break;

+ 3 - 3
app/service/deal_bills.js

@@ -129,9 +129,9 @@ module.exports = app => {
                     const data = {
                         deal_id: bills.length + 1,
                         tender_id: tenderId,
-                        code: row[iCode],
-                        name: row[iName],
-                        unit: row[iUnit],
+                        code: this.ctx.helper.replaceReturn(row[iCode]),
+                        name: this.ctx.helper.replaceReturn(row[iName]),
+                        unit: this.ctx.helper.replaceReturn(row[iUnit]),
                         unit_price: (row[iUp] === undefined || row[iUp] === null) ? 0 : this._.toNumber(row[iUp]),
                         quantity: (row[iQty] === undefined || row[iQty] === null) ? 0 : this._.toNumber(row[iQty]),
                         total_price: (row[iTp] === undefined || row[iTp] === null) ? 0 : this._.toNumber(row[iTp]),

+ 5 - 5
app/service/pos.js

@@ -101,7 +101,7 @@ module.exports = app => {
         async _getUpdateBills(data) {
             const datas = data instanceof Array ? data : [data];
             const bills = await this.ctx.service.ledger.getDataById(datas[0].lid);
-            const billsPos = await this.getAllDataByCondition({where: {lid: bills.id} });
+            const billsPos = await this.getAllDataByCondition({where: {tid: bills.tender_id, lid: bills.id} });
             const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, bills.unit);
             const updateBills = {id: bills.id};
             for (const bp of billsPos) {
@@ -173,7 +173,7 @@ module.exports = app => {
             if (data.sgfh_qty !== undefined || data.sjcl_qty !== undefined || data.qtcl_qty !== undefined) {
                 const op = await this.getDataById(data.id);
                 const bills = await this.ctx.service.ledger.getDataById(op.lid);
-                const billsPos = await this.getAllDataByCondition({where: {lid: op.lid} });
+                const billsPos = await this.getAllDataByCondition({where: {tid: tid, lid: op.lid} });
 
                 const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, bills.unit);
                 if (data.sgfh_qty !== undefined) {
@@ -231,7 +231,7 @@ module.exports = app => {
             if (data.length === 0) return;
             const op = await this.getDataById(data[0].id);
             const bills = await this.ctx.service.ledger.getDataById(op.lid);
-            const billsPos = await this.getAllDataByCondition({where: {lid: op.lid} });
+            const billsPos = await this.getAllDataByCondition({where: {tid: tid, lid: op.lid} });
             const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, bills.unit);
             for (const d of data) {
                 if (d.sgfh_qty !== undefined || d.sjcl_qty !== undefined || d.qtcl_qty !== undefined) {
@@ -293,7 +293,7 @@ module.exports = app => {
 
             const pos = await this.getPosData({tid: tid, id: data});
             const bills = await this.ctx.service.ledger.getDataById(pos[0].lid);
-            const billsPos = await this.getAllDataByCondition({ where: {lid: bills.id} });
+            const billsPos = await this.getAllDataByCondition({ where: {tid: tid, lid: bills.id} });
             const updateBills = {id: bills.id, sgfh_qty: null, sjcl_qty: null, qtcl_qty: null, quantity: null};
             for (const bp of billsPos) {
                 if (data.indexOf(bp.id) >= 0) continue;
@@ -360,7 +360,7 @@ module.exports = app => {
             const bills = await this.ctx.service.ledger.getDataById(data[0].lid);
             const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, bills.unit);
             const updateBills = {id: bills.id};
-            const billsPos = await this.getAllDataByCondition({where: {lid: bills.id} });
+            const billsPos = await this.getAllDataByCondition({where: {tid: tid, lid: bills.id} });
             for (const bp of billsPos) {
                 const d = data.find(function (x) {
                     return bp.id ? x.id === bp.id : false;

+ 3 - 3
app/service/revise_pos.js

@@ -124,7 +124,7 @@ module.exports = app => {
             if (data.sgfh_qty !== undefined || data.sjcl_qty !== undefined || data.qtcl_qty !== undefined) {
                 const op = await this.getDataById(data.id);
                 const bills = await this.ctx.service.reviseBills.getDataById(op.lid);
-                const billsPos = await this.getAllDataByCondition({where: {lid: op.lid} });
+                const billsPos = await this.getAllDataByCondition({where: {tid: tid, lid: op.lid} });
 
                 const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, bills.unit);
                 if (data.sgfh_qty !== undefined) {
@@ -182,7 +182,7 @@ module.exports = app => {
             if (data.length === 0) return;
             const op = await this.getDataById(data[0].id);
             const bills = await this.ctx.service.reviseBills.getDataById(op.lid);
-            const billsPos = await this.getAllDataByCondition({where: {lid: op.lid} });
+            const billsPos = await this.getAllDataByCondition({where: {tid: tid, lid: op.lid} });
             const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, bills.unit);
             for (const d of data) {
                 if (d.sgfh_qty !== undefined || d.sjcl_qty !== undefined || d.qtcl_qty !== undefined) {
@@ -244,7 +244,7 @@ module.exports = app => {
 
             const pos = await this.getPosData({tid: tid, id: data});
             const bills = await this.ctx.service.reviseBills.getDataById(pos[0].lid);
-            const billsPos = await this.getAllDataByCondition({ where: {lid: bills.id} });
+            const billsPos = await this.getAllDataByCondition({ where: {tid: tid, lid: bills.id} });
             const updateBills = {id: bills.id, sgfh_qty: null, sjcl_qty: null, qtcl_qty: null, quantity: null};
             for (const bp of billsPos) {
                 if (data.indexOf(bp.id) >= 0) continue;

+ 29 - 28
app/service/stage_bills.js

@@ -178,6 +178,22 @@ module.exports = app => {
             return await this.db.queryOne(sql, sqlParam);
         }
 
+        _calcStageBillsData(data, orgData, ledgerData) {
+            const info = this.ctx.tender.info;
+            const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, ledgerData.unit);
+            if (data.contract_qty !== undefined) {
+                data.contract_qty = this.round(data.contract_qty, precision.value);
+                data.contract_tp = this.ctx.helper.mul(data.contract_qty, ledgerData.unit_price, info.decimal.tp);
+            }
+            if (data.qc_qty !== undefined) {
+                data.qc_qty = this.round(data.qc_qty, precision.value);
+                data.qc_tp = this.ctx.helper.mul(data.qc_qty, ledgerData.unit_price, info.decimal.tp);
+            }
+            if (ledgerData.is_tp && data.contract_tp !== undefined) {
+                data.contract_tp = this.ctx.helper.round(data.contract_tp, info.decimal.tp);
+            }
+        }
+
         async _insertStageBillsData(transaction, insertData, orgData, ledgerData) {
             const info = this.ctx.tender.info;
             const d = {
@@ -195,8 +211,8 @@ module.exports = app => {
                 d.qc_tp = orgData.qc_tp;
                 d.postil = orgData.postil;
             }
-
             const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, ledgerData.unit);
+
             if (insertData.contract_qty !== undefined) {
                 d.contract_qty = this.round(insertData.contract_qty, precision.value);
                 d.contract_tp = this.ctx.helper.mul(d.contract_qty, ledgerData.unit_price, info.decimal.tp);
@@ -208,6 +224,10 @@ module.exports = app => {
             if (insertData.postil) {
                 d.postil = insertData.postil;
             }
+            if (ledgerData.is_tp && insertData.contract_tp !== undefined) {
+                d.contract_tp = this.ctx.helper.round(insertData.contract_tp, info.decimal.tp);
+            }
+            console.log(d);
             await transaction.insert(this.tableName, d);
         }
 
@@ -217,26 +237,17 @@ module.exports = app => {
          * @returns {Promise<void>}
          */
         async updateStageData(data) {
-            const info = this.ctx.tender.info;
             const datas = data instanceof Array ? data : [data];
             const transaction = await this.db.beginTransaction();
             try {
                 for (const d of datas) {
                     const stageBills = await this.getLastestStageData(this.ctx.tender.id, this.ctx.stage.id, d.lid);
                     const ledgerBills = await this.ctx.service.ledger.getDataById(d.lid);
-                    const precision = this.ctx.helper.findPrecision(info.precision, ledgerBills.unit);
-                    if (d.contract_qty !== undefined) {
-                        d.contract_qty = this.round(d.contract_qty, precision.value);
-                        d.contract_tp = this.ctx.helper.mul(d.contract_qty, ledgerBills.unit_price, info.decimal.tp);
-                    }
-                    if (d.qc_qty !== undefined) {
-                        d.qc_qty = this.round(d.qc_qty, precision.value);
-                        d.qc_tp = this.ctx.helper.mul(d.qc_qty, ledgerBills.unit_price, info.decimal.tp);
-                    }
                     if (!stageBills || stageBills.times !== this.ctx.stage.curTimes || stageBills.order !== this.ctx.stage.curOrder) {
                         await this._insertStageBillsData(transaction, d, stageBills, ledgerBills);
                     } else {
                         d.id = stageBills.id;
+                        this._calcStageBillsData(d, stageBills, ledgerBills);
                         await transaction.update(this.tableName, d);
                     }
                 }
@@ -258,29 +269,19 @@ module.exports = app => {
          * @private
          */
         async updateStageBillsQty(transaction, ledgerBills, stageBills, data) {
-            const info = this.ctx.tender.info;
-            const precision = this.ctx.helper.findPrecision(info.precision, ledgerBills.unit);
-            const updateData = {};
-            if (data.contract_qty !== undefined) {
-                updateData.contract_qty = this.round(data.contract_qty, precision.value);
-                updateData.contract_tp = this.ctx.helper.mul(updateData.contract_qty, ledgerBills.unit_price, info.decimal.tp);
-            }
-            if (data.qc_qty !== undefined) {
-                updateData.qc_qty = this.round(data.qc_qty, precision.value);
-                updateData.qc_tp = this.ctx.helper.mul(updateData.qc_qty, ledgerBills.unit_price, info.decimal.tp);
-            }
             if (stageBills) {
-                if ((updateData.contract_qty === undefined || stageBills.contract_qty !== updateData.contract_qty) ||
-                    (updateData.qc_qty === undefined || stageBills.qc_qty !== updateData.qc_qty)) {
+                if ((data.contract_qty === undefined || stageBills.contract_qty !== data.contract_qty) ||
+                    (data.qc_qty === undefined || stageBills.qc_qty !== data.qc_qty)) {
                     if (stageBills.times === this.ctx.stage.curTimes && stageBills.order === this.ctx.stage.curOrder) {
-                        updateData.id = stageBills.id;
-                        await transaction.update(this.tableName, updateData);
+                        data.id = stageBills.id;
+                        this._calcStageBillsData(data, stageBills, ledgerBills);
+                        await transaction.update(this.tableName, data);
                     } else {
-                        await this._insertStageBillsData(transaction, updateData, stageBills, ledgerBills);
+                        await this._insertStageBillsData(transaction, data, stageBills, ledgerBills);
                     }
                 }
             } else {
-                await this._insertStageBillsData(transaction, updateData, stageBills, ledgerBills);
+                await this._insertStageBillsData(transaction, data, stageBills, ledgerBills);
             }
         };
         /**

+ 3 - 1
app/service/tender_info.js

@@ -83,11 +83,13 @@ module.exports = app => {
          * @returns {Promise<void>}
          */
         async saveTenderInfo(tenderId, data) {
+            console.log(data);
             for (const di in data) {
-                if (parseInfo.indexOf(di) >= 0) {
+                if (parseInfo.indexOf(di) >= 0 || arrayInfo.indexOf(di) >= 0) {
                     data[di] = JSON.stringify(data[di]);
                 }
             }
+            console.log(data);
             await this.db.update(this.tableName, data, {where: {tid: tenderId}});
         }
 

+ 301 - 125
app/view/change/info_modal.ejs

@@ -234,19 +234,14 @@
                         <div class="col-4">
                             <a href="#sub-ap" data-toggle="modal" data-category="" data-target="#sub-ap" id="hideSp">修改审批流程</a>
                             <div class="card mt-3">
-                                <ul class="list-group list-group-flush">
-                                    <% for (const [index, audit] of auditList.entries()) { %>
-                                        <% if (audit.usite === 0) { %>
+                                <ul class="list-group list-group-flush" id="shenpi-audit-list">
+                                    <% for (const [index,a] of auditList.entries()) { %>
+                                        <% if (a.usite === 0) { %>
                                             <li class="list-group-item">
                                                 <i class="fa fa-play-circle fa-rotate-90"></i>
-                                                <%= audit.name %>  <small class="text-muted"><%= audit.jobs %></small><span class="pull-right">原报</span>
+                                                <%= a.name %>  <small class="text-muted"><%= a.jobs %></small><span class="pull-right">原报</span>
                                             </li>
-                                        <% } %>
-                                    <% } %>
-                                </ul>
-                                <ul class="list-group list-group-flush" id="shenpi-audit-list">
-                                    <% for (const [index,a] of auditList.entries()) { %>
-                                        <% if (a.usite !== 0 ) { %>
+                                        <% } else { %>
                                             <li class="list-group-item" data-auditid="<%= a.uid %>">
                                                 <% if (index+1 !== auditList.length) { %>
                                                     <i class="fa fa-chevron-circle-down"></i>
@@ -280,8 +275,10 @@
                                                         <i class="fa <% if (aindex+1 === auditList3[time].length) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> text-danger"></i>
                                                     <% } else if (al.status === 5 || al.status === 6) { %>
                                                         <i class="fa <% if (aindex+1 === auditList3[time].length) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> text-warning"></i>
+                                                    <% } else if (al.status === 7) { %>
+                                                        <i class="fa fa-chevron-circle-down text-warning"></i>
                                                     <% } %>
-                                                    <%= al.name %>&nbsp;<small class="text-muted"><%= al.jobs %></small><span class="pull-right"><%= al.usite === 0 ? '原报' : (aindex+1 === auditList3[time].length ? '终审' : ctx.helper.transFormToChinese(al.usite) + '审') %></span>
+                                                    <%= al.name %>&nbsp;<small class="text-muted"><%= al.jobs %></small><span class="pull-right"><%= al.usite === 0 ? '原报' : (al.max_sort === al.usite ? '终审' : ctx.helper.transFormToChinese(al.usite) + '审') %></span>
                                                 </h5>
                                                 <div class="ml-3">
                                                     <% if (al.usite === 0 && al.status === 2) { %>
@@ -295,10 +292,12 @@
                                                     <% } else if (al.usite !== 0 && al.status === 4) { %>
                                                         <span class="text-danger"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批终止</span>
                                                     <% } else if (al.usite !== 0 && (al.status === 5 || al.status === 6)) { %>
-                                                        <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批退回 </span>
+                                                        <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批退回 <% if (al.status === 5) {%><%= auditList3[time][0].name %><% } %></span>
+                                                    <% } else if (al.usite !== 0 && al.status === 7) { %>
+                                                        <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>重新审批 </span>
                                                     <% } %>
                                                     <% if (al.sdesc !== '' && al.sdesc !== null) { %>
-                                                        <p class="card-text"><%= al.sdesc %></p>
+                                                        <p class="card-text"><%- al.sdesc %></p>
                                                     <% } %>
                                                 </div>
                                             </li>
@@ -307,6 +306,31 @@
                                 </div>
                             <% } %>
                             <% } %>
+                                <div class="card mt-3">
+                                    <ul class="list-group list-group-flush" id="shenpi-audit-list2">
+                                        <% for (const [index, audit] of auditList.entries()) { %>
+                                            <% if (audit.usite === 0) { %>
+                                            <li class="list-group-item">
+                                                <h5 class="card-title">
+                                                    <i class="fa fa-play-circle fa-rotate-90"></i>
+                                                    <%= audit.name %>  <small class="text-muted"><%= audit.jobs %></small><span class="pull-right">原报</span>
+                                                </h5>
+                                            </li>
+                                            <% } else { %>
+                                            <li class="list-group-item" data-auditid="<%= audit.uid %>">
+                                                <h5 class="card-title">
+                                                    <% if (index+1 !== auditList.length) { %>
+                                                        <i class="fa fa-chevron-circle-down"></i>
+                                                    <% } else if (index+1 === auditList.length) { %>
+                                                        <i class="fa fa-stop-circle"></i>
+                                                    <% } %>
+                                                    <%= audit.name %>  <small class="text-muted"><%= audit.jobs %></small><span class="pull-right"><%= index+1 === auditList.length ? '终' : ctx.helper.transFormToChinese(index) %>审</span>
+                                                </h5>
+                                            </li>
+                                            <% } %>
+                                        <% } %>
+                                    </ul>
+                                </div>
                         </div>
                     </div>
                 </div>
@@ -371,7 +395,7 @@
                                         <% } else if (al.status === 7) { %>
                                         <i class="fa fa-chevron-circle-down text-warning"></i>
                                         <% } %>
-                                        <%= al.name %>&nbsp;<small class="text-muted"><%= al.jobs %></small><span class="pull-right"><%= al.usite === 0 ? '原报' : (aindex+1 === auditList3[time].length ? '终审' : ctx.helper.transFormToChinese(aindex) + '审')  %></span>
+                                        <%= al.name %>&nbsp;<small class="text-muted"><%= al.jobs %></small><span class="pull-right"><%= al.usite === 0 ? '原报' : (al.max_sort === al.usite ? '终审' : ctx.helper.transFormToChinese(al.usite) + '审')  %></span>
                                     </h5>
                                     <div class="ml-3">
                                         <% if (al.usite === 0 && al.status === 2) { %>
@@ -392,7 +416,7 @@
                                             <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>重新审批</span>
                                         <% } %>
                                         <% if (al.sdesc !== '' && al.sdesc !== null) { %>
-                                            <p class="card-text"><%= al.sdesc %></p>
+                                            <p class="card-text"><%- al.sdesc %></p>
                                         <% } %>
                                     </div>
                                 </li>
@@ -414,61 +438,138 @@
 <% if (auditStatus === 6) { %>
     <!--审批通过-->
     <div class="modal fade" id="sp-done" data-backdrop="static">
-        <div class="modal-dialog" role="document">
-            <div class="modal-content">
+        <div class="modal-dialog modal-lg" role="document">
+            <form class="modal-content" action="/change/approval?_csrf=<%= ctx.csrf %>" method="post" id="success-approval">
                 <div class="modal-header">
                     <h5 class="modal-title">审批通过</h5>
                 </div>
-                <form action="/change/approval?_csrf=<%= ctx.csrf %>" method="post" id="success-approval">
                 <div class="modal-body">
-                    <div class="card mt-3">
-                        <ul class="list-group list-group-flush">
-                            <% for (const [index,a] of auditList.entries()) { %>
-                            <li class="list-group-item">
-                                <% if (a.status === 3 && a.usite === 0 && a.times === 1) { %>
-                                <span class="text-success pull-right">上报</span>
-                                <% } else if (a.status === 3 && a.usite === 0 && a.times !== 1) { %>
-                                <span class="text-success pull-right">重新上报</span>
-                                <% } else if (a.status === 3 && a.usite !== 0) { %>
-                                <span class="text-success pull-right">审批通过</span>
-                                <% } else if (a.status === 2) { %>
-                                <span class="pull-right">审批中</span>
-                                <% } %>
-                                <h5 class="card-title">
-                                    <% if (a.usort === 0) { %>
-                                    <i class="fa fa-play-circle fa-rotate-90 <% if (a.status === 3) { %>text-success<% } %>"></i>
-                                    <% } else if (a.usort !== 0 && index+1 !== auditList.length) { %>
-                                    <i class="fa fa-chevron-circle-down <% if (a.status === 3) { %>text-success<% } %>"></i>
-                                    <% } else if (a.usort !== 0 && index+1 === auditList.length) { %>
-                                    <i class="fa fa-stop-circle"></i>
-                                    <% } %>
-                                    <%= a.name %>&nbsp;<small class="text-muted"><%= a.jobs%></small>
-                                </h5>
-                                <% if (a.sdesc !== '' && a.sdesc !== null) { %>
-                                    <p class="card-text mb-1"><%= a.sdesc %></p>
-                                <% } %>
-                                <% if (a.sin_time !== null) { %>
-                                    <p class="card-text"><small class="text-muted"><%= moment(a.sin_time).format('YYYY-MM-DD') %></small></p>
-                                <% } %>
-                                <% if (a.status === 2) { %>
-                                    <div class="form-group">
-                                        <label>审批意见<b class="text-danger">*</b></label>
-                                        <textarea class="form-control form-control-sm" name="sdesc">同意</textarea>
-                                        <input type="hidden" name="audit_id" value="<%= a.id %>">
-                                        <% if (a.usort !== 0 && index+1 === auditList.length) { %>
-                                        <!--终审填写批复编号-->
-                                        <div class="form-group mt-3">
-                                            <label><b class="text-danger">*&nbsp;</b>变更令号(批复编号)</label>
-                                            <input class="form-control form-control-sm" value="<%= change.code %>" name="p_code" type="text">
-                                        </div>
+                    <div class="row">
+                        <div class="col-4">
+                            <div class="card mt-3">
+                                <ul class="list-group list-group-flush">
+                                    <% for (const [index,a] of auditList2.entries()) { %>
+                                        <% if (a.usite === 0) { %>
+                                            <li class="list-group-item">
+                                                <i class="fa fa-play-circle fa-rotate-90"></i>
+                                                <%= a.name %> <small class="text-muted"><%= a.jobs %></small><span class="pull-right">原报</span>
+                                            </li>
                                         <% } else { %>
-                                            <input type="hidden" name="audit_next_id" value="<%= auditList[index+1].id %>">
-                                        <% } %>
+                                            <li class="list-group-item">
+                                                <% if (index+1 !== auditList.length) { %>
+                                                    <i class="fa fa-chevron-circle-down"></i>
+                                                <% } else if (index+1 === auditList.length) { %>
+                                                    <i class="fa fa-stop-circle"></i>
+                                                <% } %>
+                                                <%= a.name %> <small class="text-muted"><%= a.jobs %></small><span class="pull-right"><%= index+1 === auditList2.length ? '终' : ctx.helper.transFormToChinese(index) %>审</span>
+                                            </li>
+                                        <% }%>
+                                    <% } %>
+                                </ul>
+                            </div>
+                        </div>
+                        <div class="col-8 modal-height-500" style="overflow: auto">
+                            <% for (const time in auditList3) { %>
+                                <% if (auditList3[time].length > 0) { %>
+                                    <div class="card mt-3">
+                                        <ul class="list-group list-group-flush">
+                                            <% for (const [aindex,al] of auditList3[time].entries()) { %>
+                                                <li class="list-group-item">
+                                                    <h5 class="card-title">
+                                                        <% if (al.usite === 0 && al.status === 2 ) { %>
+                                                            <i class="fa fa-play-circle fa-rotate-90"></i>
+                                                        <% } else if (al.usite === 0 && al.status === 3 ) { %>
+                                                            <i class="fa fa-play-circle fa-rotate-90 text-success"></i>
+                                                        <% } else if (al.status === 1 || al.status === 2) { %>
+                                                            <i class="fa <% if (aindex+1 === auditList3[time].length) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> "></i>
+                                                        <% } else if (al.status === 3) { %>
+                                                            <i class="fa <% if (aindex+1 === auditList3[time].length) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> text-success"></i>
+                                                        <% } else if (al.status === 4) { %>
+                                                            <i class="fa <% if (aindex+1 === auditList3[time].length) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> text-danger"></i>
+                                                        <% } else if (al.status === 5 || al.status === 6) { %>
+                                                            <i class="fa <% if (aindex+1 === auditList3[time].length) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> text-warning"></i>
+                                                        <% } else if (al.status === 7) { %>
+                                                            <i class="fa fa-chevron-circle-down text-warning"></i>
+                                                        <% } %>
+                                                        <%= al.name %>&nbsp;<small class="text-muted"><%= al.jobs %></small><span class="pull-right"><%= al.usite === 0 ? '原报' : (al.max_sort === al.usite ? '终审' : ctx.helper.transFormToChinese(al.usite) + '审') %></span>
+                                                    </h5>
+                                                    <div class="ml-3">
+                                                        <% if (al.usite === 0 && al.status === 2) { %>
+                                                            <span>重新上报中</span>
+                                                        <% } else if (al.usite === 0 && al.status === 3) { %>
+                                                            <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>上报</span>
+                                                        <% } else if (al.usite !== 0 && al.status === 2) { %>
+                                                            <span>审批中</span>
+                                                        <% } else if (al.usite !== 0 && al.status === 3) { %>
+                                                            <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批通过</span>
+                                                        <% } else if (al.usite !== 0 && al.status === 4) { %>
+                                                            <span class="text-danger"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批终止</span>
+                                                        <% } else if (al.usite !== 0 && (al.status === 5 || al.status === 6)) { %>
+                                                            <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批退回 <% if (al.status === 5) {%><%= auditList3[time][0].name %><% } %></span>
+                                                        <% } else if (al.usite !== 0 && al.status === 7) { %>
+                                                            <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>重新审批</span>
+                                                        <% } %>
+                                                        <% if (al.sdesc !== '' && al.sdesc !== null) { %>
+                                                            <p class="card-text"><%- al.sdesc %></p>
+                                                        <% } %>
+                                                    </div>
+                                                </li>
+                                            <% } %>
+                                        </ul>
                                     </div>
                                 <% } %>
-                            </li>
                             <% } %>
-                        </ul>
+                            <div class="card mt-3">
+                                <ul class="list-group list-group-flush">
+                                    <% for (const [index,a] of auditList.entries()) { %>
+                                        <li class="list-group-item">
+                                        <% if (a.usite === 0 ) { %>
+                                            <h5 class="card-title">
+                                                <i class="fa fa-play-circle fa-rotate-90 text-success"></i>
+                                                <%= a.name %>&nbsp;<small class="text-muted"><%= a.jobs%></small><span class="pull-right">原报</span>
+                                            </h5>
+                                            <div class="ml-3">
+                                                <span class="text-success"><small><%= moment(a.sin_time).format('YYYY-MM-DD') %> </small><span class="text-success"><% if (a.status === 3 && a.usite === 0 && a.times !== 1) { %>重新<% } %>上报</span></span>
+                                            </div>
+                                        <% } else { %>
+                                            <h5 class="card-title">
+                                                <i class="fa <% if (index+1 !== auditList.length) { %>fa-chevron-circle-down <% } else { %>fa-stop-circle <% } %><% if (a.status === 3) { %>text-success<% } else if (a.status === 4) { %>text-danger<% } else if (a.status === 6 || a.status === 7) { %>text-warning<% } %>"></i>
+                                                <%= a.name %>&nbsp;<small class="text-muted"><%= a.jobs%></small><span class="pull-right"><%= a.max_sort === a.usite ? '终' : ctx.helper.transFormToChinese(a.usite) %>审</span>
+                                            </h5>
+                                            <div class="ml-3">
+                                                <% if (a.status === 3) { %>
+                                                    <span class="text-success"><% if (a.sin_time !== null) { %><small><%= moment(a.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批通过</span>
+                                                <% } else if (a.status === 4) { %>
+                                                    <span class="text-danger"><% if (a.sin_time !== null) { %><small><%= moment(a.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批终止</span>
+                                                <% } else if (a.status === 6) { %>
+                                                <span class="text-warning"><% if (a.sin_time !== null) { %><small><%= moment(a.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批退回</span>
+                                                <% } else if (a.status === 7) { %>
+                                                    <span class="text-warning"><% if (a.sin_time !== null) { %><small><%= moment(a.sin_time).format('YYYY-MM-DD') %></small> <% } %>重新审批</span>
+                                                <% } %>
+                                                <p class="card-text"><%- a.sdesc %></p>
+                                            </div>
+                                            <% if (a.status === 2) { %>
+                                                <div class="form-group">
+                                                    <label>审批意见<b class="text-danger">*</b></label>
+                                                    <textarea class="form-control form-control-sm" name="sdesc">同意</textarea>
+                                                    <input type="hidden" name="audit_id" value="<%= a.id %>">
+                                                    <% if (a.usort !== 0 && index+1 === auditList.length) { %>
+                                                        <!--终审填写批复编号-->
+                                                        <div class="form-group mt-3">
+                                                            <label><b class="text-danger">*&nbsp;</b>变更令号(批复编号)</label>
+                                                            <input class="form-control form-control-sm" value="<%= change.code %>" name="p_code" type="text">
+                                                        </div>
+                                                    <% } else { %>
+                                                        <input type="hidden" name="audit_next_id" value="<%= auditList[index+1].id %>">
+                                                    <% } %>
+                                                </div>
+                                            <% } %>
+                                        <% } %>
+                                        </li>
+                                    <% } %>
+                                </ul>
+                            </div>
+                        </div>
                     </div>
                 </div>
                 <div class="modal-footer">
@@ -479,78 +580,154 @@
                     <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
                     <button type="button" class="btn btn-success btn-sm approval-btn">确认通过</button>
                 </div>
-                </form>
-            </div>
+            </form>
         </div>
     </div>
     <!--审批退回-->
     <div class="modal fade" id="sp-back" data-backdrop="static">
-        <div class="modal-dialog" role="document">
-            <div class="modal-content">
+        <div class="modal-dialog modal-lg" role="document">
+            <form class="modal-content" action="/change/approval?_csrf=<%= ctx.csrf %>" method="post" id="fail-approval">
                 <div class="modal-header">
                     <h5 class="modal-title">审批退回</h5>
                 </div>
-                <form action="/change/approval?_csrf=<%= ctx.csrf %>" method="post" id="fail-approval">
                 <div class="modal-body">
-                    <div class="card mt-3">
-                        <ul class="list-group list-group-flush">
-                            <% for (const [index,a] of auditList.entries()) { %>
-                                <li class="list-group-item">
-                                    <% if (a.status === 3 && a.usite === 0 && a.times === 1) { %>
-                                        <span class="text-success pull-right">上报</span>
-                                    <% } else if (a.status === 3 && a.usite === 0 && a.times !== 1) { %>
-                                        <span class="text-success pull-right">重新上报</span>
-                                    <% } else if (a.status === 3 && a.usite !== 0) { %>
-                                        <span class="text-success pull-right">审批通过</span>
-                                    <% } else if (a.status === 2) { %>
-                                        <span class="pull-right">审批中</span>
-                                    <% } %>
-                                    <h5 class="card-title">
-                                        <% if (a.usort === 0) { %>
-                                            <i class="fa fa-play-circle fa-rotate-90 <% if (a.status === 3) { %>text-success<% } %>"></i>
-                                        <% } else if (a.usort !== 0 && index+1 !== auditList.length) { %>
-                                            <i class="fa fa-chevron-circle-down <% if (a.status === 3) { %>text-success<% } %>"></i>
-                                        <% } else if (a.usort !== 0 && index+1 === auditList.length) { %>
-                                            <i class="fa fa-stop-circle"></i>
-                                        <% } %>
-                                        <%= a.name %>&nbsp;<small class="text-muted"><%= a.jobs%></small>
-                                    </h5>
-                                    <% if (a.sdesc !== '' && a.sdesc !== null) { %>
-                                        <p class="card-text mb-1"><%= a.sdesc %></p>
-                                    <% } %>
-                                    <% if (a.sin_time !== null) { %>
-                                        <p class="card-text"><small class="text-muted"><%= moment(a.sin_time).format('YYYY-MM-DD') %></small></p>
+                    <div class="row">
+                        <div class="col-4">
+                            <div class="card mt-3">
+                                <ul class="list-group list-group-flush">
+                                    <% for (const [index,a] of auditList2.entries()) { %>
+                                        <% if (a.usite === 0) { %>
+                                            <li class="list-group-item">
+                                                <i class="fa fa-play-circle fa-rotate-90"></i>
+                                                <%= a.name %> <small class="text-muted"><%= a.jobs %></small><span class="pull-right">原报</span>
+                                            </li>
+                                        <% } else { %>
+                                            <li class="list-group-item">
+                                                <% if (index+1 !== auditList.length) { %>
+                                                    <i class="fa fa-chevron-circle-down"></i>
+                                                <% } else if (index+1 === auditList.length) { %>
+                                                    <i class="fa fa-stop-circle"></i>
+                                                <% } %>
+                                                <%= a.name %> <small class="text-muted"><%= a.jobs %></small><span class="pull-right"><%= index+1 === auditList2.length ? '终' : ctx.helper.transFormToChinese(index) %>审</span>
+                                            </li>
+                                        <% }%>
                                     <% } %>
-                                    <% if (a.status === 2) { %>
-                                        <div class="form-group">
-                                            <label>审批意见<b class="text-danger">*</b></label>
-                                            <textarea class="form-control form-control-sm" name="sdesc">不同意</textarea>
-                                            <input type="hidden" name="audit_id" value="<%= a.id %>">
-                                        </div>
-                                        <div class="alert alert-warning">
-                                            <div class="form-check form-check-inline">
-                                                <input class="form-check-input" type="radio" name="status" id="change-back" value="5" <% if (index === 1) { %>checked<% } %>>
-                                                <label class="form-check-label" for="change-back">退回上报 <%= auditList[0].name %></label>
-                                            </div>
-                                            <% if (index !== 1) { %>
-                                            <div class="form-check form-check-inline">
-                                                <input class="form-check-input" type="radio" name="status" id="chagne-backnew" value="6" <% if (index !== 1) { %>checked<% } %>>
-                                                <label class="form-check-label" for="chagne-backnew">退回上一审批人 <%= auditList[index-1].name %></label>
-                                                <input type="hidden" name="audit_last_id" value="<%= auditList[index-1].id %>">
-                                            </div>
+                                </ul>
+                            </div>
+                        </div>
+                        <div class="col-8 modal-height-500" style="overflow: auto">
+                            <% for (const time in auditList3) { %>
+                                <% if (auditList3[time].length > 0) { %>
+                                    <div class="card mt-3">
+                                        <ul class="list-group list-group-flush">
+                                            <% for (const [aindex,al] of auditList3[time].entries()) { %>
+                                                <li class="list-group-item">
+                                                    <h5 class="card-title">
+                                                        <% if (al.usite === 0 && al.status === 2 ) { %>
+                                                            <i class="fa fa-play-circle fa-rotate-90"></i>
+                                                        <% } else if (al.usite === 0 && al.status === 3 ) { %>
+                                                            <i class="fa fa-play-circle fa-rotate-90 text-success"></i>
+                                                        <% } else if (al.status === 1 || al.status === 2) { %>
+                                                            <i class="fa <% if (aindex+1 === auditList3[time].length) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> "></i>
+                                                        <% } else if (al.status === 3) { %>
+                                                            <i class="fa <% if (aindex+1 === auditList3[time].length) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> text-success"></i>
+                                                        <% } else if (al.status === 4) { %>
+                                                            <i class="fa <% if (aindex+1 === auditList3[time].length) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> text-danger"></i>
+                                                        <% } else if (al.status === 5 || al.status === 6) { %>
+                                                            <i class="fa <% if (aindex+1 === auditList3[time].length) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> text-warning"></i>
+                                                        <% } else if (al.status === 7) { %>
+                                                            <i class="fa fa-chevron-circle-down text-warning"></i>
+                                                        <% } %>
+                                                        <%= al.name %>&nbsp;<small class="text-muted"><%= al.jobs %></small><span class="pull-right"><%= al.usite === 0 ? '原报' : (al.max_sort === al.usite ? '终审' : ctx.helper.transFormToChinese(al.usite) + '审') %></span>
+                                                    </h5>
+                                                    <div class="ml-3">
+                                                        <% if (al.usite === 0 && al.status === 2) { %>
+                                                            <span>重新上报中</span>
+                                                        <% } else if (al.usite === 0 && al.status === 3) { %>
+                                                            <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>上报</span>
+                                                        <% } else if (al.usite !== 0 && al.status === 2) { %>
+                                                            <span>审批中</span>
+                                                        <% } else if (al.usite !== 0 && al.status === 3) { %>
+                                                            <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批通过</span>
+                                                        <% } else if (al.usite !== 0 && al.status === 4) { %>
+                                                            <span class="text-danger"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批终止</span>
+                                                        <% } else if (al.usite !== 0 && (al.status === 5 || al.status === 6)) { %>
+                                                            <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批退回 <% if (al.status === 5) {%><%= auditList3[time][0].name %><% } %></span>
+                                                        <% } else if (al.usite !== 0 && al.status === 7) { %>
+                                                            <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>重新审批</span>
+                                                        <% } %>
+                                                        <% if (al.sdesc !== '' && al.sdesc !== null) { %>
+                                                            <p class="card-text"><%- al.sdesc %></p>
+                                                        <% } %>
+                                                    </div>
+                                                </li>
                                             <% } %>
-                                            <!--<div class="form-check form-check-inline">-->
-                                                <!--<input class="form-check-input" type="radio" name="status" id="change-stop" value="4">-->
-                                                <!--<label class="form-check-label" for="change-stop">终止</label>-->
-                                            <!--</div>-->
-                                        </div>
-                                        <div class="alert alert-danger change-approval-stop" style="display: none">
-                                            审批终止,将结束本次审批,本条变更令作废。
-                                        </div>
-                                    <% } %>
-                                </li>
+                                        </ul>
+                                    </div>
+                                <% } %>
                             <% } %>
-                        </ul>
+                            <div class="card mt-3">
+                                <ul class="list-group list-group-flush">
+                                    <% for (const [index,a] of auditList.entries()) { %>
+                                        <li class="list-group-item">
+                                            <% if (a.usite === 0 ) { %>
+                                                <h5 class="card-title">
+                                                    <i class="fa fa-play-circle fa-rotate-90 text-success"></i>
+                                                    <%= a.name %>&nbsp;<small class="text-muted"><%= a.jobs%></small><span class="pull-right">原报</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <span class="text-success"><small><%= moment(a.sin_time).format('YYYY-MM-DD') %> </small><span class="text-success"><% if (a.status === 3 && a.usite === 0 && a.times !== 1) { %>重新<% } %>上报</span></span>
+                                                </div>
+                                            <% } else { %>
+                                                <h5 class="card-title">
+                                                    <i class="fa <% if (index+1 !== auditList.length) { %>fa-chevron-circle-down <% } else { %>fa-stop-circle <% } %><% if (a.status === 3) { %>text-success<% } else if (a.status === 4) { %>text-danger<% } else if (a.status === 6 || a.status === 7) { %>text-warning<% } %>"></i>
+                                                    <%= a.name %>&nbsp;<small class="text-muted"><%= a.jobs%></small><span class="pull-right"><%= a.max_sort === a.usite ? '终' : ctx.helper.transFormToChinese(a.usite) %>审</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <% if (a.status === 3) { %>
+                                                        <span class="text-success"><% if (a.sin_time !== null) { %><small><%= moment(a.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批通过</span>
+                                                    <% } else if (a.status === 4) { %>
+                                                        <span class="text-danger"><% if (a.sin_time !== null) { %><small><%= moment(a.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批终止</span>
+                                                    <% } else if (a.status === 6) { %>
+                                                        <span class="text-warning"><% if (a.sin_time !== null) { %><small><%= moment(a.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批退回</span>
+                                                    <% } else if (a.status === 7) { %>
+                                                        <span class="text-warning"><% if (a.sin_time !== null) { %><small><%= moment(a.sin_time).format('YYYY-MM-DD') %></small> <% } %>重新审批</span>
+                                                    <% } %>
+                                                    <p class="card-text"><%- a.sdesc %></p>
+                                                </div>
+                                                <% if (a.status === 2) { %>
+                                                    <div class="form-group">
+                                                        <label>审批意见<b class="text-danger">*</b></label>
+                                                        <textarea class="form-control form-control-sm" name="sdesc">不同意</textarea>
+                                                        <input type="hidden" name="audit_id" value="<%= a.id %>">
+                                                    </div>
+                                                    <div class="alert alert-warning">
+                                                        <div class="form-check form-check-inline">
+                                                            <input class="form-check-input" type="radio" name="status" id="change-back" value="5" <% if (index === 1) { %>checked<% } %>>
+                                                            <label class="form-check-label" for="change-back">退回上报 <%= auditList[0].name %></label>
+                                                        </div>
+                                                        <% if (index !== 1) { %>
+                                                            <div class="form-check form-check-inline">
+                                                                <input class="form-check-input" type="radio" name="status" id="chagne-backnew" value="6" <% if (index !== 1) { %>checked<% } %>>
+                                                                <label class="form-check-label" for="chagne-backnew">退回上一审批人 <%= auditList2[a.usite-1].name %></label>
+                                                                <input type="hidden" name="audit_last_id" value="<%= auditList2[a.usite-1].id %>">
+                                                            </div>
+                                                        <% } %>
+                                                        <!--<div class="form-check form-check-inline">-->
+                                                        <!--<input class="form-check-input" type="radio" name="status" id="change-stop" value="4">-->
+                                                        <!--<label class="form-check-label" for="change-stop">终止</label>-->
+                                                        <!--</div>-->
+                                                    </div>
+                                                    <div class="alert alert-danger change-approval-stop" style="display: none">
+                                                        审批终止,将结束本次审批,本条变更令作废。
+                                                    </div>
+                                                <% } %>
+                                            <% } %>
+                                        </li>
+                                    <% } %>
+                                </ul>
+                            </div>
+                        </div>
                     </div>
                 </div>
                 <div class="modal-footer">
@@ -560,8 +737,7 @@
                     <button type="button" class="btn btn-warning btn-sm change-approval-back approval-btn">确认退回</button>
                     <button type="button" class="btn btn-danger btn-sm change-approval-stop approval-btn" style="display: none">确认终止</button>
                 </div>
-                </form>
-            </div>
+            </form>
         </div>
     </div>
 <% } %>

+ 243 - 39
app/view/ledger/audit_modal.ejs

@@ -1,31 +1,133 @@
 <% if (tender.ledger_status === auditConst.status.checking && curAuditor.audit_id === ctx.session.sessionUser.accountId) { %>
 <!--审批通过-->
 <div class="modal fade" id="sp-done" data-backdrop="static">
-    <div class="modal-dialog" role="document">
-        <form class="modal-content" action="/tender/<%- tender.id %>/ledger/audit/check" method="post">
+    <div class="modal-dialog modal-lg" role="document">
+        <form class="modal-content" action="/tender/<%- tender.id %>/ledger/audit/check" method="post" onsubmit="return auditCheck();">
             <div class="modal-header">
                 <h5 class="modal-title">审批通过</h5>
             </div>
             <div class="modal-body">
-                <div class="card mt-3">
-                    <ul class="list-group list-group-flush">
-                        <% for (let i = 0, iLen = auditors.length; i < iLen; i++) { %>
-                        <li class="list-group-item" auditorId="<%- auditors[i].audit_id %>">
-                            <% if (auditors[i].status !== auditConst.status.uncheck) { %>
-                            <span class="<%- auditConst.statusClass[auditors[i].status] %> pull-right"><%- auditConst.statusString[auditors[i].status] %></span>
-                            <% } %>
-                            <h5 class="card-title"><%- auditors[i].audit_order %> <%- auditors[i].name %> <small class="text-muted"><%- auditors[i].role %></small></h5>
-                            <% if (auditors[i].status === auditConst.status.checked) { %>
-                            <p class="card-text"><%- auditors[i].opinion %> <%- auditors[i].end_time ? auditors[i].end_time.toLocaleString() : '' %></p>
-                            <% } else if (auditors[i].status === auditConst.status.checking) { %>
-                            <div class="form-group">
-                                <label>审批意见<b class="text-danger">*</b></label>
-                                <textarea class="form-control form-control-sm" name="opinion">同意</textarea>
+                <div class="row">
+                    <div class="col-4">
+                        <div class="card mt-3">
+                            <ul class="list-group list-group-flush">
+                                <li class="list-group-item">
+                                    <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- user.name %>  <small class="text-muted"><%- user.role %></small><span class="pull-right">原报</span>
+                                </li>
+                                <% for (let i = 0; i < auditors.length; i++) { %>
+                                    <li class="list-group-item">
+                                        <% if (i < auditors.length - 1) { %>
+                                            <i class="fa fa-chevron-circle-down"></i> <%- auditors[i].name %>  <small class="text-muted"><%- auditors[i].role %></small><span class="pull-right"><%= ctx.helper.transFormToChinese(i+1)%>审</span>
+                                        <% } else {%>
+                                            <i class="fa fa fa-stop-circle"></i> <%- auditors[i].name %>  <small class="text-muted"><%- auditors[i].role %></small><span class="pull-right">终审</span>
+                                        <% } %>
+                                    </li>
+                                <% } %>
+                            </ul>
+                        </div>
+                    </div>
+                    <div class="col-8 modal-height-500" style="overflow: auto">
+                        <% for (const ah of auditHistory) { %>
+                            <div class="card mt-3">
+                                <ul class="list-group list-group-flush">
+                                    <% for (let iA = 0; iA < ah.length; iA++) { %>
+                                        <% if (iA === 0) { %>
+                                            <li class="list-group-item">
+                                                <h5 class="card-title">
+                                                    <i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- user.name %> <small class="text-muted"><%- user.role %></small><span class="pull-right">原报</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <span class="text-success"><small><%- ah[iA].begin_time.toLocaleDateString() %></small> <% if (auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
+                                                </div>
+                                            </li>
+                                            <li class="list-group-item">
+                                                <h5 class="card-title">
+                                                    <i class="fa <%if (iA === ah.length - 1) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small><span class="pull-right"><%= ah[iA].sort === ah[iA].max_sort ? '终' : ctx.helper.transFormToChinese(ah[iA].sort) %>审</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <% if (ah[iA].status !== auditConst.status.uncheck) { %>
+                                                        <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- user.name %><% } %></span>
+                                                    <% } %>
+                                                    <p class="card-text"><%- ah[iA].opinion %></p>
+                                                </div>
+                                            </li>
+                                        <% } else if (iA === ah.length - 1) { %>
+                                            <li class="list-group-item">
+                                                <h5 class="card-title">
+                                                    <i class="fa fa-stop-circle <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small><span class="pull-right">终审</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <% if (ah[iA].status !== auditConst.status.uncheck) { %>
+                                                        <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- user.name %><% } %></span>
+                                                    <% } %>
+                                                    <p class="card-text"><%- ah[iA].opinion %></p>
+                                                </div>
+                                            </li>
+                                        <% } else { %>
+                                            <li class="list-group-item">
+                                                <h5 class="card-title">
+                                                    <i class="fa fa-chevron-circle-down <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small><span class="pull-right"><%= ah[iA].sort === ah[iA].max_sort ? '终' : ctx.helper.transFormToChinese(ah[iA].sort) %>审</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <% if (ah[iA].status !== auditConst.status.uncheck) { %>
+                                                        <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- user.name %><% } %></span>
+                                                    <% } %>
+                                                    <p class="card-text"><%- ah[iA].opinion %></p>
+                                                </div>
+                                            </li>
+                                        <% } %>
+                                    <% } %>
+                                </ul>
+                            </div>
+                        <% } %>
+                        <% if (tender.ledger_status === auditConst.status.checking || tender.ledger_status === auditConst.status.checked) {%>
+                            <div class="card mt-3">
+                                <ul class="list-group list-group-flush">
+                                    <li class="list-group-item">
+                                        <h5 class="card-title"><i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- user.name %> <small class="text-muted"><%- user.role %></small><span class="pull-right">原报</span></h5>
+                                        <div class="ml-3">
+                                            <span class="text-success"><small><%- auditors[0].begin_time.toLocaleDateString() %></small> <% if (tender.ledger_times > 1) { %>重新<% } %>上报</span>
+                                        </div>
+                                    </li>
+                                    <% for (let iA = 0; iA < auditors.length; iA++) { %>
+                                        <li class="list-group-item">
+                                            <% if (auditors[iA].status === auditConst.status.checked) { %>
+                                                <h5 class="card-title">
+                                                    <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down text-success' : 'fa fa-stop-circle text-success') %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small><span class="pull-right"><%= auditors[iA].sort === auditors[iA].max_sort ? '终' : ctx.helper.transFormToChinese(auditors[iA].sort) %>审</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <span class="text-success"><small><%- auditors[iA].end_time.toLocaleDateString() %></small> 审批通过</span>
+                                                    <p class="card-text"><%- auditors[iA].opinion %></p>
+                                                </div>
+                                            <% } else if (auditors[iA].stauts == auditConst.status.checking) { %>
+                                                <h5 class="card-title">
+                                                    <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down' : 'fa fa-stop-circle') %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small><span class="pull-right"><%= auditors[iA].sort === auditors[iA].max_sort ? '终' : ctx.helper.transFormToChinese(auditors[iA].sort) %>审</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <span>审批中</span>
+                                                    <p class="card-text"><%- auditors[iA].opinion %></p>
+                                                </div>
+                                            <% } else { %>
+                                                <h5 class="card-title">
+                                                    <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down' : 'fa fa-stop-circle') %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small><span class="pull-right"><%= auditors[iA].sort === auditors[iA].max_sort ? '终' : ctx.helper.transFormToChinese(auditors[iA].sort) %>审</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <p class="card-text"><%- auditors[iA].opinion %></p>
+                                                </div>
+                                            <% } %>
+                                            <% if (auditors[iA].status === auditConst.status.checked) { %>
+                                            <% } else if (auditors[iA].status === auditConst.status.checking) { %>
+                                                <div class="form-group">
+                                                    <label>审批意见<b class="text-danger">*</b></label>
+                                                    <textarea class="form-control form-control-sm" name="opinion">同意</textarea>
+                                                </div>
+                                            <% } %>
+                                        </li>
+                                    <% } %>
+                                </ul>
                             </div>
-                            <% } %>
-                        </li>
                         <% } %>
-                    </ul>
+                    </div>
                 </div>
             </div>
             <div class="modal-footer">
@@ -39,32 +141,134 @@
 </div>
 <!--审批退回-->
 <div class="modal fade" id="sp-back" data-backdrop="static">
-    <div class="modal-dialog" role="document">
-        <form class="modal-content" action="/tender/<%- tender.id %>/ledger/audit/check" method="post">
+    <div class="modal-dialog modal-lg" role="document">
+        <form class="modal-content" action="/tender/<%- tender.id %>/ledger/audit/check" method="post" onsubmit="return auditCheck();">
             <div class="modal-header">
                 <h5 class="modal-title">审批退回</h5>
             </div>
             <div class="modal-body">
-                <div class="card mt-3">
-                    <ul class="list-group list-group-flush">
-                        <% for (let i = 0, iLen = auditors.length; i < iLen; i++) { %>
-                        <li class="list-group-item" auditorId="<%- auditors[i].audit_id %>">
-                            <% if (auditors[i].status !== auditConst.status.uncheck) { %>
-                            <span class="<%- auditConst.statusClass[auditors[i].status] %> pull-right"><%- auditConst.statusString[auditors[i].status] %></span>
-                            <% } %>
-                            <h5 class="card-title"><%- auditors[i].audit_order %> <%- auditors[i].name %> <small class="text-muted"><%- auditors[i].role %></small></h5>
-                            <% if (auditors[i].status === auditConst.status.checked) { %>
-                            <p class="card-text"><%- auditors[i].opinion %> <%- auditors[i].end_time ? auditors[i].end_time.toLocaleString() : '' %></p>
-                            <% } else if (auditors[i].status === auditConst.status.checking) { %>
-                            <div class="form-group">
-                                <label>审批意见<b class="text-danger">*</b></label>
-                                <textarea class="form-control form-control-sm" name="opinion">不同意</textarea>
+                <div class="row">
+                    <div class="col-4">
+                        <div class="card mt-3">
+                            <ul class="list-group list-group-flush">
+                                <li class="list-group-item">
+                                    <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- user.name %>  <small class="text-muted"><%- user.role %></small><span class="pull-right">原报</span>
+                                </li>
+                                <% for (let i = 0; i < auditors.length; i++) { %>
+                                    <li class="list-group-item">
+                                        <% if (i < auditors.length - 1) { %>
+                                            <i class="fa fa-chevron-circle-down"></i> <%- auditors[i].name %>  <small class="text-muted"><%- auditors[i].role %></small><span class="pull-right"><%= ctx.helper.transFormToChinese(i+1)%>审</span>
+                                        <% } else {%>
+                                            <i class="fa fa fa-stop-circle"></i> <%- auditors[i].name %>  <small class="text-muted"><%- auditors[i].role %></small><span class="pull-right">终审</span>
+                                        <% } %>
+                                    </li>
+                                <% } %>
+                            </ul>
+                        </div>
+                    </div>
+                    <div class="col-8 modal-height-500" style="overflow: auto">
+                        <% for (const ah of auditHistory) { %>
+                            <div class="card mt-3">
+                                <ul class="list-group list-group-flush">
+                                    <% for (let iA = 0; iA < ah.length; iA++) { %>
+                                        <% if (iA === 0) { %>
+                                            <li class="list-group-item">
+                                                <h5 class="card-title">
+                                                    <i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- user.name %> <small class="text-muted"><%- user.role %></small><span class="pull-right">原报</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <span class="text-success"><small><%- ah[iA].begin_time.toLocaleDateString() %></small> <% if (auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
+                                                </div>
+                                            </li>
+                                            <li class="list-group-item">
+                                                <h5 class="card-title">
+                                                    <i class="fa <%if (iA === ah.length - 1) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small><span class="pull-right"><%= ah[iA].sort === ah[iA].max_sort ? '终' : ctx.helper.transFormToChinese(ah[iA].sort) %>审</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <% if (ah[iA].status !== auditConst.status.uncheck) { %>
+                                                        <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- user.name %><% } %></span>
+                                                    <% } %>
+                                                    <p class="card-text"><%- ah[iA].opinion %></p>
+                                                </div>
+                                            </li>
+                                        <% } else if (iA === ah.length - 1) { %>
+                                            <li class="list-group-item">
+                                                <h5 class="card-title">
+                                                    <i class="fa fa-stop-circle <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small><span class="pull-right">终审</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <% if (ah[iA].status !== auditConst.status.uncheck) { %>
+                                                        <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- user.name %><% } %></span>
+                                                    <% } %>
+                                                    <p class="card-text"><%- ah[iA].opinion %></p>
+                                                </div>
+                                            </li>
+                                        <% } else { %>
+                                            <li class="list-group-item">
+                                                <h5 class="card-title">
+                                                    <i class="fa fa-chevron-circle-down <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small><span class="pull-right"><%= ah[iA].sort === ah[iA].max_sort ? '终' : ctx.helper.transFormToChinese(ah[iA].sort) %>审</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <% if (ah[iA].status !== auditConst.status.uncheck) { %>
+                                                        <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- user.name %><% } %></span>
+                                                    <% } %>
+                                                    <p class="card-text"><%- ah[iA].opinion %></p>
+                                                </div>
+                                            </li>
+                                        <% } %>
+                                    <% } %>
+                                </ul>
+                            </div>
+                        <% } %>
+                        <% if (tender.ledger_status === auditConst.status.checking || tender.ledger_status === auditConst.status.checked) {%>
+                            <div class="card mt-3">
+                                <ul class="list-group list-group-flush">
+                                    <li class="list-group-item">
+                                        <h5 class="card-title"><i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- user.name %> <small class="text-muted"><%- user.role %></small><span class="pull-right">原报</span></h5>
+                                        <div class="ml-3">
+                                            <span class="text-success"><small><%- auditors[0].begin_time.toLocaleDateString() %></small> <% if (tender.ledger_times > 1) { %>重新<% } %>上报</span>
+                                        </div>
+                                    </li>
+                                    <% for (let iA = 0; iA < auditors.length; iA++) { %>
+                                        <li class="list-group-item">
+                                            <% if (auditors[iA].status === auditConst.status.checked) { %>
+                                                <h5 class="card-title">
+                                                    <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down text-success' : 'fa fa-stop-circle text-success') %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small><span class="pull-right"><%= auditors[iA].sort === auditors[iA].max_sort ? '终' : ctx.helper.transFormToChinese(auditors[iA].sort) %>审</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <span class="text-success"><small><%- auditors[iA].end_time.toLocaleDateString() %></small> 审批通过</span>
+                                                    <p class="card-text"><%- auditors[iA].opinion %></p>
+                                                </div>
+                                            <% } else if (auditors[iA].stauts == auditConst.status.checking) { %>
+                                                <h5 class="card-title">
+                                                    <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down' : 'fa fa-stop-circle') %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small><span class="pull-right"><%= auditors[iA].sort === auditors[iA].max_sort ? '终' : ctx.helper.transFormToChinese(auditors[iA].sort) %>审</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <span>审批中</span>
+                                                    <p class="card-text"><%- auditors[iA].opinion %></p>
+                                                </div>
+                                            <% } else { %>
+                                                <h5 class="card-title">
+                                                    <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down' : 'fa fa-stop-circle') %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small><span class="pull-right"><%= auditors[iA].sort === auditors[iA].max_sort ? '终' : ctx.helper.transFormToChinese(auditors[iA].sort) %>审</span>
+                                                </h5>
+                                                <div class="ml-3">
+                                                    <p class="card-text"><%- auditors[iA].opinion %></p>
+                                                </div>
+                                            <% } %>
+                                            <% if (auditors[iA].status === auditConst.status.checked) { %>
+                                            <% } else if (auditors[iA].status === auditConst.status.checking) { %>
+                                                <div class="form-group">
+                                                    <label>审批意见<b class="text-danger">*</b></label>
+                                                    <textarea class="form-control form-control-sm" name="opinion">不同意</textarea>
+                                                </div>
+                                                <div class="alert alert-warning">审批退回,将直接退回给上报人。</div>
+                                            <% } %>
+                                        </li>
+                                    <% } %>
+                                </ul>
                             </div>
-                            <div class="alert alert-warning">审批退回,将直接退回给上报人。</div>
-                            <% } %>
-                        </li>
                         <% } %>
-                    </ul>
+                    </div>
                 </div>
             </div>
             <div class="modal-footer">

+ 3 - 2
app/view/material/audit_modal.ejs

@@ -55,7 +55,7 @@
         <!--审批通过-->
         <div class="modal fade" id="sp-done" data-backdrop="static">
     <div class="modal-dialog modal-lg" role="document">
-        <form class="modal-content" action="<%- preUrl %>/audit/check" method="post">
+        <form class="modal-content" action="<%- preUrl %>/audit/check" method="post" onsubmit="return auditCheck();">
             <div class="modal-header">
                 <h5 class="modal-title">审批通过</h5>
             </div>
@@ -143,7 +143,7 @@
         <!--审批退回-->
         <div class="modal fade" id="sp-back" data-backdrop="static">
     <div class="modal-dialog modal-lg" role="document">
-        <form class="modal-content modal-lg" action="<%- preUrl %>/audit/check" method="post">
+        <form class="modal-content modal-lg" action="<%- preUrl %>/audit/check" method="post" onsubmit="return auditCheck();">
             <div class="modal-header">
                 <h5 class="modal-title">审批退回</h5>
             </div>
@@ -211,6 +211,7 @@
                                         <label>审批意见<b class="text-danger">*</b></label>
                                         <textarea class="form-control form-control-sm" name="opinion">不同意</textarea>
                                     </div>
+                                    <div class="alert alert-warning">审批退回,将直接退回给上报人。</div>
                                     <% } %>
                                 </li>
                                 <% } %>

+ 16 - 4
app/view/report/index.ejs

@@ -25,13 +25,14 @@
         <div class="c-header p-0"></div>
         <div class="c-body">
             <div class="row">
-                <div class="col-2">
+                <div class="col-auto pr-0" id="tree-view" style="width: 17%">
                     <div class="sjs-height-1">
                         <div class="text-center"></div>
                         <ul id="rptTplTree" class="ztree"></ul>
                     </div>
                 </div>
-                <div class="col-10">
+                <div class="col-auto" id="main-view" style="width: 83%">
+                    <div class="resize-x" id="right-spr" r-Type="width" div1="#tree-view" div2="#main-view" title="调整大小" a-type="percent"><!--调整左右高度条--></div>
                     <div class="toolsbar-f d-flex justify-content-between">
                         <div class="print-toolsbar">
                             <div class="panel">
@@ -144,6 +145,7 @@
 </div>
 
 <script src="/public/js/sub_menu.js"></script>
+<script src="/public/js/div_resizer.js"></script>
 <script>
     $.subMenu({
         menu: '#sub-menu', miniMenu: '#sub-mini-menu', miniMenuList: '#mini-menu-list',
@@ -161,6 +163,12 @@
             autoFlashHeight();
         }
     });
+    $.divResizer({
+        select: '#right-spr',
+        callback: function () {
+            autoFlashHeight();
+        }
+    });
 </script>
 
 <script type="text/javascript">  autoFlashHeight();</script>
@@ -343,14 +351,18 @@
         const parentDom = $(dom).parent().parent();
         const brotherDom = parentDom.prev();
         const nextDom = $(dom).children();
+        const left = $('#tree-view'), right = $('#main-view'), parent = left.parent();
         if (dom.title === '收起侧栏') {
             dom.title = '展开侧栏';
             brotherDom[0].style = 'display:none';
-            parentDom[0].className = 'col-12';
+            left.hide();
+            right.css('width', '100%');
             nextDom[0].className = 'fa fa-chevron-right';
         } else {
             dom.title = '收起侧栏';
-            parentDom[0].className = 'col-10';
+            left.show();
+            const percent = 100 - left.outerWidth() /parent.width() * 100;
+            right.css('width', percent + '%');
             brotherDom[0].style = 'display:';
             nextDom[0].className = 'fa fa-chevron-left';
         }

+ 4 - 4
app/view/stage/audit_modal.ejs

@@ -78,7 +78,7 @@
         <!--审批通过-->
         <div class="modal fade" id="sp-done" data-backdrop="static">
             <div class="modal-dialog modal-lg" role="document">
-                <form class="modal-content" action="<%- preUrl %>/audit/check" method="post">
+                <form class="modal-content" action="<%- preUrl %>/audit/check" method="post" onsubmit="return auditCheck();">
                     <div class="modal-header">
                         <h5 class="modal-title">审批通过</h5>
                     </div>
@@ -179,7 +179,7 @@
         <!--审批退回-->
         <div class="modal fade" id="sp-back" data-backdrop="static">
             <div class="modal-dialog modal-lg" role="document">
-                <form class="modal-content modal-lg" action="<%- preUrl %>/audit/check" method="post">
+                <form class="modal-content modal-lg" action="<%- preUrl %>/audit/check" method="post" onsubmit="return auditCheck();">
                     <div class="modal-header">
                         <h5 class="modal-title">审批退回</h5>
                     </div>
@@ -987,7 +987,7 @@
         <!--审批通过-->
         <div class="modal fade" id="sp-done" data-backdrop="static">
             <div class="modal-dialog modal-lg" role="document">
-                <form class="modal-content" action="<%- preUrl %>/audit/check" method="post">
+                <form class="modal-content" action="<%- preUrl %>/audit/check" method="post" onsubmit="return auditCheck();">
                     <div class="modal-header">
                         <h5 class="modal-title">审批通过</h5>
                     </div>
@@ -1088,7 +1088,7 @@
         <!--审批退回-->
         <div class="modal fade" id="sp-back" data-backdrop="static">
             <div class="modal-dialog modal-lg" role="document">
-                <form class="modal-content" action="<%- preUrl %>/audit/check" method="post">
+                <form class="modal-content" action="<%- preUrl %>/audit/check" method="post" onsubmit="return auditCheck();">
                     <div class="modal-header">
                         <h5 class="modal-title">审批退回</h5>
                     </div>

+ 7 - 5
app/view/stage/index.ejs

@@ -111,11 +111,13 @@
                         </div>
                         <div class="sjs-bottom">
                             <% if (!stage.readOnly) { %>
-                            <div class="d-flex justify-content-end mb-1">
-                                <a href="javascript: void(0);" class="btn btn-sm btn-outline-primary" id="edit-detail" style="display: none;">编辑</a>
-                                <a href="javascript: void(0);" class="btn btn-sm btn-outline-success" id="save-detail" style="display: none;">保存</a>
-                                <a href="javascript: void(0);" class="btn btn-sm btn-outline-secondary" id="cancel-detail" style="display: none;">取消</a>
-                            </div>
+                            <legend class="sticky-top bg-white">
+                                <div class="d-flex justify-content-end mb-1">
+                                    <a href="javascript: void(0);" class="btn btn-sm btn-outline-primary" id="edit-detail" style="display: none;">编辑</a>
+                                    <a href="javascript: void(0);" class="btn btn-sm btn-outline-success" id="save-detail" style="display: none;">保存</a>
+                                    <a href="javascript: void(0);" class="btn btn-sm btn-outline-secondary" id="cancel-detail" style="display: none;">取消</a>
+                                </div>
+                            </legend>
                             <% } %>
                             <table class="table table-sm table-bordered" id="detail-show">
                                 <tbody>

+ 2 - 2
app/view/tender/detail.ejs

@@ -77,7 +77,7 @@
                 <div class="mb-3">
                     <div class="progress">
                         <% if (tender.pre_ratio > 0) { %>
-                        <div class="progress-bar bg-success" style="width: <%- tender.pre_ratio %>%;" data-placement="bottom" data-toggle="tooltip" data-original-title="截止上期累计完成:¥<%- ctx.helper.formatMoney(tender.end_gather_tp) %>"><%- tender.pre_ratio %>%</div>
+                        <div class="progress-bar bg-success" style="width: <%- tender.pre_ratio %>%;" data-placement="bottom" data-toggle="tooltip" data-original-title="截止上期累计完成:¥<%- ctx.helper.formatMoney(tender.pre_gather_tp) %>"><%- tender.pre_ratio %>%</div>
                         <% } %>
                         <% if (tender.cur_ratio > 0) { %>
                         <div class="progress-bar bg-info" style="width: <%- tender.cur_ratio %>%;" data-placement="bottom" data-toggle="tooltip" data-original-title="本期完成:¥<%- ctx.helper.formatMoney(tender.gather_tp) %>"><%- tender.cur_ratio %>%</div>
@@ -507,7 +507,7 @@
                                                     <div class="col">
                                                         <div class="form-group form-check">
                                                             <input type="checkbox" class="form-check-input" id="ledger-dgn-qty" checked="">
-                                                            <label class="form-check-label" for="ledger-dgn-qty">设计数量</label>
+                                                            <label class="form-check-label" for="ledger-dgn-qty">项目节数量</label>
                                                         </div>
                                                         <div class="form-group form-check">
                                                             <input type="checkbox" class="form-check-input" id="ledger-cl-qty" checked="">