1
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<div class="search-bar" v-if="!expanded">
|
||||
<el-input
|
||||
v-model="quickSearch"
|
||||
placeholder="快速搜索..."
|
||||
:placeholder="placeholder"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuickSearch"
|
||||
@clear="handleQuickSearch"
|
||||
@@ -86,6 +86,10 @@ export default {
|
||||
model: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: '快速搜索...'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<!-- 移动端:搜索表单部分 -->
|
||||
<mobile-search-form
|
||||
:model="queryParams"
|
||||
placeholder="订单号 / 备注 / 下单人 / 地址"
|
||||
@search="handleQuery"
|
||||
@reset="resetQuery"
|
||||
@quick-search="handleQuickSearch"
|
||||
@@ -1457,6 +1458,7 @@ export default {
|
||||
pageSize: 50,
|
||||
remark: undefined,
|
||||
orderSearch: undefined,
|
||||
mobileQuickSearch: undefined,
|
||||
distributionMark: undefined,
|
||||
modelNumber: undefined,
|
||||
modelShop: undefined,
|
||||
@@ -1891,16 +1893,19 @@ export default {
|
||||
break
|
||||
}
|
||||
},
|
||||
/** 快速搜索 */
|
||||
/** 手机端快速搜索:备注、订单号、下单人、地址任一命中即可,并去掉日期限制 */
|
||||
handleQuickSearch(keyword) {
|
||||
if (!keyword) {
|
||||
this.handleQuery()
|
||||
return
|
||||
const text = (keyword || '').trim()
|
||||
this.queryParams.mobileQuickSearch = text || undefined
|
||||
if (text) {
|
||||
this.queryParams.remark = undefined
|
||||
this.queryParams.orderSearch = undefined
|
||||
this.queryParams.buyer = undefined
|
||||
this.queryParams.address = undefined
|
||||
this.dateRange = []
|
||||
this.queryParams.beginTime = null
|
||||
this.queryParams.endTime = null
|
||||
}
|
||||
// 快速搜索:在订单号、备注、下单人等字段中搜索
|
||||
this.queryParams.orderSearch = keyword
|
||||
this.queryParams.remark = keyword
|
||||
this.queryParams.buyer = keyword
|
||||
this.handleQuery()
|
||||
},
|
||||
/** 设置默认日期范围为今天 */
|
||||
@@ -2242,6 +2247,7 @@ export default {
|
||||
pageSize: this.isMobile ? MOBILE_JD_ORDER_PAGE_SIZE : 50,
|
||||
remark: undefined,
|
||||
orderSearch: undefined,
|
||||
mobileQuickSearch: undefined,
|
||||
distributionMark: undefined,
|
||||
modelNumber: undefined,
|
||||
modelShop: undefined,
|
||||
@@ -3336,7 +3342,7 @@ export default {
|
||||
|
||||
/** 准备查询参数:仅去除空格,保留日期等所有搜索条件 */
|
||||
prepareQueryParams() {
|
||||
const textKeys = ['remark', 'orderSearch', 'distributionMark', 'modelNumber', 'link', 'buyer', 'address', 'status']
|
||||
const textKeys = ['remark', 'orderSearch', 'mobileQuickSearch', 'distributionMark', 'modelNumber', 'link', 'buyer', 'address', 'status']
|
||||
|
||||
textKeys.forEach(key => {
|
||||
const value = this.queryParams[key]
|
||||
|
||||
Reference in New Issue
Block a user