|
@@ -198,8 +198,14 @@ module.exports = app => {
|
|
|
|
|
|
// 本期一些必要数据(如应耗数量和上期调差金额)插入到material_bills_history表里
|
|
|
const materialBillsData = await this.ctx.service.materialBills.getAllDataByCondition({ where: { tid: this.ctx.tender.id } });
|
|
|
+ if (materialBillsData.length === 0) {
|
|
|
+ throw '调差工料不能为空';
|
|
|
+ }
|
|
|
const mbhList = [];
|
|
|
for (const mb of materialBillsData) {
|
|
|
+ if (mb.code === '') {
|
|
|
+ throw '调差工料编号不能为空';
|
|
|
+ }
|
|
|
const newMbh = {
|
|
|
tid: this.ctx.tender.id,
|
|
|
mid: this.ctx.material.id,
|