feat: 退款订单与订单列表整合

This commit is contained in:
2025-10-29 17:39:25 +08:00
parent e226bd11c2
commit a15a0e7111
4 changed files with 21 additions and 18 deletions
@@ -12,12 +12,12 @@ interface RefundReviewModalProps {
}
const RefundReviewModal: React.FC<RefundReviewModalProps> = ({
visible,
orderNo,
onCancel,
onSuccess,
isReviewMode = true,
}) => {
visible,
orderNo,
onCancel,
onSuccess,
isReviewMode = true,
}) => {
const [form] = Form.useForm();
const [loading, setLoading] = useState(false);
const [refundData, setRefundData] = useState<any>(null);
@@ -28,7 +28,7 @@ const RefundReviewModal: React.FC<RefundReviewModalProps> = ({
// 审核结果选项
const reviewResults = [
{ label: '审核通过', value: 1 },
{ label: '审核拒绝', value: 0 },
{ label: '审核拒绝', value: 2 },
];
// 格式化金额(分转元)
@@ -56,14 +56,14 @@ const RefundReviewModal: React.FC<RefundReviewModalProps> = ({
}
};
// 根据status获取退款状态的文案和颜色
const getRefundStatusInfo = (status: number) => {
// 根据state获取退款状态的文案和颜色
const getRefundStateInfo = (state: number) => {
const statusMap: Record<number, { text: string; bgColor: string; textColor: string }> = {
7: { text: '退款中', bgColor: '#fff7e6', textColor: '#d46b08' }, // orange
8: { text: '退款成功', bgColor: '#f6ffed', textColor: '#52c41a' }, // lime
9: { text: '退款失败', bgColor: '#fff1f0', textColor: '#f5222d' }, // red
0: { text: '审核中', bgColor: '#fff7e6', textColor: '#d46b08' }, // orange
1: { text: '审核通过', bgColor: '#f6ffed', textColor: '#52c41a' }, // lime
2: { text: '审核失败', bgColor: '#fff1f0', textColor: '#f5222d' }, // red
};
return statusMap[status] || { text: '未知状态', bgColor: '#f5f5f5', textColor: '#666' };
return statusMap[state] || { text: '未知状态', bgColor: '#f5f5f5', textColor: '#666' };
};
// 获取退款订单详情
@@ -119,7 +119,7 @@ const RefundReviewModal: React.FC<RefundReviewModalProps> = ({
refundNo: refundData?.refundNo,
refundAmount: String(actualRefundAmount), // 后端期望字符串格式
status: 7, // 退款中状态码
state: values.reviewResult, // 审核状态:1=通过(APPROVED),0=拒绝(REFUSED)
state: values.reviewResult, // 审核状态:1=通过(APPROVED),2=拒绝(REFUSED)
approveReason: values.reviewComment, // 审核意见
});
@@ -253,7 +253,7 @@ const RefundReviewModal: React.FC<RefundReviewModalProps> = ({
<span style={{ fontWeight: 'bold' }}>退款状态</span>
<div style={{ marginTop: 4 }}>
{(() => {
const statusInfo = getRefundStatusInfo(refundData?.status);
const statusInfo = getRefundStateInfo(refundData?.state);
return (
<span style={{
padding: '2px 8px',