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/personnel-capacity.vue | 34 +++++++++++++++++++++++++++-------
1 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/src/components/do/a6-personnel/personnel-capacity.vue b/src/components/do/a6-personnel/personnel-capacity.vue
index cde9fe9..58c9435 100644
--- a/src/components/do/a6-personnel/personnel-capacity.vue
+++ b/src/components/do/a6-personnel/personnel-capacity.vue
@@ -297,7 +297,7 @@
}
}, {
label: '纭浜�',
- prop: 'confirmOperatingPersonnelId',
+ prop: 'confirmOperatingPersonnelName',
minWidth: '100'
}, {
label: '纭鏃ユ湡',
@@ -394,13 +394,33 @@
downLoadPost(row) {
this.$axios.get(this.$api.personnel.exportPersonnelCapacity + '?id=' + row.id,{responseType: "blob"}).then(res => {
this.outLoading = false
- this.$message.success('瀵煎嚭鎴愬姛')
const blob = new Blob([res],{ type: 'application/msword' });
- const url = URL.createObjectURL(blob);
- const link = document.createElement('a');
- link.href = url;
- link.download = "浜哄憳鑳藉姏瀵煎嚭" + '.docx';
- link.click();
+ //灏咮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 url = URL.createObjectURL(blob);
+ const link = document.createElement('a');
+ link.href = url;
+ link.download = "浜哄憳鑳藉姏瀵煎嚭" + '.docx';
+ link.click();
+ this.$message.success('瀵煎嚭鎴愬姛')
+ }
+ } catch (err) {
+ console.log(err);
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement('a');
+ link.href = url;
+ link.download = "浜哄憳鑳藉姏瀵煎嚭" + '.docx';
+ link.click();
+ this.$message.success('瀵煎嚭鎴愬姛')
+ }
+ }
})
},
// 鏌ヨ
--
Gitblit v1.9.3