fix(订单中心):新增订单支付类型后,订单列表显示和首页统计添加筛选条件

This commit is contained in:
2025-09-01 14:35:49 +08:00
parent 925c915a9b
commit b477c5913b
3 changed files with 52 additions and 1 deletions
@@ -31,6 +31,21 @@ const TableList: React.FC = () => {
return <Tag color={statusInfo.color}>{statusInfo.text}</Tag>;
}, []);
// 支付类型选项
const PAY_TYPE_OPTIONS = [
{ label: '微信支付', value: 1 },
{ label: '优惠券支付', value: 2 },
];
// 渲染支付类型标签
const renderPayType = (payType: number) => {
const payTypeInfo = PAY_TYPE_OPTIONS.find(option => option.value === payType);
if (!payTypeInfo) return <Tag color="default">未知</Tag>;
const color = payType === 1 ? 'green' : 'blue';
return <Tag color={color}>{payTypeInfo.label}</Tag>;
};
// 处理修改操作
const handleEdit = useCallback(async (fields: { orderStatus: number }) => {
const hide = message.loading('正在更新');
@@ -161,6 +176,17 @@ const TableList: React.FC = () => {
copyable: true,
ellipsis: true,
},
{
title: '支付类型',
dataIndex: 'payType',
render: (payType) => renderPayType(payType as number),
width: 120,
filters: PAY_TYPE_OPTIONS.map(option => ({
text: option.label,
value: option.value,
})),
filterMultiple: false,
},
{
title: '状态',
dataIndex: 'orderStatus',
@@ -223,6 +249,7 @@ const TableList: React.FC = () => {
orderNo: values.orderNo?.trim(), // 去除空格
orderStatus: values.orderStatus, // 状态
tourismId: values.tourismId, // 景区ID
payType: values.payType, // 支付类型
};
// 过滤掉空值
const validParams = Object.fromEntries(
@@ -244,6 +271,13 @@ const TableList: React.FC = () => {
options={STATUS_OPTIONS}
allowClear
/>
<ProFormSelect
name="payType"
label="支付类型"
placeholder="请选择支付类型"
options={PAY_TYPE_OPTIONS}
allowClear
/>
<ProFormSelect
name="tourismId"
label="景区"
@@ -7,6 +7,7 @@ declare namespace ORDERS {
id: number;
orderNo: string;
orderStatus: string;
payType?: number; // 支付类型(1:微信支付,2:优惠券支付)
createTime?: string;
tenantId?: string;
updateTime?: string;