From 12dbf5d12244d1db1109ac291165c6927a5a220c Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Sat, 30 Mar 2024 16:57:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E4=B8=8B=E8=BD=BD=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/smartImport/cpts/createdTask.vue | 42 ++++++++++++------- src/views/modules/portrayal/jumin/index.vue | 1 - 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/src/views/modules/base/smartImport/cpts/createdTask.vue b/src/views/modules/base/smartImport/cpts/createdTask.vue index 87f8f217f..4169783a0 100644 --- a/src/views/modules/base/smartImport/cpts/createdTask.vue +++ b/src/views/modules/base/smartImport/cpts/createdTask.vue @@ -429,28 +429,40 @@ export default { data: params, }) .then((res) => { - if (res.status==200) { + // if (res.status==200) { // let fileName = window.decodeURI( // res.headers["content-disposition"] // .split(";")[1] // .split("=")[1] // ); - let fileName = `${ + // let fileName = `${ + // this.$store.state.user.agencyName + this.categoryName + // }导入模板`; + // let blob = new Blob([res.data], { + // type: "application/vnd.ms-excel", + // }); + // var url = window.URL.createObjectURL(blob); + // var aLink = document.createElement("a"); + // aLink.style.display = "none"; + // aLink.href = url; + // aLink.setAttribute("download", fileName); + // document.body.appendChild(aLink); + // aLink.click(); + // document.body.removeChild(aLink); //下载完成移除元素 + // window.URL.revokeObjectURL(url); //释放掉blob对象 + // } else this.$message.error("下载失败"); + let fileName = `${ this.$store.state.user.agencyName + this.categoryName }导入模板`; - let blob = new Blob([res.data], { - type: "application/vnd.ms-excel", - }); - var url = window.URL.createObjectURL(blob); - var aLink = document.createElement("a"); - aLink.style.display = "none"; - aLink.href = url; - aLink.setAttribute("download", fileName); - document.body.appendChild(aLink); - aLink.click(); - document.body.removeChild(aLink); //下载完成移除元素 - window.URL.revokeObjectURL(url); //释放掉blob对象 - } else this.$message.error("下载失败"); + const url = res.data.data; + const aLink = document.createElement("a"); + aLink.style.display = "none"; + aLink.href = url; + aLink.setAttribute("download",`${fileName}.xlsx`); + document.body.appendChild(aLink); + aLink.click(); + document.body.removeChild(aLink); + window.URL.revokeObjectURL(url); }) .catch((err) => { console.log(err); diff --git a/src/views/modules/portrayal/jumin/index.vue b/src/views/modules/portrayal/jumin/index.vue index 0b8160a94..ebecc80fb 100644 --- a/src/views/modules/portrayal/jumin/index.vue +++ b/src/views/modules/portrayal/jumin/index.vue @@ -1206,7 +1206,6 @@ export default { if(keysWithValueOneName[i] === this.originalExpandList[k].title){ for(let c in this.menuList){ if(this.menuList[c].name === keysWithValueOneName[i] || this.menuList[c].name === '基本信息' || this.menuList[c].name === '拓展信息' || this.menuList[c].name === '居住信息' ){ - console.log(this.menuList[c]); if(this.menuList.findIndex(item=>item.name === keysWithValueOneName[i]) === -1){ this.menuList.push(this.menuList[c]) }