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/training-record.vue | 43 ++++++++++++++++++++++++++++++++-----------
1 files changed, 32 insertions(+), 11 deletions(-)
diff --git a/src/components/do/a6-personnel/training-record.vue b/src/components/do/a6-personnel/training-record.vue
index 21ad553..cfc5c2f 100644
--- a/src/components/do/a6-personnel/training-record.vue
+++ b/src/components/do/a6-personnel/training-record.vue
@@ -164,10 +164,12 @@
}, {
label: '鍩硅鍐呭',
prop: 'trainingContent'
- }, {
- label: '鍩硅璇炬椂',
- prop: 'educationBackground'
- }, {
+ },
+ // {
+ // label: '鍩硅璇炬椂',
+ // prop: 'educationBackground'
+ // },
+ {
label: '璇炬椂',
prop: 'classHour'
}, {
@@ -197,13 +199,32 @@
const name = this.isDepartment ? 'departmentId' : 'userId';
this.$axios.get(this.$api.personnel.personTrackRecordExport + `&${name}=` + this.departId, { responseType: 'blob' }).then(res => {
this.outLoading = false;
- this.$message.success('瀵煎嚭鎴愬姛');
- const blob = new Blob([res], { type: 'application/octet-stream' });
- const url = URL.createObjectURL(blob);
- const link = document.createElement('a');
- link.href = url;
- link.download = '鍩硅璁板綍.xlsx';
- 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('瀵煎嚭鎴愬姛')
+ }
+ }
}).catch(err => {
this.outLoading = false;
})
--
Gitblit v1.9.3