MaiXinRong 3 years ago
parent
commit
e980651293

+ 3 - 2
app/controller/tender_controller.js

@@ -127,6 +127,9 @@ module.exports = app => {
                 const tenderList = await this.ctx.service.tender.getList('', userPermission, this.ctx.session.sessionUser.is_admin);
 
                 for (const t of tenderList) {
+                    const tenderInfo = await this.ctx.service.tenderInfo.getTenderInfo(t.id);
+                    t.contract_price = tenderInfo.deal_param.contractPrice;
+
                     if (t.user_id === this.ctx.session.sessionUser.accountId && (
                         t.ledger_status === auditConst.ledger.status.checkNo || t.ledger_status === auditConst.ledger.status.uncheck)) {
                         const sum = await this.ctx.service.ledger.addUp({ tender_id: t.id/* , is_leaf: true*/ });
@@ -178,8 +181,6 @@ module.exports = app => {
                 renderData.tenderList = await this.ctx.service.tender.getList(list_status, renderData.userPermission, this.ctx.session.sessionUser.is_admin);
 
                 for (const t of renderData.tenderList) {
-                    const tenderInfo = await this.ctx.service.tenderInfo.getTenderInfo(t.id);
-                    t.deal_tp = tenderInfo.deal_param.contractPrice;
                     if (t.ledger_status === auditConst.ledger.status.checked) {
                         t.lastStage = await this.ctx.service.stage.getLastestStage(t.id, true);
                         t.completeStage = await this.ctx.service.stage.getLastestCompleteStage(t.id);

+ 3 - 3
app/public/js/tender_list_info.js

@@ -201,7 +201,7 @@ function calculateParent(node) {
         node.yf_tp = 0;
         node.end_yf_tp = 0;
         node.advance_tp = 0;
-        node.deal_tp = 0;
+        node.contract_price = 0;
         for (const c of node.children) {
             calculateParent(c);
             node.total_price = ZhCalc.add(node.total_price, c.total_price);
@@ -213,7 +213,7 @@ function calculateParent(node) {
             node.yf_tp = ZhCalc.add(node.yf_tp, c.yf_tp);
             node.end_yf_tp = ZhCalc.add(node.end_yf_tp, c.end_yf_tp);
             node.advance_tp = ZhCalc.add(node.advance_tp, c.advance_tp);
-            node.deal_tp = ZhCalc.add(node.deal_tp, c.deal_tp);
+            node.contract_price = ZhCalc.add(node.contract_price, c.contract_price);
         }
     }
 }
@@ -339,7 +339,7 @@ function recursiveGetTenderNodeHtml (node, arr, pid) {
     html.push('</td>');
     // 签约合同价
     html.push('<td style="width: 6%" class="text-right">');
-    html.push(node.deal_tp || '');
+    html.push(node.contract_price || '');
     html.push('</td>');
     // 0号台账合同
     html.push('<td style="width: 6%" class="text-right">');

+ 3 - 3
app/public/js/tender_list_progress.js

@@ -197,7 +197,7 @@ function calculateParent(node) {
         node.gather_tp = 0;
         node.sum_tp = 0;
         node.lastStage = 0;
-        node.deal_tp = 0;
+        node.contract_price = 0;
         for (const c of node.children) {
             calculateParent(c);
             node.end_qc_tp = ZhCalc.add(node.end_qc_tp, c.end_qc_tp);
@@ -207,7 +207,7 @@ function calculateParent(node) {
             node.lastStage = c.cid
                 ? Math.max(node.lastStage, c.lastStage)
                 : (c.lastStage ? Math.max(node.lastStage, c.lastStage.order) : node.lastStage);
-            node.deal_tp = ZhCalc.add(node.deal_tp, c.deal_tp);
+            node.contract_price = ZhCalc.add(node.contract_price, c.contract_price);
         }
     }
 }
@@ -343,7 +343,7 @@ function recursiveGetTenderNodeHtml (node, arr, pid) {
     html.push('</td>');
     // 签约合同价
     html.push('<td width="8%" class="text-right">');
-    html.push(node.deal_tp ? node.deal_tp : '');
+    html.push(node.contract_price ? node.contract_price : '');
     html.push('</td>');
     // 总价
     html.push('<td width="8%" class="text-right">');