Просмотр исходного кода

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

695593266@qq.com 11 месяцев назад
Родитель
Сommit
0d5dcae8c2
1 измененных файлов с 8 добавлено и 10 удалено
  1. 8 10
      src/views/factoryModel/station/components/edit.vue

+ 8 - 10
src/views/factoryModel/station/components/edit.vue

@@ -392,7 +392,7 @@
   import { getFactoryarea } from '@/api/factoryModel';
 
   import { getteampage, listUserByIds } from '@/api/workforceManagement/team';
-
+  import { getCode } from '@/api/codeManagement/index.js';
   export default {
     components: {
       AreaSelect,
@@ -617,7 +617,7 @@
         this.$forceUpdate();
       },
 
-      open(type, row) {
+      async open(type, row) {
         this.type = type;
         this.visible = true;
         if (type == 'edit' || type == 'copy') {
@@ -630,7 +630,7 @@
               }
             }
           }
-          this.getData(row.id);
+          await this.getData(row.id);
 
           // 请求下拉数据
           if (this.form.extInfo.factoryId) {
@@ -647,9 +647,9 @@
             this.getUserPage();
           }
         }
-        if (this.type == 'copy') {
-            this.form.code = '';
-          }
+        if (this.type != 'edit') {
+          this.form.code = await getCode('station_code');
+        }
         this.getListWorkCenter();
         this.getListProduce();
       },
@@ -845,7 +845,7 @@
       change_productionLineId() {},
       // 请求详情
       getData(id) {
-        getById(id).then((res) => {
+       return getById(id).then((res) => {
           if (
             res.workstationSubstanceList &&
             res.workstationSubstanceList.length > 0
@@ -862,9 +862,7 @@
           if (res.taskList?.length) {
             this.form.taskNames = res.taskList.map((i) => i.name);
           }
-          if (this.type == 'copy') {
-            this.form.code = '';
-          }
+    
         });
       }
     }