order:完善订单聚合搜索

(cherry picked from commit 615763d415)
This commit is contained in:
puhui999 2023-09-09 23:08:28 +08:00 committed by shizhong
parent 2e4cad38bb
commit 4dda8d2ab7

View File

@ -104,13 +104,19 @@
<el-form-item label="聚合搜索">
<el-input
v-show="true"
v-model="queryType.v"
v-model="queryParams[queryType.k]"
class="!w-280px"
clearable
placeholder="请输入"
>
<template #prepend>
<el-select v-model="queryType.k" class="!w-110px" clearable placeholder="全部">
<el-select
v-model="queryType.k"
class="!w-110px"
clearable
placeholder="全部"
@change="inputChangeSelect"
>
<el-option
v-for="dict in searchList"
:key="dict.value"
@ -335,41 +341,41 @@ const total = ref(2) // 列表的总页数
const list = ref<TradeOrderApi.OrderVO[]>([]) //
const queryFormRef = ref<FormInstance>() //
//
const queryParams = reactive({
pageNo: 1, //
pageSize: 10, //
no: '',
userId: '',
userNickname: '',
userMobile: '',
receiverName: '',
receiverMobile: '',
terminal: '',
type: null,
status: null,
payChannelCode: '',
createTime: [],
deliveryType: null,
spuName: '',
itemCount: '',
pickUpStoreId: [],
logisticsId: null,
all: ''
const queryParams = ref({
pageNo: 1, //
pageSize: 10, //
status: null, //
payChannelCode: null, //
createTime: null, //
terminal: null, //
type: null, //
deliveryType: null, //
logisticsId: null, //
pickUpStoreId: null //
})
const queryType = reactive({ k: '', v: '' }) // kv
/**
* 订单聚合搜索
* 商品名称商品件数全部
*
* 需要后端支持 TODO
*/
const queryType = reactive({ k: '' }) // k
// select
const searchList = ref([
{ value: 'no', label: '订单号' },
{ value: 'userId', label: '用户UID' },
{ value: 'userNickname', label: '用户昵称' },
{ value: 'userMobile', label: '用户电话' }
])
/**
* 聚合搜索切换查询对象时触发
* @param val
*/
const inputChangeSelect = (val: string) => {
searchList.value
.filter((item) => item.value !== val)
?.forEach((item1) => {
//
if (queryParams.value.hasOwnProperty(item1.value)) {
delete queryParams.value[item1.value]
}
})
}
const headerStyle = ({ row, columnIndex }: any) => {
// 8
@ -417,7 +423,7 @@ const spanMethod = ({ row, rowIndex, columnIndex }: SpanMethodProps) => {
const getList = async () => {
loading.value = true
try {
const data = await TradeOrderApi.getOrderPage(queryParams)
const data = await TradeOrderApi.getOrderPage(unref(queryParams))
list.value = data.list
total.value = data.total
} finally {
@ -427,13 +433,25 @@ const getList = async () => {
/** 搜索按钮操作 */
const handleQuery = async () => {
queryParams.pageNo = 1
queryParams.value.pageNo = 1
await getList()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields()
queryParams.value = {
pageNo: 1, //
pageSize: 10, //
status: null, //
payChannelCode: null, //
createTime: null, //
terminal: null, //
type: null, //
deliveryType: null, //
logisticsId: null, //
pickUpStoreId: null //
}
handleQuery()
}