浏览代码

新增项目管理报表数据指标

MaiXinRong 1 年之前
父节点
当前提交
9242c36e8f
共有 2 个文件被更改,包括 9 次插入3 次删除
  1. 9 2
      app/service/report_memory.js
  2. 0 1
      app/service/rpt_stage_sum_memory.js

+ 9 - 2
app/service/report_memory.js

@@ -1546,6 +1546,10 @@ module.exports = app => {
 
                 return x.create_time - y.create_time;
             });
+            result.forEach(x => {
+                x.PaidPercent = x.Price ? helper.mul(helper.div(x.Paid, x.Price, 4), 100) : 0;
+                x.Tree_PaidPercent = x.Tree_ContractPrice ? helper.mul(helper.div(x.Tree_ContractsPaid, x.Tree_ContractPrice, 4), 100) : 0;
+            });
             return result;
         }
 
@@ -1585,8 +1589,11 @@ module.exports = app => {
                 }
                 return sum;
             };
-            sortSumChildren(root, result, ['ContractPrice', 'ContractReturned', 'ContractsPaid']);
-            result.forEach(x => { delete x.children });
+            sortSumChildren(root, result, ['ContractPrice', 'ContractReturned', 'ContractsPaid', 'ContractDeductionTotal']);
+            result.forEach(x => {
+                x.PaidPercent = x.ContractPrice ? helper.mul(helper.div(x.ContractsPaid, x.ContractPrice, 4), 100) : 0;
+                delete x.children
+            });
             return result;
         }
     }

+ 0 - 1
app/service/rpt_stage_sum_memory.js

@@ -151,7 +151,6 @@ module.exports = app => {
                 order: [['order', 'ASC']],
             });
 
-            const gsSetting = JSON.parse(gsDefine.setting);
             for (const s of gsCustom.stages) {
                 const stage = await this.db.get(this.ctx.service.stage.tableName, { tid: this.ctx.tender.id, order: s });
                 if (!stage) continue;