diff --git a/anrui-scm/anrui-scm-ui/src/api/bikerebate/bicyclerebatecheck.js b/anrui-scm/anrui-scm-ui/src/api/bikerebate/bicyclerebatecheck.js index cbed3d1db6..b128f5f305 100644 --- a/anrui-scm/anrui-scm-ui/src/api/bikerebate/bicyclerebatecheck.js +++ b/anrui-scm/anrui-scm-ui/src/api/bikerebate/bicyclerebatecheck.js @@ -98,6 +98,16 @@ export default { method: 'get' }) }, + // 导出 + downloadExcel: function(data) { + return request({ + url: '/scm/v1/scmvehrebatecheckapply/excelList', + method: 'post', + params: data, + responseType: 'blob', // 表明返回服务器返回的数据类型 + headers: { 'Content-Type': 'application/json' } + }) + }, createPdf: function(data) { return request({ url: '/scm/v1/scmvehrebatecheckapply/createPdf', diff --git a/anrui-scm/anrui-scm-ui/src/views/bikerebate/bicyclerebatecheck/bicyclerebatecheckInfo.vue b/anrui-scm/anrui-scm-ui/src/views/bikerebate/bicyclerebatecheck/bicyclerebatecheckInfo.vue index 1809ecbc08..5416460e3e 100644 --- a/anrui-scm/anrui-scm-ui/src/views/bikerebate/bicyclerebatecheck/bicyclerebatecheckInfo.vue +++ b/anrui-scm/anrui-scm-ui/src/views/bikerebate/bicyclerebatecheck/bicyclerebatecheckInfo.vue @@ -7,7 +7,7 @@
{{ viewTitle }}
- 导出 + 导出 下载 关闭
@@ -184,6 +184,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({ vehCheckSid: 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/danchefanliheduiFlow/danchefanliheduiYiBanInfo.vue b/anrui-scm/anrui-scm-ui/src/views/workFlow/danchefanliheduiFlow/danchefanliheduiYiBanInfo.vue index 050f916e52..803d495ff0 100644 --- a/anrui-scm/anrui-scm-ui/src/views/workFlow/danchefanliheduiFlow/danchefanliheduiYiBanInfo.vue +++ b/anrui-scm/anrui-scm-ui/src/views/workFlow/danchefanliheduiFlow/danchefanliheduiYiBanInfo.vue @@ -7,7 +7,7 @@
{{ viewTitle }}
- 导出 + 导出 下载 撤回
@@ -220,6 +220,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({ vehCheckSid: this.formobj.sid, userName: window.sessionStorage.getItem('name') }).then((resp) => { if (resp.success && resp.data !== '') {