Browse Source

修复调差多计量期添加工料bug

ellisran 11 months ago
parent
commit
ca0762f688
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/service/material_stage_bills.js

+ 2 - 2
app/service/material_stage_bills.js

@@ -97,7 +97,7 @@ module.exports = app => {
         // 添加工料时同步生成
         async add(transaction, id, remark = null) {
             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 msInfo = await transaction.get(this.ctx.service.materialStage.tableName, { tid: this.ctx.tender.id, mid: this.ctx.material.id, sid });
                 const insertData = {
                     tid: this.ctx.tender.id,
                     mid: this.ctx.material.id,
@@ -113,7 +113,7 @@ module.exports = app => {
         async adds(transaction, billsList, remark = null, ms_id = null) {
             // 这里有坑!必须按独立期分开入库才行,不然会出现第二期之后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 msInfo = await transaction.get(this.ctx.service.materialStage.tableName, { tid: this.ctx.tender.id, mid: this.ctx.material.id, sid });
                 const insertList = [];
                 for (const b of billsList) {
                     const insertData = {