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