From f2dcf52e97f3acd00211ad065550d041c48ab3c5 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期五, 31 五月 2024 11:09:23 +0800
Subject: [PATCH] 修改班次bug

---
 src/components/do/b3-work-time-management/work-time-management.vue |   34 +++++++---------------------------
 1 files changed, 7 insertions(+), 27 deletions(-)

diff --git a/src/components/do/b3-work-time-management/work-time-management.vue b/src/components/do/b3-work-time-management/work-time-management.vue
index 583d07b..0135ba5 100644
--- a/src/components/do/b3-work-time-management/work-time-management.vue
+++ b/src/components/do/b3-work-time-management/work-time-management.vue
@@ -702,35 +702,15 @@
     },
     handleOut(){
       this.outLoading = true
-      this.$axios.post(this.$api.auxiliaryOutputWorkingHours.exportWorkingHours,{responseType: 'blob'}).then(res => {
+      this.$axios.post(this.$api.auxiliaryOutputWorkingHours.exportWorkingHours,{responseType: "blob"}).then(res => {
         this.outLoading = false
         this.$message.success('瀵煎嚭鎴愬姛')
-        // let fileName="鏃ュ伐鏃舵眹鎬昏〃";
-        // const blob = new Blob([res], {
-        //   type: 'application/force-download'
-        // })
-        // const filename = decodeURI(fileName+'.xlsx')
-        // // 鍒涘缓涓�涓秴閾炬帴锛屽皢鏂囦欢娴佽祴杩涘幓锛岀劧鍚庡疄鐜拌繖涓秴閾炬帴鐨勫崟鍑讳簨浠�
-        // const elink = document.createElement('a')
-        // elink.download = filename
-        // elink.style.display = 'none'
-        // elink.href = URL.createObjectURL(blob)
-        // document.body.appendChild(elink)
-        // elink.click()
-        // URL.revokeObjectURL(elink.href) // 閲婃斁URL 瀵硅薄
-        // document.body.removeChild(elink)
-        const blob = new Blob([res], {
-          type: 'application/force-download'
-        })
-        const link = document.createElement('a')
-        link.href = URL.createObjectURL(blob)
-        link.download = decodeURI('鏃ュ伐鏃舵眹鎬昏〃'+'.xlsx')
-        document.body.appendChild(link)
-        link.click()
-        window.setTimeout(function () {
-            URL.revokeObjectURL(blob)
-            document.body.removeChild(link)
-        }, 0)
+        const blob = new Blob([res.data]);
+        const url = URL.createObjectURL(blob);
+        const link = document.createElement('a');
+        link.href = url;
+        link.download = '鏃ュ伐鏃舵眹鎬昏〃.xlsx';
+        link.click();
       })
     },
   }

--
Gitblit v1.9.3