|
@@ -437,9 +437,14 @@ module.exports = app => {
|
|
|
|
|
|
const posStage = await this.getLastestStageData2(b.tender_id, this.ctx.stage.id, {lid: b.id});
|
|
|
let contract_qty = 0;
|
|
|
+ const newPosRange = data.filter(x => {return x.lid = b.id});
|
|
|
+ for (const nps of newPosRange) {
|
|
|
+ contract_qty = this.ctx.helper.add(contract_qty, nps.contract_qty);
|
|
|
+ }
|
|
|
for (const ps of posStage) {
|
|
|
const nps = this._.find(datas, {pid: ps.pid});
|
|
|
- contract_qty = this.ctx.helper.add(contract_qty, nps ? nps.contract_qty : ps.contract_qty);
|
|
|
+ if (nps) continue;
|
|
|
+ contract_qty = this.ctx.helper.add(contract_qty, ps.contract_qty);
|
|
|
}
|
|
|
if (stageBills && stageBills.times === this.ctx.stage.curTimes && stageBills.order === this.ctx.stage.curOrder) {
|
|
|
if (contract_qty === stageBills.contract_qty) continue;
|