diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/shop/overview/index.vue b/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/shop/overview/index.vue index 72b88a2f..eeca10c3 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/shop/overview/index.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/shop/overview/index.vue @@ -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); @@ -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 = { 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(); });