From 2f351dbd681274d17e3c58a6a69b6f7dcc907a44 Mon Sep 17 00:00:00 2001 From: aixianling Date: Tue, 5 Jul 2022 15:23:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=A1=E7=94=A8=E6=8A=A5=E5=91=8A=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xiushan/components/enterpriseDialog.vue | 20 ++++++++++++++++++- .../xiushan/components/personCreditReport.vue | 20 ++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/project/xiushan/components/enterpriseDialog.vue b/project/xiushan/components/enterpriseDialog.vue index ef6c67f3..8892c58d 100644 --- a/project/xiushan/components/enterpriseDialog.vue +++ b/project/xiushan/components/enterpriseDialog.vue @@ -5,7 +5,7 @@

- 下载报告 + 下载报告

{ + this.instance.post("/appcreditreport/downloadCreditReport", null, { + params: {id, type: 1} + }).then(res => { + if (res?.data) { + const link = document.createElement('a') + link.style.display = 'none' + link.href = res.data + link.setAttribute('download', this.info.name + '信用报告.pdf') + document.body.appendChild(link) + link.click() + document.body.removeChild(link) + } + }) + }).catch(() => 0) + } }, props: { diff --git a/project/xiushan/components/personCreditReport.vue b/project/xiushan/components/personCreditReport.vue index b65f8f34..06ee4d2d 100644 --- a/project/xiushan/components/personCreditReport.vue +++ b/project/xiushan/components/personCreditReport.vue @@ -14,7 +14,7 @@ - 下载报告 + 下载报告
@@ -115,6 +115,24 @@ export default { this.info = res.data } }) + }, + handleDownload(id) { + this.$confirm("是否要下载报告?").then(() => { + this.instance.post("/appcreditreport/downloadCreditReport", null, { + params: {id, type: 0} + }).then(res => { + if (res?.data) { + const link = document.createElement('a') + link.style.display = 'none' + link.href = res.data + link.setAttribute('download', this.info.name + '信用报告.pdf') + document.body.appendChild(link) + link.click() + document.body.removeChild(link) + } + }) + }).catch(() => 0) + } }, props: {