ysy 1 year ago
parent
commit
e666aa994b
1 changed files with 10 additions and 3 deletions
  1. 10 3
      src/views/inspectionWork/components/edit.vue

+ 10 - 3
src/views/inspectionWork/components/edit.vue

@@ -191,7 +191,11 @@
 
     <div class="title" v-if="title != '新增'">质检内容</div>
 
-    <el-tabs v-model="tabTaskId" class="tab-box" type="border-card">
+    <el-tabs
+      v-model="tabTaskId"
+      class="tab-box"
+      type="border-card"
+    >
       <el-tab-pane
         v-for="(item, index) in form.categoryParamList"
         :label="item.name"
@@ -342,7 +346,8 @@
           row.accessory = row.accessory || [];
 
           this.form = JSON.parse(JSON.stringify(row));
-          this.tabTaskId = this.form.categoryParamList[0].id;
+          this.tabTaskId =
+            this.form.categoryParamList[0] && this.form.categoryParamList[0].id;
           if (this.form.groupId) {
             this.getUserList({ groupId: this.form.groupId });
           }
@@ -352,7 +357,9 @@
             row.accessory = row.accessory || [];
 
             this.form = res.data;
-            this.tabTaskId = this.form.categoryParamList[0].id;
+            this.tabTaskId =
+              this.form.categoryParamList[0] &&
+              this.form.categoryParamList[0].id;
             if (this.form.groupId) {
               this.getUserList({ groupId: this.form.groupId });
             }