|
|
@ -7,7 +7,7 @@ |
|
|
|
<div>{{ viewTitle }}</div> |
|
|
|
<!--start 添加修改按钮--> |
|
|
|
<div> |
|
|
|
<el-button type="primary" size="small">导出</el-button> |
|
|
|
<el-button type="primary" size="small" @click="doExport">导出</el-button> |
|
|
|
<el-button type="primary" size="small" @click="download">下载</el-button> |
|
|
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|
|
|
</div> |
|
|
@ -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 !== '') { |
|
|
|