From d67b031476d33a4a2d002ed32bc30dac34fc5493 Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期二, 25 二月 2025 15:29:45 +0800 Subject: [PATCH] 导出修改 --- src/views/business/productOrder/index.vue | 23 ++++++----------------- 1 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/views/business/productOrder/index.vue b/src/views/business/productOrder/index.vue index 757f49d..af91337 100644 --- a/src/views/business/productOrder/index.vue +++ b/src/views/business/productOrder/index.vue @@ -865,14 +865,10 @@ }, // 瀵煎嚭璁板綍 downLoad () { - rawAllInsOrderExport({...this.entity, responseType: "blob"}).then(res => { + rawAllInsOrderExport({...this.entity}).then(res => { this.$message.success('瀵煎嚭鎴愬姛') - const blob = new Blob([res],{ type: 'application/octet-stream' }); - const url = URL.createObjectURL(blob); - const link = document.createElement('a'); - link.href = url; - link.download = '濮旀墭妫�娴嬩俊鎭鍑�' + '.xlsx'; - link.click(); + let url = this.javaApi + '/word/' + res.data + this.$download.saveAs(url, '濮旀墭妫�娴嬩俊鎭鍑�.xlsx'); }).catch(err => { console.log('err---', err); }) @@ -984,13 +980,10 @@ let url = ''; if(res.data.type==1){ url = this.javaApi+'/img/'+res.data.fileUrl - file.downloadIamge(url,row.fileName) + this.$download.saveAs(url, row.fileName); }else{ url = this.javaApi+'/word/'+res.data.fileUrl - const link = document.createElement('a'); - link.href = url; - link.download = row.fileName; - link.click(); + this.$download.saveAs(url, row.fileName); } } }).catch(error => { @@ -1002,11 +995,7 @@ let url = row.urlS?row.urlS:row.url; if(url){ url = url.split('.')[0]+'.pdf' - const link = document.createElement('a'); - link.href = this.javaApi + url; - link.target = '_blank'; - document.body.appendChild(link); - link.click(); + this.$download.saveAs(url, this.downLoadInfo.fileName); } }, // 鎾ら攢 -- Gitblit v1.9.3