lxf 1 year ago
parent
commit
d35d60a663
1 changed files with 15 additions and 13 deletions
  1. 15 13
      src/views/production/warehouse/putInStorage/add.vue

+ 15 - 13
src/views/production/warehouse/putInStorage/add.vue

@@ -207,20 +207,22 @@ const selectBOM = (item) => {
       return ElMessage("该BOM已添加");
     }
   }
-  if (item.id) {
-    formData.data.inOutStorageBomList.push({
-      bomSpecId: item.id || item.bomSpecId,
-      code: item.code,
-      name: item.name,
-      length: item.length,
-      width: item.width,
-      height: item.height,
-      quantity: undefined,
-      purchaseQuantity: item.purchaseQuantity,
-      arrivalQuantity: item.arrivalQuantity,
-    });
-    ElMessage({ message: "选择完成", type: "success" });
+  let id = item.id;
+  if (formData.data.purchaseId) {
+    id = item.bomSpecId;
   }
+  formData.data.inOutStorageBomList.push({
+    bomSpecId: id,
+    code: item.code,
+    name: item.name,
+    length: item.length,
+    width: item.width,
+    height: item.height,
+    quantity: undefined,
+    purchaseQuantity: item.purchaseQuantity,
+    arrivalQuantity: item.arrivalQuantity,
+  });
+  ElMessage({ message: "选择完成", type: "success" });
 };
 const clickDelete = (index) => {
   formData.data.inOutStorageBomList.splice(index, 1);