Browse Source

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

MaiXinRong 5 years ago
parent
commit
b4de04a326

+ 29 - 0
app/controller/setting_controller.js

@@ -132,6 +132,35 @@ module.exports = app => {
         }
 
         /**
+         * 项目设置 -- 账号解绑设置(Post)
+         * @param ctx
+         * @return {Promise<void>}
+         */
+        async userUnbind(ctx) {
+            const projectData = ctx.session.sessionProjectData;
+
+            try {
+                if (projectData.id === undefined) {
+                    throw '不存在对应的项目数据';
+                }
+                if (ctx.session.sessionUser.is_admin === 0) {
+                    throw '非管理员无权解绑账号';
+                }
+                const accountId = parseInt(ctx.request.body.id);
+                const result = await ctx.service.projectAccount.update({ bind: 0 }, { id: accountId });
+                if (!result) {
+                    throw '解绑失败';
+                }
+
+                this.setMessage('解绑成功', this.messageType.SUCCESS);
+            } catch (error) {
+                console.log(error);
+                this.setMessage(error.toString(), this.messageType.ERROR);
+            }
+            ctx.redirect(ctx.request.header.referer);
+        }
+
+        /**
          * 项目权限 -- 账号设置(Get)
          * @param ctx
          * @return {Promise<void>}

+ 13 - 2
app/controller/tender_controller.js

@@ -363,12 +363,23 @@ module.exports = app => {
                 if (!data) {
                     throw '提交数据错误';
                 }
+                // 针对查阅所有标段者但非原报和审批人提示
+                const times = ctx.tender.data.ledger_status === auditConst.ledger.status.checkNo ? ctx.tender.data.ledger_times - 1 : ctx.tender.data.ledger_times;
+                const auditors = await this.service.ledgerAudit.getAuditors(ctx.tender.id, times);
+                const auditorsId = ctx.helper._.map(auditors, 'audit_id');
+                const stageAuditors = await this.service.stageAudit.getAllAuditors(ctx.tender.id);
+                const stageAUditorsId = ctx.helper._.map(stageAuditors, 'aid');
+                const accountId = ctx.session.sessionUser.accountId;
+                if (auditorsId.indexOf(accountId) === -1 && ctx.tender.data.user_id !== accountId &&
+                    stageAUditorsId.indexOf(accountId) === -1) {
+                    throw '您无权修改标段设置内容';
+                }
+
                 if (ctx.tender.data.ledger_status === auditConst.ledger.status.checked) {
                     if (data.deal_param) {
                         const lastStage = await this.ctx.service.stage.getLastestStage(ctx.tender.id, true);
                         if (lastStage) {
-                            if (lastStage.order > 1 || (lastStage.status === auditConst.stage.status.checked || lastStage.status === auditConst.stage.status.checking))
-                                throw '第一期上报后不可修改合同参数';
+                            if (lastStage.order > 1 || (lastStage.status === auditConst.stage.status.checked || lastStage.status === auditConst.stage.status.checking)) throw '第一期上报后不可修改合同参数';
                             if (lastStage.user_id !== ctx.session.sessionUser.accountId) throw '仅原报可修改合同参数';
                         }
                     }

+ 9 - 0
app/public/js/setting.js

@@ -150,6 +150,15 @@ $(document).ready(() => {
                 $('#edit-user2 input[name="cooperation"]').attr('disabled', true);
             }
         }
+    });
+
+    // 解绑第三方平台
+    $('.unlink-user').on('click', function () {
+        const id = $(this).data('account');
+        const accountData = _.find(accountList, { id });
+        console.log(accountData);
+        $('#bind_account').text(accountData.name + ' ' + accountData.mobile);
+        $('#account_id').val(id);
     })
 });
 

+ 15 - 1
app/reports/rpt_component/helper/jpc_helper_discrete.js

@@ -8,7 +8,7 @@ const JpcAreaHelper = require('./jpc_helper_area');
 const JpcFieldHelper = require('./jpc_helper_field');
 
 const JpcDiscreteHelper = {
-    outputDiscreteInfo: function(discreteArray, bands, dataObj, unitFactor, pageStatus, segIdx, multiCols, multiColIdx, $CURRENT_RPT, customizeCfg, signatureRst, signatureDateRst) {
+    outputDiscreteInfo: function(discreteArray, bands, dataObj, unitFactor, pageStatus, segIdx, multiCols, multiColIdx, $CURRENT_RPT, customizeCfg, signatureRst, signatureDateRst, signatureAuditRst) {
         const rst = [];
         if (discreteArray && dataObj) {
             for (let i = 0; i < discreteArray.length; i++) {
@@ -57,6 +57,20 @@ const JpcDiscreteHelper = {
                                     signatureDateItem[JV.PROP_AREA] = JpcAreaHelper.outputArea(df[JV.PROP_AREA], band, unitFactor, 1, 0, 1, 0, 1, 0, false, false);
                                     signatureDateRst.push(signatureDateItem);
                                 }
+                            } else if (JE.isSignatureAudit(df[JV.PROP_PARAM_ID], $CURRENT_RPT)) {
+                                if (Array.isArray(signatureAuditRst)) {
+                                    let pID = 0;
+                                    if (df.hasOwnProperty(JV.PROP_PARAM_ID)) {
+                                        pID = df[JV.PROP_PARAM_ID];
+                                    } else {
+                                        pID = df[JV.PROP_ID];
+                                    }
+                                    const param = JE.P(pID, $CURRENT_RPT);
+                                    const signatureAuditItem = JpcCommonOutputHelper.createCommonOutputWithoutDecorate(df, df[JV.PROP_DFT_VALUE], true);
+                                    signatureAuditItem.signature_name = param[JV.PROP_NAME];
+                                    signatureAuditItem[JV.PROP_AREA] = JpcAreaHelper.outputArea(df[JV.PROP_AREA], band, unitFactor, 1, 0, 1, 0, 1, 0, false, false);
+                                    signatureAuditRst.push(signatureAuditItem);
+                                }
                             } else {
                                 let value = '';
                                 let isPic = false;

+ 4 - 2
app/reports/rpt_component/jpc_bill_tab.js

@@ -19,6 +19,7 @@ JpcBillTabSrv.prototype.createNew = function() {
 
         me.signatureRst = [];
         me.signatureDateRst = [];
+        me.signatureAuditRst = [];
     };
     JpcBillTabResult.sorting = function(rptTpl) {
         const me = this;
@@ -62,6 +63,7 @@ JpcBillTabSrv.prototype.createNew = function() {
         let rst = [];
         me.signatureRst = [];
         me.signatureDateRst = [];
+        me.signatureAuditRst = [];
         const tabRstLst = [];
         // 1. calculate the band position
         const pageStatus = [true, false, false, false, false, false, false, false];
@@ -71,7 +73,7 @@ JpcBillTabSrv.prototype.createNew = function() {
         //  2.1 output content
         tabRstLst.push(me.outputContent(rptTpl, dataObj, page, bands, unitFactor, controls, pageStatus, $CURRENT_RPT, customizeCfg));
         //  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, me.signatureRst, me.signatureDateRst));
+        tabRstLst.push(JpcDiscreteHelper.outputDiscreteInfo(rptTpl[JV.NODE_BILL_INFO][JV.NODE_DISCRETE_INFO], bands, dataObj, unitFactor, pageStatus, page - 1, 1, 0, $CURRENT_RPT, customizeCfg, me.signatureRst, me.signatureDateRst, me.signatureAuditRst));
         for (let i = 0; i < tabRstLst.length; i++) {
             rst = rst.concat(tabRstLst[i]);
             tabRstLst[i] = null;
@@ -181,7 +183,7 @@ JpcBillTabSrv.prototype.createNew = function() {
                     }
                 }
                 if (tab[JV.NODE_DISCRETE_INFO]) {
-                    rst = rst.concat(JpcDiscreteHelper.outputDiscreteInfo(tab[JV.NODE_DISCRETE_INFO], bands, dataObj, unitFactor, pageStatus, page - 1, 1, 0, customizeCfg, me.signatureRst, me.signatureDateRst));
+                    rst = rst.concat(JpcDiscreteHelper.outputDiscreteInfo(tab[JV.NODE_DISCRETE_INFO], bands, dataObj, unitFactor, pageStatus, page - 1, 1, 0, customizeCfg, me.signatureRst, me.signatureDateRst, me.signatureAuditRst));
                 }
             }
         }

+ 223 - 191
app/reports/rpt_component/jpc_cross_tab.js

@@ -1,26 +1,29 @@
-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 JpcBand = require('./jpc_band');
-let JpcCrossTabHelper = require('./helper/jpc_helper_cross_tab');
-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 JpcCrossTabSrv = function(){};
-JpcCrossTabSrv.prototype.createNew = function(){
+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 JpcBand = require('./jpc_band');
+const JpcCrossTabHelper = require('./helper/jpc_helper_cross_tab');
+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 JpcCrossTabSrv = function() {};
+
+JpcCrossTabSrv.prototype.createNew = function() {
     function private_addTabValue(tabValuedIdxLst, sortedSequence, segIdx, preRec, nextRec, dispSerialIdxLst, sorted_sum_value_Lst, rst_sum_value_Lst) {
         if (tabValuedIdxLst) {
             let serial1stTier = null;
             if (dispSerialIdxLst) serial1stTier = [];
-            let pgseg1stTier = [];
-            let sumVal = [];
+            const pgseg1stTier = [];
+            const sumVal = [];
             let sumValL = 1;
             if (sortedSequence) {
-                let arrDupVals = sortedSequence[segIdx];
+                const arrDupVals = sortedSequence[segIdx];
                 let arrDupSumVals = null;
                 if (sorted_sum_value_Lst !== null) {
                     arrDupSumVals = sorted_sum_value_Lst[segIdx];
@@ -39,7 +42,7 @@ JpcCrossTabSrv.prototype.createNew = function(){
                         }
                         continue;
                     }
-                    let duplicateValueArr = arrDupVals[preRec + i];
+                    const duplicateValueArr = arrDupVals[preRec + i];
                     pgseg1stTier[i] = duplicateValueArr[0];
                     if (arrDupSumVals !== null) sumVal[i] = arrDupSumVals[preRec + i];
 
@@ -55,7 +58,7 @@ JpcCrossTabSrv.prototype.createNew = function(){
                     rst_sum_value_Lst.push(sumVal);
                 }
             } else {
-                //should push blank value index rather than null
+                // should push blank value index rather than null
                 for (let i = 0; i < nextRec; i++) {
                     pgseg1stTier[i] = JV.BLANK_VALUE_INDEX;
                     sumVal[i] = null;
@@ -75,10 +78,10 @@ JpcCrossTabSrv.prototype.createNew = function(){
     }
     function private_addContentValue(dispValueIdxLst_Content, sortedContentSequence, segIdx, counterRowRec, maxRowRec, counterColRec, maxColRec, page_seg_map, pageIdx) {
         if (dispValueIdxLst_Content !== null) {
-            page_seg_map.push([pageIdx,segIdx]);
-            let arrContents = [];
+            page_seg_map.push([pageIdx, segIdx]);
+            const arrContents = [];
             if (sortedContentSequence !== null) {
-                let arrAllContent = sortedContentSequence[segIdx];
+                const arrAllContent = sortedContentSequence[segIdx];
                 for (let i = 0; i < maxRowRec; i++) {
                     arrContents.push([]);
                     for (let j = 0; j < maxColRec; j++) {
@@ -91,7 +94,7 @@ JpcCrossTabSrv.prototype.createNew = function(){
                 }
                 dispValueIdxLst_Content.push(arrContents);
             } else {
-                //should push blank value index rather than null
+                // should push blank value index rather than null
                 for (let i = 0; i < maxRowRec; i++) {
                     arrContents.push([]);
                     for (let j = 0; j < maxColRec; j++) {
@@ -103,20 +106,20 @@ JpcCrossTabSrv.prototype.createNew = function(){
         }
     }
     function private_SortAndOptimize(rptTpl, dataObj, dataSeq, sortTab, rstFieldsIdx, $CURRENT_RPT) {
-        let result = [];
-        let tab = rptTpl[JV.NODE_CROSS_INFO][sortTab];
+        const result = [];
+        const tab = rptTpl[JV.NODE_CROSS_INFO][sortTab];
         if (tab) {
             let sIDX = 0;
-            //1. prepare and sort by tab-field
-            let fields = [];
+            // 1. prepare and sort by tab-field
+            const fields = [];
             JpcFieldHelper.findAndPutDataFieldIdx(rptTpl, tab[JV.PROP_CROSS_FIELDS], fields, rstFieldsIdx);
-            let data_details = dataObj[JV.DATA_DETAIL_DATA];
+            const data_details = dataObj[JV.DATA_DETAIL_DATA];
             JpcCrossTabHelper.sortTabFields(fields, rstFieldsIdx, data_details, dataSeq, $CURRENT_RPT);
-            //2. distinguish sort tab fields value
+            // 2. distinguish sort tab fields value
             let b1 = false;
             for (let i = 0; i < dataSeq.length; i++) {
                 sIDX = 0;
-                let segArr = [];
+                const segArr = [];
                 if (dataSeq[i].length === 1) {
                     JpcCrossTabHelper.pushToSeg(segArr, dataSeq, i, 0, 1);
                 } else {
@@ -124,9 +127,9 @@ JpcCrossTabSrv.prototype.createNew = function(){
                         b1 = false;
                         for (let k = 0; k < rstFieldsIdx.length; k++) {
                             if (fields[k].hasOwnProperty(JV.TAB_FIELD_PROP_SORT)) {
-                                //只有被选择了作为排序字段的才进入排序及优化
-                                if (typeof(rstFieldsIdx[k]) === 'object') {
-                                    let map_data_field = JE.F(rstFieldsIdx[k][JV.PROP_ID], $CURRENT_RPT);
+                                // 只有被选择了作为排序字段的才进入排序及优化
+                                if (typeof rstFieldsIdx[k] === 'object') {
+                                    const map_data_field = JE.F(rstFieldsIdx[k][JV.PROP_ID], $CURRENT_RPT);
                                     if (map_data_field[JV.PROP_AD_HOC_DATA][dataSeq[i][j - 1]] !== map_data_field[JV.PROP_AD_HOC_DATA][dataSeq[i][j]]) {
                                         b1 = true;
                                         break;
@@ -155,27 +158,28 @@ JpcCrossTabSrv.prototype.createNew = function(){
         }
         return result;
     }
-    function private_SortForDisplayContent(rptTpl, rowSeq, colSeq, rstFieldsIdx){
-        let result = [];
-        let tab = rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_CONTENT];
+    function private_SortForDisplayContent(rptTpl, rowSeq, colSeq, rstFieldsIdx) {
+        const result = [];
+        const tab = rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_CONTENT];
         if (tab) {
             JpcFieldHelper.findAndPutDataFieldIdx(rptTpl, tab[JV.PROP_CROSS_FIELDS], null, rstFieldsIdx);
         }
         for (let i = 0; i < rowSeq.length; i++) {
-            let rl = rowSeq[i], cl = colSeq[i];
-            let ds = [];
-            //1. initialize to blank value index
+            const rl = rowSeq[i];
+            const cl = colSeq[i];
+            const ds = [];
+            // 1. initialize to blank value index
             for (let j = 0; j < rl.length; j++) {
                 ds.push([]);
                 for (let k = 0; k < cl.length; k++) {
                     ds[j].push(JV.BLANK_VALUE_INDEX);
                 }
             }
-            //2. then fill up the right index
+            // 2. then fill up the right index
             for (let j = 0; j < rl.length; j++) {
-                let ra = rl[j];
+                const ra = rl[j];
                 for (let k = 0; k < ra.length; k++) {
-                    let colIdx = JpcCrossTabHelper.getColIDX(cl, ra[k]);
+                    const colIdx = JpcCrossTabHelper.getColIDX(cl, ra[k]);
                     if (colIdx >= 0) {
                         ds[j][colIdx] = ra[k];
                     }
@@ -186,9 +190,9 @@ JpcCrossTabSrv.prototype.createNew = function(){
         return result;
     }
 
-    let JpcCrossTabResult = {};
+    const JpcCrossTabResult = {};
     JpcCrossTabResult.initialize = function() {
-        let me = this;
+        const me = this;
         me.dispValueIdxLst_Row = [];
         me.dispValueIdxLst_Col = [];
         me.dispValueIdxLst_Content = [];
@@ -208,22 +212,23 @@ JpcCrossTabSrv.prototype.createNew = function(){
         me.paging_option = JV.PAGING_OPTION_NORMAL;
         me.signatureRst = [];
         me.signatureDateRst = [];
+        me.signatureAuditRst = [];
     };
     JpcCrossTabResult.sorting = function(rptTpl, dataObj, dataSeq, $CURRENT_RPT) {
-        let me = this;
-        //IMPORTANT: the data should be sorted in SQL/NoSQL level!
+        const me = this;
+        // IMPORTANT: the data should be sorted in SQL/NoSQL level!
         me.sortedRowSequence = private_SortAndOptimize(rptTpl, dataObj, dataSeq, JV.NODE_CROSS_ROW, me.row_fields_idx, $CURRENT_RPT);
         private_SortAndOptimize(rptTpl, dataObj, dataSeq, JV.NODE_CROSS_ROW_AD_HOC, me.row_fields_adhoc_idx, $CURRENT_RPT);
         me.sortedColSequence = private_SortAndOptimize(rptTpl, dataObj, dataSeq, JV.NODE_CROSS_COL, me.col_fields_idx, $CURRENT_RPT);
         me.sortedContentSequence = private_SortForDisplayContent(rptTpl, me.sortedRowSequence, me.sortedColSequence, me.content_fields_idx);
         JpcFieldHelper.findAndPutDataFieldIdx(rptTpl, rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_COL_SUM][JV.PROP_CROSS_FIELDS], null, me.col_sum_fields_idx);
-        //pre-sum the data(for col sum display)
-        let data_details = dataObj[JV.DATA_DETAIL_DATA],
-            data_fields = [];
+        // pre-sum the data(for col sum display)
+        const data_details = dataObj[JV.DATA_DETAIL_DATA];
+        const data_fields = [];
         for (let i = 0; i < me.col_sum_fields_idx.length; i++) {
             let data_field = null;
             if (typeof me.col_sum_fields_idx[i] === 'object') {
-                let exField = JE.F(me.col_sum_fields_idx[i][JV.PROP_ID], $CURRENT_RPT);
+                const exField = JE.F(me.col_sum_fields_idx[i][JV.PROP_ID], $CURRENT_RPT);
                 if (exField) {
                     data_field = exField[JV.PROP_AD_HOC_DATA];
                 }
@@ -232,15 +237,15 @@ JpcCrossTabSrv.prototype.createNew = function(){
             }
             data_fields.push(data_field);
         }
-        for (let i = 0; i < me.sortedRowSequence.length; i++) { //seg level
+        for (let i = 0; i < me.sortedRowSequence.length; i++) { // seg level
             if (me.sortedRowSequence[i].length > 0) {
                 me.col_sum_fields_value_total.push([]);
                 for (let j = 0; j < me.sortedRowSequence[i].length; j++) {
-                    let rowGrandTotal = [];
+                    const rowGrandTotal = [];
                     for (let di = 0; di < data_fields.length; di++) {
                         rowGrandTotal.push(0.0);
                         for (let k = 0; k < me.sortedRowSequence[i][j].length; k++) {
-                            //3. start to sum
+                            // 3. start to sum
                             rowGrandTotal[di] = rowGrandTotal[di] + 1.0 * JpcFieldHelper.getValue(data_fields[di], me.sortedRowSequence[i][j][k]);
                         }
                     }
@@ -251,12 +256,18 @@ JpcCrossTabSrv.prototype.createNew = function(){
         }
     };
     JpcCrossTabResult.preSetupPages = function(rptTpl, defProperties, option) {
-        let me = this, rst = 0;
-        me.paging_option = option||JV.PAGING_OPTION_NORMAL;
-        //1. original initialize
-        let maxRowRec = 1, maxColRec = 1, counterRowRec = 0, counterColRec = 0, pageIdx = 0, segCnt = me.sortedContentSequence.length;
-        let pageStatus = [true, true, false, true, false, false, false, false];
-        //2. calculate the page info one by one
+        const me = this;
+        let rst = 0;
+        me.paging_option = option || JV.PAGING_OPTION_NORMAL;
+        // 1. original initialize
+        let maxRowRec = 1;
+        let maxColRec = 1;
+        let counterRowRec = 0;
+        let counterColRec = 0;
+        let pageIdx = 0;
+        const segCnt = me.sortedContentSequence.length;
+        const pageStatus = [true, true, false, true, false, false, false, false];
+        // 2. calculate the page info one by one
         let bands = JpcBand.createNew(rptTpl, defProperties);
         function private_resetBandArea() {
             JpcBandHelper.setBandArea(bands, rptTpl, pageStatus);
@@ -288,9 +299,10 @@ JpcCrossTabSrv.prototype.createNew = function(){
              //*/
         } else {
             for (let segIdx = 0; segIdx < segCnt; segIdx++) {
-                //2.1. seg level initialize
+                // 2.1. seg level initialize
                 private_resetBandArea();
-                let orgMaxRowRec = maxRowRec, orgMaxColRec = maxColRec;
+                const orgMaxRowRec = maxRowRec;
+                const orgMaxColRec = maxColRec;
                 let rowSplitCnt = Math.ceil(1.0 * me.sortedRowSequence[segIdx].length / maxRowRec);
                 let colSplitCnt = Math.ceil(1.0 * me.sortedColSequence[segIdx].length / maxColRec);
                 pageStatus[JV.STATUS_CROSS_ROW_END] = true;
@@ -302,12 +314,12 @@ JpcCrossTabSrv.prototype.createNew = function(){
                 pageStatus[JV.STATUS_CROSS_ROW_END] = false;
                 pageStatus[JV.STATUS_CROSS_COL_END] = true;
                 private_resetBandArea();
-                let hasAdHocCol = !JpcCrossTabHelper.chkTabEnd(JV.NODE_CROSS_COL_SUM, rptTpl, bands, me.sortedColSequence, segIdx, (colSplitCnt - 1) * orgMaxColRec, maxColRec);
+                const hasAdHocCol = !JpcCrossTabHelper.chkTabEnd(JV.NODE_CROSS_COL_SUM, rptTpl, bands, me.sortedColSequence, segIdx, (colSplitCnt - 1) * orgMaxColRec, maxColRec);
                 pageStatus[JV.STATUS_CROSS_COL_END] = false;
                 private_resetBandArea();
                 if (hasAdHocRow) rowSplitCnt++;
                 if (hasAdHocCol) colSplitCnt++;
-                //2.2
+                // 2.2
                 if (rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_CROSS_DISPLAY_ORDER] === JV.PAGE_ORIENTATION_H_FIRST) {
                     for (let rowIdx = 0; rowIdx < rowSplitCnt; rowIdx++) {
                         pageStatus[JV.STATUS_CROSS_ROW_END] = (rowIdx === (rowSplitCnt - 1));
@@ -369,34 +381,35 @@ JpcCrossTabSrv.prototype.createNew = function(){
                 }
                 JpcCrossTabHelper.initialPageStatus(pageStatus);
             }
-            //3. set pageSeq and return the result
+            // 3. set pageSeq and return the result
             rst = pageIdx;
         }
         bands = null;
         return rst;
     };
-    JpcCrossTabResult.outputAsPreviewPage = function (rptTpl, bands, controls, $CURRENT_RPT, customizeCfg) {
-        let me = this, rst = [];
-        let pageStatus = [true, true, true, true, true, true, true, true];
+    JpcCrossTabResult.outputAsPreviewPage = function(rptTpl, bands, controls, $CURRENT_RPT, customizeCfg) {
+        const me = this;
+        let rst = [];
+        const pageStatus = [true, true, true, true, true, true, true, true];
         me.pageStatusLst.push(pageStatus);
         // JpcFieldHelper.findAndPutDataFieldIdx(rptTpl, rptTpl[JV.NODE_FLOW_INFO][JV.NODE_FLOW_CONTENT][JV.PROP_FLOW_FIELDS], null, me.disp_fields_idx, false);
         JpcBandHelper.setBandArea(bands, rptTpl, pageStatus, true, false);
-        let maxRowRec = JpcCrossTabHelper.getMaxRowsPerPage(bands, rptTpl);
-        let maxColRec = JpcCrossTabHelper.getMaxColsPerPage(bands, rptTpl);
-        let unitFactor = JpcCommonHelper.getUnitFactor(rptTpl);
-        //1. 交叉行
+        const maxRowRec = JpcCrossTabHelper.getMaxRowsPerPage(bands, rptTpl);
+        const maxColRec = JpcCrossTabHelper.getMaxColsPerPage(bands, rptTpl);
+        const unitFactor = JpcCommonHelper.getUnitFactor(rptTpl);
+        // 1. 交叉行
         rst = rst.concat(me.outputPreviewRowTab(rptTpl, bands, controls, $CURRENT_RPT, customizeCfg, maxRowRec, unitFactor));
-        //2. 交叉列
+        // 2. 交叉列
         rst = rst.concat(me.outputPreviewColTab(rptTpl, bands, controls, $CURRENT_RPT, customizeCfg, maxColRec, unitFactor));
-        //3. 交叉数据
+        // 3. 交叉数据
         rst = rst.concat(me.outputPreviewContent(rptTpl, bands, controls, $CURRENT_RPT, customizeCfg, maxRowRec, maxColRec, unitFactor));
-        //4. 交叉行拓展
+        // 4. 交叉行拓展
         rst = rst.concat(me.outputPreviewTabExt(rptTpl, bands, controls, $CURRENT_RPT, customizeCfg, maxColRec, unitFactor));
-        //5. 交叉行拓展合计
+        // 5. 交叉行拓展合计
         rst = rst.concat(me.outputPreviewSumTabExt(rptTpl, bands, controls, $CURRENT_RPT, customizeCfg, unitFactor));
-        //6. 交叉列合计
+        // 6. 交叉列合计
         rst = rst.concat(me.outputPreviewTabSum(rptTpl, bands, controls, $CURRENT_RPT, customizeCfg, maxRowRec, JV.NODE_CROSS_COL_SUM, unitFactor));
-        //7. 离散
+        // 7. 离散
         rst = rst.concat(JpcDiscreteHelper.outputPreviewDiscreteInfo(rptTpl[JV.NODE_CROSS_INFO][JV.NODE_DISCRETE_INFO], bands, unitFactor, pageStatus));
         return rst;
     };
@@ -415,21 +428,22 @@ JpcCrossTabSrv.prototype.createNew = function(){
         return this.private_OutputPreviewCommon(rptTpl, bands, controls, $CURRENT_RPT, customizeCfg, maxRowRec, 1, rptTpl[JV.NODE_CROSS_INFO][tabNodeName], unitFactor);
     };
     JpcCrossTabResult.outputPreviewTabExt = function(rptTpl, bands, controls, $CURRENT_RPT, customizeCfg, maxColRec, unitFactor) {
-        //交叉行拓展
+        // 交叉行拓展
         return this.private_OutputPreviewCommon(rptTpl, bands, controls, $CURRENT_RPT, customizeCfg, 1, maxColRec, rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_ROW_EXT], unitFactor);
     };
     JpcCrossTabResult.outputPreviewSumTabExt = function(rptTpl, bands, controls, $CURRENT_RPT, customizeCfg, unitFactor) {
-        //交叉行拓展合计
+        // 交叉行拓展合计
         return this.private_OutputPreviewCommon(rptTpl, bands, controls, $CURRENT_RPT, customizeCfg, 1, 1, rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_ROW_SUM_EXT], unitFactor);
     };
     JpcCrossTabResult.private_OutputPreviewCommon = function(rptTpl, bands, controls, $CURRENT_RPT, customizeCfg, maxRowRec, maxColRec, tab, unitFactor) {
-        let me = this, rst = [];
-        let band = (tab)?bands[tab[JV.PROP_BAND_NAME]]:null;
+        const me = this;
+        const rst = [];
+        const band = (tab) ? bands[tab[JV.PROP_BAND_NAME]] : null;
         if (band) {
-            let tab_fields = tab[JV.PROP_CROSS_FIELDS];
+            const tab_fields = tab[JV.PROP_CROSS_FIELDS];
             for (let rowIdx = 0; rowIdx < maxRowRec; rowIdx++) {
                 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])) {
                         for (let colIdx = 0; colIdx < maxColRec; colIdx++) {
                             if (tab_field[JV.PROP_IS_SERIAL]) {
@@ -452,8 +466,10 @@ JpcCrossTabSrv.prototype.createNew = function(){
         return rst;
     };
     JpcCrossTabResult.outputAsSimpleJSONPage = function(rptTpl, dataObj, page, bands, controls, $CURRENT_RPT, customizeCfg) {
-        let me = this, rst = [], tabRstLst = [];
-        let unitFactor = JpcCommonHelper.getUnitFactor(rptTpl);
+        const me = this;
+        let rst = [];
+        const tabRstLst = [];
+        const unitFactor = JpcCommonHelper.getUnitFactor(rptTpl);
         if (me.paging_option === JV.PAGING_OPTION_INFINITY) {
             /*
              let segIdx = page - 1;
@@ -484,26 +500,26 @@ JpcCrossTabSrv.prototype.createNew = function(){
              tabRstLst.push(JpcDiscreteHelper.outputDiscreteInfo(rptTpl[JV.NODE_CROSS_INFO][JV.NODE_DISCRETE_INFO], bands, dataObj, unitFactor, me.pageStatusLst[page - 1], segIdx, 1, 0, $CURRENT_RPT, customizeCfg));
              //*/
         } else {
-            let segIdx = JpcCommonHelper.getSegIdxByPageIdx(page, me.page_seg_map);
-            //1 calculate the band position
+            const segIdx = JpcCommonHelper.getSegIdxByPageIdx(page, me.page_seg_map);
+            // 1 calculate the band position
             JpcBandHelper.setBandArea(bands, rptTpl, me.pageStatusLst[page - 1]);
-            //2. start to output detail-part
-            //2.1 Row-Tab
-            //tabRstLst.push(me.outputRowTab(rptTpl, dataObj, page, bands, unitFactor, controls, $CURRENT_RPT, customizeCfg));
+            // 2. start to output detail-part
+            //  2.1 Row-Tab
+            // tabRstLst.push(me.outputRowTab(rptTpl, dataObj, page, bands, unitFactor, controls, $CURRENT_RPT, customizeCfg));
             tabRstLst.push(me.outputRowTabCommon(rptTpl, dataObj, page, bands, JV.NODE_CROSS_ROW, me.row_fields_idx, unitFactor, controls, $CURRENT_RPT, customizeCfg));
             tabRstLst.push(me.outputRowTabCommon(rptTpl, dataObj, page, bands, JV.NODE_CROSS_ROW_AD_HOC, me.row_fields_adhoc_idx, unitFactor, controls, $CURRENT_RPT, customizeCfg));
-            //2.2 Col-Tab
+            //  2.2 Col-Tab
             tabRstLst.push(me.outputColTab(rptTpl, dataObj, page, bands, unitFactor, controls, $CURRENT_RPT, customizeCfg));
-            //2.3 Content-Tab
+            //  2.3 Content-Tab
             tabRstLst.push(me.outputContent(rptTpl, dataObj, page, bands, unitFactor, controls, $CURRENT_RPT, customizeCfg));
-            //2.4 Sum-Tab Row
-            //2.4 Sum-tab Col
+            //  2.4 Sum-Tab Row
+            //  2.4 Sum-tab Col
             tabRstLst.push(me.outputTabSum(rptTpl, dataObj, page, bands, unitFactor, JV.NODE_CROSS_COL_SUM, controls, $CURRENT_RPT, customizeCfg));
-            //2.x row tab ext
+            //  2.x row tab ext
             tabRstLst.push(me.outputTabExt(rptTpl, dataObj, page, bands, unitFactor, controls, $CURRENT_RPT, customizeCfg));
             tabRstLst.push(me.outputSumTabExt(rptTpl, dataObj, page, bands, unitFactor, segIdx, controls, $CURRENT_RPT, customizeCfg));
-            //2.5 Discrete
-            tabRstLst.push(JpcDiscreteHelper.outputDiscreteInfo(rptTpl[JV.NODE_CROSS_INFO][JV.NODE_DISCRETE_INFO], bands, dataObj, unitFactor, me.pageStatusLst[page - 1], segIdx, 1, 0, $CURRENT_RPT, customizeCfg));
+            //  2.5 Discrete
+            tabRstLst.push(JpcDiscreteHelper.outputDiscreteInfo(rptTpl[JV.NODE_CROSS_INFO][JV.NODE_DISCRETE_INFO], bands, dataObj, unitFactor, me.pageStatusLst[page - 1], segIdx, 1, 0, $CURRENT_RPT, customizeCfg, me.signatureRst, me.signatureDateRst, me.signatureAuditRst));
         }
         for (let i = 0; i < tabRstLst.length; i++) {
             rst = rst.concat(tabRstLst[i]);
@@ -512,22 +528,25 @@ JpcCrossTabSrv.prototype.createNew = function(){
         return rst;
     };
     JpcCrossTabResult.outputRowTabCommon = function(rptTpl, dataObj, page, bands, tabStr, rowFieldsIdxArr, unitFactor, controls, $CURRENT_RPT, customizeCfg) {
-        let me = this, rst = [];
-        let tab = rptTpl[JV.NODE_CROSS_INFO][tabStr];
-        let band = (tab)?bands[tab[JV.PROP_BAND_NAME]]:null;
+        const me = this;
+        const rst = [];
+        const tab = rptTpl[JV.NODE_CROSS_INFO][tabStr];
+        const band = (tab) ? bands[tab[JV.PROP_BAND_NAME]] : null;
         if (band) {
-            let pageStatus = me.pageStatusLst[page - 1];
+            const pageStatus = me.pageStatusLst[page - 1];
             if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] === true) {
-                let tab_fields = tab[JV.PROP_CROSS_FIELDS];
-                let data_details = dataObj[JV.DATA_DETAIL_DATA];
-                let valuesIdx = me.dispValueIdxLst_Row[page - 1];
-                let serialsIdx = me.dispSerialIdxLst_Row[page - 1];
-                let flexiblePrecisionRefObj = null, flexibleRefField = null, precision_ref_data = null;
+                const tab_fields = tab[JV.PROP_CROSS_FIELDS];
+                const data_details = dataObj[JV.DATA_DETAIL_DATA];
+                const valuesIdx = me.dispValueIdxLst_Row[page - 1];
+                const serialsIdx = me.dispSerialIdxLst_Row[page - 1];
+                let flexiblePrecisionRefObj = null;
+                let flexibleRefField = null;
+                let precision_ref_data = null;
                 for (let i = 0; i < rowFieldsIdxArr.length; i++) {
-                    let tab_field = tab_fields[i];
+                    const tab_field = tab_fields[i];
                     if (!(tab_field[JV.PROP_HIDDEN])) {
                         let data_field = null;
-                        let map_data_field = JE.F(tab_field[JV.PROP_FIELD_ID], $CURRENT_RPT);
+                        const map_data_field = JE.F(tab_field[JV.PROP_FIELD_ID], $CURRENT_RPT);
                         if (typeof rowFieldsIdxArr[i] !== 'object') {
                             data_field = data_details[rowFieldsIdxArr[i]];
                         } else {
@@ -535,15 +554,15 @@ JpcCrossTabSrv.prototype.createNew = function(){
                                 data_field = map_data_field[JV.PROP_AD_HOC_DATA];
                             }
                         }
-                        let rows = valuesIdx.length;
+                        const rows = valuesIdx.length;
                         for (let rowIdx = 0; rowIdx < rows; rowIdx++) {
                             if (map_data_field && map_data_field[JV.PROP_PRECISION] && map_data_field.flexiblePrecisionRefObj) {
                                 if (flexiblePrecisionRefObj === null) {
                                     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, valuesIdx[rowIdx], customizeCfg);
@@ -559,22 +578,26 @@ JpcCrossTabSrv.prototype.createNew = function(){
         return rst;
     };
     JpcCrossTabResult.outputColTab = function(rptTpl, dataObj, page, bands, unitFactor, controls, $CURRENT_RPT, customizeCfg) {
-        let me = this, rst = [], firstTextOutput = true;
-        let tab = rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_COL];
-        let band = bands[tab[JV.PROP_BAND_NAME]];
+        const me = this;
+        let rst = [];
+        let firstTextOutput = true;
+        const tab = rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_COL];
+        const band = bands[tab[JV.PROP_BAND_NAME]];
         if (band) {
-            let pageStatus = me.pageStatusLst[page - 1];
+            const pageStatus = me.pageStatusLst[page - 1];
             if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] === true) {
-                let tab_fields = tab[JV.PROP_CROSS_FIELDS];
-                let data_details = dataObj[JV.DATA_DETAIL_DATA];
-                let valuesIdx = me.dispValueIdxLst_Col[page - 1];
-                let flexiblePrecisionRefObj = null, flexibleRefField = null, precision_ref_data = null;
+                const tab_fields = tab[JV.PROP_CROSS_FIELDS];
+                const data_details = dataObj[JV.DATA_DETAIL_DATA];
+                const valuesIdx = me.dispValueIdxLst_Col[page - 1];
+                let flexiblePrecisionRefObj = null;
+                let flexibleRefField = null;
+                let precision_ref_data = null;
                 for (let i = 0; i < me.col_fields_idx.length; i++) {
-                    let tab_field = tab_fields[i];
+                    const tab_field = tab_fields[i];
                     if (!(tab_field[JV.PROP_HIDDEN])) {
-                        let mergedRst = [];
+                        const mergedRst = [];
                         let data_field = null;
-                        let map_data_field = JE.F(tab_field[JV.PROP_FIELD_ID], $CURRENT_RPT);
+                        const map_data_field = JE.F(tab_field[JV.PROP_FIELD_ID], $CURRENT_RPT);
                         if (typeof me.col_fields_idx[i] !== 'object') {
                             data_field = data_details[me.col_fields_idx[i]];
                         } else {
@@ -582,15 +605,15 @@ JpcCrossTabSrv.prototype.createNew = function(){
                                 data_field = map_data_field[JV.PROP_AD_HOC_DATA];
                             }
                         }
-                        let cols = valuesIdx.length;
+                        const cols = valuesIdx.length;
                         for (let colIdx = 0; colIdx < cols; colIdx++) {
                             if (map_data_field && map_data_field[JV.PROP_PRECISION] && map_data_field.flexiblePrecisionRefObj) {
                                 if (flexiblePrecisionRefObj === null) {
                                     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, valuesIdx[colIdx], customizeCfg);
@@ -598,8 +621,8 @@ JpcCrossTabSrv.prototype.createNew = function(){
                                 if (colIdx === 0) JpcFieldHelper.resetFormat(tab_field, map_data_field, customizeCfg);
                             }
                             mergedRst.push(me.outputTabField(band, tab_field, data_field, valuesIdx[colIdx], -1, 1, 0, cols, colIdx, unitFactor, false, controls));
-                            //rst.push(me.outputTabField(band, tab_field, data_field, valuesIdx[colIdx], -1, 1, 0, cols, colIdx, unitFactor, false, controls));
-                            //2. output texts
+                            // rst.push(me.outputTabField(band, tab_field, data_field, valuesIdx[colIdx], -1, 1, 0, cols, colIdx, unitFactor, false, controls));
+                            // 2. output texts
                             if (firstTextOutput) {
                                 if (tab[JV.PROP_TEXT]) {
                                     // mergedRst.push(JpcTextHelper.outputText(tab[JV.PROP_TEXT], band, unitFactor, 1, 0, cols, colIdx, 1, 0));
@@ -614,7 +637,7 @@ JpcCrossTabSrv.prototype.createNew = function(){
                             }
                         }
                         firstTextOutput = false;
-                        //判断是否需要合并
+                        // 判断是否需要合并
                         if (tab_field[JV.PROP_IS_MERGE] && mergedRst.length > 1) {
                             let lastCell = mergedRst[mergedRst.length - 1];
                             for (let mergeIdx = mergedRst.length - 2; mergeIdx >= 0; mergeIdx--) {
@@ -632,21 +655,24 @@ JpcCrossTabSrv.prototype.createNew = function(){
         }
         return rst;
     };
-    JpcCrossTabResult.outputContent = function (rptTpl, dataObj, page, bands, unitFactor, controls, $CURRENT_RPT, customizeCfg) {
-        let me = this, rst = [];
-        let tab = rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_CONTENT];
-        let band = bands[tab[JV.PROP_BAND_NAME]];
+    JpcCrossTabResult.outputContent = function(rptTpl, dataObj, page, bands, unitFactor, controls, $CURRENT_RPT, customizeCfg) {
+        const me = this;
+        const rst = [];
+        const tab = rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_CONTENT];
+        const band = bands[tab[JV.PROP_BAND_NAME]];
         if (band) {
-            let pageStatus = me.pageStatusLst[page - 1];
+            const pageStatus = me.pageStatusLst[page - 1];
             if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] === true) {
-                let tab_fields = tab[JV.PROP_CROSS_FIELDS];
-                let data_details = dataObj[JV.DATA_DETAIL_DATA];
-                let contentValuesIdx = me.dispValueIdxLst_Content[page - 1];
-                let flexiblePrecisionRefObj = null, flexibleRefField = null, precision_ref_data = null;
+                const tab_fields = tab[JV.PROP_CROSS_FIELDS];
+                const data_details = dataObj[JV.DATA_DETAIL_DATA];
+                const contentValuesIdx = me.dispValueIdxLst_Content[page - 1];
+                let flexiblePrecisionRefObj = null;
+                let flexibleRefField = null;
+                let precision_ref_data = null;
                 for (let i = 0; i < tab_fields.length; i++) {
-                    let tab_field = tab_fields[i];
+                    const tab_field = tab_fields[i];
                     let data_field = null;
-                    let map_data_field = JE.F(tab_field[JV.PROP_FIELD_ID], $CURRENT_RPT);
+                    const map_data_field = JE.F(tab_field[JV.PROP_FIELD_ID], $CURRENT_RPT);
                     if (typeof me.content_fields_idx[i] !== 'object') {
                         data_field = data_details[me.content_fields_idx[i]];
                     } else {
@@ -655,17 +681,17 @@ JpcCrossTabSrv.prototype.createNew = function(){
                         }
                     }
                     if (!(tab_field[JV.PROP_HIDDEN])) {
-                        let rows = contentValuesIdx.length;
+                        const rows = contentValuesIdx.length;
                         for (let rowIdx = 0; rowIdx < rows; rowIdx++) {
-                            let cols = contentValuesIdx[rowIdx].length;
+                            const cols = contentValuesIdx[rowIdx].length;
                             for (let colIdx = 0; colIdx < cols; colIdx++) {
                                 if (map_data_field && map_data_field[JV.PROP_PRECISION] && map_data_field.flexiblePrecisionRefObj) {
                                     if (flexiblePrecisionRefObj === null) {
                                         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, contentValuesIdx[rowIdx][colIdx], customizeCfg);
@@ -681,26 +707,27 @@ JpcCrossTabSrv.prototype.createNew = function(){
         }
         return rst;
     };
-    JpcCrossTabResult.outputTabSum = function (rptTpl, dataObj, page, bands, unitFactor, tabNodeName, controls, $CURRENT_RPT, customizeCfg) {
-        let me = this, rst = [],
-            tab = rptTpl[JV.NODE_CROSS_INFO][tabNodeName],
-            band = bands[tab[JV.PROP_BAND_NAME]];
+    JpcCrossTabResult.outputTabSum = function(rptTpl, dataObj, page, bands, unitFactor, tabNodeName, controls, $CURRENT_RPT, customizeCfg) {
+        const me = this;
+        const rst = [];
+        const tab = rptTpl[JV.NODE_CROSS_INFO][tabNodeName];
+        const band = bands[tab[JV.PROP_BAND_NAME]];
         if (band) {
-            let pageStatus = me.pageStatusLst[page - 1];
+            const pageStatus = me.pageStatusLst[page - 1];
             if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] === true) {
-                let tab_fields = tab[JV.PROP_CROSS_FIELDS];
+                const tab_fields = tab[JV.PROP_CROSS_FIELDS];
                 for (let i = 0; i < me.dispSumValueLst_Col[page - 1].length; i++) {
                     if (i === 0) {
                         for (let tfIdx = 0; tfIdx < tab_fields.length; tfIdx++) {
-                            let map_data_field = JE.F(tab_fields[tfIdx][JV.PROP_FIELD_ID], $CURRENT_RPT);
+                            const map_data_field = JE.F(tab_fields[tfIdx][JV.PROP_FIELD_ID], $CURRENT_RPT);
                             JpcFieldHelper.resetFormat(tab_fields[tfIdx], map_data_field, customizeCfg);
                         }
                     }
                     if (me.dispSumValueLst_Col[page - 1][i] !== null) {
                         for (let j = 0; j < me.dispSumValueLst_Col[page - 1][i].length; j++) {
-                            let tab_field = tab_fields[j];
-                            let val = me.dispSumValueLst_Col[page - 1][i][j];
-                            let cellItem = JpcCommonOutputHelper.createCommonOutput(tab_field, val, controls);
+                            const tab_field = tab_fields[j];
+                            const val = me.dispSumValueLst_Col[page - 1][i][j];
+                            const cellItem = JpcCommonOutputHelper.createCommonOutput(tab_field, val, controls);
                             cellItem[JV.PROP_AREA] = JpcAreaHelper.outputArea(tab_field[JV.PROP_AREA], band, unitFactor, me.dispSumValueLst_Col[page - 1].length, i, 1, 0, 1, 0, true, false);
                             rst.push(cellItem);
                         }
@@ -713,9 +740,9 @@ JpcCrossTabSrv.prototype.createNew = function(){
                             }
                         }
                         for (let j = 0; j < sumL; j++) {
-                            let tab_field = tab_fields[j];
-                            let val = null;
-                            let cellItem = JpcCommonOutputHelper.createCommonOutput(tab_field, val, controls);
+                            const tab_field = tab_fields[j];
+                            const val = null;
+                            const cellItem = JpcCommonOutputHelper.createCommonOutput(tab_field, val, controls);
                             cellItem[JV.PROP_AREA] = JpcAreaHelper.outputArea(tab_field[JV.PROP_AREA], band, unitFactor, me.dispSumValueLst_Col[page - 1].length, i, 1, 0, 1, 0, true, false);
                             rst.push(cellItem);
                         }
@@ -725,20 +752,22 @@ JpcCrossTabSrv.prototype.createNew = function(){
         }
         return rst;
     };
-    JpcCrossTabResult.outputTabExt = function (rptTpl, dataObj, page, bands, unitFactor, controls, $CURRENT_RPT, customizeCfg) {
-        let me = this, rst = [], firstTextOutput = true,
-            tab = rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_ROW_EXT];
-        let band = bands[tab[JV.PROP_BAND_NAME]];
+    JpcCrossTabResult.outputTabExt = function(rptTpl, dataObj, page, bands, unitFactor, controls, $CURRENT_RPT, customizeCfg) {
+        const me = this;
+        const rst = [];
+        let firstTextOutput = true;
+        const tab = rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_ROW_EXT];
+        const band = bands[tab[JV.PROP_BAND_NAME]];
         if (band) {
-            let pageStatus = me.pageStatusLst[page - 1];
+            const pageStatus = me.pageStatusLst[page - 1];
             if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] === true) {
-                let tab_fields = tab[JV.PROP_CROSS_FIELDS],
-                    data_details = dataObj[JV.DATA_DETAIL_DATA],
-                    valuesIdx = me.dispValueIdxLst_Col[page - 1];
+                const tab_fields = tab[JV.PROP_CROSS_FIELDS];
+                const data_details = dataObj[JV.DATA_DETAIL_DATA];
+                const valuesIdx = me.dispValueIdxLst_Col[page - 1];
                 for (let i = 0; i < me.row_extension_fields_idx.length; i++) {
-                    let tab_field = tab_fields[i];
+                    const tab_field = tab_fields[i];
                     let data_field = null;
-                    let map_data_field = JE.F(tab_field[JV.PROP_FIELD_ID], $CURRENT_RPT);
+                    const map_data_field = JE.F(tab_field[JV.PROP_FIELD_ID], $CURRENT_RPT);
                     if (typeof me.row_extension_fields_idx[i] !== 'object') {
                         data_field = data_details[me.row_extension_fields_idx[i]];
                     } else {
@@ -748,11 +777,11 @@ JpcCrossTabSrv.prototype.createNew = function(){
                     }
 
                     if (!(tab_field[JV.PROP_HIDDEN])) {
-                        let cols = valuesIdx.length;
+                        const cols = valuesIdx.length;
                         for (let colIdx = 0; colIdx < cols; colIdx++) {
                             if (colIdx === 0) JpcFieldHelper.resetFormat(tab_field, map_data_field, customizeCfg);
                             rst.push(me.outputTabField(band, tab_field, data_field, valuesIdx[colIdx], -1, 1, 0, cols, colIdx, unitFactor, false, controls));
-                            //2. output texts if has
+                            // 2. output texts if has
                             if (firstTextOutput) {
                                 if (tab[JV.PROP_TEXT]) {
                                     rst.push(JpcTextHelper.outputText(tab[JV.PROP_TEXT], band, unitFactor, 1, 0, cols, colIdx, 1, 0));
@@ -771,21 +800,22 @@ JpcCrossTabSrv.prototype.createNew = function(){
         }
         return rst;
     };
-    JpcCrossTabResult.outputSumTabExt = function (rptTpl, dataObj, page, bands, unitFactor, segIdx, controls, $CURRENT_RPT, customizeCfg) {
-        let me = this, rst = [],
-            tab = rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_ROW_SUM_EXT];
-        let band = bands[tab[JV.PROP_BAND_NAME]];
+    JpcCrossTabResult.outputSumTabExt = function(rptTpl, dataObj, page, bands, unitFactor, segIdx, controls, $CURRENT_RPT, customizeCfg) {
+        const me = this;
+        const rst = [];
+        const tab = rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_ROW_SUM_EXT];
+        const band = bands[tab[JV.PROP_BAND_NAME]];
         if (band) {
-            let pageStatus = me.pageStatusLst[page - 1];
+            const pageStatus = me.pageStatusLst[page - 1];
             if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] === true && pageStatus[JV.STATUS_CROSS_ROW_END] === true) {
-                let tab_fields = tab[JV.PROP_CROSS_FIELDS],
-                    data_details = dataObj[JV.DATA_DETAIL_DATA],
-                    data_fields = [];
+                const tab_fields = tab[JV.PROP_CROSS_FIELDS];
+                const data_details = dataObj[JV.DATA_DETAIL_DATA];
+                const data_fields = [];
                 for (let i = 0; i < me.row_sum_extension_fields_idx.length; i++) {
                     // let data_field = data_details[me.row_sum_extension_fields_idx[i]];
-                    let tab_field = tab_fields[i];
+                    const tab_field = tab_fields[i];
                     let data_field = null;
-                    let map_data_field = JE.F(tab_field[JV.PROP_FIELD_ID], $CURRENT_RPT);
+                    const map_data_field = JE.F(tab_field[JV.PROP_FIELD_ID], $CURRENT_RPT);
                     if (typeof me.row_sum_extension_fields_idx[i] !== 'object') {
                         data_field = data_details[me.row_sum_extension_fields_idx[i]];
                     } else {
@@ -796,27 +826,27 @@ JpcCrossTabSrv.prototype.createNew = function(){
                     JpcFieldHelper.resetFormat(tab_field, map_data_field, customizeCfg);
                     data_fields.push(data_field);
                 }
-                //2. initialize grand total value
-                let rowGrandTotal = [];
+                // 2. initialize grand total value
+                const rowGrandTotal = [];
                 for (let di = 0; di < data_fields.length; di++) {
                     rowGrandTotal[di] = 0.0;
-                    //3. start to sum
+                    // 3. start to sum
                     for (let i = 0; i < me.sortedColSequence[segIdx].length; i++) {
-                        //me.sortedColSequence[segIdx][i][0] //this is the data field value index!
+                        // me.sortedColSequence[segIdx][i][0] //this is the data field value index!
                         rowGrandTotal[di] = rowGrandTotal[di] + 1.0 * JpcFieldHelper.getValue(data_fields[di], me.sortedColSequence[segIdx][i][0]);
                     }
                 }
-                //4. output
+                // 4. output
                 for (let di = 0; di < tab_fields.length; di++) {
-                    let tab_field = tab_fields[di];
+                    const tab_field = tab_fields[di];
                     if (!tab_field[JV.PROP_HIDDEN]) {
-                        let val = rowGrandTotal[di];
-                        let cellItem = JpcCommonOutputHelper.createCommonOutput(tab_field, val, controls);
+                        const val = rowGrandTotal[di];
+                        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);
                     }
                 }
-                //output texts if has
+                // output texts if has
                 if (tab[JV.PROP_TEXT]) {
                     rst.push(JpcTextHelper.outputText(tab[JV.PROP_TEXT], band, unitFactor, 1, 0, 1, 0, 1, 0));
                 }
@@ -829,16 +859,18 @@ JpcCrossTabSrv.prototype.createNew = function(){
         }
         return rst;
     };
-    JpcCrossTabResult.outputTabField = function (band, tab_field, data_field, valueIdx, serialIdx, rows, rowIdx, cols, colIdx, unitFactor, isRow, controls) {
+    JpcCrossTabResult.outputTabField = function(band, tab_field, data_field, valueIdx, serialIdx, rows, rowIdx, cols, colIdx, unitFactor, isRow, controls) {
         let rst = null;
         if (isRow === true && tab_field[JV.PROP_IS_SERIAL] && tab_field[JV.PROP_IS_SERIAL] === true) {
             if (serialIdx >= 0) {
-                rst = JpcCommonOutputHelper.createCommonOutput(tab_field, serialIdx + 1)
-            } else rst = JpcCommonOutputHelper.createCommonOutput(tab_field, "", controls);
+                rst = JpcCommonOutputHelper.createCommonOutput(tab_field, serialIdx + 1);
+            } else {
+                rst = JpcCommonOutputHelper.createCommonOutput(tab_field, '', controls);
+            }
         } else {
             rst = JpcCommonOutputHelper.createCommonOutput(tab_field, JpcFieldHelper.getValue(data_field, valueIdx), controls);
         }
-        //position
+        // position
         if (isRow === true) {
             rst[JV.PROP_AREA] = JpcAreaHelper.outputArea(tab_field[JV.PROP_AREA], band, unitFactor, rows, rowIdx, cols, colIdx, 1, 0, true, false);
         } else {
@@ -850,4 +882,4 @@ JpcCrossTabSrv.prototype.createNew = function(){
     return JpcCrossTabResult;
 };
 
-module.exports = new JpcCrossTabSrv();
+module.exports = new JpcCrossTabSrv();

+ 5 - 3
app/reports/rpt_component/jpc_flow_tab.js

@@ -183,6 +183,7 @@ JpcFlowTabSrv.prototype.createNew = function() {
 
         me.signatureRst = [];
         me.signatureDateRst = [];
+        me.signatureAuditRst = [];
     };
     JpcFlowTabResult.sorting = function(rptTpl, dataObj, dataSeq, $CURRENT_RPT) {
         const me = this;
@@ -791,6 +792,7 @@ JpcFlowTabSrv.prototype.createNew = function() {
         // 电子签名内容需要先清空
         me.signatureRst = [];
         me.signatureDateRst = [];
+        me.signatureAuditRst = [];
         if (me.paging_option === JV.PAGING_OPTION_INFINITY) {
             const segIdx = page - 1;
             // 1 calculate the band position
@@ -811,7 +813,7 @@ JpcFlowTabSrv.prototype.createNew = function() {
             tabRstLst.push(me.outputPageSum(rptTpl, dataObj, page, segIdx, bands, unitFactor, controls, $CURRENT_RPT, customizeCfg));
             // 2.5 Group
             // 2.6 Discrete
-            tabRstLst.push(JpcDiscreteHelper.outputDiscreteInfo(rptTpl[FLOW_NODE_STR][JV.NODE_DISCRETE_INFO], bands, dataObj, unitFactor, me.pageStatusLst[page - 1], segIdx, 1, 0, $CURRENT_RPT, customizeCfg, me.signatureRst, me.signatureDateRst));
+            tabRstLst.push(JpcDiscreteHelper.outputDiscreteInfo(rptTpl[FLOW_NODE_STR][JV.NODE_DISCRETE_INFO], bands, dataObj, unitFactor, me.pageStatusLst[page - 1], segIdx, 1, 0, $CURRENT_RPT, customizeCfg, me.signatureRst, me.signatureDateRst, me.signatureAuditRst));
             // 3. reset merge band position
             if (bands[JV.BAND_PROP_MERGE_BAND] && adHocMergePos) {
                 const mergedBand = bands[JV.BAND_PROP_MERGE_BAND];
@@ -846,7 +848,7 @@ JpcFlowTabSrv.prototype.createNew = function() {
                 // 2.5 Group
                 // 2.6 Discrete
                 if (pi === 0) {
-                    tabRstLst.push(JpcDiscreteHelper.outputDiscreteInfo(rptTpl[FLOW_NODE_STR][JV.NODE_DISCRETE_INFO], bands, dataObj, unitFactor, me.pageStatusLst[actualPage - 1], segIdx, 1, pi, $CURRENT_RPT, customizeCfg, me.signatureRst, me.signatureDateRst));
+                    tabRstLst.push(JpcDiscreteHelper.outputDiscreteInfo(rptTpl[FLOW_NODE_STR][JV.NODE_DISCRETE_INFO], bands, dataObj, unitFactor, me.pageStatusLst[actualPage - 1], segIdx, 1, pi, $CURRENT_RPT, customizeCfg, me.signatureRst, me.signatureDateRst, me.signatureAuditRst));
                 }
             }
         }
@@ -1408,7 +1410,7 @@ JpcFlowTabSrv.prototype.createNew = function() {
             }
         }
         if (tab[JV.NODE_DISCRETE_INFO]) {
-            rst = rst.concat(JpcDiscreteHelper.outputDiscreteInfo(tab[JV.NODE_DISCRETE_INFO], bands, dataObj, unitFactor, me.pageStatusLst[page - 1], segIdx, 1, 0, $CURRENT_RPT, customizeCfg, me.signatureRst, me.signatureDateRst));
+            rst = rst.concat(JpcDiscreteHelper.outputDiscreteInfo(tab[JV.NODE_DISCRETE_INFO], bands, dataObj, unitFactor, me.pageStatusLst[page - 1], segIdx, 1, 0, $CURRENT_RPT, customizeCfg, me.signatureRst, me.signatureDateRst, me.signatureAuditRst));
         }
         return rst;
     };

+ 5 - 0
app/reports/rpt_component/jpc_param.js

@@ -16,6 +16,11 @@ const JpcParam = {
                 me.createSingle(rptTpl[JV.NODE_DYNAMIC_DATE_PARAMS][i], JpcParamResult[JV.NODE_DYNAMIC_DATE_PARAMS], rptTpl, i);
             }
         }
+        if (rptTpl[JV.NODE_SIGNATURE_AUDIT_FIELDS]) {
+            for (let i = 0; i < rptTpl[JV.NODE_SIGNATURE_AUDIT_FIELDS].length; i++) {
+                me.createSingle(rptTpl[JV.NODE_SIGNATURE_AUDIT_FIELDS][i], JpcParamResult[JV.NODE_SIGNATURE_AUDIT_FIELDS], rptTpl, i);
+            }
+        }
         return JpcParamResult;
     },
     createSingle: function(paramNode, parentObj, rptTpl, sequence) {

+ 7 - 0
app/reports/rpt_component/jpc_rte.js

@@ -194,6 +194,13 @@ const JE = {
         }
         return rst;
     },
+    isSignatureAudit: function(pID, $CURRENT_RPT) {
+        let rst = false;
+        if ($CURRENT_RPT.params[JV.NODE_SIGNATURE_AUDIT_FIELDS]) {
+            rst = $CURRENT_RPT.params[JV.NODE_SIGNATURE_AUDIT_FIELDS][JV.PROP_ID + '_' + pID] !== undefined;
+        }
+        return rst;
+    },
 };
 
 module.exports = JE;

+ 1 - 0
app/reports/rpt_component/jpc_value_define.js

@@ -15,6 +15,7 @@ module.exports = {
     NODE_NO_MAPPING_FIELDS: '无映射离散指标_集合',
     NODE_SIGNATURE_FIELDS: '电子签名离散指标_集合',
     NODE_DYNAMIC_DATE_PARAMS: '动态日期离散参数_集合',
+    NODE_SIGNATURE_AUDIT_FIELDS: '电子签名审核意见指标_集合',
     NODE_DISCRETE_PARAMS: '离散参数_集合',
     NODE_MASTER_FIELDS: '主数据指标_集合',
     NODE_MASTER_FIELDS_EX: '主数据指标_拓展集合',

+ 1 - 0
app/router.js

@@ -57,6 +57,7 @@ module.exports = app => {
     app.post('/setting/user/permission', sessionAuth, 'settingController.permission');
     app.post('/setting/user/reset/password', sessionAuth, 'settingController.resetUserPassword');
     app.post('/setting/user/exist', sessionAuth, 'settingController.accountExist');
+    app.post('/setting/user/unbind', sessionAuth, 'settingController.userUnbind');
 
     // 标段自定义类别
     app.get('/setting/category', sessionAuth, 'settingController.category');

+ 7 - 1
app/view/setting/user.ejs

@@ -38,7 +38,7 @@
                                     <td><%= account.name %></td>
                                     <td><%= account.company %></td>
                                     <td><%= account.role %></td>
-                                    <td><%= account.mobile %></td>
+                                    <td><%= account.mobile %><% if (account.bind === 1) { %>(已绑定第三方平台)<% } %></td>
                                     <td><%= account.telephone %></td>
                                     <td class="text-center"><a href="#edit-user" data-account="<%= JSON.stringify(account) %>" data-toggle="modal" data-target="#edit-user" class="btn btn-sm btn-outline-primary">编辑</a>
                                         <% if (account.is_admin !== 1) { %>
@@ -48,6 +48,9 @@
                                                 <!--<a href="" class="btn btn-sm btn-outline-danger account-switch-btn" data-account="<%= account.id %>">停用</a>-->
                                             <% } %>
                                         <% } %>
+                                        <% if (account.bind === 1) { %>
+                                            <a href="#unlink-user" data-toggle="modal" data-target="#unlink-user" class="btn btn-sm btn-outline-dark unlink-user" data-account="<%= account.id %>" >解绑</a>
+                                        <% } %>
                                     </td>
                                 </tr>
                             <% } %>
@@ -60,5 +63,8 @@
         </div>
     </div>
 </div>
+<script>
+    const accountList = JSON.parse('<%- JSON.stringify(accountData) %>');
+</script>
 <script src="/public/js/setting.js"></script>
 <script>autoFlashHeight();</script>

+ 19 - 0
app/view/setting/user_modal.ejs

@@ -155,3 +155,22 @@
         </div>
     </div>
 </div>
+<!--弹出解绑帐号-->
+<div class="modal fade" id="unlink-user" data-backdrop="static">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">解绑第三方平台账号</h5>
+            </div>
+            <div class="modal-body">
+                <h4>确认解除 <span id="bind_account">陈特 15812644017</span> 的绑定状态?</h4>
+            </div>
+            <form method="post" action="/setting/user/unbind" class="modal-footer">
+                <input type="hidden" name="_csrf" value="<%= ctx.csrf %>">
+                <input type="hidden" name="id" id="account_id" value="">
+                <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">关闭</button>
+                <button type="button" class="btn btn-sm btn-sm btn-primary">确定解绑</button>
+            </form>
+        </div>
+    </div>
+</div>