浏览代码

解决页面报错问题

paidaxin666 2 年之前
父节点
当前提交
fd076bee06

+ 3 - 16
imcs-ui/src/views/zuihou/statisticalAnalysis/productInfoStatistics/Index.vue

@@ -147,16 +147,7 @@ export default {
     elDragDialog,
   },
   components: {},
-  // props: {
-  //   loadingId: {
-  //     type: String,
-  //     default: "",
-  //   },
-  //   loadingDate: {
-  //     type: String,
-  //     default: "",
-  //   },
-  // },
+
   data() {
     return {
       tableData: [], // 讲师列表
@@ -164,10 +155,6 @@ export default {
       page: 1, // 当前页码
       limit: 10, // 每页记录数
       searchObj: {}, // 查询条件
-      // operatorPerformanceVisible: false, // 产线人员工时管理
-      //           rowData: {}, // row数据
-      //           tableKey: 0,
-      //           selection: []
     };
   },
   computed: {},
@@ -202,8 +189,8 @@ export default {
         .getProductInfoStatistics(this.page, this.limit, this.searchObj)
         .then((response) => {
           const res = response.data;
-          this.tableData = res.data.records;
-          this.total = res.data.total;
+          this.tableData = (res.data || []).records;
+          this.total = (res.data || []).total;
         });
     },
     // 每页记录数改变,size:回调参数,表示当前选中的“每页条数”

+ 2 - 3
imcs-ui/src/views/zuihou/statisticalAnalysis/productStatistics/Index.vue

@@ -37,7 +37,6 @@
     <el-table
       :key="tableKey"
       ref="table"
-      v-loading="loading"
       :data="tableData"
       border
       fit
@@ -184,8 +183,8 @@ export default {
         .getProductStatistics(this.page, this.limit, this.searchObj)
         .then((response) => {
           const res = response.data;
-          this.tableData = res.data.records;
-          this.total = res.data.total;
+          this.tableData = (res.data || []).records;
+          this.total = (res.data || []).total;
         });
     },
     // 每页记录数改变,size:回调参数,表示当前选中的“每页条数”

+ 2 - 2
imcs-ui/src/views/zuihou/statisticalAnalysis/queryProcedure/Index.vue

@@ -177,8 +177,8 @@ export default {
         .queryProcedure(this.page, this.limit, this.searchObj)
         .then((response) => {
           const res = response.data;
-          this.tableData = res.data.records;
-          this.total = res.data.total;
+          this.tableData = (res.data || []).records;
+          this.total = (res.data || []).total;
         });
     },
     // 每页记录数改变,size:回调参数,表示当前选中的“每页条数”