mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 01:59:20 +08:00
feat: 店铺订单列表新增更多筛选条件
新增筛选条件: - 订单状态(支持下拉选择) - 实收金额范围(最小/最大) - 确认状态(已确认/未确认) - 折叠行数调整为2行
This commit is contained in:
@@ -18,6 +18,8 @@ import dayjs from 'dayjs';
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import { getShopOverviewStatisticsApi } from '#/api/ecommerce/shop';
|
||||
import { getOrderPageApi } from '#/api/ecommerce/order';
|
||||
import { getAllOrderStatusListApi } from '#/api/ecommerce/order-status';
|
||||
import type { OrderStatusVO } from '#/api/ecommerce/order-status/types';
|
||||
import { exportByPost } from '#/utils/export';
|
||||
|
||||
defineOptions({ name: 'ShopOverview' });
|
||||
@@ -34,6 +36,9 @@ const shopId = computed(() => {
|
||||
// 响应式数据
|
||||
const loading = ref(false);
|
||||
const orderLoading = ref(false);
|
||||
|
||||
// 订单状态选项
|
||||
const orderStatusOptions = ref<{ label: string; value: number }[]>([]);
|
||||
const exportLoading = ref(false);
|
||||
const overviewData = ref<null | ShopVO.OverviewStatistics>(null);
|
||||
|
||||
@@ -414,6 +419,9 @@ const orderSortOrderOptions = [
|
||||
const orderSearchForm = ref({
|
||||
platformOrderNo: '',
|
||||
statusId: undefined as number | undefined,
|
||||
minReceivedAmount: undefined as number | undefined,
|
||||
maxReceivedAmount: undefined as number | undefined,
|
||||
confirm: undefined as number | undefined,
|
||||
sortField: 'orderTime' as string | undefined,
|
||||
sortOrder: 'desc' as string | undefined,
|
||||
});
|
||||
@@ -511,6 +519,9 @@ const orderGridOptions: VxeGridProps<any> = {
|
||||
shopId: shopId.value,
|
||||
platformOrderNo: orderSearchForm.value.platformOrderNo || undefined,
|
||||
statusId: orderSearchForm.value.statusId,
|
||||
minReceivedAmount: orderSearchForm.value.minReceivedAmount,
|
||||
maxReceivedAmount: orderSearchForm.value.maxReceivedAmount,
|
||||
confirm: orderSearchForm.value.confirm,
|
||||
},
|
||||
};
|
||||
// 添加排序参数
|
||||
@@ -553,6 +564,49 @@ const orderFormOptions = computed(() => ({
|
||||
fieldName: 'platformOrderNo',
|
||||
label: '订单号',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
placeholder: '请选择订单状态',
|
||||
options: orderStatusOptions.value,
|
||||
allowClear: true,
|
||||
},
|
||||
fieldName: 'statusId',
|
||||
label: '订单状态',
|
||||
},
|
||||
{
|
||||
component: 'InputNumber',
|
||||
componentProps: {
|
||||
placeholder: '最小金额',
|
||||
min: 0,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
fieldName: 'minReceivedAmount',
|
||||
label: '实收金额(起)',
|
||||
},
|
||||
{
|
||||
component: 'InputNumber',
|
||||
componentProps: {
|
||||
placeholder: '最大金额',
|
||||
min: 0,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
fieldName: 'maxReceivedAmount',
|
||||
label: '实收金额(止)',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
placeholder: '请选择确认状态',
|
||||
options: [
|
||||
{ label: '已确认', value: 1 },
|
||||
{ label: '未确认', value: 0 },
|
||||
],
|
||||
allowClear: true,
|
||||
},
|
||||
fieldName: 'confirm',
|
||||
label: '确认状态',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
@@ -576,7 +630,7 @@ const orderFormOptions = computed(() => ({
|
||||
],
|
||||
showDefaultActions: true,
|
||||
collapsed: true,
|
||||
collapsedRows: 1,
|
||||
collapsedRows: 2,
|
||||
}));
|
||||
|
||||
// 创建订单列表 Grid 实例
|
||||
@@ -593,9 +647,23 @@ function refreshOrderGrid() {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取订单状态选项
|
||||
async function fetchOrderStatusOptions() {
|
||||
try {
|
||||
const data = await getAllOrderStatusListApi();
|
||||
orderStatusOptions.value = data.map((status: OrderStatusVO.Info) => ({
|
||||
label: status.statusName,
|
||||
value: status.id,
|
||||
}));
|
||||
} catch (error) {
|
||||
console.error('获取订单状态列表失败:', error);
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化
|
||||
onMounted(async () => {
|
||||
await refreshOverviewByCurrentParams(true);
|
||||
await fetchOrderStatusOptions();
|
||||
refreshOrderGrid();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user