fix: 修复订单管理页店铺选择筛选不生效的问题

This commit is contained in:
小蟑螂
2026-03-27 21:44:38 +08:00
parent 1f6afd6d93
commit fa6e71faa1
@@ -224,14 +224,16 @@ const gridOptions: VxeGridProps<any> = {
loading.value = true; loading.value = true;
// 从表单获取搜索参数 // 从表单获取搜索参数
const searchParams = form || {}; const searchParams = form || {};
// 合并表单值和本地状态
const filters = {
platformOrderNo: searchParams.platformOrderNo || searchForm.value.platformOrderNo || undefined,
shopId: searchParams.shopId ?? searchForm.value.shopId,
statusId: searchParams.statusId ?? searchForm.value.statusId,
};
const params: PageQueryDTO<OrderDTO.Filters> = { const params: PageQueryDTO<OrderDTO.Filters> = {
page: page.currentPage, page: page.currentPage,
pageSize: page.pageSize, pageSize: page.pageSize,
filters: { filters,
platformOrderNo: searchParams.platformOrderNo || undefined,
shopId: searchParams.shopId,
statusId: searchParams.statusId,
},
}; };
// 处理排序参数 // 处理排序参数
if (currentSort.value) { if (currentSort.value) {
@@ -279,7 +281,10 @@ const formOptions = computed(() => ({
filterOption: false, filterOption: false,
onSearch: handleShopSearch, onSearch: handleShopSearch,
onPopupScroll: handleShopPopupScroll, onPopupScroll: handleShopPopupScroll,
onChange: () => gridApi?.reload(), onChange: (val: any) => {
searchForm.value.shopId = val;
gridApi?.reload();
},
loading: shopLoading, loading: shopLoading,
dropdownMenuColumnStyle: { maxHeight: '300px', overflow: 'auto' }, dropdownMenuColumnStyle: { maxHeight: '300px', overflow: 'auto' },
}, },
@@ -292,7 +297,10 @@ const formOptions = computed(() => ({
placeholder: '请选择状态', placeholder: '请选择状态',
options: orderStatusOptions, options: orderStatusOptions,
allowClear: true, allowClear: true,
onChange: () => gridApi?.reload(), onChange: (val: any) => {
searchForm.value.statusId = val;
gridApi?.reload();
},
}, },
fieldName: 'statusId', fieldName: 'statusId',
label: '订单状态', label: '订单状态',