From 5b381602fc5e37a46c2919a5016031e87f0113f4 Mon Sep 17 00:00:00 2001 From: yunuo970428 <405378304@qq.com> Date: Wed, 8 Jan 2025 11:43:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=B8=93=E9=A1=B9=E8=BF=94?= =?UTF-8?q?=E5=88=A9=E6=A0=B8=E5=AF=B9=E8=AF=A6=E6=83=85=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/specialrebate/specialrebatecheck.js | 10 +++++++ .../specialrebatecheckInfo.vue | 27 ++++++++++++++++++- .../zhuanxiangfanliheduiYiBanInfo.vue | 27 ++++++++++++++++++- 3 files changed, 62 insertions(+), 2 deletions(-) diff --git a/anrui-scm/anrui-scm-ui/src/api/specialrebate/specialrebatecheck.js b/anrui-scm/anrui-scm-ui/src/api/specialrebate/specialrebatecheck.js index a2410ef217..3c07720e9b 100644 --- a/anrui-scm/anrui-scm-ui/src/api/specialrebate/specialrebatecheck.js +++ b/anrui-scm/anrui-scm-ui/src/api/specialrebate/specialrebatecheck.js @@ -98,6 +98,16 @@ export default { method: 'get' }) }, + // 导出 + downloadExcel: function(data) { + return request({ + url: '/scm/v1/scmspecialrebatecheckapply/excelList', + method: 'post', + params: data, + responseType: 'blob', // 表明返回服务器返回的数据类型 + headers: { 'Content-Type': 'application/json' } + }) + }, createPdf: function(data) { return request({ url: '/scm/v1/scmspecialrebatecheckapply/createPdf', diff --git a/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatecheck/specialrebatecheckInfo.vue b/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatecheck/specialrebatecheckInfo.vue index ded4933104..c2d2b5938b 100644 --- a/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatecheck/specialrebatecheckInfo.vue +++ b/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatecheck/specialrebatecheckInfo.vue @@ -7,7 +7,7 @@
{{ viewTitle }}
- 导出 + 导出 下载 关闭
@@ -183,6 +183,31 @@ export default { }) return sums }, + doExport() { + const loading = this.$loading({ + lock: true, + text: 'Loading', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }) + req.downloadExcel({ sid: this.formobj.sid }).then((resp) => { + loading.close() + const blob = new Blob([resp], { + type: 'application/vnd.ms-excel' + }) + const fileName = '专项返利核对明细' + '.xls' + const elink = document.createElement('a') + elink.download = fileName + elink.style.display = 'none' + elink.href = URL.createObjectURL(blob) + document.body.appendChild(elink) + elink.click() + URL.revokeObjectURL(elink.href) + document.body.removeChild(elink) + }).catch(() => { + loading.close() + }) + }, download() { req.createPdf({ specialCheckSid: this.formobj.sid, userName: window.sessionStorage.getItem('name') }).then((resp) => { if (resp.success && resp.data !== '') { diff --git a/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliheduiFlow/zhuanxiangfanliheduiYiBanInfo.vue b/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliheduiFlow/zhuanxiangfanliheduiYiBanInfo.vue index 5871faf99e..6015e4d5f5 100644 --- a/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliheduiFlow/zhuanxiangfanliheduiYiBanInfo.vue +++ b/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliheduiFlow/zhuanxiangfanliheduiYiBanInfo.vue @@ -7,7 +7,7 @@
{{ viewTitle }}
- 导出 + 导出 下载 撤回
@@ -219,6 +219,31 @@ export default { }) return sums }, + doExport() { + const loading = this.$loading({ + lock: true, + text: 'Loading', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }) + req.downloadExcel({ sid: this.formobj.sid }).then((resp) => { + loading.close() + const blob = new Blob([resp], { + type: 'application/vnd.ms-excel' + }) + const fileName = '专项返利核对明细' + '.xls' + const elink = document.createElement('a') + elink.download = fileName + elink.style.display = 'none' + elink.href = URL.createObjectURL(blob) + document.body.appendChild(elink) + elink.click() + URL.revokeObjectURL(elink.href) + document.body.removeChild(elink) + }).catch(() => { + loading.close() + }) + }, download() { req.createPdf({ specialCheckSid: this.formobj.sid, userName: window.sessionStorage.getItem('name') }).then((resp) => { if (resp.success && resp.data !== '') {