Commit c7fb3d08 authored by Facius's avatar Facius

improve: 订单列表中,异常单、审核中、已完工不需要排序,所以要分页

parent e63794f3
......@@ -114,7 +114,7 @@ export default {
showCountTime,
})
},
handleClickButton(item, type) {
handleClickButton(item, type, showCountTime) {
this.$emit('update:visible', false)
this.$emit('click', item, type, showCountTime)
// 去完工
......
......@@ -110,7 +110,6 @@ export default {
return {
curNow: 0,
pageNumber: 0,
pageSize: 1000, // 因为需要排序,所以暂时去掉分页
orderList: [
// 用多个数组存储可以优化用户切换体验,但是会增加内存
[[], [], [], [], [], []],
......@@ -174,10 +173,26 @@ export default {
subList() {
return ['全部订单', '今日订单']
},
// 0:'去预约', 1:'去签到', 2:'去完工', 3:'审核中', 4:'去处理', 5'已完工'
// 0 全部订单: 0:'待预约', 1:'待签到', 2:'待完工', 3:'审核中', 4:'异常单', 5'已完工'
// 1 今日订单: 0:'待联系', 1:'待完工', 2:'异常单'
orderType() {
return this.indexStatus[this.curNow][this.current[this.curNow]]
},
pageSize() {
// 待预约, 待签到,待完工,因为需要排序,所以暂时去掉分页,一次要完所有
return this.pageSizes[this.curNow][this.current[this.curNow]]
},
needSort() {
// 待预约, 待签到,待完工需要排序
return this.current + this.current[this.curNow] < 3
},
pageSizes() {
// 待预约, 待签到,待完工,因为需要排序,所以暂时去掉分页,一次要完所有
return [
[10000, 10000, 10000, 15, 15, 15],
[10000, 10000, 15],
]
},
offset() {
return [
[0, 0],
......@@ -302,12 +317,14 @@ export default {
self.types[this.curNow][res.data.type]
].total = res.data.total
}
self.orderList[this.curNow][this.current[this.curNow]].sort(
(x, y) => {
return x.currentOverTime <= y.currentOverTime ? 1 : -1
}
)
if (this.needSort) {
// 待预约, 待签到,待完工需要排序
self.orderList[this.curNow][this.current[this.curNow]].sort(
(x, y) => {
return x.currentOverTime <= y.currentOverTime ? 1 : -1
}
)
}
self.loadStatus =
res.data.total >
......
......@@ -67,7 +67,7 @@ export default {
data() {
return {
pageNumber: 0,
pageSize: 1000, // 因为需要排序,所以暂时去掉分页
pageSize: 10000, // 因为需要排序,所以暂时去掉分页
orderList: [],
loadStatus: 'loading',
dataValue: [],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment