文件路径:src/views/accounts/statement/index.vue
import createWorkBook from '@/utils/newToExcel.js';
async exports(time) {
let excelData = JSON.parse(JSON.stringify(this.tableForm)), data = []
excelData.page = 1
let pageCount = 1
let lebData = {};
for (let i = 0; i < pageCount; i++) {
lebData = await this.downData(excelData,time)
pageCount = Math.ceil(lebData.count/excelData.limit)
if (lebData.export.length) {
data = data.concat(lebData.export)
excelData.page++
}
}
createWorkBook(lebData.header, lebData.title, data, lebData.foot,lebData.filename);
return
},
/**订单列表 */
downData(excelData,time) {
excelData.date = time
return new Promise((resolve, reject) => {
downloadFinancialApi(this.tableForm.type,excelData).then((res) => {
return resolve(res.data)
})
})
},
文件路径:src/api/accounts.js按照下面截图的修改