|
@@ -563,8 +563,10 @@ module.exports = app => {
|
|
|
const his = await this.ctx.service.sumLoadHistory.saveStageHistory(this.ctx.tender.id, this.ctx.stage.id, lid, tenders, result.errors, cover);
|
|
|
if (updateStageBills.length > 0) await conn.updateRows(this.tableName, updateStageBills);
|
|
|
if (insertStageBills.length > 0) await conn.insert(this.tableName, insertStageBills);
|
|
|
- await conn.delete(this.ctx.service.stageImportChange.tableName, { import_lid: lid, sid: this.ctx.stage.id });
|
|
|
- if (result.qc_detail.length > 0) await conn.insert(this.ctx.service.stageImportChange.tableName, result.qc_detail);
|
|
|
+ if (loadChange) {
|
|
|
+ await conn.delete(this.ctx.service.stageImportChange.tableName, { import_lid: lid, sid: this.ctx.stage.id });
|
|
|
+ if (result.qc_detail.length > 0) await conn.insert(this.ctx.service.stageImportChange.tableName, result.qc_detail);
|
|
|
+ }
|
|
|
await conn.commit();
|
|
|
return { curStageData: result.update, sumLoadHis: his };
|
|
|
} catch (err) {
|