|
|
@@ -1,10 +1,26 @@
|
|
|
+<!--
|
|
|
+ 花店采购记录列表:默认近 30 天、按开单时间 addTime 倒序。
|
|
|
+ 筛选先选开单/发货/账单,再选日期范围;排序跟着当前类型走。
|
|
|
+-->
|
|
|
<template>
|
|
|
<view class="order-page">
|
|
|
<view class="sticky-toolbar">
|
|
|
<app-tabs :tabs="tabs" :isFixed="false" :currentTab="tabIndex" @change="change" itemWidth="20%" />
|
|
|
|
|
|
<view class="filter-panel">
|
|
|
+ <!-- 先选按哪种时间,再选日期范围,读起来是:按开单 / 近30天 -->
|
|
|
<view class="filter-row">
|
|
|
+ <view
|
|
|
+ v-for="item in timeTypeOptions"
|
|
|
+ :key="item.value"
|
|
|
+ class="filter-chip filter-chip--type"
|
|
|
+ :class="{ 'filter-chip--active': searchTimeType === item.value }"
|
|
|
+ @click="onSelectTimeType(item.value)"
|
|
|
+ >
|
|
|
+ <text class="filter-chip-text">{{ item.label }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="filter-row filter-row--range">
|
|
|
<view class="filter-chip filter-chip--date">
|
|
|
<DateSelect
|
|
|
ref="dateSelectRef"
|
|
|
@@ -103,7 +119,13 @@ export default {
|
|
|
startTime:'',
|
|
|
endTime:'',
|
|
|
ghsId:0,
|
|
|
- ghsName:''
|
|
|
+ ghsName:'',
|
|
|
+ searchTimeType: 0,
|
|
|
+ timeTypeOptions: [
|
|
|
+ { label: '开单', value: 0 },
|
|
|
+ { label: '发货', value: 2 },
|
|
|
+ { label: '账单', value: 1 }
|
|
|
+ ]
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -148,10 +170,9 @@ export default {
|
|
|
this.searchTime = 'last30Days'
|
|
|
this.startTime = ''
|
|
|
this.endTime = ''
|
|
|
- if (this.$refs.dateSelectRef) {
|
|
|
- this.$refs.dateSelectRef.defaultDateName = '近30天'
|
|
|
- this.$refs.dateSelectRef.startDate = ''
|
|
|
- this.$refs.dateSelectRef.endDate = ''
|
|
|
+ this.searchTimeType = 0
|
|
|
+ if (this.$refs.dateSelectRef && this.$refs.dateSelectRef.reset) {
|
|
|
+ this.$refs.dateSelectRef.reset()
|
|
|
}
|
|
|
this.resetList()
|
|
|
this.getMyPurchase()
|
|
|
@@ -162,6 +183,17 @@ export default {
|
|
|
this.endTime = val.endTime
|
|
|
this.resetList()
|
|
|
this.getMyPurchase()
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 切换开单 / 发货 / 账单时间筛选,列表排序跟着当前类型走。
|
|
|
+ */
|
|
|
+ onSelectTimeType(type) {
|
|
|
+ if (this.searchTimeType === type) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.searchTimeType = type
|
|
|
+ this.resetList()
|
|
|
+ this.getMyPurchase()
|
|
|
},
|
|
|
change(e) {
|
|
|
if (this.tabIndex != e.index) {
|
|
|
@@ -186,7 +218,7 @@ export default {
|
|
|
this.getMyPurchase()
|
|
|
},
|
|
|
getMyPurchase () {
|
|
|
- return purchaseList({ status: this.status,page: this.list.page,searchTime: this.searchTime,startTime: this.startTime,endTime: this.endTime,ghsId:this.ghsId}).then(res => {
|
|
|
+ return purchaseList({ status: this.status,page: this.list.page,searchTime: this.searchTime,startTime: this.startTime,endTime: this.endTime,ghsId:this.ghsId,searchTimeType: this.searchTimeType}).then(res => {
|
|
|
this.completes(res)
|
|
|
if (this.$util.isEmpty(res.data)){
|
|
|
return false
|
|
|
@@ -243,6 +275,10 @@ export default {
|
|
|
align-items: center;
|
|
|
}
|
|
|
|
|
|
+.filter-row--range {
|
|
|
+ margin-top: 12upx;
|
|
|
+}
|
|
|
+
|
|
|
.filter-chip {
|
|
|
height: 68upx;
|
|
|
padding: 0 22upx;
|
|
|
@@ -271,6 +307,11 @@ export default {
|
|
|
justify-content: flex-start;
|
|
|
}
|
|
|
|
|
|
+.filter-chip--type {
|
|
|
+ flex: 1;
|
|
|
+ min-width: 0;
|
|
|
+}
|
|
|
+
|
|
|
.filter-chip--reset {
|
|
|
min-width: 96upx;
|
|
|
border-color: #d9dee8;
|