浏览代码

合同管理,新增指标数据

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

+ 1 - 1
app/lib/pm.js

@@ -61,7 +61,7 @@ module.exports = {
 
         const url = ctx.app.config.managementProxyPath + dealDataApi;
         try {
-            const data = { code: pCode, token: pmUtils.getJwt(), key: ['contracts'], bidsectionid: selects };
+            const data = { code: pCode, token: pmUtils.getJwt(), key: ['contracts', 'tree_contracts'], bidsectionid: selects };
             return await pmUtils.postData(ctx, url, data);
         } catch (err) {
             ctx.log(err);

+ 8 - 0
app/service/report_memory.js

@@ -1351,6 +1351,14 @@ module.exports = app => {
             this.pmDeal = await pm.dealData(this.ctx, this.ctx.session.sessionProject.code, selects);
 
             result = this.pmDeal.contracts ? this.pmDeal.contracts.filter(x => { return x.ContractsType === 2 }) : [];
+            const fields = ['Code', 'Name', 'ContractName', 'ContractCode', 'ContractPrice', 'ContractReturned', 'ContractsPaid', 'ContractStatus', 'ContractLocking', 'CreateTime'], self = this;
+            result.forEach(x => {
+                const treeNode = self.pmDeal.tree_contracts.find(y => { return x.TreeId === y.Id });
+                if (!treeNode) return;
+                for (const f of fields) {
+                    x['Tree_' + f] = treeNode[f];
+                }
+            });
             // 排序:标段-合同类别-创建时间
             result.sort((x, y) => {
                 const bidSort = selects.indexOf(x.BidsectionId + '') - selects.indexOf(y.BidsectionId + '');