yusheng 6 месяцев назад
Родитель
Сommit
20c3bfc547

+ 9 - 1
src/views/unqualifiedProduct/unqualifiedList/reasonType/components/edit.vue

@@ -18,7 +18,12 @@
       <el-row>
         <el-col :span="24">
           <el-form-item label="原因类型代码:" prop="code">
-            <el-input clearable v-model="form.code" placeholder="请输入"  disabled />
+            <el-input
+              clearable
+              v-model="form.code"
+              placeholder="请输入"
+              disabled
+            />
           </el-form-item>
         </el-col>
         <el-col :span="24">
@@ -93,6 +98,9 @@
     methods: {
       async open(row, type) {
         this.visible = true;
+        this.$nextTick(() => {
+          this.$refs.form.resetFields();
+        });
         this.type = type;
         this.title = type == 'add' ? '新增' : type == 'edit' ? '修改' : '详情';
         if (type !== 'add') {

+ 3 - 1
src/views/unqualifiedProduct/unqualifiedList/unqualifiedName/components/edit.vue

@@ -126,7 +126,9 @@
     methods: {
       async open(row, type) {
         this.visible = true;
-
+        this.$nextTick(() => {
+          this.$refs.form.resetFields();
+        });
         this.type = type;
         this.title = type == 'add' ? '新增' : type == 'edit' ? '修改' : '详情';
         if (type !== 'add') {

+ 5 - 5
src/views/unqualifiedProduct/unqualifiedList/unqualifiedType/components/edit.vue

@@ -13,7 +13,7 @@
       label-width="120px"
       class="el-form-box"
       :disabled="title == '详情'"
-     @close="cancel"
+      @close="cancel"
     >
       <el-row>
         <el-col :span="24">
@@ -80,9 +80,7 @@
         loading: false,
         title: '',
         rules: {
-          name: [
-            { required: true, message: '名称不能为空', trigger: 'change' }
-          ],
+          name: [{ required: true, message: '名称不能为空', trigger: 'change' }]
           // code: [{ required: true, message: '代码不能为空', trigger: 'change' }]
         },
         type: ''
@@ -94,7 +92,9 @@
     methods: {
       async open(row, type) {
         this.visible = true;
-
+        this.$nextTick(() =>{
+          this.$refs.form.resetFields()
+        });
         this.type = type;
         this.title = type == 'add' ? '新增' : type == 'edit' ? '修改' : '详情';
         if (type !== 'add') {