Commit c7fb3d08 authored by Facius's avatar Facius

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

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