Преглед изворни кода

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into dev

yusheng пре 1 месец
родитељ
комит
dad58f2945
1 измењених фајлова са 9 додато и 6 уклоњено
  1. 9 6
      src/views/factoryModel/station/components/edit.vue

+ 9 - 6
src/views/factoryModel/station/components/edit.vue

@@ -470,9 +470,9 @@
     },
     data() {
       return {
-        defaultForm,
         // 表单数据
-        form: defaultForm(),
+        form: defaultForm.call(this),
+        clientEnvironmentId: this.$store.state.user.info.clientEnvironmentId,
 
         factoryList: [],
         workshopPlanList: [],
@@ -660,14 +660,17 @@
 
       async open(type, row) {
         this.type = type;
+        this.form = defaultForm.call(this);
         this.visible = true;
         if (type == 'edit' || type == 'copy') {
           for (const key of Object.keys(this.form)) {
             if (key !== 'extInfo') {
               this.form[key] = row[key];
             } else {
-              for (const el of Object.keys(this.form.extInfo)) {
-                this.form.extInfo[el] = row.extInfo[el];
+              if (row.extInfo) {
+                for (const el of Object.keys(this.form.extInfo)) {
+                  this.form.extInfo[el] = row.extInfo[el];
+                }
               }
             }
           }
@@ -786,7 +789,7 @@
         });
       },
       restForm() {
-        this.form = { ...this.defaultForm() };
+        this.form = { ...defaultForm.call(this) };
         this.$nextTick(() => {
           this.$refs.form.clearValidate();
         });
@@ -927,7 +930,7 @@
               res.tMainFactoryWorkstationOperationAddPOList
             );
           });
-          const baseForm = defaultForm();
+          const baseForm = defaultForm.call(this);
 
           this.form = {
             ...baseForm,