liqianyi преди 2 години
родител
ревизия
0abf1b3316
променени са 1 файла, в които са добавени 4 реда и са изтрити 13 реда
  1. 4 13
      src/views/modules/tech/product-add-or-update.vue

+ 4 - 13
src/views/modules/tech/product-add-or-update.vue

@@ -375,13 +375,8 @@ export default {
         })
       },
       addMaterialItem (item) {
-        this.materialList.push({
-          materialId: item.materialId,
-          materialName: item.materialName,
-          specifications: item.specifications,
-          cnt: 0,
-          unitName: item.unitName,
-          notes: item.notes
+        this.materialList.push({...item,
+          cnt: 0
         })
       },
       validateField (type) {
@@ -398,9 +393,7 @@ export default {
             if (this.dataForm.isCompose === '1' && this.productDetails.length > 0) {
               this.productDetails.forEach((item) => {
                 this.dataForm.composeProductMaterialList.push({
-                  cnt: item.cnt,
-                  materialId: item.productId,
-                  notes: item.notes
+                  ...item
                 })
               })
             }
@@ -409,9 +402,7 @@ export default {
             if (this.materialList.length > 0) {
               this.materialList.forEach((item) => {
                 this.dataForm.productMaterialList.push({
-                  cnt: item.cnt,
-                  materialId: item.materialId,
-                  notes: item.notes
+                  ...item
                 })
               })
             }