From ec7c5e86cf1a94182650678a763876cf0d71cec2 Mon Sep 17 00:00:00 2001 From: wanggongfeng <1305282856@qq.com> Date: Fri, 10 Jun 2022 15:27:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E6=88=BF=E5=B1=8B=E4=BA=8C?= =?UTF-8?q?=E7=BB=B4=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../personroom/epidemicbuildingunit.vue | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/views/modules/personroom/epidemicbuildingunit.vue b/src/views/modules/personroom/epidemicbuildingunit.vue index ba0f154..fa0520b 100644 --- a/src/views/modules/personroom/epidemicbuildingunit.vue +++ b/src/views/modules/personroom/epidemicbuildingunit.vue @@ -83,7 +83,7 @@ @@ -148,7 +148,8 @@ export default { roomUseArr: [], dataForm: { id: '' - } + }, + uploadUrl: '' } }, components: { @@ -256,11 +257,14 @@ export default { }).catch(() => {}) }, downloadMa (id) { - this.$http.post(`/custom/epidemicbuildingunit/createHouseQrcode`, {id: id}).then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - }).catch(() => {}) + this.$http.post(`/custom/epidemicbuildingunit/createHouseQrcode`, {id: id}, { responseType: 'blob' }).then(res => { + let fileName = '房屋二维码.png' + let objectUrl = URL.createObjectURL(new Blob([res.data])) + const link = document.createElement('a') + link.download = decodeURI(fileName) + link.href = objectUrl + link.click() + }).catch(() => {}) }, // 导出错误数据 exportError () {