浏览代码

决策大屏修正本期补差数据值

laiguoran 2 年之前
父节点
当前提交
1ffabeb46f
共有 4 个文件被更改,包括 9 次插入11 次删除
  1. 1 3
      app/controller/stage_controller.js
  2. 3 3
      app/controller/tender_controller.js
  3. 2 2
      app/service/stage.js
  4. 3 3
      app/view/datacollect/index.ejs

+ 1 - 3
app/controller/stage_controller.js

@@ -121,9 +121,7 @@ module.exports = app => {
                 const thisMonth = moment().month();
                 // const thisMonth = 11;
                 const thisDate = new Date();
-                const onMonth = stageStart.end_month === funSetConst.endMonth[1].val && thisMonth === parseInt(moment(thisDate).format('MM')) - 1;
                 let startEndDay = stageStart.end_day + '号';
-                // const nowDay = Date.now();
                 let startDay = moment([thisYear, thisMonth, stageStart.start_day]).isValid() ? [thisYear, thisMonth, stageStart.start_day] : [thisYear, thisMonth + 1, 1];
                 const maxDay = moment(thisDate).format('YYYY-MM-DD') >= moment(startDay).format('YYYY-MM-DD');
                 startEndDay = maxDay && stageStart.end_month === funSetConst.endMonth[1].val ? funSetConst.endMonth[stageStart.end_month - 1].name + startEndDay : startEndDay;
@@ -147,7 +145,7 @@ module.exports = app => {
                     endDay = [thisYear, thisMonth + 1, 1];
                     endDay = moment(endDay).subtract(1, 'days');
                 }
-                console.log(moment(thisDate).format('YYYY-MM-DD'), moment(startDay).format('YYYY-MM-DD'), moment(endDay).format('YYYY-MM-DD'));
+                // console.log(moment(thisDate).format('YYYY-MM-DD'), moment(startDay).format('YYYY-MM-DD'), moment(endDay).format('YYYY-MM-DD'));
                 const startPermission = moment(moment(thisDate).format('YYYY-MM-DD')).isBetween(moment(startDay).format('YYYY-MM-DD'), moment(endDay).format('YYYY-MM-DD'), null, '[]');
                 ctx.stage.startPermission = startPermission;
             }

+ 3 - 3
app/controller/tender_controller.js

@@ -411,9 +411,9 @@ module.exports = app => {
                         tender.deal_tp = sum.deal_tp;
                     }
 
-                    tender.gather_tp = ctx.helper.add(lastStage.contract_tp, lastStage.qc_tp);
-                    tender.end_contract_tp = ctx.helper.add(lastStage.contract_tp, lastStage.pre_contract_tp);
-                    tender.end_qc_tp = ctx.helper.add(lastStage.qc_tp, lastStage.pre_qc_tp);
+                    tender.gather_tp = ctx.helper.sum([lastStage.contract_tp, lastStage.qc_tp, lastStage.pc_tp]);
+                    tender.end_contract_tp = ctx.helper.sum([lastStage.contract_tp, lastStage.pre_contract_tp, lastStage.contract_pc_tp]);
+                    tender.end_qc_tp = ctx.helper.sum([lastStage.qc_tp, lastStage.pre_qc_tp, lastStage.qc_pc_tp]);
                     tender.end_gather_tp = ctx.helper.add(tender.end_contract_tp, tender.end_qc_tp);
                     tender.pre_gather_tp = ctx.helper.add(lastStage.pre_contract_tp, lastStage.pre_qc_tp);
                     tender.yf_tp = lastStage.yf_tp;

+ 2 - 2
app/service/stage.js

@@ -232,7 +232,7 @@ module.exports = app => {
                     stage.contract_pc_tp = pcSum.contract_pc_tp;
                     stage.qc_pc_tp = pcSum.qc_pc_tp;
                     stage.pc_tp = pcSum.pc_tp;
-                    stage.tp =this.ctx.helper.add(stage.contract_tp, stage.qc_tp);
+                    stage.tp = this.ctx.helper.sum([stage.contract_tp, stage.qc_tp, stage.pc_tp]);
                     const tp = await this.ctx.service.stagePay.getSpecialTotalPrice(stage);
                     stage.yf_tp = tp.yf;
                     stage.sf_tp = tp.sf;
@@ -250,7 +250,7 @@ module.exports = app => {
                         stage.qc_tp = his.qc_tp;
                         stage.yf_tp = his.yf_tp;
                         stage.sf_tp = his.sf_tp;
-                        stage.tp = this.ctx.helper.add(stage.contract_tp, stage.qc_tp);
+                        stage.tp = this.ctx.helper.sum([stage.contract_tp, stage.qc_tp, stage.pc_tp]);
                         stage.end_tp = this.ctx.helper.add(stage.pre_tp, stage.tp);
                     }
                 }

+ 3 - 3
app/view/datacollect/index.ejs

@@ -1335,9 +1335,9 @@
 
         function calculateTender(tender) {
             if (tender.lastStage) {
-                tender.gather_tp = ZhCalc.add(tender.lastStage.contract_tp, tender.lastStage.qc_tp);
-                tender.end_contract_tp = ZhCalc.add(tender.lastStage.pre_contract_tp, tender.lastStage.contract_tp);
-                tender.end_qc_tp = ZhCalc.add(tender.lastStage.pre_qc_tp, tender.lastStage.qc_tp);
+                tender.gather_tp = ZhCalc.sum([tender.lastStage.contract_tp, tender.lastStage.qc_tp, tender.lastStage.pc_tp]);
+                tender.end_contract_tp = ZhCalc.sum([tender.lastStage.pre_contract_tp, tender.lastStage.contract_tp, tender.lastStage.contract_pc_tp]);
+                tender.end_qc_tp = ZhCalc.sum([tender.lastStage.pre_qc_tp, tender.lastStage.qc_tp, tender.lastStage.qc_pc_tp]);
                 tender.end_gather_tp = ZhCalc.add(tender.end_contract_tp, tender.end_qc_tp);
                 tender.pre_gather_tp = ZhCalc.add(tender.lastStage.pre_contract_tp, tender.lastStage.pre_qc_tp);
                 tender.yf_tp = ZhCalc.add(tender.lastStage.yf_tp);