Pārlūkot izejas kodu

修改分厂临时计划

chencc 1 gadu atpakaļ
vecāks
revīzija
1112e330ae
1 mainītis faili ar 17 papildinājumiem un 30 dzēšanām
  1. 17 30
      src/views/productionPlan/components/factoryAdd/index.vue

+ 17 - 30
src/views/productionPlan/components/factoryAdd/index.vue

@@ -69,9 +69,8 @@
         <headerTitle title="产品信息"> </headerTitle>
 
         <el-row :gutter="24">
-
-          <ele-pro-table ref="tableRef" :columns="columns" row-key="code" :cache-key="`ProductionPlanTable`"
-            :datasource="form.productInfoList" border height="40vh" key="id">
+          <ele-pro-table ref="tableRef"  :columns="columns" row-key="code" :cache-key="`ProductionPlanTable`" :datasource="form.productInfoList"
+            border height="40vh" key="id">
 
 
             <template v-slot:requiredFormingNum="{ row, $index }">
@@ -509,11 +508,8 @@ export default {
         { label: '改型计划', value: '4' },
         { label: '返工返修计划', value: '5' },
       ],
-
-
-
-
       loading: false,
+
       form: {
         timeDimensionPlanType: 3,
         categoryId: '',
@@ -534,6 +530,7 @@ export default {
         requiredFormingNum: '',
         productInfoList: []
       },
+
       disabledList: [],
       bomVersionList: [],
       routingList: [],
@@ -581,10 +578,11 @@ export default {
     },
     open() {
 
-      console.log('this.form', this.form);
-
       this.visible = true;
+      this.initForm();
+      console.log('this.form123', this.form);
 
+     
       //this.clientEnvironmentId 环境判断 宝悦环境
       if (this.clientEnvironmentId == 4) {
         this.getPlanRoutingNew();
@@ -615,9 +613,7 @@ export default {
           }
 
         })
-
-      }
-
+      };
 
       list = list.filter(
         (i) =>
@@ -626,7 +622,7 @@ export default {
           )
       )
         .map((item, index) => {
-          console.log(item, '555555555555');
+
           if (item.productCode) {
             return item;
           } else {
@@ -651,7 +647,6 @@ export default {
       this.form.productInfoList = [];
 
 
-      console.log(list, 'list');
       //  取出在弹窗中选中并且不在表格中的数据
       const result = list.filter(
         (i) =>
@@ -701,11 +696,9 @@ export default {
     handleDeleteItem(index) {
       this.$confirm('确定删除当前数据?', '提示')
         .then(() => {
-
           const newArray = this.form.productInfoList.filter((item, i) => i !== index)
-
+          this.form.productInfoList =newArray
           this.$refs.tableRef.setData(newArray);
-
         })
         .catch(() => { });
 
@@ -718,12 +711,13 @@ export default {
         this.$set(this.form, 'code', code);
       } catch (err) { }
     },
+
     initForm() {
       this.form = {
         timeDimensionPlanType: 3,
         categoryId: '',
         productName: '',
-        planType: 1,
+        planType: '',
         moCount: '', // 模具数量
         blockCount: 0, // 块数
         noWordCount: '',// 无字数量
@@ -738,7 +732,8 @@ export default {
         productInfoList: [],
         requiredFormingNum: ''
       };
-      this.$refs.tableRef.setData([]);
+      // console.log(this.$refs);
+      // this.$refs.tableRef.setData([]);
     },
     changeBomId(row, index) {
 
@@ -766,22 +761,16 @@ export default {
 
         this.$nextTick(() => {
           row.bomVersionList = arr;
-          
-          
-
           this.form.productInfoList[index].bomVersionList = arr;
-
           let arrAll = JSON.parse(JSON.stringify(this.form));
+          this.$set(this, 'form', arrAll);
 
-          this.$set(this,'form',arrAll);
-
-          this.$forceUpdate()
         })
 
-      
+
         // this.$set(this.form.productInfoList[index], 'bomVersionList', arr);
 
-        
+
       })
 
     },
@@ -871,8 +860,6 @@ export default {
       // return
       // , index, e, name
 
-      console.log(row, name, '99999999999');
-
       if (row.specification && this.clientEnvironmentId == 4) {
 
         let modelArr = row.specification.split('*');