Procházet zdrojové kódy

计量进度,总价计算调整

MaiXinRong před 5 hodinami
rodič
revize
7915b3e711

+ 4 - 0
app/controller/tender_controller.js

@@ -56,6 +56,7 @@ module.exports = app => {
                 for (const t of tenderList) {
                     await this.ctx.service.tenderCache.loadTenderCache(t, this.ctx.session.sessionUser.accountId);
                     t.canFinish = await this.ctx.service.tender.checkTenderCanFinish(t);
+                    [t.change_tp, t.change_p_tp, t.change_n_tp, t.change_valuation_tp, t.change_unvaluation_tp] = await this.ctx.service.change.getChangeTp(t.id);
                 }
                 const categoryData = await this.ctx.service.category.getAllCategory(this.ctx.subProject);
                 const valuations = await this.ctx.service.valuation.getProjectValidValuation(this.ctx.session.sessionProject.id);
@@ -95,6 +96,7 @@ module.exports = app => {
                 for (const t of tenderList) {
                     await this.ctx.service.tenderCache.loadTenderCache(t, this.ctx.session.sessionUser.accountId);
                     t.canFinish = await this.ctx.service.tender.checkTenderCanFinish(t);
+                    [t.change_tp, t.change_p_tp, t.change_n_tp, t.change_valuation_tp, t.change_unvaluation_tp] = await this.ctx.service.change.getChangeTp(t.id);
                 }
                 const categoryData = await this.ctx.service.category.getAllCategory(this.ctx.subProject);
                 const valuations = await this.ctx.service.valuation.getProjectValidValuation(this.ctx.session.sessionProject.id);
@@ -132,6 +134,7 @@ module.exports = app => {
                     t.visitor = (await this.ctx.service.tenderTourist.getTourists(t.id)).map(x => { return x.user_name; });
                     await this.ctx.service.tenderCache.loadTenderCache(t, this.ctx.session.sessionUser.accountId);
                     t.canFinish = await this.ctx.service.tender.checkTenderCanFinish(t);
+                    [t.change_tp, t.change_p_tp, t.change_n_tp, t.change_valuation_tp, t.change_unvaluation_tp] = await this.ctx.service.change.getChangeTp(t.id);
                 }
                 renderData.categoryData = await this.ctx.service.category.getAllCategory(this.ctx.subProject);
                 renderData.valuations = await this.ctx.service.valuation.getProjectValidValuation(this.ctx.session.sessionProject.id);
@@ -162,6 +165,7 @@ module.exports = app => {
                     t.visitor = (await this.ctx.service.tenderTourist.getTourists(t.id)).map(x => { return x.user_name; });
                     await this.ctx.service.tenderCache.loadTenderCache(t, this.ctx.session.sessionUser.accountId);
                     t.canFinish = await this.ctx.service.tender.checkTenderCanFinish(t);
+                    [t.change_tp, t.change_p_tp, t.change_n_tp, t.change_valuation_tp, t.change_unvaluation_tp] = await this.ctx.service.change.getChangeTp(t.id);
                 }
                 renderData.categoryData = await this.ctx.service.category.getAllCategory(this.ctx.subProject);
                 renderData.valuations = await this.ctx.service.valuation.getProjectValidValuation(this.ctx.session.sessionProject.id);

+ 5 - 2
app/public/js/tender_list_progress.js

@@ -98,7 +98,7 @@ const tenderListSpec = (function(){
         html.push('</td>');
         // 总价
         html.push('<td width="120px" class="text-right">');
-        html.push(node.sum_tp ? node.sum_tp : '');
+        html.push(node.sum_tp1 ? node.sum_tp1 : '');
         html.push('</td>');
         // 截止本期累计完成/本期完成/未完成
         html.push('<td width="30%">');
@@ -122,7 +122,7 @@ const tenderListSpec = (function(){
         html.push('<th class="text-center" style="width: 230px">', '当前流程', '</th>');
         html.push('<th class="text-center" style="width: 150px">', '上一流程审批时间', '</th>');
         html.push('<th class="text-center" style="width: 120px">', '签约合同价', '</th>');
-        html.push('<th style="width: 120px" class="text-center">', '总价 <i class="fa fa-question-circle text-primary"  data-placement="bottom" data-toggle="tooltip" data-original-title="0号台账+截止本期数量变更"></i>', '</th>');
+        html.push('<th style="width: 120px" class="text-center">', '总价 <i class="fa fa-question-circle text-primary"  data-placement="bottom" data-toggle="tooltip" data-original-title="0号台账+批复变更总金额"></i>', '</th>');
         html.push('<th style="width: 30%" class="text-center">', '截止上期完成/本期完成/未完成', '</th>');
         html.push('</tr>', '</thead>');
         return html.join('');
@@ -141,6 +141,7 @@ const tenderListSpec = (function(){
         } else {
             tender.sum_tp = tender.total_price;
         }
+        tender.sum_tp1 = ZhCalc.add(tender.total_price, tender.change_tp);
     }
     function calculateParent(node) {
         if (node.children && node.cid) {
@@ -148,6 +149,7 @@ const tenderListSpec = (function(){
             node.pre_gather_tp = 0;
             node.gather_tp = 0;
             node.sum_tp = 0;
+            node.sum_tp1 = 0;
             node.lastStage = 0;
             node.contract_price = 0;
             node.stage_count = 0;
@@ -157,6 +159,7 @@ const tenderListSpec = (function(){
                 node.pre_gather_tp = ZhCalc.add(node.pre_gather_tp, c.pre_gather_tp);
                 node.gather_tp = ZhCalc.add(node.gather_tp, c.gather_tp);
                 node.sum_tp = ZhCalc.add(node.sum_tp, c.sum_tp);
+                node.sum_tp1 = ZhCalc.add(node.sum_tp1, c.sum_tp1);
                 node.lastStage = c.cid
                     ? Math.max(node.lastStage, c.lastStage)
                     : (c.lastStage ? Math.max(node.lastStage, c.lastStage.order) : node.lastStage);