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 () {