From e4bb381c896015c4b87faa002ba6875c06a2fd16 Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期四, 26 十二月 2024 14:33:10 +0800 Subject: [PATCH] 同步检测中心cnas修改 --- src/components/caorui/Department/components/Plan/index.vue | 49 ++++++++++++++++++++++++++++++++++++------------- 1 files changed, 36 insertions(+), 13 deletions(-) diff --git a/src/components/caorui/Department/components/Plan/index.vue b/src/components/caorui/Department/components/Plan/index.vue index 560a949..d593a63 100644 --- a/src/components/caorui/Department/components/Plan/index.vue +++ b/src/components/caorui/Department/components/Plan/index.vue @@ -92,7 +92,7 @@ return { planId: undefined, yearForm: { - organizationPerson: undefined, + organizationPerson: undefined, }, yearTableData: [], // 骞磋〃 yearPage: { @@ -107,7 +107,7 @@ minWidth: '150px' }, { label: '缂栧埗浜�', - prop: 'organizationPerson', + prop: 'organizationPersonName', minWidth: '100' }, { label: '缂栧埗鏃ユ湡', @@ -117,14 +117,17 @@ label: '鎵瑰噯浜�', prop: 'approvalName', minWidth: '100' - }, { + }, + { label: '鎵瑰噯鏃ユ湡', prop: 'approvalDate', minWidth: '160' - }, { - label: '瀹℃牳浜�', - prop: 'examine' - }, { + }, + // { + // label: '瀹℃牳浜�', + // prop: 'examine' + // }, + { dataType: 'tag', label: '鎵瑰噯鐘舵��', prop: 'approvalStatus', @@ -411,13 +414,33 @@ downLoadPost(row) { this.$axios.get(exportSuperVisePlanApi + '?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 = row.fileName + '.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 = row.fileName + '.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 = row.fileName + '.docx'; + link.click(); + this.$message.success('瀵煎嚭鎴愬姛') + } + } }) }, async approvalYearPlanFun(approvalStatus, rowId) { -- Gitblit v1.9.3