ソースを参照

fix(produce): 修复物料匹配逻辑使用id替代categoryCode

移除新增明细时的id清空,并删除调试日志。
yusheng 1 週間 前
コミット
e2cf094dc0

+ 4 - 6
src/views/produce/components/prenatalExamination/material.vue

@@ -272,7 +272,6 @@
               i.ruleId = this.ruleId;
               i.outputType = this.outputType;
               i.bomCategoryId = this.bomCategoryId;
-              i.id = null;
               return i;
             }
           );
@@ -414,7 +413,7 @@
               if (this.outputType == 1) {
                 // 取值产出清单
                 const outputItem = this.localOutputDetails.find(
-                  (item) => item.categoryCode === row.categoryCode
+                  (item) => item.id === row.id
                 );
 
                 if (outputItem) {
@@ -467,7 +466,7 @@
             formatter: (row) => {
               if (this.outputType == 1) {
                 const outputItem = this.localOutputDetails.find(
-                  (item) => item.categoryCode == row.categoryCode
+                  (item) => item.id == row.id
                 );
 
                 // 查询其他工单sumOutputDetails中已产生的bom标准产出和在制品的累计消耗数量
@@ -840,7 +839,7 @@
 
         data.forEach((newItem) => {
           const index = this.localPickDetails.findIndex(
-            (item) => item.categoryCode === newItem.categoryCode
+            (item) => item.id === newItem.id
           );
           if (index !== -1) {
             // 存在则替换数量
@@ -968,7 +967,7 @@
         if (row.selected) {
           // 判断是否存在
           const index = this.localOutputDetails.findIndex(
-            (item) => item.categoryId === row.categoryId
+            (item) => item.id === row.id
           );
 
           if (index === -1) {
@@ -989,7 +988,6 @@
             // 不存在则添加
             this.localOutputDetails.push({
               ...row,
-              id: null,
               reportQuantity: 0,
               reportQuantityCopy: 0,
               qualifiedQuantity: 0,

+ 1 - 0
src/views/produceOrder/workReport.vue

@@ -1076,6 +1076,7 @@
 
       async footBtn(t) {
         this.workPlanType = '';
+        console.log('t', t);
         // this.operationType = t;
         // 新增判断 *** 出现弹窗的时候不然右边数据消失
         if (['work', 'workStep', 'task'].includes(t)) {