Explorar o código

获取本期应付,本期实付调整

MaiXinRong hai 2 días
pai
achega
09122e3018
Modificáronse 1 ficheiros con 6 adicións e 4 borrados
  1. 6 4
      app/service/stage_pay.js

+ 6 - 4
app/service/stage_pay.js

@@ -304,10 +304,12 @@ module.exports = app => {
         async getSpecialTotalPrice(stage) {
             if (!stage) throw '计算数据错误';
             const stagePays = await this.getStagePays(stage);
-            const PayCalculator = require('../lib/pay_calc');
-            const tenderInfo = await this.ctx.service.tenderInfo.getTenderInfo(stage.tid);
-            const payCalculator = new PayCalculator(this.ctx, stage, tenderInfo);
-            await payCalculator.calculateAll(stagePays);
+            if (!stage.readOnly) {
+                const PayCalculator = require('../lib/pay_calc');
+                const tenderInfo = await this.ctx.service.tenderInfo.getTenderInfo(stage.tid);
+                const payCalculator = new PayCalculator(this.ctx, stage, tenderInfo);
+                await payCalculator.calculateAll(stagePays);
+            }
             const yf = this._.find(stagePays, {ptype: payConst.payType.yf});
             const sf = this._.find(stagePays, {ptype: payConst.payType.sf});
             return { yf: yf ? yf.tp : 0, sf: sf ? sf.tp : 0 };