Pārlūkot izejas kodu

合同支付,计算调整

MaiXinRong 4 nedēļas atpakaļ
vecāks
revīzija
99a85d1c51

+ 4 - 4
app/lib/pay_calc.js

@@ -161,11 +161,11 @@ class PayCalculate {
         this.cur = await this.ctx.service.stageBills.getSumTotalPrice(this.stage);
         this.add = {};
         if (this.pre) {
-            this.add.contract_tp = this.ctx.helper.add(this.pre.contract_tp, this.cur.contract_tp);
-            this.add.qc_tp = this.ctx.helper.add(this.pre.qc_tp, this.cur.qc_tp);
+            this.add.contract_tp = this.ctx.helper.sum([this.pre.contract_tp, this.cur.contract_tp, this.cur.contract_pc_tp]);
+            this.add.qc_tp = this.ctx.helper.sum([this.pre.qc_tp, this.cur.qc_tp, this.cur.qc_pc_tp]);
         } else {
-            this.add.contract_tp = this.cur.contract_tp;
-            this.add.qc_tp = this.cur.qc_tp;
+            this.add.contract_tp = this.ctx.helper.add(this.cur.contract_tp, this.cur.contract_pc_tp);
+            this.add.qc_tp = this.ctx.helper.add(this.cur.qc_tp, this.cur.qc_pc_tp);
         }
         this.add.gather_tp = this.ctx.helper.add(this.add.contract_tp, this.add.qc_tp);
     }

+ 1 - 1
app/middleware/uncheck_tender_check.js

@@ -57,7 +57,7 @@ module.exports = options => {
                 if (this.helper.isWap(this.request)) {
                     this.redirect('/wap/subproj');
                 } else {
-                    err === '您无权查看该内容' ? this.redirect(this.request.headers.referer) : this.redirect(`/sp/${ctx.subProject.id}/list`);
+                    err === '您无权查看该内容' ? this.redirect(this.request.headers.referer) : this.redirect(`/sp/${this.subProject.id}/list`);
                 }
             }
         }

+ 7 - 7
app/public/js/budget_compare.js

@@ -131,6 +131,13 @@ $(document).ready(() => {
             $('#compare-set').modal('hide');
             Cookies.set(comparePhaseKey, phase1 + ',' + phase2);
         },
+        reCalcColVisible() {
+            const type = this.compareType;
+            spreadSetting.cols.forEach(x => {
+                if (!x.bc_type) return;
+                x.visible = x.bc_type === type && x.defaultVisible;
+            });
+        },
         curFinalId() {
             return this.finalInfo ? this.finalInfo.id : undefined;
         },
@@ -325,13 +332,6 @@ $(document).ready(() => {
             const colIndex = spreadSetting.cols.findIndex(x => { return x.field === 'stackedBar'});
             SpreadJsObj.reloadColData(compareSheet, colIndex);
         },
-        reCalcColVisible() {
-            const type = this.compareType;
-            spreadSetting.cols.forEach(x => {
-                if (!x.bc_type) return;
-                x.visible = x.bc_type === type && x.defaultVisible;
-            });
-        },
         setCompareType(type) {
             this.compareType = type || 'number';
             $('[name=showType]').removeClass('active');

+ 1 - 1
app/service/stage_bills.js

@@ -457,7 +457,7 @@ module.exports = app => {
         }
 
         async getSumTotalPrice(stage) {
-            const sql = 'SELECT Sum(`contract_tp`) As `contract_tp`, Sum(`qc_tp`) As `qc_tp`, Sum(`positive_qc_tp`) As positive_qc_tp, Sum(`negative_qc_tp`) As negative_qc_tp FROM ' + this.departTableName(stage.tid) + ' As Bills ' +
+            const sql = 'SELECT Sum(`contract_tp`) As `contract_tp`, Sum(`qc_tp`) As `qc_tp`, Sum(`positive_qc_tp`) As positive_qc_tp, Sum(`negative_qc_tp`) As negative_qc_tp, Sum(`contract_pc_tp`) As contract_qc_tp, Sum(`qc_pc_tp`) As qc_pc_tp FROM ' + this.departTableName(stage.tid) + ' As Bills ' +
                 '  INNER JOIN ( ' +
                 '    SELECT MAX(`times` * ' + timesLen + ' + `order`) As `flow`, `lid`, `sid` From ' + this.departTableName(stage.tid) +
                 '      WHERE (`times` < ? OR (`times` = ? AND `order` <= ?)) AND `sid` = ?' +