浏览代码

Merge branch 'dev' of http://192.168.1.41:3000/maixinrong/Calculation into dev

MaiXinRong 6 月之前
父节点
当前提交
f4702c2249

+ 18 - 0
app/reports/rpt_component/jpc_bill_tab.js

@@ -117,6 +117,24 @@ JpcBillTabSrv.prototype.createNew = function() {
         }
         return rst;
     };
+    JpcBillTabResult.setPageFlow = function(rptTpl, dataObj, page, thisPageRst, $CURRENT_RPT) {
+        // const me = this;
+        const segPageIdx = page - 1;
+        // 专门的'流程'签字处理
+        if (rptTpl[JV.NODE_CUSTOM_DEFINE] && rptTpl[JV.NODE_CUSTOM_DEFINE][JV.NODE_CUS_OPTION]) {
+            const flowStr = rptTpl[JV.NODE_CUSTOM_DEFINE][JV.NODE_CUS_OPTION] || '';
+            if (flowStr.includes('"ledgerFieldId"')) {
+                // 得先判断是否有这个台账ID(判断是含双引号的),毕竟这个选项是通用的
+                const flowObj = JSON.parse(flowStr);
+                if (flowObj.ledgerFieldId) {
+                    const flowField = JE.F(flowObj.ledgerFieldId, $CURRENT_RPT);
+                    const flowDataField = dataObj[flowField.DataNodeName][flowField.DataSeq];
+                    thisPageRst[JV.PROP_EXT_FLOW_OPTIONS] = flowDataField[segPageIdx] || '';
+                }
+            }
+        }
+        //
+    };
     JpcBillTabResult.outputPreviewContent = function(rptTpl, bands, unitFactor, controls, pageStatus, $CURRENT_RPT) {
         const me = this;
         let rst = [];

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

@@ -636,6 +636,24 @@ JpcCrossTabSrv.prototype.createNew = function() {
         me.checkCombineEvent(JV.RUN_TYPE_AFTER_COMBINE, [], [], rst, $CURRENT_RPT, dataObj, me, page);
         return rst;
     };
+    JpcCrossTabResult.setPageFlow = function(rptTpl, dataObj, page, thisPageRst, $CURRENT_RPT) {
+        const me = this;
+        const segPageIdx = JpcCommonHelper.getSegIdxByPageIdx(page, me.page_seg_map);
+        // 专门的'流程'签字处理
+        if (rptTpl[JV.NODE_CUSTOM_DEFINE] && rptTpl[JV.NODE_CUSTOM_DEFINE][JV.NODE_CUS_OPTION]) {
+            const flowStr = rptTpl[JV.NODE_CUSTOM_DEFINE][JV.NODE_CUS_OPTION] || '';
+            if (flowStr.includes('"ledgerFieldId"')) {
+                // 得先判断是否有这个台账ID(判断是含双引号的),毕竟这个选项是通用的
+                const flowObj = JSON.parse(flowStr);
+                if (flowObj.ledgerFieldId) {
+                    const flowField = JE.F(flowObj.ledgerFieldId, $CURRENT_RPT);
+                    const flowDataField = dataObj[flowField.DataNodeName][flowField.DataSeq];
+                    thisPageRst[JV.PROP_EXT_FLOW_OPTIONS] = flowDataField[segPageIdx] || '';
+                }
+            }
+        }
+        //
+    };
     JpcCrossTabResult.checkCombineEvent = function($RUN_TYPE, $VER_COMB_ARRAY, $HOR_COMB_ARRAY, $CURRENT_CELL_ITEMS, $CURRENT_RPT, $CURRENT_DATA, $PARENT, $PAGE) {
         if ($CURRENT_RPT.formulas) {
             for (let execFmlIdx = 0; execFmlIdx < $CURRENT_RPT.formulas.length; execFmlIdx++) {

+ 6 - 23
app/reports/rpt_component/jpc_ex.js

@@ -383,8 +383,6 @@ JpcExSrv.prototype.createNew = function() {
                     mergedBand[JV.BAND_PROP_STYLE] = band[JV.BAND_PROP_STYLE];
                     rst[JV.BAND_PROP_MERGE_BAND] = mergedBand;
                 }
-                // 这里专门为'流程'签字增加处理
-                me.setFlows(rptTpl, dataObj, rst);
             } catch (exception) {
                 console.log(exception);
             } finally {
@@ -393,26 +391,6 @@ JpcExSrv.prototype.createNew = function() {
         }
         return rst;
     };
-    JpcResult.setFlows = function(rptTpl, dataObj, allPageRst) {
-        const me = this;
-        // 专门的'流程'签字处理
-        if (rptTpl[JV.NODE_CUSTOM_DEFINE] && rptTpl[JV.NODE_CUSTOM_DEFINE][JV.NODE_CUS_OPTION]) {
-            const flowStr = rptTpl[JV.NODE_CUSTOM_DEFINE][JV.NODE_CUS_OPTION] || '';
-            if (flowStr.includes('"ledgerFieldId"')) {
-                // 得先判断是否有这个台账ID(判断是含双引号的),毕竟这个选项是通用的
-                const flowObj = JSON.parse(flowStr);
-                if (flowObj.ledgerFieldId) {
-                    const flowField = $JE.F(flowObj.ledgerFieldId, me);
-                    const flowDataField = dataObj[flowField.DataNodeName][flowField.DataSeq];
-                    if (flowDataField) {
-                        for (let pIdx = 0; pIdx < allPageRst.items.length; pIdx++) {
-                            allPageRst.items[pIdx][JV.PROP_EXT_FLOW_OPTIONS] = flowDataField[pIdx] || '';
-                        }
-                    }
-                }
-            }
-        }
-    };
     JpcResult.outputAsSimpleJSONPage = function(rptTpl, dataObj, bands, page, controls, fonts, customizeCfg) {
         const me = this;
         let rst = null;
@@ -450,7 +428,8 @@ JpcExSrv.prototype.createNew = function() {
                         adHocMergePos[JV.NODE_PAGE_SIZE] = JpcCommonHelper.getPageSize(rptTpl);
                         rst[JV.PAGE_SPECIAL_MERGE_POS] = adHocMergePos;
                     }
-
+                    // 这里专门为'流程'签字增加处理
+                    me.flowTab.setPageFlow(rptTpl, dataObj, page, rst, me);
                 } else {
                     if (!me.isFollowMode) {
                         rst[JV.PROP_CELLS] = me.flowTabEx.outputAsSimpleJSONPage(rptTpl, dataObj, page - (me.totalPages - me.exTotalPages), bands, controls, fonts, adHocMergePos, me, customizeCfg);
@@ -468,6 +447,8 @@ JpcExSrv.prototype.createNew = function() {
                 rst[JV.PROP_SIGNATURE_AUDIT_CELLS] = me.crossTab.signatureAuditRst;
                 rst[JV.PROP_INTERACT_CELLS] = me.crossTab.interactRst;
                 rst[JV.PROP_FIGURE_CELLS] = me.crossTab.figureRst;
+                // 这里专门为'流程'签字增加处理
+                me.flowTab.setPageFlow(rptTpl, dataObj, page, rst, me);
             } else if (me.billTab) {
                 rst[JV.PROP_CELLS] = me.billTab.outputAsSimpleJSONPage(rptTpl, dataObj, page, bands, controls, fonts, me, customizeCfg);
                 rst[JV.PROP_SIGNATURE_CELLS] = me.billTab.signatureRst;
@@ -475,6 +456,8 @@ JpcExSrv.prototype.createNew = function() {
                 rst[JV.PROP_SIGNATURE_AUDIT_CELLS] = me.billTab.signatureAuditRst;
                 rst[JV.PROP_INTERACT_CELLS] = me.billTab.interactRst;
                 rst[JV.PROP_FIGURE_CELLS] = me.billTab.figureRst;
+                // 这里专门为'流程'签字增加处理
+                me.flowTab.setPageFlow(rptTpl, dataObj, page, rst, me);
             }
             if (!(me.flowTab && me.flowTab.paging_option === JV.PAGING_OPTION_INFINITY)) {
                 const pageMergeBorder = getPageMergeBorder();

+ 19 - 0
app/reports/rpt_component/jpc_flow_tab.js

@@ -987,6 +987,25 @@ JpcFlowTabSrv.prototype.createNew = function() {
         }
         return rst;
     };
+    JpcFlowTabResult.setPageFlow = function(rptTpl, dataObj, page, thisPageRst, $CURRENT_RPT) {
+        const me = this;
+        const segPageIdx = JpcCommonHelper.getSegIdxByPageIdx(page, me.page_seg_map);
+        // me.page_seg_map
+        // 专门的'流程'签字处理
+        if (rptTpl[JV.NODE_CUSTOM_DEFINE] && rptTpl[JV.NODE_CUSTOM_DEFINE][JV.NODE_CUS_OPTION]) {
+            const flowStr = rptTpl[JV.NODE_CUSTOM_DEFINE][JV.NODE_CUS_OPTION] || '';
+            if (flowStr.includes('"ledgerFieldId"')) {
+                // 得先判断是否有这个台账ID(判断是含双引号的),毕竟这个选项是通用的
+                const flowObj = JSON.parse(flowStr);
+                if (flowObj.ledgerFieldId) {
+                    const flowField = JE.F(flowObj.ledgerFieldId, $CURRENT_RPT);
+                    const flowDataField = dataObj[flowField.DataNodeName][flowField.DataSeq];
+                    thisPageRst[JV.PROP_EXT_FLOW_OPTIONS] = flowDataField[segPageIdx] || '';
+                }
+            }
+        }
+        //
+    };
     JpcFlowTabResult.prepareBlankCellsForErase = function(contentCells) {
         // 此方法过滤出符合要求的空白行cells,并初始化 pageBlankCellsForErase
         const me = this;