|
@@ -213,8 +213,7 @@ module.exports = app => {
|
|
|
});
|
|
|
// 本期一些必要数据(如应耗数量和上期调差金额)插入到material_bills_history表里
|
|
|
const materialBillsData = await this.ctx.service.materialBills.getAllDataByCondition({ where: { tid: this.ctx.tender.id } });
|
|
|
- const materialExponentData = await this.ctx.service.materialExponent.getAllDataByCondition({ where: { tid: this.ctx.tender.id } });
|
|
|
- if (materialBillsData.length === 0 && materialExponentData.length === 0) {
|
|
|
+ if (materialBillsData.length === 0 && this.ctx.material.ex_expr === null) {
|
|
|
throw '请至少使用一种调差方式';
|
|
|
}
|
|
|
const mbhList = [];
|
|
@@ -243,6 +242,7 @@ module.exports = app => {
|
|
|
}
|
|
|
await transaction.insert(this.ctx.service.materialBillsHistory.tableName, mbhList);
|
|
|
|
|
|
+ const materialExponentData = await this.ctx.service.materialExponent.getAllDataByCondition({ where: { tid: this.ctx.tender.id } });
|
|
|
const mehList = [];
|
|
|
for (const me of materialExponentData) {
|
|
|
const newMeh = {
|