<el-button type="primary" size="small" @click="exportExcel" :disabled="tableData.length === 0 ? true : false">导出Excel</el-button>
// 导出的方法
async exportExcel () {
await axios.get(`/api/shop/excel?shopId=${this.user.shopId}&time=${this.dateValue}`, {responseType: 'arraybuffer'}).then(res => {
console.log(res)
let url = window.URL.createObjectURL(new Blob([res.data]), {type: 'application/vnd.ms-excel;charset=utf-8'})
let link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.download = this.dateValue + '月医保对账单.xlsx'
document.body.appendChild(link)
link.click()
})
}