|
@@ -118,21 +118,23 @@ class PayCalculate {
|
|
|
* @param {Array} pays - (标段)合同支付数据
|
|
|
*/
|
|
|
async calculateStartRangePrice (pays) {
|
|
|
- const order = this.stage.curOrder;
|
|
|
+ //const order = this.stage.curOrder;
|
|
|
for (const p of pays) {
|
|
|
// 非本期,本次添加的合同支付项,不允许计算,其中默认添加的合同支付项,归属于第一期原报
|
|
|
- if (p.csorder === this.stage.order || (p.csorder === 0 || this.stage.order === 1)) {
|
|
|
- if (p.csaorder === order) {
|
|
|
- if (!p.sprice && p.sexpr && p.sexpr !== '') {
|
|
|
- p.sprice = this.ctx.helper.round(this._calculateExpr(p.sexpr), this.decimal);
|
|
|
- } else if (p.sprice && !p.sexpr) {
|
|
|
- p.sprice = this.ctx.helper.round(p.sprice, this.decimal);
|
|
|
- }
|
|
|
- if (!p.rprice && p.rexpr && p.rexpr !== '') {
|
|
|
- p.rprice = this.ctx.helper.round(this._calculateExpr(p.rexpr), this.decimal);
|
|
|
- } else if (p.rprice && !p.rexpr) {
|
|
|
- p.rprice = this.ctx.helper.round(p.rprice, this.decimal);
|
|
|
- }
|
|
|
+ // if (p.csorder === this.stage.order || (p.csorder === 0 || this.stage.order === 1)) {
|
|
|
+ // if (p.csaorder === order) {
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ if (!p.pre_used) {
|
|
|
+ if (!p.sprice && p.sexpr && p.sexpr !== '') {
|
|
|
+ p.sprice = this.ctx.helper.round(this._calculateExpr(p.sexpr), this.decimal);
|
|
|
+ } else if (p.sprice && !p.sexpr) {
|
|
|
+ p.sprice = this.ctx.helper.round(p.sprice, this.decimal);
|
|
|
+ }
|
|
|
+ if (!p.rprice && p.rexpr && p.rexpr !== '') {
|
|
|
+ p.rprice = this.ctx.helper.round(this._calculateExpr(p.rexpr), this.decimal);
|
|
|
+ } else if (p.rprice && !p.rexpr) {
|
|
|
+ p.rprice = this.ctx.helper.round(p.rprice, this.decimal);
|
|
|
}
|
|
|
}
|
|
|
}
|