695593266@qq.com 1 ماه پیش
والد
کامیت
331f53f8aa

+ 5 - 3
src/views/material/BOMmanage/components/routing.vue

@@ -275,9 +275,11 @@
         this.current = row;
         this.showEdit = true;
         this.isBomRoute = true;
-        this.$refs.userEdit.isUpdate = true;
-        this.$refs.userEdit.$refs.form &&
-          this.$refs.userEdit.$refs.form.clearValidate();
+        this.isUpdate = !!(row && row.id);
+        this.$nextTick(() => {
+          this.$refs.userEdit.$refs.form &&
+            this.$refs.userEdit.$refs.form.clearValidate();
+        });
       },
 
       routeReload(routeID) {

+ 9 - 5
src/views/technology/route/components/user-edit.vue

@@ -7,7 +7,7 @@
     :append-to-body="true"
     :close-on-click-modal="false"
     custom-class="ele-dialog-form"
-    :title="isUpdate ? '修改工艺路线' : '添加工艺路线'"
+    :title="innerIsUpdate ? '修改工艺路线' : '添加工艺路线'"
     @update:visible="updateVisible"
     :maxable="true"
   >
@@ -36,7 +36,7 @@
               v-model="form.factoryId"
               placeholder="请选择"
               filterable
-              :disabled="isUpdate"
+              :disabled="innerIsUpdate"
             >
               <el-option
                 v-for="item in fList"
@@ -79,7 +79,7 @@
           </el-form-item>
         </el-col>
 
-        <el-col :span="8" v-if="isUpdate">
+        <el-col :span="8" v-if="innerIsUpdate">
           <el-form-item label="版本是否升级:" prop="versionUpgradeType">
             <el-select v-model="form.versionUpgradeType" placeholder="请选择">
               <el-option label="不升级" :value="0" />
@@ -117,7 +117,7 @@
     </el-form>
 
     <user-taskinstance
-      :isEdit="isUpdate"
+      :isEdit="innerIsUpdate"
       ref="taskRef"
       :taskInfo="form"
       @taskList="taskList"
@@ -165,6 +165,7 @@
       };
       return {
         defaultForm,
+        innerIsUpdate: this.isUpdate,
         fList: [], //仓库列表
 
         // 表单数据
@@ -218,7 +219,7 @@
 
     computed: {
       statusTitle() {
-        return this.isUpdate ? '修改' : '保存';
+        return this.innerIsUpdate ? '修改' : '保存';
       },
       // 是否开启响应式布局
       styleResponsive() {
@@ -344,6 +345,9 @@
     },
 
     watch: {
+      isUpdate(val) {
+        this.innerIsUpdate = val;
+      },
       async visible(visible) {
         if (visible) {
           this.getVersionList();

+ 2 - 2
src/views/technology/route/index.vue

@@ -409,9 +409,9 @@
         this.current = row;
         this.showEdit = true;
         if (row?.id) {
-          this.$refs.userEdit.isUpdate = true;
+          this.$refs.userEdit.innerIsUpdate = true;
         } else {
-          this.$refs.userEdit.isUpdate = false;
+          this.$refs.userEdit.innerIsUpdate = false;
         }
 
         this.$refs.userEdit.$refs.form &&