From 6be6a7f6225da2160e44c2a98192abbc05577294 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期五, 27 十二月 2024 13:28:53 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/cnas' into master
---
src/components/caorui/Department/components/Records/index.vue | 107 ++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 84 insertions(+), 23 deletions(-)
diff --git a/src/components/caorui/Department/components/Records/index.vue b/src/components/caorui/Department/components/Records/index.vue
index 48d5365..84b89f1 100644
--- a/src/components/caorui/Department/components/Records/index.vue
+++ b/src/components/caorui/Department/components/Records/index.vue
@@ -114,10 +114,11 @@
searchVal: undefined
},
superviseColumnData: [
+ // {
+ // label: 'id',
+ // prop: 'id'
+ // },
{
- label: 'id',
- prop: 'id'
- }, {
label: '妫�娴嬩汉鍛�',
prop: 'testerName',
width: 120
@@ -303,39 +304,99 @@
controlDown() {
this.$axios.get(exportSupervisionControlSheet + '?supervisionRecordId=' + this.downloadId, { 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('瀵煎嚭鎴愬姛')
+ }
+ }
})
},
// 澶勭悊鍗曞鍑�
processingDown() {
this.$axios.get(exportSupervisionProcessingSheet + '?supervisionRecordId=' + this.downloadId, { 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();
+ this.outLoading = false
+ const blob = new Blob([res], { type: 'application/msword' });
+ //灏咮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('瀵煎嚭鎴愬姛')
+ }
+ }
})
},
// 鐩戠潱璁板綍瀵煎嚭
supervisoryDown() {
this.$axios.get(exportPersonSupervisionRecord + '?id=' + this.downloadId, { 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