|
|
@@ -1,5 +1,12 @@
|
|
|
<template>
|
|
|
<div class="app-main app-content">
|
|
|
+ <!-- 时间筛选:默认近30天,与订单列表 order.vue 同一 DateSelect 组件 -->
|
|
|
+ <view class="input-wrap_box">
|
|
|
+ <view class="select-dn_bx">
|
|
|
+ <DateSelect ref="dateSelectRef" class="bar" top="0" @selectDateFn="selectDateFn" defaultShowName="近30天" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
<div class="list-wrap">
|
|
|
<block v-if="!$util.isEmpty(list.data)">
|
|
|
<div class="list" v-for="(item, index) in list.data" :key="index">
|
|
|
@@ -47,6 +54,7 @@
|
|
|
<script>
|
|
|
import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
|
import ModalModule from "@/components/plugin/modal";
|
|
|
+import DateSelect from "@/components/module/dateSelect";
|
|
|
import { list } from "@/mixins";
|
|
|
import { mapGetters } from "vuex";
|
|
|
import orderMixin from "@/mixins/order";
|
|
|
@@ -57,6 +65,7 @@ export default {
|
|
|
components: {
|
|
|
AppWrapperEmpty,
|
|
|
ModalModule,
|
|
|
+ DateSelect,
|
|
|
OrderItem,
|
|
|
},
|
|
|
mixins: [list,orderMixin],
|
|
|
@@ -69,6 +78,10 @@ export default {
|
|
|
fhWl:'顺丰',
|
|
|
fhWlFocus:false,
|
|
|
fhLabelShow:false,
|
|
|
+ // 默认近30天,与订单列表一致,避免一次加载客户全量历史订单
|
|
|
+ searchTime: 'last30Days',
|
|
|
+ startTime: '',
|
|
|
+ endTime: '',
|
|
|
}
|
|
|
},
|
|
|
onPullDownRefresh() {
|
|
|
@@ -182,8 +195,26 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ /**
|
|
|
+ * DateSelect 选中日期后刷新列表
|
|
|
+ * @param {Object} val - { searchTime, startTime, endTime }
|
|
|
+ */
|
|
|
+ selectDateFn(val) {
|
|
|
+ this.searchTime = val.searchTime || ''
|
|
|
+ this.startTime = val.startTime || ''
|
|
|
+ this.endTime = val.endTime || ''
|
|
|
+ this.resetList()
|
|
|
+ this.getOrderList()
|
|
|
+ },
|
|
|
+ /** 按客户 + 时间范围拉取订单列表 */
|
|
|
getOrderList() {
|
|
|
- return getListB({ page: this.list.page,customId:this.option.customId }).then((res) => {
|
|
|
+ return getListB({
|
|
|
+ page: this.list.page,
|
|
|
+ customId: this.option.customId,
|
|
|
+ searchTime: this.searchTime,
|
|
|
+ startTime: this.startTime,
|
|
|
+ endTime: this.endTime,
|
|
|
+ }).then((res) => {
|
|
|
this.completes(res)
|
|
|
})
|
|
|
}
|
|
|
@@ -222,7 +253,8 @@ page{
|
|
|
}
|
|
|
}
|
|
|
.list-wrap {
|
|
|
- padding-top: 20upx;
|
|
|
+ // 为顶部固定时间筛选栏留出空间
|
|
|
+ padding-top: 100upx;
|
|
|
.list {
|
|
|
background-color: #fff;
|
|
|
margin-bottom: 20upx;
|