MaiXinRong пре 2 година
родитељ
комит
6a5b129500
1 измењених фајлова са 21 додато и 26 уклоњено
  1. 21 26
      app/lib/rpt_data_analysis.js

+ 21 - 26
app/lib/rpt_data_analysis.js

@@ -370,7 +370,7 @@ const gatherChapter = {
             name: '合计',
             order: 4,
         },
-        filter: [{ node_type: standard.nodeType.find(function(x) { return x.text === '计日工'; }).value }, { field: 'name', part: '计日工' }],
+        filter: [{node_type: standard.nodeType.find(function (x) {return x.text === '计日工'}).value}, {field: 'name', part: '计日工'}],
     },
     customSetting1: {
         count: 7,
@@ -379,11 +379,11 @@ const gatherChapter = {
             order: 1,
         },
         custom: [
-            { 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', all: '暂定金额' }] },
-            { name: '投标报价、台账价(8+11+12)=13', order_calc: 'o1+o4+o5', order: 6 },
+            {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', all: '暂定金额'}]},
+            {name: '投标报价、台账价(8+11+12)=13', order_calc: 'o1+o4+o5', order: 6},
         ],
         rela: [
             {
@@ -439,7 +439,7 @@ const gatherChapter = {
         }
         if (options.sum) {
             otherChapter.push({
-                name: options.sum.name, cType: 41,
+                name: options.sum.name , cType: 41,
                 serialNo: serialNo + options.sum.order, order: options.sum.order,
                 visible: options.sum.visible,
             });
@@ -457,7 +457,7 @@ const gatherChapter = {
                     cc.match = JSON.parse(JSON.stringify(c.match));
                     for (const m of cc.match) {
                         if (m.node_type && m.node_type !== '') {
-                            const nodeType = standard.nodeType.find(function(x) { return x.text === m.node_type; });
+                            const nodeType = standard.nodeType.find(function (x) {return x.text === m.node_type});
                             m.node_type = nodeType.value;
                         }
                     }
@@ -699,7 +699,7 @@ const join = {
             }
         }
         for (const s of sub) {
-            const subR = result.filter(function(x) {
+            let subR = result.filter(function(x) {
                 for (const k of options.keyFields) {
                     switch (k.type) {
                         case 'string':
@@ -1206,16 +1206,10 @@ const gatherSelectConverse = {
 
         const gsDefine = csRela.tplDefine.gather_select;
         if (!gsDefine || !gsDefine.enable || !gsDefine.setting || gsDefine.setting === '') return;
-        if (typeof gsDefine.setting === 'string') {
-            gsDefine.setting = JSON.parse(gsDefine.setting);
-        }
         const gsCustom = csRela.cDefine ? csRela.cDefine.gather_select : null;
-        let count = 0;
-        if (gsCustom) {
-            count = gsDefine.setting.special
-                ? gsCustom.tenders.length - gsDefine.setting.special.length
-                : gsCustom.tenders.length;
-        }
+        const count = gsDefine.setting.special
+            ? gsCustom.tenders.length - gsDefine.setting.special.length
+            : gsCustom.tenders.length;
 
         for (const t of options.table) {
             switch (t) {
@@ -1533,10 +1527,10 @@ const loadCooperationData = {
         if (!auditor) return '';
         if (auditor.ass_user_id) {
             return auditor.sign_path ? 'public/upload/sign/' + auditor.sign_path : '';
+        } else {
+            if (!auditor.end_time) return '';
+            return auditor.sign_path ? 'public/upload/sign/' + auditor.sign_path : '';
         }
-        if (!auditor.end_time) return '';
-        return auditor.sign_path ? 'public/upload/sign/' + auditor.sign_path : '';
-
     },
     _loadImCooperationData(ctx, data, options, csRela) {
         let coSignOrder = [];
@@ -1712,7 +1706,7 @@ const getChangeLedger = {
                 end_contract_tp: b.end_contract_tp, end_qc_tp: b.end_qc_tp, end_gather_tp: b.end_gather_tp,
             };
             result.push(l);
-            const childGcl = bills.filter(x => { return x.ledger_pid === b.ledger_id && x.b_code; });
+            const childGcl = bills.filter(x => { return x.ledger_pid === b.ledger_id && x.b_code});
             if (!childGcl || childGcl.length === 0) continue;
 
             const gcl = bills.filter(x => { return x.full_path.indexOf(l.full_path + '-') === 0 && x.b_code; });
@@ -1746,7 +1740,8 @@ const getChangeLedger = {
             const calc = changeLedger.filter(x => { return x.full_path.indexOf(f.full_path) === 0 && x.changes && x.changes.length > 0; });
             if (!calc || calc.length === 0) continue;
 
-            if (options.level === '2-leaf') { if (f.level !== 2 && (!f.changes || f.changes.length === 0)) continue; }
+            if (options.level === '2-leaf')
+                if (f.level !== 2 && (!f.changes || f.changes.length === 0)) continue;
 
             result.push({
                 code: f.code, name: f.name, unit: f.unit,
@@ -1842,14 +1837,14 @@ const gatherGcl2 = {
 
         data.mem_gcl_gather_bills = gatherUtil.gclList;
         data.mem_gcl_gather_xmj = gatherUtil.leafXmjs;
-    },
+    }
 };
 const gatherMaterialGl = {
     name: '分类汇总调差工料',
     hint: '根据工程量清单分类汇总调差工料,要求先使用【工程量清单汇总2】处理得到工程量清单数据,并引入【调差工料明细】',
     _relaGl(source, data) {
         if (!source) return;
-        const gl = source.find(x => { return x.id === data.mb_id; });
+        const gl = source.find(x => {return x.id === data.mb_id;});
         if (gl) {
             data.gl_code = gl.code;
             data.gl_name = gl.name;
@@ -1903,7 +1898,7 @@ const gatherMaterialGl = {
             }
         }
         data.mem_material_gl_detail = result;
-    },
+    }
 };
 
 const analysisObj = {