002201 1 year ago
parent
commit
0ad92ab37c
1 changed files with 8 additions and 5 deletions
  1. 8 5
      src/views/purchase/transferOrder/add.vue

+ 8 - 5
src/views/purchase/transferOrder/add.vue

@@ -482,15 +482,15 @@
                     :disabled="sonDisable"
                     size="mini"
                     v-model="scope.row.materialCode"
-                    @clear="cleanMx(scope.$index, '物料编码')"
-                    @focus="chooseMaterial(scope.$index)"
+                    @clear="cleanMx(scope.row.$index, '物料编码')"
+                    @focus="chooseMaterial(scope.row.$index)"
                   >
                     <el-button
                       size="mini"
                       :disabled="sonDisable"
                       slot="append"
                       icon="el-icon-more"
-                      @click="chooseMaterial(scope.$index)"
+                      @click="chooseMaterial(scope.row.$index)"
                     ></el-button>
                   </el-input>
                 </el-form-item>
@@ -1685,7 +1685,9 @@ export default {
   computed: {
     showMaterialInfo: {
       get() {
-        return this.materialInfo.filter(({ delFlag }) => delFlag !== "2");
+        return this.materialInfo
+          .map((item, index) => ({ ...item, $index: index }))
+          .filter(({ delFlag }) => delFlag !== "2");
       },
       set() {},
     },
@@ -2014,8 +2016,9 @@ export default {
         customerLogisticName: null,
       };
       this.materialInfo.push(newLine);
+      console.log(this.materialInfo);
     },
-    delLine($index) {
+    delLine(index, { $index }) {
       // this.materialInfo.splice(index, 1);
       this.materialInfo = this.materialInfo.map((item, index) => ({
         ...item,