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

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

View File

@@ -20,7 +20,7 @@
<div class="store-category">
<ul class="cate-list">
<li class="cate-item" @click="searchByCate({id:'', labelName: '店铺推荐'})">首页</li>
<li class="cate-item" v-for="(cate, index) in cateList" :key="index" >
<li class="cate-item" v-for="(cate, index) in cateList" :key="index">
<Dropdown v-if="cate.children.length">
<div @click.self="searchByCate(cate)">{{cate.labelName}} <Icon type="ios-arrow-down"></Icon></div>
<DropdownMenu slot="list">

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: "", // 起始时间