导出
<el-button type="primary" @click="handle('export')">导出</el-button>
<a id="link"></a>
handle(type) {
switch (type) {
case 'export': this.exportList()
break
default:
console.log('error:无匹配参数')
}
},
exportList() {
debugger
return new Promise((resolve, reject) => {
excelInsOrderList(this.$route.query.id, this.form).then(response => {
const blob = new Blob([response.data], { type: 'application/ms-excel' })
const link = document.getElementById('link')
link.href = window.URL.createObjectURL(blob)
link.download = '支付订单.xls'
link.click()
window.URL.revokeObjectURL(link.href)
}).catch(err => {
reject(err)
})
})
},
// 订单管理-导出退款订单列表
export function excelOrderRefundList(data) {
return request({
url: '/statisticalInstitutionDay/excelOrderRefundList',
method: 'GET',
params: data,
responseType: 'arraybuffer'
})
}