|
@@ -277,6 +277,9 @@ module.exports = app => {
|
|
|
}
|
|
}
|
|
|
this.ctx.service.calcTmpl.calcByTemplate(ln, ln, ln, stage.calcTemplate.calc_expr);
|
|
this.ctx.service.calcTmpl.calcByTemplate(ln, ln, ln, stage.calcTemplate.calc_expr);
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ for (const prop of costFields.sumFields) {
|
|
|
|
|
+ ln[prop] = 0;
|
|
|
|
|
+ }
|
|
|
for (const [i, d] of node.detail.entries()) {
|
|
for (const [i, d] of node.detail.entries()) {
|
|
|
const ld = {
|
|
const ld = {
|
|
|
id: this.uuid.v4(), tender_id: stage.tid, stage_id: stage.id,
|
|
id: this.uuid.v4(), tender_id: stage.tid, stage_id: stage.id,
|
|
@@ -295,11 +298,12 @@ module.exports = app => {
|
|
|
ld[prop] = preDetailSource ? preDetailSource[prop] || 0 : 0;
|
|
ld[prop] = preDetailSource ? preDetailSource[prop] || 0 : 0;
|
|
|
}
|
|
}
|
|
|
this.ctx.service.calcTmpl.calcByTemplate(ld, ld, ld, stage.calcTemplate.calc_expr);
|
|
this.ctx.service.calcTmpl.calcByTemplate(ld, ld, ld, stage.calcTemplate.calc_expr);
|
|
|
- for (const prop of costFields.selfCalcFields) {
|
|
|
|
|
|
|
+ for (const prop of costFields.sumFields) {
|
|
|
ln[prop] = this.ctx.helper.add(ln[prop], ld[prop]);
|
|
ln[prop] = this.ctx.helper.add(ln[prop], ld[prop]);
|
|
|
}
|
|
}
|
|
|
insertDetailData.push(ld);
|
|
insertDetailData.push(ld);
|
|
|
}
|
|
}
|
|
|
|
|
+ this.ctx.service.calcTmpl.calcByTemplate(ln, ln, ln, stage.calcTemplate.calc_expr);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|