瀏覽代碼

代码强壮性修改

chenguo 7 小時之前
父節點
當前提交
8f98c01749
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      src/views/company/companyTrafficLog/index.vue

+ 4 - 3
src/views/company/companyTrafficLog/index.vue

@@ -262,9 +262,10 @@ export default {
       this.single = selection.length !== 1
       this.multiple = !selection.length
     },
-
-    companyNameFormatter(row){
-      return this.formatterCompanyOptions.filter(item => item.dictValue === row.companyId)[0].dictLabel
+    companyNameFormatter(row) {
+      if (!row.companyId) return '';
+      const company = this.formatterCompanyOptions.find(item => item.dictValue === row.companyId);
+      return company ? company.dictLabel : '';
     },
 
     /** 导出按钮操作 */