Jelajahi Sumber

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

MaiXinRong 5 tahun lalu
induk
melakukan
d98f1981ee

+ 27 - 0
app/controller/change_controller.js

@@ -411,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;

+ 5 - 0
app/controller/report_controller.js

@@ -280,6 +280,8 @@ async function getReportData(ctx, params, filters) {
     const rst = {};
     const runnableRst = [];
     const runnableKey = []; // 这个配合runnableRst用,未来考虑并行查询优化
+    // console.log('params');
+    // console.log(params);
     for (const filter of filters) {
         switch (filter) {
             case 'project' :
@@ -326,7 +328,10 @@ async function getReportData(ctx, params, filters) {
                 break;
         }
     }
+    // console.log('before query, runnableKey');
+    // console.log(runnableKey);
     const queryRst = await Promise.all(runnableRst);
+    // console.log('after query');
     for (let idx = 0; idx < runnableKey.length; idx++) {
         rst[runnableKey[idx]] = queryRst[idx];
         // console.log(runnableKey[idx]);

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

@@ -74,8 +74,7 @@ $(document).ready(() => {
 
             if(returnflag) {
                 $('input[name="w_code"]').val($('#w_code').val());
-                sdesc.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' ');
-                $('#success-approval').find('textarea').val(sdesc);
+                $('#success-approval').find('textarea').val(sdesc.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' '));
                 $('#success-approval').submit();
             }
         } else {
@@ -90,8 +89,7 @@ $(document).ready(() => {
                 returnflag = false;
             }
             if(returnflag) {
-                sdesc.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' ');
-                $('#fail-approval').find('textarea').val(sdesc);
+                $('#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并删除之前的操作

+ 10 - 6
app/public/report/js/jpc_output.js

@@ -440,14 +440,18 @@ let JpcCanvasOutput = {
                 private_drawCell(cell, fonts, styles, controls, newPageMergeBand);
             }
             //电子签名
-            for (let k = 0; k < page.signature_cells.length; k++) {
-                let cell = page.signature_cells[k];
-                private_drawSignatureCell(cell, fonts, styles, controls, newPageMergeBand);
+            if (page.signature_cells && page.signature_cells.length > 0) {
+                for (let k = 0; k < page.signature_cells.length; k++) {
+                    let cell = page.signature_cells[k];
+                    private_drawSignatureCell(cell, fonts, styles, controls, newPageMergeBand);
+                }
             }
             //电子签名日期(跟普通格子输出一样)
-            for (let k = 0; k < page.signature_date_cells.length; k++) {
-                let cell = page.signature_date_cells[k];
-                private_drawCell(cell, fonts, styles, controls, newPageMergeBand);
+            if (page.signature_date_cells && page.signature_date_cells.length > 0) {
+                for (let k = 0; k < page.signature_date_cells.length; k++) {
+                    let cell = page.signature_date_cells[k];
+                    private_drawCell(cell, fonts, styles, controls, newPageMergeBand);
+                }
             }
         }
     },

+ 58 - 45
app/reports/rpt_component/jpc_bill_tab.js

@@ -1,28 +1,33 @@
-let JV = require('./jpc_value_define');
-let JE = require('./jpc_rte');
-let JpcFieldHelper = require('./helper/jpc_helper_field');
-let JpcBandHelper = require('./helper/jpc_helper_band');
-let JpcCommonHelper = require('./helper/jpc_helper_common');
-let JpcDiscreteHelper = require('./helper/jpc_helper_discrete');
-let JpcTextHelper = require('./helper/jpc_helper_text');
-let JpcCommonOutputHelper = require('./helper/jpc_helper_common_output');
-let JpcAreaHelper = require('./helper/jpc_helper_area');
+'use strict';
 
-let JpcBillTabSrv = function(){};
-JpcBillTabSrv.prototype.createNew = function(){
-    let JpcBillTabResult = {};
+const JV = require('./jpc_value_define');
+const JE = require('./jpc_rte');
+const JpcFieldHelper = require('./helper/jpc_helper_field');
+const JpcBandHelper = require('./helper/jpc_helper_band');
+const JpcCommonHelper = require('./helper/jpc_helper_common');
+const JpcDiscreteHelper = require('./helper/jpc_helper_discrete');
+const JpcTextHelper = require('./helper/jpc_helper_text');
+const JpcCommonOutputHelper = require('./helper/jpc_helper_common_output');
+const JpcAreaHelper = require('./helper/jpc_helper_area');
+
+const JpcBillTabSrv = function() {};
+JpcBillTabSrv.prototype.createNew = function() {
+    const JpcBillTabResult = {};
     JpcBillTabResult.initialize = function() {
-        let me = this;
+        const me = this;
         me.disp_fields_idx = [];
+
+        me.signatureRst = [];
+        me.signatureDateRst = [];
     };
     JpcBillTabResult.sorting = function(rptTpl) {
-        let me = this;
+        const me = this;
         JpcFieldHelper.findAndPutDataFieldIdx(rptTpl, rptTpl[JV.NODE_BILL_INFO][JV.NODE_BILL_CONTENT][JV.PROP_BILL_FIELDS], null, me.disp_fields_idx);
     };
     JpcBillTabResult.paging = function(rptTpl, dataObj) {
         let rst = 0;
         function getDataLength(fields_str) {
-            let dataFields = dataObj[fields_str];
+            const dataFields = dataObj[fields_str];
             if (dataFields && dataFields.length > 0) {
                 rst = dataFields[0].length;
             }
@@ -40,26 +45,30 @@ JpcBillTabSrv.prototype.createNew = function(){
         }
         return rst;
     };
-    JpcBillTabResult.outputAsPreviewPage = function (rptTpl, bands, controls, $CURRENT_RPT) {
-        let me = this, rst = [], vIdx = [];
-        //只预览第一页的数据
-        let pageStatus = [true, true, false, true, false, false, false, false];
+    JpcBillTabResult.outputAsPreviewPage = function(rptTpl, bands, controls, $CURRENT_RPT) {
+        const me = this;
+        let rst = [];
+        // const vIdx = [];
+        // 只预览第一页的数据
+        const pageStatus = [true, true, false, true, false, false, false, false];
         JpcBandHelper.setBandArea(bands, rptTpl, pageStatus, true, false);
-        let unitFactor = JpcCommonHelper.getUnitFactor(rptTpl);
+        const unitFactor = JpcCommonHelper.getUnitFactor(rptTpl);
         rst = rst.concat(me.outputPreviewContent(rptTpl, bands, unitFactor, controls, pageStatus));
         rst = rst.concat(JpcDiscreteHelper.outputPreviewDiscreteInfo(rptTpl[JV.NODE_BILL_INFO][JV.NODE_DISCRETE_INFO], bands, unitFactor, pageStatus));
         return rst;
     };
-    JpcBillTabResult.outputAsSimpleJSONPage = function (rptTpl, dataObj, page, bands, controls, $CURRENT_RPT, customizeCfg) {
-        let me = this, rst = [], tabRstLst = [];
-        //1 calculate the band position
-        let pageStatus = [true, false, false, false, false, false, false, false];
+    JpcBillTabResult.outputAsSimpleJSONPage = function(rptTpl, dataObj, page, bands, controls, $CURRENT_RPT, customizeCfg) {
+        const me = this;
+        let rst = [];
+        const tabRstLst = [];
+        // 1. calculate the band position
+        const pageStatus = [true, false, false, false, false, false, false, false];
         JpcBandHelper.setBandArea(bands, rptTpl, pageStatus);
-        //2. start to output detail-part
-        let unitFactor = JpcCommonHelper.getUnitFactor(rptTpl);
-        //2.1 output content
+        // 2. start to output detail-part
+        const unitFactor = JpcCommonHelper.getUnitFactor(rptTpl);
+        //  2.1 output content
         tabRstLst.push(me.outputContent(rptTpl, dataObj, page, bands, unitFactor, controls, pageStatus, $CURRENT_RPT, customizeCfg));
-        //2.2 output discrete
+        //  2.2 output discrete
         tabRstLst.push(JpcDiscreteHelper.outputDiscreteInfo(rptTpl[JV.NODE_BILL_INFO][JV.NODE_DISCRETE_INFO], bands, dataObj, unitFactor, pageStatus, page - 1, 1, 0, $CURRENT_RPT, customizeCfg));
         for (let i = 0; i < tabRstLst.length; i++) {
             rst = rst.concat(tabRstLst[i]);
@@ -69,15 +78,15 @@ JpcBillTabSrv.prototype.createNew = function(){
     };
     JpcBillTabResult.outputPreviewContent = function(rptTpl, bands, unitFactor, controls, pageStatus) {
         let rst = [];
-        let tab = rptTpl[JV.NODE_BILL_INFO][JV.NODE_BILL_CONTENT];
-        let band = bands[tab[JV.PROP_BAND_NAME]];
+        const tab = rptTpl[JV.NODE_BILL_INFO][JV.NODE_BILL_CONTENT];
+        const band = bands[tab[JV.PROP_BAND_NAME]];
         if (band) {
             if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]]) {
-                let tab_fields = tab[JV.PROP_BILL_FIELDS];
+                const tab_fields = tab[JV.PROP_BILL_FIELDS];
                 for (let i = 0; i < tab_fields.length; i++) {
-                    let tab_field = tab_fields[i];
+                    const tab_field = tab_fields[i];
                     if (!(tab_field[JV.PROP_HIDDEN])) {
-                        let cellItem = JpcCommonOutputHelper.createCommonOutput(tab_field, "", controls);
+                        const cellItem = JpcCommonOutputHelper.createCommonOutput(tab_field, '', controls);
                         cellItem[JV.PROP_AREA] = JpcAreaHelper.outputArea(tab_field[JV.PROP_AREA], band, unitFactor, 1, 0, 1, 0, 1, 0, false, false);
                         rst.push(cellItem);
                     }
@@ -98,22 +107,26 @@ JpcBillTabSrv.prototype.createNew = function(){
         return rst;
     };
     JpcBillTabResult.outputContent = function(rptTpl, dataObj, page, bands, unitFactor, controls, pageStatus, $CURRENT_RPT, customizeCfg) {
-        let me = this, rst = [];
-        let tab = rptTpl[JV.NODE_BILL_INFO][JV.NODE_BILL_CONTENT];
-        let band = bands[tab[JV.PROP_BAND_NAME]];
+        const me = this;
+        let rst = [];
+        const tab = rptTpl[JV.NODE_BILL_INFO][JV.NODE_BILL_CONTENT];
+        const band = bands[tab[JV.PROP_BAND_NAME]];
         if (band) {
             if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]]) {
-                let tab_fields = tab[JV.PROP_BILL_FIELDS];
+                const tab_fields = tab[JV.PROP_BILL_FIELDS];
                 let data_details = null;
                 if (rptTpl[JV.NODE_FIELD_MAP][JV.NODE_DETAIL_FIELDS]) {
                     data_details = dataObj[JV.DATA_DETAIL_DATA];
                 } else if (rptTpl[JV.NODE_FIELD_MAP][JV.NODE_MASTER_FIELDS]) {
                     data_details = dataObj[JV.DATA_MASTER_DATA];
                 }
-                let flexiblePrecisionRefObj = null, flexibleRefField = null, precision_ref_data = null;
+                let flexiblePrecisionRefObj = null;
+                let flexibleRefField;
+                let precision_ref_data;
                 for (let i = 0; i < tab_fields.length; i++) {
-                    let tab_field = tab_fields[i];
-                    let data_field = null, map_data_field = JE.F(tab_field[JV.PROP_FIELD_ID], $CURRENT_RPT);
+                    const tab_field = tab_fields[i];
+                    let data_field = null;
+                    const map_data_field = JE.F(tab_field[JV.PROP_FIELD_ID], $CURRENT_RPT);
                     if (me.disp_fields_idx.length > i && me.disp_fields_idx[i] !== JV.BLANK_FIELD_INDEX && (typeof me.disp_fields_idx[i] !== 'object')) {
                         data_field = data_details[me.disp_fields_idx[i]];
                     } else {
@@ -126,8 +139,8 @@ JpcBillTabSrv.prototype.createNew = function(){
                             flexiblePrecisionRefObj = {};
                             flexibleRefField = JE.F(map_data_field[JV.PROP_PRECISION][JV.PROP_FLEXIBLE_REF_FILED_ID], $CURRENT_RPT);
                             precision_ref_data = dataObj[map_data_field.DataNodeName][flexibleRefField.DataSeq];
-                            for (let decimalObj of map_data_field.flexiblePrecisionRefObj) {
-                                flexiblePrecisionRefObj["refUnit_" + decimalObj.unit] = decimalObj.decimal;
+                            for (const decimalObj of map_data_field.flexiblePrecisionRefObj) {
+                                flexiblePrecisionRefObj['refUnit_' + decimalObj.unit] = decimalObj.decimal;
                             }
                         }
                         JpcFieldHelper.resetFlexibleFormat(tab_field, precision_ref_data, flexiblePrecisionRefObj, page - 1, customizeCfg);
@@ -135,8 +148,8 @@ JpcBillTabSrv.prototype.createNew = function(){
                         if (page === 1) JpcFieldHelper.resetFormat(tab_field, map_data_field, customizeCfg);
                     }
                     if (!(tab_field[JV.PROP_HIDDEN])) {
-                        let val = JpcFieldHelper.getValue(data_field, page - 1);
-                        let cellItem = JpcCommonOutputHelper.createCommonOutput(tab_field, val, controls);
+                        const val = JpcFieldHelper.getValue(data_field, page - 1);
+                        const cellItem = JpcCommonOutputHelper.createCommonOutput(tab_field, val, controls);
                         cellItem[JV.PROP_AREA] = JpcAreaHelper.outputArea(tab_field[JV.PROP_AREA], band, unitFactor, 1, 0, 1, 0, 1, 0, false, false);
                         rst.push(cellItem);
                     }
@@ -159,4 +172,4 @@ JpcBillTabSrv.prototype.createNew = function(){
     return JpcBillTabResult;
 };
 
-module.exports = new JpcBillTabSrv();
+module.exports = new JpcBillTabSrv();

+ 2 - 0
app/reports/rpt_component/jpc_cross_tab.js

@@ -206,6 +206,8 @@ JpcCrossTabSrv.prototype.createNew = function(){
         me.crsOrient = JV.PAGE_ORIENTATION_V_FIRST;
         me.pageStatusLst = [];
         me.paging_option = JV.PAGING_OPTION_NORMAL;
+        me.signatureRst = [];
+        me.signatureDateRst = [];
     };
     JpcCrossTabResult.sorting = function(rptTpl, dataObj, dataSeq, $CURRENT_RPT) {
         let me = this;

+ 4 - 0
app/reports/rpt_component/jpc_ex.js

@@ -380,8 +380,12 @@ JpcExSrv.prototype.createNew = function() {
                 }
             } else if (me.crossTab) {
                 rst[JV.PROP_CELLS] = me.crossTab.outputAsSimpleJSONPage(rptTpl, dataObj, page, bands, controls, me, customizeCfg);
+                rst[JV.PROP_SIGNATURE_CELLS] = me.crossTab.signatureRst;
+                rst[JV.PROP_SIGNATURE_DATE_CELLS] = me.crossTab.signatureDateRst;
             } else if (me.billTab) {
                 rst[JV.PROP_CELLS] = me.billTab.outputAsSimpleJSONPage(rptTpl, dataObj, page, bands, controls, me, customizeCfg);
+                rst[JV.PROP_SIGNATURE_CELLS] = me.billTab.signatureRst;
+                rst[JV.PROP_SIGNATURE_DATE_CELLS] = me.billTab.signatureDateRst;
             }
             if (!(me.flowTab && me.flowTab.paging_option === JV.PAGING_OPTION_INFINITY)) {
                 const pageMergeBorder = getPageMergeBorder();

+ 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;

+ 9 - 1
app/service/report_memory.js

@@ -87,7 +87,11 @@ module.exports = app => {
         async _generateStageIm(tid, sid, isTz = true) {
             await this._checkTender(tid);
             await this._checkStage(sid);
+            // console.log('this.ctx.stage.im_type: ' + this.ctx.stage.im_type);
+            // console.log('imType.tz.value: ' + imType.tz.value);
+            // console.log('isTz: ' + isTz);
             if (isTz && this.ctx.stage.im_type !== imType.tz.value) {
+                // console.log('您查看的报表跟设置不符,请查看“总量控制”的报表');
                 throw '您查看的报表跟设置不符,请查看“总量控制”的报表';
             } else if (!isTz && this.ctx.stage.im_type === imType.tz.value) {
                 throw '您查看的报表跟设置不符,请查看“0号台账”的报表';
@@ -106,6 +110,7 @@ module.exports = app => {
                 try {
                     await this._generateStageIm(tid, sid);
                 } catch(err) {
+                    // console.log('getStageImTzData exception');
                     if (err.statck) {
                         this.ctx.logger.error(error);
                     }
@@ -121,7 +126,9 @@ module.exports = app => {
                 this.stageImData = {};
                 try {
                     await this._generateStageIm(tid, sid);
-                } catch(err) {
+                } catch (err) {
+                    // console.log(err);
+                    // console.log('getStageImTzBillsData exception');
                     if (err.statck) {
                         this.ctx.logger.error(error);
                     }
@@ -137,6 +144,7 @@ module.exports = app => {
             try {
                 await this._generateStageIm(tid, sid, false);
             } catch(err) {
+                // console.log('getStageImZlData exception');
                 if (err.statck) {
                     this.ctx.logger.error(error);
                 }

+ 299 - 123
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,6 +275,8 @@
                                                         <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>
@@ -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>
@@ -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>
 <% } %>