Sfoglia il codice sorgente

报表预处理,汇总章级数据,添加visible属性

MaiXinRong 5 anni fa
parent
commit
50620c0064
1 ha cambiato i file con 23 aggiunte e 6 eliminazioni
  1. 23 6
      app/lib/rpt_data_analysis.js

+ 23 - 6
app/lib/rpt_data_analysis.js

@@ -228,7 +228,7 @@ const gatherChapter = {
             order: 1,
         },
         custom: [
-            {name: '已包含在清单合计中的材料、工程设备、专业工程暂估价', order: 2},
+            {name: '已包含在清单合计中的材料、工程设备、专业工程暂估价', order: 2, visible: false},
             {name: '清单合计减去材料、工程设备、专业工程暂估价(即8-9=10)', order_calc: 'o1-o2', order: 3},
             {name: '计日工合计', node_type: '计日工', order: 4},
             {name: '暂列金额(不含计日工总额)(即10×暂列金额比列)', order: 5, match: [{node_type: '暂列金额'}, {field: 'name', part: '暂列金额'}, {field: 'name', part: '暂定金额'}]},
@@ -263,16 +263,32 @@ const gatherChapter = {
         }
 
         if (options.unChapter) {
-            gclChapter.push({ name: options.unChapter.name, cType: 21, serialNo: serialNo + options.unChapter.order, order: options.unChapter.order });
+            gclChapter.push({
+                name: options.unChapter.name, cType: 21,
+                serialNo: serialNo + options.unChapter.order, order: options.unChapter.order,
+                visible: options.unChapter.visible,
+            });
         }
         if (options.gclSum) {
-            otherChapter.push({ name: options.gclSum.name, cType: 11, serialNo: serialNo + options.gclSum.order, order: options.gclSum.order  });
+            otherChapter.push({
+                name: options.gclSum.name, cType: 11,
+                serialNo: serialNo + options.gclSum.order, order: options.gclSum.order,
+                visible: options.gclSum.visible,
+            });
         }
         if (options.unGcl) {
-            otherChapter.push({ name: options.unGcl.name, cType: 31, serialNo: serialNo + options.unGcl.order, order: options.unGcl.order  });
+            otherChapter.push({
+                name: options.unGcl.name, cType: 31,
+                serialNo: serialNo + options.unGcl.order, order: options.unGcl.order,
+                visible: options.unGcl.visible,
+            });
         }
         if (options.sum) {
-            otherChapter.push({ name: options.sum.name , cType: 41, serialNo: serialNo + options.sum.order, order: options.sum.order  });
+            otherChapter.push({
+                name: options.sum.name , cType: 41,
+                serialNo: serialNo + options.sum.order, order: options.sum.order,
+                visible: options.sum.visible,
+            });
         }
 
         if (options.custom && options.custom instanceof Array) {
@@ -281,6 +297,7 @@ const gatherChapter = {
                     name: c.name, serialNo: serialNo + c.order,
                     order_calc: c.order_calc,
                     cType: 5, order: c.order,
+                    visible: c.visible,
                 };
                 if (c.match) {
                     cc.match = JSON.parse(JSON.stringify(c.match));
@@ -450,7 +467,7 @@ const gatherChapter = {
                 }
                 return false;
             } else {
-                return true;
+                return x.visible !== undefined || x.visible !== null ? x.visible : true;
             }
         });
     },