|
|
@@ -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 };
|