From b87075597989e9a7de543967d54be4780be27de7 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期三, 19 二月 2025 10:15:51 +0800
Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/tx-lims-before
---
src/components/do/a6-personnel/reward-punishment-record.vue | 43 ++++++++++++++++++++++++++++++++++---------
1 files changed, 34 insertions(+), 9 deletions(-)
diff --git a/src/components/do/a6-personnel/reward-punishment-record.vue b/src/components/do/a6-personnel/reward-punishment-record.vue
index 9bac57a..6e5dbaa 100644
--- a/src/components/do/a6-personnel/reward-punishment-record.vue
+++ b/src/components/do/a6-personnel/reward-punishment-record.vue
@@ -250,15 +250,40 @@
const blob = new Blob([res], {
type: 'application/force-download'
})
- // 鍒涘缓涓�涓秴閾炬帴锛屽皢鏂囦欢娴佽祴杩涘幓锛岀劧鍚庡疄鐜拌繖涓秴閾炬帴鐨勫崟鍑讳簨浠�
- const elink = document.createElement('a')
- elink.download = decodeURI('濂栨儵璁板綍'+'.xlsx')
- elink.style.display = 'none'
- elink.href = URL.createObjectURL(blob)
- document.body.appendChild(elink)
- elink.click();
- URL.revokeObjectURL(elink.href) // 閲婃斁URL 瀵硅薄
- document.body.removeChild(elink)
+ //灏咮lob 瀵硅薄杞崲鎴愬瓧绗︿覆
+ let reader = new FileReader();
+ reader.readAsText(blob, 'utf-8');
+ reader.onload = () => {
+ try {
+ let result = JSON.parse(reader.result);
+ if (result.message) {
+ this.$message.error(result.message);
+ } else {
+ // 鍒涘缓涓�涓秴閾炬帴锛屽皢鏂囦欢娴佽祴杩涘幓锛岀劧鍚庡疄鐜拌繖涓秴閾炬帴鐨勫崟鍑讳簨浠�
+ const elink = document.createElement('a')
+ elink.download = decodeURI('濂栨儵璁板綍'+'.xlsx')
+ elink.style.display = 'none'
+ elink.href = URL.createObjectURL(blob)
+ document.body.appendChild(elink)
+ elink.click();
+ URL.revokeObjectURL(elink.href) // 閲婃斁URL 瀵硅薄
+ document.body.removeChild(elink)
+ this.$message.success('瀵煎嚭鎴愬姛')
+ }
+ } catch (err) {
+ console.log(err);
+ // 鍒涘缓涓�涓秴閾炬帴锛屽皢鏂囦欢娴佽祴杩涘幓锛岀劧鍚庡疄鐜拌繖涓秴閾炬帴鐨勫崟鍑讳簨浠�
+ const elink = document.createElement('a')
+ elink.download = decodeURI('濂栨儵璁板綍'+'.xlsx')
+ elink.style.display = 'none'
+ elink.href = URL.createObjectURL(blob)
+ document.body.appendChild(elink)
+ elink.click();
+ URL.revokeObjectURL(elink.href) // 閲婃斁URL 瀵硅薄
+ document.body.removeChild(elink)
+ this.$message.success('瀵煎嚭鎴愬姛')
+ }
+ }
})
},
// 鑾峰彇璐熻矗浜轰俊鎭帴鍙�
--
Gitblit v1.9.3