Просмотр исходного кода

处理流程列表数据请求失败报错导致页面异常问题

lph 1 год назад
Родитель
Сommit
f1ba02e309
1 измененных файлов с 31 добавлено и 18 удалено
  1. 31 18
      zkqy-ui/src/views/bussiness/processMange.vue

+ 31 - 18
zkqy-ui/src/views/bussiness/processMange.vue

@@ -432,8 +432,8 @@ export default {
     // 获取列表数据
     getList() {
       this.loading = true;
-      processList({ ...this.queryParams, taskName: this.queryString }).then(
-        (res) => {
+      processList({ ...this.queryParams, taskName: this.queryString })
+        .then((res) => {
           if (res.code == 200) {
             this.tableData = res.rows.map((item) => item.resultMap);
             this.total = res.total;
@@ -442,8 +442,11 @@ export default {
             this.$message.error("网络异常,请稍后再试");
           }
           this.loading = false;
-        }
-      );
+        })
+        .finally((e) => {
+          console.log(e);
+          this.loading = false;
+        });
     },
     getDoneNumber() {
       let params = {
@@ -452,13 +455,18 @@ export default {
         taskProcessState: "3",
         taskProcessType: 0,
       };
-      processList(params).then((res) => {
-        if (res.code == 200) {
-          this.doneNum = res.total;
-        } else {
-          this.$message.error("网络异常,请稍后再试");
-        }
-      });
+      processList(params)
+        .then((res) => {
+          if (res.code == 200) {
+            this.doneNum = res.total;
+          } else {
+            this.$message.error("网络异常,请稍后再试");
+          }
+        })
+        .finally((e) => {
+          console.log(e);
+          this.loading = false;
+        });
     },
     getDoingNumber() {
       let params = {
@@ -467,13 +475,18 @@ export default {
         taskProcessState: "0",
         taskProcessType: 0,
       };
-      processList(params).then((res) => {
-        if (res.code == 200) {
-          this.doingNum = res.total;
-        } else {
-          this.$message.error("网络异常,请稍后再试");
-        }
-      });
+      processList(params)
+        .then((res) => {
+          if (res.code == 200) {
+            this.doingNum = res.total;
+          } else {
+            this.$message.error("网络异常,请稍后再试");
+          }
+        })
+        .finally((e) => {
+          console.log(e);
+          this.loading = false;
+        });
     },
     // 获取表单数据
     async getFormData() {