695593266@qq.com 10 сар өмнө
parent
commit
961242b71a

+ 17 - 3
src/views/cuttingPlan/components/plan-edit-dialog.vue

@@ -1,6 +1,7 @@
 <template>
   <ele-modal
     :visible.sync="visible"
+    v-if="visible"
     :closed="cancel"
     :title="`${type == 'add' ? '创建' : '编辑'}下料计划`"
     custom-class="ele-dialog-form"
@@ -24,6 +25,7 @@
               placeholder="请选择"
               style="width: 100%"
               :disabled="type == 'detail'"
+              @change="changType"
             >
               <el-option
                 v-for="item in demandTypeList"
@@ -614,10 +616,17 @@
       async open(type, row) {
         this.type = type;
         if (type == 'add') {
-          this.formData.demandType = '';
-          this.formData.name = '';
-          this.formData.remark = '';
+          this.formData = {
+            name: '',
+            remark: '',
+            detailRemoveIds: [],
+            materialRemoveIds: [],
+            orderType: 1,
+            demandType: ''
+          };
         }
+
+        console.log(this.formData, 'this.formData');
         this.visible = true;
         this.formData.orderType = 1;
         if (row) {
@@ -629,6 +638,11 @@
         }
       },
 
+      changType(val) {
+        console.log(val);
+        this.$set(this.formData, 'demandType', val);
+      },
+
       getDetail(id) {
         getById(id).then((res) => {
           this.$set(this.formData, 'demandType', res.demandType);