فهرست منبع

审批记录表格刷新bug,mainDvpId获取bug,data为null报错

wumingxin 10 ماه پیش
والد
کامیت
68e731b60b

+ 4 - 0
src/App.vue

@@ -289,11 +289,13 @@ export default {
       // 拿到跳转页面的URL相关信息
       let _from = getUrlParam("from");
       let backUrl = utils.getUrlKey('back');
+      let _mainDvpId = getUrlParam("mainDvpId");
       let _realLifeState = getUrlParam("realLifeState");
       let _departmentId = getUrlParam("departmentId");
       this.$router.push(
         this.stepsList[currentStepForPage].path +
         "?dvpId=" + dvpId +
+        "&mainDvpId=" + _mainDvpId +
         "&realLifeState=" + _realLifeState +
         "&departmentId=" + _departmentId +
         "&from=" + _from +
@@ -320,10 +322,12 @@ export default {
         let dvpId = getUrlParam("dvpId");
         let _realLifeState = getUrlParam("realLifeState");
         let _departmentId = getUrlParam("departmentId");
+        let _mainDvpId = getUrlParam("mainDvpId");
         let _from = getUrlParam("from");
         let backUrl = utils.getUrlKey('back');
         this.$router.push(
           stepList.path + "?dvpId=" + dvpId +
+          "&mainDvpId=" + _mainDvpId +
           "&realLifeState=" + _realLifeState +
           "&departmentId=" + _departmentId +
           "&from=" + _from +

+ 16 - 8
src/views/componentsDVP/baseInfo/approvalRecord/index.vue

@@ -130,14 +130,22 @@ export default {
       };
       this.loading = true;
       await this.$api.getApprovalRecordList(data).then((response) => {
-            this.loading = false;
-            if (response.flag) {
-              this.approvalRecordData = response.data.data;
-            } else {
-              this.approvalRecordData = [];
-              this.pagination.total = 0;
-            }
-          });
+        this.loading = false;
+        if (response.flag) {
+          if (response.data && response.data.data) {
+            this.approvalRecordData = response.data.data;
+          } else {
+            this.approvalRecordData = [];
+            this.pagination.total = 0;
+          }
+        } else {
+          this.approvalRecordData = [];
+          this.pagination.total = 0;
+        }
+      })
+      .finally(() => {
+        this.loading = false;
+      })
     }
   },
   mounted() {

+ 15 - 8
src/views/fullVehicle/baseInfo/approvalRecord/index.vue

@@ -130,14 +130,21 @@ export default {
       };
       this.loading = true;
       await this.$api.getApprovalRecordList(data).then((response) => {
-            this.loading = false;
-            if (response.flag) {
-              this.approvalRecordData = response.data.data;
-            } else {
-              this.approvalRecordData = [];
-              this.pagination.total = 0;
-            }
-          });
+        if (response.flag) {
+          if (response.data && response.data.data) {
+            this.approvalRecordData = response.data.data;
+          } else {
+            this.approvalRecordData = [];
+            this.pagination.total = 0;
+          }
+        } else {
+          this.approvalRecordData = [];
+          this.pagination.total = 0;
+        }
+      })
+      .finally(() => {
+        this.loading = false;
+      });
     }
   },
   mounted() {

+ 15 - 8
src/views/systemDVP/baseInfo/approvalRecord/index.vue

@@ -129,14 +129,21 @@ export default {
       };
       this.loading = true;
       await this.$api.getApprovalRecordList(data).then((response) => {
-            this.loading = false;
-            if (response.flag) {
-              this.approvalRecordData = response.data.data;
-            } else {
-              this.approvalRecordData = [];
-              this.pagination.total = 0;
-            }
-          });
+        if (response.flag) {
+          if (response.data && response.data.data) {
+            this.approvalRecordData = response.data.data;
+          } else {
+            this.approvalRecordData = [];
+            this.pagination.total = 0;
+          }
+        } else {
+          this.approvalRecordData = [];
+          this.pagination.total = 0;
+        }
+      })
+      .finally(() => {
+        this.loading = false;
+      })
     }
   },
   mounted() {

+ 16 - 12
src/views/systemDVP/baseInfo/logManagent/index.vue

@@ -1,19 +1,19 @@
 <template>
-  <a-card class="backCard">
-    <div class="pad12">
+  <a-card class="back-card">
+    <div class="pad-12">
       <a-table
-        size="small"
+        :columns="loginManagentColumns"
+        :dataSource="loginManagentData"
+        :loading="loading"
         :pagination="pagination"
         :rowKey="
           (record, index) => {
             return index;
           }"
+        :scroll="{ x: 1520 }"
         bordered
-        :columns="loginManagentColumns"
-        :dataSource="loginManagentData"
+        size="small"
         @change="handleOuterTableChange"
-        :loading="loading"
-        :scroll="{ x: 1520 }"
       >
         <template slot="sortNumber" slot-scope="text, row, index"
           >{{ (pagination.pageNo - 1) * pagination.pageSize + 1 + index }}
@@ -123,10 +123,14 @@ export default {
       this.$api.systemInitDvpLogManage(data).then(res => {
           if (!res.flag) {
             this.$notification.error({ message: res.message });
+          } else {
+            _this.loginManagentData = res.data.data || [];
+            _this.pagination.total = res.data.total !== null && res.data.total !== undefined ? res.data.total : 0;
+            _this.each(_this.loginManagentData);
           }
-          _this.loginManagentData = res.data.data || [];
-          _this.pagination.total = res.data.data.total || 0;
-          _this.each(_this.loginManagentData);
+        })
+        .catch(error => {
+          console.error("Error occurred: " + error);
         })
         .finally(() => {
           _this.loading = false;
@@ -174,11 +178,11 @@ export default {
 </script>
 
 <style lang="less" scoped>
-.backCard {
+.back-card {
   border: hidden;
   border-radius: 0px;
 }
-.pad12 {
+.pad-12 {
   padding: 12px 0;
 }
 </style>