导出订单默认导出一万条,优化代码

master
mabo 2021-08-06 16:12:41 +08:00
parent 5cfbfdf67c
commit 146854b098
3 changed files with 22 additions and 4 deletions

View File

@ -35,9 +35,9 @@
</Form>
<div>
<download-excel class="export-excel-wrapper" :data="data" :fields="fields" name="商品订单.xls">
<download-excel class="export-excel-wrapper" :data="data" :fields="fields" :fetch="exportOrder" name="商品订单.xls">
<Button type="info" class="export">
导出Excel
导出订单
</Button>
</download-excel>
</div>
@ -269,6 +269,24 @@ export default {
query: { sn: sn },
});
},
//
async exportOrder () {
const params = JSON.parse(JSON.stringify(this.searchForm))
params.pageNumber = 1;
params.pageSize = 10000
const result = await API_Order.getOrderList(params)
if (result.success) {
if (result.result.records.length === 0) {
this.$Message.warning('暂无待发货订单')
return []
} else {
return result.result.records
}
} else {
this.$Message.warning('导出订单失败,请重试')
}
}
},
mounted() {
this.init();

View File

@ -258,7 +258,7 @@ export default {
const params = {
//
pageNumber: 1, //
pageSize: 100, //
pageSize: 10000, //
sort: "startDate", //
order: "desc", //
startDate: "", //