MS-CIAZDCOIXVRW\Administrator il y a 3 ans
Parent
commit
db0fbe1417
1 fichiers modifiés avec 122 ajouts et 118 suppressions
  1. 122 118
      src/components/Home/index.vue

+ 122 - 118
src/components/Home/index.vue

@@ -926,131 +926,135 @@ export default {
     },
 
     // 下载按钮回调
-    async handleDownload() {
-      const loading = this.$loading({
-        lock: true,
-        text: "下载中",
-        spinner: "el-icon-loading",
-        background: "rgba(0, 0, 0, 0.7)",
-      });
+    handleDownload() {
+      setTimeout(async () => {
+        const loading = this.$loading({
+          lock: true,
+          text: "下载中",
+          spinner: "el-icon-loading",
+          background: "rgba(0, 0, 0, 0.7)",
+        });
 
-      let res = await this.$axios({
-        url: "/attendance/month/title",
-        method: "get",
-      });
-      // console.log(res);
-      if (res.data.success) {
-        let temList = [
-          "oneOfMonth",
-          "twoOfMonth",
-          "threeOfMonth",
-          "fourOfMonth",
-          "fiveOfMonth",
-          "sixOfMonth",
-          "sevenOfMonth",
-          "eightOfMonth",
-          "nineOfMonth",
-          "tenOfMonth",
-          "elevenOfMonth",
-          "twelveOfMonth",
-          "thirteenOfMonth",
-          "fourteenOfMonth",
-          "fifteenOfMonth",
-          "sixteenOfMonth",
-          "seventeenOfMonth",
-          "eighteenOfMonth",
-          "nineteenOfMonth",
-          "twentyOfMonth",
-          "twentyOneOfMonth",
-          "twentyTwoOfMonth",
-          "twentyThreeOfMonth",
-          "twentyFourOfMonth",
-          "twentyFiveOfMonth",
-          "twentySixOfMonth",
-          "twentySevenOfMonth",
-          "twentyEightOfMonth",
-          "twentyNineOfMonth",
-          "thirtyOfMonth",
-          "thirtyOneOfMonth",
-        ];
-        let temList2 = res.data.data;
-        let size = temList.length;
-        for (let i = 0; i < size; i++) {
-          let a = {};
-          a.column_comment = temList[i];
-          a.column_name = temList2[i];
-          this.TemHeader.push(a);
-        }
-        this.$nextTick(() => {
-          this.exportExcel3();
+        let res = await this.$axios({
+          url: "/attendance/month/title",
+          method: "get",
         });
-      } else {
-        this.$message.error(res.data.message);
-      }
-      loading.close();
+        // console.log(res);
+        if (res.data.success) {
+          let temList = [
+            "oneOfMonth",
+            "twoOfMonth",
+            "threeOfMonth",
+            "fourOfMonth",
+            "fiveOfMonth",
+            "sixOfMonth",
+            "sevenOfMonth",
+            "eightOfMonth",
+            "nineOfMonth",
+            "tenOfMonth",
+            "elevenOfMonth",
+            "twelveOfMonth",
+            "thirteenOfMonth",
+            "fourteenOfMonth",
+            "fifteenOfMonth",
+            "sixteenOfMonth",
+            "seventeenOfMonth",
+            "eighteenOfMonth",
+            "nineteenOfMonth",
+            "twentyOfMonth",
+            "twentyOneOfMonth",
+            "twentyTwoOfMonth",
+            "twentyThreeOfMonth",
+            "twentyFourOfMonth",
+            "twentyFiveOfMonth",
+            "twentySixOfMonth",
+            "twentySevenOfMonth",
+            "twentyEightOfMonth",
+            "twentyNineOfMonth",
+            "thirtyOfMonth",
+            "thirtyOneOfMonth",
+          ];
+          let temList2 = res.data.data;
+          let size = temList.length;
+          for (let i = 0; i < size; i++) {
+            let a = {};
+            a.column_comment = temList[i];
+            a.column_name = temList2[i];
+            this.TemHeader.push(a);
+          }
+          this.$nextTick(() => {
+            this.exportExcel3();
+          });
+        } else {
+          this.$message.error(res.data.message);
+        }
+        loading.close();
+      }, 300);
     },
 
     // 预览按钮回调
-    async handlePreview() {
-      const loading2 = this.$loading({
-        lock: true,
-        text: "加载中",
-        spinner: "el-icon-loading",
-        background: "rgba(0, 0, 0, 0.7)",
-      });
+    handlePreview() {
+      setTimeout(async () => {
+        const loading = this.$loading({
+          lock: true,
+          text: "加载中",
+          spinner: "el-icon-loading",
+          background: "rgba(0, 0, 0, 0.7)",
+        });
 
-      let res = await this.$axios({
-        url: "/attendance/month/title",
-        method: "get",
-      });
-      // console.log(res);
-      if (res.data.success) {
-        let temList = [
-          "oneOfMonth",
-          "twoOfMonth",
-          "threeOfMonth",
-          "fourOfMonth",
-          "fiveOfMonth",
-          "sixOfMonth",
-          "sevenOfMonth",
-          "eightOfMonth",
-          "nineOfMonth",
-          "tenOfMonth",
-          "elevenOfMonth",
-          "twelveOfMonth",
-          "thirteenOfMonth",
-          "fourteenOfMonth",
-          "fifteenOfMonth",
-          "sixteenOfMonth",
-          "seventeenOfMonth",
-          "eighteenOfMonth",
-          "nineteenOfMonth",
-          "twentyOfMonth",
-          "twentyOneOfMonth",
-          "twentyTwoOfMonth",
-          "twentyThreeOfMonth",
-          "twentyFourOfMonth",
-          "twentyFiveOfMonth",
-          "twentySixOfMonth",
-          "twentySevenOfMonth",
-          "twentyEightOfMonth",
-          "twentyNineOfMonth",
-          "thirtyOfMonth",
-          "thirtyOneOfMonth",
-        ];
-        let temList2 = res.data.data;
-        let size = temList.length;
-        for (let i = 0; i < size; i++) {
-          let a = {};
-          a.column_comment = temList[i];
-          a.column_name = temList2[i];
-          this.TemHeader.push(a);
+        let res = await this.$axios({
+          url: "/attendance/month/title",
+          method: "get",
+        });
+        // console.log(res);
+        if (res.data.success) {
+          let temList = [
+            "oneOfMonth",
+            "twoOfMonth",
+            "threeOfMonth",
+            "fourOfMonth",
+            "fiveOfMonth",
+            "sixOfMonth",
+            "sevenOfMonth",
+            "eightOfMonth",
+            "nineOfMonth",
+            "tenOfMonth",
+            "elevenOfMonth",
+            "twelveOfMonth",
+            "thirteenOfMonth",
+            "fourteenOfMonth",
+            "fifteenOfMonth",
+            "sixteenOfMonth",
+            "seventeenOfMonth",
+            "eighteenOfMonth",
+            "nineteenOfMonth",
+            "twentyOfMonth",
+            "twentyOneOfMonth",
+            "twentyTwoOfMonth",
+            "twentyThreeOfMonth",
+            "twentyFourOfMonth",
+            "twentyFiveOfMonth",
+            "twentySixOfMonth",
+            "twentySevenOfMonth",
+            "twentyEightOfMonth",
+            "twentyNineOfMonth",
+            "thirtyOfMonth",
+            "thirtyOneOfMonth",
+          ];
+          let temList2 = res.data.data;
+          let size = temList.length;
+          for (let i = 0; i < size; i++) {
+            let a = {};
+            a.column_comment = temList[i];
+            a.column_name = temList2[i];
+            this.TemHeader.push(a);
+          }
+          this.dialogVisible = true;
+        } else {
+          this.$message.error(res.data.message);
         }
-        this.dialogVisible = true;
-      } else {
-        this.$message.error(res.data.message);
-      }
-      loading2.close();
+        loading.close();
+      }, 300);
     },
 
     // 重新开始按钮回调