瀏覽代碼

fix: TASK #5597 + code sync

Tony Kang 1 天之前
父節點
當前提交
78c32f7545
共有 4 個文件被更改,包括 21 次插入1 次删除
  1. 15 0
      app/controller/report_controller.js
  2. 3 1
      app/reports/rpt_component/jpc_flow_tab.js
  3. 1 0
      app/router.js
  4. 2 0
      app/view/report/index.ejs

+ 15 - 0
app/controller/report_controller.js

@@ -1411,6 +1411,21 @@ module.exports = app => {
             await this._indexForContract(ctx, sourceTypeConst.sourceType.contract, -600, preUrl, thisUrl);
         }
 
+        async indexForCostManager(ctx) {
+            // 成本管理报表入口
+            try {
+                const ledge_stage_type = this.ctx.service.costStage.stageType.ledger.key;
+                const analysis_stage_type = this.ctx.service.costStage.stageType.analysis.key;
+                const book_stage_type = this.ctx.service.costStage.stageType.book.key;
+                const ledge_stages = await this.getTypeStages(ctx, ledge_stage_type);
+                const analysis_stages = await this.getTypeStages(ctx, analysis_stage_type);
+                const book_stages = await this.getTypeStages(ctx, book_stage_type);
+                // await this._getCostManagerViewData(ctx);
+            } catch (err) {
+                //
+            }
+        }
+
         /**
          * 报表打印页面
          *

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

@@ -1176,6 +1176,7 @@ JpcFlowTabSrv.prototype.createNew = function() {
         //     假如:第一列的前3个数据(1、2、3)是相同的,第二列中第2、3、4行数据相同,那么第二列只能合并2、3行的数据,不能合并到第四行
         //     同理如此类推第三列...n列
         // 另:要考虑紧密输出情况,需要重新拆分数据
+        const regSplit = new RegExp('\\|', 'g');
         const _splitValues = function(oCell) {
             // JpcFieldHelper.setValue(data_field, theRecIdx, value);
             const values = (typeof oCell.Value === 'string') ? oCell.Value.split('|') : [oCell.Value];
@@ -1313,13 +1314,14 @@ JpcFlowTabSrv.prototype.createNew = function() {
                             if (preCell.Value === '') {
                                 preCell = rstPageCells[cacheObj.hCache[hStr][cIdx]];
                             } else {
-                                if (preCell.Value === rstPageCells[cacheObj.hCache[hStr][cIdx]].Value) {
+                                if ((preCell.Value || ' ').replace(regSplit, '') === (rstPageCells[cacheObj.hCache[hStr][cIdx]].Value || '  ').replace(regSplit, '')) {
                                     if (preCell[JV.PROP_AREA][JV.PROP_RIGHT] < rstPageCells[cacheObj.hCache[hStr][cIdx]][JV.PROP_AREA][JV.PROP_RIGHT]) {
                                         preCell[JV.PROP_AREA][JV.PROP_RIGHT] = rstPageCells[cacheObj.hCache[hStr][cIdx]][JV.PROP_AREA][JV.PROP_RIGHT];
                                     } else {
                                         preCell[JV.PROP_AREA][JV.PROP_LEFT] = rstPageCells[cacheObj.hCache[hStr][cIdx]][JV.PROP_AREA][JV.PROP_LEFT];
                                     }
                                     removeCellIds.push(cacheObj.hCache[hStr][cIdx]);
+                                    preCell.Value = (preCell.Value || '').replace(regSplit, '');
                                 } else {
                                     preCell = rstPageCells[cacheObj.hCache[hStr][cIdx]];
                                 }

+ 1 - 0
app/router.js

@@ -551,6 +551,7 @@ module.exports = app => {
     app.post('/sp/:id/cost/member', sessionAuth, subProjectCheck, projectManagerCheck, 'costController.member');
     app.post('/sp/:id/cost/memberSave', sessionAuth, subProjectCheck, projectManagerCheck, 'costController.memberSave');
     app.post('/sp/:id/cost/templateSet', sessionAuth, subProjectCheck, projectManagerCheck, 'subProjController.templateSet');
+    // app.get('/sp/:id/cost/tender/:tid/report', sessionAuth, subProjectCheck, tenderCheck, tenderPermissionCheck, 'reportController.indexForCostManager');
     app.get('/sp/:id/cost/tender/:tid/ledger', sessionAuth, subProjectCheck, tenderCheck, tenderPermissionCheck, 'costController.ledger');
     app.get('/sp/:id/cost/tender/:tid/book', sessionAuth, subProjectCheck, tenderCheck, tenderPermissionCheck, 'costController.book');
     app.get('/sp/:id/cost/tender/:tid/analysis', sessionAuth, subProjectCheck, tenderCheck, tenderPermissionCheck, 'costController.analysis');

+ 2 - 0
app/view/report/index.ejs

@@ -12,6 +12,8 @@
     <% include ../contract/sub_menu.ejs %>
 <% } else if ([-700].includes(stg_id)) { %>
     <% include ../phase_pay/sub_menu.ejs %>
+<% } else if ([-800, -801, -802, -803].includes(stg_id)) { %>
+    <% include ../cost/list_menu_list.ejs %>
 <% } else { %>
     <% include ../stage/stage_sub_menu.ejs %>
 <% } %>