|
@@ -111,9 +111,10 @@ module.exports = app => {
|
|
|
|
|
|
// 批量添加工料时同步生成
|
|
|
async adds(transaction, billsList, remark = null, ms_id = null) {
|
|
|
- const insertList = [];
|
|
|
+ // 这里有坑!必须按独立期分开入库才行,不然会出现第二期之后msg_tp的数据无法入库的情况,奇怪的bug
|
|
|
for (const sid of this.ctx.material.stage_id.split(',')) {
|
|
|
const msInfo = await transaction.get(this.ctx.service.materialStage.tableName, { tid: this.ctx.tender.id, sid });
|
|
|
+ const insertList = [];
|
|
|
for (const b of billsList) {
|
|
|
const insertData = {
|
|
|
tid: this.ctx.tender.id,
|
|
@@ -134,8 +135,9 @@ module.exports = app => {
|
|
|
}
|
|
|
insertList.push(insertData);
|
|
|
}
|
|
|
+ if (insertList.length > 0) await transaction.insert(this.tableName, insertList);
|
|
|
}
|
|
|
- if (insertList.length > 0) await transaction.insert(this.tableName, insertList);
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
async updateByExport(transaction, bills, datas, includeSpec, ms_id) {
|