zh 2 роки тому
батько
коміт
d7c75cb6ef
1 змінених файлів з 22 додано та 18 видалено
  1. 22 18
      src/components/LogisticsTabs/index.vue

+ 22 - 18
src/components/LogisticsTabs/index.vue

@@ -146,7 +146,7 @@
         </el-row>
       </el-form>
 
-      <zj-table :is-drop="true" :columns="installInfo" :table-data=" installDetail && installDetail.logs" />
+      <zj-table :is-drop="true" :columns="installInfo" :table-data=" (installDetail && installDetail.logs)|| []" />
     </el-card>
     <el-card v-if="curTarget === 5 && tabsList[curTarget - 1].show">
       <div slot="header">
@@ -901,25 +901,29 @@ export default {
       })
     },
     getListInstallCodeV2() {
-      getListInstallCodeV2({
-        pageNum: 1,
-        pageSize: -1,
-        params: [
-          {
-            param: 'gong_dan_id',
-            compare: '=',
-            value: this.gongDanId
-          }
-        ]
-      }).then(res => {
-        this.instalLList = res.data.records
-      })
+      if (this.gongDanId) {
+        getListInstallCodeV2({
+          pageNum: 1,
+          pageSize: -1,
+          params: [
+            {
+              param: 'gong_dan_id',
+              compare: '=',
+              value: this.gongDanId
+            }
+          ]
+        }).then(res => {
+          this.instalLList = res.data.records
+        })
+      }
     },
     getInstalDetail() {
-      getInstalDetail({ gongDanId: this.gongDanId }).then(res => {
-        this.installDetail = res.data || {}
-        this.installDetail.logs = this.installDetail.logs.sort((a, b) => b.id - a.id)
-      })
+      if (this.gongDanId) {
+        getInstalDetail({ gongDanId: this.gongDanId }).then(res => {
+          this.installDetail = res.data || {}
+          this.installDetail.logs = this.installDetail.logs.sort((a, b) => b.id - a.id)
+        })
+      }
     },
     copy() {
       const clipboard = new Clipboard('.tag-read')