Browse Source

计价和不计价清单金额汇总及展示

ellisran 1 year ago
parent
commit
248231286e

+ 1 - 1
app/controller/datacollect_controller.js

@@ -151,7 +151,7 @@ module.exports = app => {
                     // 用标段管理的方法获取t数据
                     await this.ctx.service.tenderCache.loadTenderCache(t, '');
                     t.total_price = t.ledger_tp && t.ledger_tp.total_price ? t.ledger_tp.total_price : 0;
-                    [t.change_tp, t.change_p_tp, t.change_n_tp] = await ctx.service.change.getChangeTp(t.id);
+                    [t.change_tp, t.change_p_tp, t.change_n_tp, t.change_valuation_tp, t.change_unvaluation_tp] = await ctx.service.change.getChangeTp(t.id);
                     // t.material_tp = await ctx.service.material.getSumMaterial(t.id);
                     // 获取本标段 本月计量期审批通过数目,变更令审批通过数目,台账修订通过数目,材料调差通过数目
                     t.month_stage_num = await ctx.service.stageAudit.getNumByMonth(t.id, startMonth, endMonth);

+ 3 - 1
app/controller/tender_controller.js

@@ -372,10 +372,12 @@ module.exports = app => {
                     tender.ledger_status === auditConst.ledger.status.checkNo || tender.ledger_status === auditConst.ledger.status.uncheck);
                 const stages = await ctx.service.stage.getValidStages(ctx.tender.id);
                 const lastStage = stages.length > 0 ? stages[0] : null; // await ctx.service.stage.getLastestStage(ctx.tender.id);
-                const [change_tp, change_p_tp, change_n_tp] = await ctx.service.change.getChangeTp(tender.id);
+                const [change_tp, change_p_tp, change_n_tp, change_valuation_tp, change_unvaluation_tp] = await ctx.service.change.getChangeTp(tender.id);
                 tender.change_tp = change_tp;
                 tender.change_p_tp = change_p_tp;
                 tender.change_n_tp = change_n_tp;
+                tender.change_valuation_tp = change_valuation_tp;
+                tender.change_unvaluation_tp = change_unvaluation_tp;
                 if (lastStage) {
                     await this.ctx.service.stage.checkStageGatherData(lastStage, this.ctx.session.sessionUser.is_admin);
 

+ 3 - 1
app/controller/wap_controller.js

@@ -210,10 +210,12 @@ module.exports = app => {
                     tender.total_price = sum.total_price;
                     tender.deal_tp = sum.deal_tp;
                 }
-                const [change_tp, change_p_tp, change_n_tp] = await ctx.service.change.getChangeTp(ctx.tender.id);
+                const [change_tp, change_p_tp, change_n_tp, change_valuation_tp, change_unvaluation_tp] = await ctx.service.change.getChangeTp(ctx.tender.id);
                 tender.change_tp = change_tp;
                 tender.change_p_tp = change_p_tp;
                 tender.change_n_tp = change_n_tp;
+                tender.change_valuation_tp = change_valuation_tp;
+                tender.change_unvaluation_tp = change_unvaluation_tp;
                 const stages = await ctx.service.stage.getValidStages(ctx.tender.id);
                 const lastStage = stages.length > 0 ? stages[0] : null; //await ctx.service.stage.getLastestStage(ctx.tender.id);
                 if (lastStage) {

+ 2 - 2
app/service/change.js

@@ -593,10 +593,10 @@ module.exports = app => {
          * @return {void}
          */
         async getChangeTp(tenderId) {
-            const sql = 'SELECT SUM(`total_price`) AS tp, SUM(`positive_tp`) AS p_tp, SUM(`negative_tp`) AS n_tp FROM ?? WHERE tid = ? AND status = ?';
+            const sql = 'SELECT SUM(`total_price`) AS tp, SUM(`positive_tp`) AS p_tp, SUM(`negative_tp`) AS n_tp, SUM(`valuation_tp`) AS v_tp, SUM(`unvaluation_tp`) AS uv_tp FROM ?? WHERE tid = ? AND status = ?';
             const sqlParam = [this.tableName, tenderId, audit.change.status.checked];
             const result = await this.db.queryOne(sql, sqlParam);
-            return result ? [result.tp, result.p_tp, result.n_tp] : [0, 0, 0];
+            return result ? [result.tp, result.p_tp, result.n_tp, result.v_tp, result.uv_tp] : [0, 0, 0, 0, 0];
         }
 
         /**

+ 1 - 1
app/view/tender/detail.ejs

@@ -114,7 +114,7 @@
                                     </style>
                                     <div class="col-auto pl-0">
                                         <div class="card text-center <% if (!ctx.tender.info.display.dayMode) { %>bg-dark text-white<% } %>">
-                                            <div class="card-body" data-toggle="tooltip" data-placement="bottom" data-html="true" data-original-title="<p style='text-align:left;'>批复正变更:<%- ctx.helper.formatMoney(tender.change_p_tp) %></p>批复负变更:<%- ctx.helper.formatMoney(tender.change_n_tp) %>">
+                                            <div class="card-body" data-toggle="tooltip" data-placement="bottom" data-html="true" data-original-title="<p style='text-align:left;'>计价金额:<%- ctx.helper.formatMoney(tender.change_valuation_tp) %></p>不计价金额:<%- ctx.helper.formatMoney(tender.change_unvaluation_tp) %>">
                                                 <h5 class="card-title card-big-title"><%- ctx.helper.formatMoney(tender.change_tp) %></h5>
                                                 <p class="card-text text-muted">已批复变更金额</p>
                                             </div>