@@ -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);
@@ -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 + '');