feat: 添加订单状态(10)为部分退款

This commit is contained in:
2025-10-30 14:39:51 +08:00
parent 3c664413b9
commit 7ab9d15761
10 changed files with 89 additions and 42 deletions
@@ -16,6 +16,8 @@ public class OrderStatusConstants {
// 退款状态集合(退款中、已退款) // 退款状态集合(退款中、已退款)
public static final String REFUND_STATUS = String.format("(%d,%d)", public static final String REFUND_STATUS = String.format("(%d,%d)",
OrderStatus.REFUNDING.getId(), // 7-退款中 OrderStatus.REFUNDING.getId(), // 7-退款中
OrderStatus.REFUNDED.getId() // 8-已退款 OrderStatus.REFUNDED.getId(), // 8-已退款
OrderStatus.REFUND_FAILED, // 9 退款失败
OrderStatus.PART_REFUNDED //10 部分退款(新加)
); );
} }
@@ -1038,8 +1038,8 @@ public class OrderController {
public PageResult<Map> listImageOrdersByUser(@RequestParam Map<String, Object> params) { public PageResult<Map> listImageOrdersByUser(@RequestParam Map<String, Object> params) {
LoginAppUser user = LoginUserContextHolder.getUser(); LoginAppUser user = LoginUserContextHolder.getUser();
params.put("userId", user.getId()); params.put("userId", user.getId());
List<Integer> orderStatusList = List.of(OrderStatus.COMPLETE.getId(), OrderStatus.UPLOADING.getId(), OrderStatus.UPLOADED.getId()); // List<Integer> orderStatusList = List.of(OrderStatus.COMPLETE.getId(), OrderStatus.UPLOADING.getId(), OrderStatus.UPLOADED.getId());
params.put("orderStatusList", orderStatusList); params.put("orderStatusList", getCompletedOrderStatuses());
PageResult<Order> result = orderService.findListByUser(params); PageResult<Order> result = orderService.findListByUser(params);
if (result.getCount() > 0){ if (result.getCount() > 0){
@@ -1135,7 +1135,9 @@ public class OrderController {
return List.of( return List.of(
OrderStatus.COMPLETE.getId(), OrderStatus.COMPLETE.getId(),
OrderStatus.UPLOADING.getId(), OrderStatus.UPLOADING.getId(),
OrderStatus.UPLOADED.getId() OrderStatus.UPLOADED.getId(),
OrderStatus.REFUNDING.getId(),
OrderStatus.PART_REFUNDED.getId()
); );
} }
@@ -173,7 +173,7 @@ public class RefundController {
return Result.failed("处理退款失败"); return Result.failed("处理退款失败");
} }
@Operation(summary = "微信支付退款") @Operation(summary = "微信支付部分退款")
@PostMapping("/approve/custom") @PostMapping("/approve/custom")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Result<com.central.order.model.Refund> approveCustomOrderAmount(@RequestBody ApproveCustomRefundAmountRequest refundRequest) { public Result<com.central.order.model.Refund> approveCustomOrderAmount(@RequestBody ApproveCustomRefundAmountRequest refundRequest) {
@@ -190,20 +190,29 @@ public class RefundController {
if (! refundRequest.getStatus().equals(OrderStatus.REFUNDING.getId())){ if (! refundRequest.getStatus().equals(OrderStatus.REFUNDING.getId())){
return Result.failed("该状态不支持审核"); return Result.failed("该状态不支持审核");
} }
if (refundRequest.getState().equals(RefundState.APPROVED.getId())){ if (refundRequest.getState().equals(RefundState.APPROVED.getId())){
dealCustomRefundAmountRequest(order,null);
refundorder.setApproveReason(refundRequest.getApproveReason());
refundorder.setState(refundRequest.getState()); //全额退款
refundService.updateById(refundorder);
return Result.succeed("已处理全额退款");
}
if (refundRequest.getState().equals(RefundState.PART.getId())){
dealCustomRefundAmountRequest(order,refundRequest.getRefundAmount()); dealCustomRefundAmountRequest(order,refundRequest.getRefundAmount());
refundorder.setApproveReason(refundRequest.getApproveReason()); refundorder.setApproveReason(refundRequest.getApproveReason());
refundorder.setState(refundRequest.getState()); //部分退款
if(refundRequest.getRefundAmount()!=null){ if(refundRequest.getRefundAmount()!=null){
refundorder.setRefundAmount(refundRequest.getRefundAmount()); refundorder.setRefundAmount(refundRequest.getRefundAmount());
} }
refundService.updateById(refundorder); refundService.updateById(refundorder);
return Result.succeed("已处理退款"); return Result.succeed("已处理部分退款");
} }
if (refundRequest.getState().equals(RefundState.REFUSED.getId())){ if (refundRequest.getState().equals(RefundState.REFUSED.getId())){
order.setOrderStatus(OrderStatus.REFUND_FAILED.getId()); order.setOrderStatus(OrderStatus.REFUND_FAILED.getId());
refundorder.setStatus(OrderStatus.REFUND_FAILED.getId()); refundorder.setStatus(OrderStatus.REFUND_FAILED.getId());
refundorder.setApproveReason(refundRequest.getApproveReason()); refundorder.setApproveReason(refundRequest.getApproveReason());
refundorder.setState(refundRequest.getState()); refundorder.setState(refundRequest.getState()); //拒绝退款
orderService.updateOrder(order); orderService.updateOrder(order);
refundService.updateById(refundorder); refundService.updateById(refundorder);
return Result.succeed("处理成功"); return Result.succeed("处理成功");
@@ -282,14 +282,27 @@ public class WxPayController {
// 退款成功,更新订单状态等操作 // 退款成功,更新订单状态等操作
com.central.order.model.Refund refund = refundService.getRefundByNo(outRefundNo); com.central.order.model.Refund refund = refundService.getRefundByNo(outRefundNo);
Assert.notNull(refund,"退款订单数据不存在"); Assert.notNull(refund,"退款订单数据不存在");
refund.setStatus(OrderStatus.REFUNDED.getId()); if(refund.getState().equals(RefundState.PART.getId())){
refund.setState(RefundState.APPROVED.getId()); //部分退款
refund.setStatus(OrderStatus.PART_REFUNDED.getId());
}else {
//全额退款
refund.setStatus(OrderStatus.REFUNDED.getId());
}
// refund.setState(RefundState.APPROVED.getId());
refund.setRefundTime(new Date()); refund.setRefundTime(new Date());
refundService.updateById(refund); refundService.updateById(refund);
Order order = orderService.getOrderByNumber(refund.getOrderNo()); Order order = orderService.getOrderByNumber(refund.getOrderNo());
Assert.notNull(order,"订单数据不存在"); Assert.notNull(order,"订单数据不存在");
order.setOrderStatus(OrderStatus.REFUNDED.getId()); // order.setOrderStatus(OrderStatus.REFUNDED.getId());
if(refund.getState().equals(RefundState.PART.getId())){
//部分退款
order.setOrderStatus(OrderStatus.PART_REFUNDED.getId());
}else {
//全额退款
order.setOrderStatus(OrderStatus.REFUNDED.getId());
}
orderService.updateOrder(order); orderService.updateOrder(order);
} else if ("CLOSED".equals(notification.getRefundStatus())) { } else if ("CLOSED".equals(notification.getRefundStatus())) {
// 退款关闭,处理退款关闭逻辑 // 退款关闭,处理退款关闭逻辑
@@ -314,14 +327,28 @@ public class WxPayController {
// 退款成功,更新订单状态等操作 // 退款成功,更新订单状态等操作
com.central.order.model.Refund refund = refundService.getRefundByNo(outRefundNo); com.central.order.model.Refund refund = refundService.getRefundByNo(outRefundNo);
Assert.notNull(refund,"退款订单数据不存在"); Assert.notNull(refund,"退款订单数据不存在");
refund.setStatus(OrderStatus.REFUNDED.getId()); // refund.setStatus(OrderStatus.REFUNDED.getId());
refund.setState(RefundState.APPROVED.getId()); // refund.setState(RefundState.APPROVED.getId());
if(refund.getState().equals(RefundState.PART.getId())){
//部分退款
refund.setStatus(OrderStatus.PART_REFUNDED.getId());
}else {
//全额退款
refund.setStatus(OrderStatus.REFUNDED.getId());
}
refund.setRefundTime(new Date()); refund.setRefundTime(new Date());
refundService.updateById(refund); refundService.updateById(refund);
Order order = orderService.getOrderByNumber(refund.getOrderNo()); Order order = orderService.getOrderByNumber(refund.getOrderNo());
Assert.notNull(order,"订单数据不存在"); Assert.notNull(order,"订单数据不存在");
order.setOrderStatus(OrderStatus.REFUNDED.getId()); // order.setOrderStatus(OrderStatus.REFUNDED.getId());
if(refund.getState().equals(RefundState.PART.getId())){
//部分退款
order.setOrderStatus(OrderStatus.PART_REFUNDED.getId());
}else {
//全额退款
order.setOrderStatus(OrderStatus.REFUNDED.getId());
}
orderService.updateOrder(order); orderService.updateOrder(order);
} else if ("CLOSED".equals(notification.getRefundStatus())) { } else if ("CLOSED".equals(notification.getRefundStatus())) {
// 退款关闭,处理退款关闭逻辑 // 退款关闭,处理退款关闭逻辑
@@ -19,7 +19,8 @@ OrderStatus implements ZltEnum {
UPLOADED(6,"素材上传完成(任务完成)"), UPLOADED(6,"素材上传完成(任务完成)"),
REFUNDING(7,"退款中"), REFUNDING(7,"退款中"),
REFUNDED(8,"已退款"), REFUNDED(8,"已退款"),
REFUND_FAILED(9,"退款失败"); REFUND_FAILED(9,"退款失败"),
PART_REFUNDED(10,"部分退款");
OrderStatus(Integer id, String content) { OrderStatus(Integer id, String content) {
this.id = id; this.id = id;
@@ -11,8 +11,9 @@ import lombok.Getter;
@Getter @Getter
public enum RefundState implements ZltEnum { public enum RefundState implements ZltEnum {
APPROVING(0,"审核中"), APPROVING(0,"审核中"),
APPROVED(1, "已通过"), APPROVED(1, "全额退款"),
REFUSED(2,"已拒绝"); REFUSED(2,"拒绝退款"),
PART(3,"部分退款");
RefundState(Integer id, String content) { RefundState(Integer id, String content) {
@@ -22,7 +22,7 @@ public interface DashboardMapper {
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>", "<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
" AND q.is_test = 0", " AND q.is_test = 0",
"</if>", "</if>",
"AND o.order_status IN (1, 3, 4, 5, 7, 8, 9)", "AND o.order_status IN (1, 3, 4, 5, 7, 8, 9,10)",
"AND (o.pay_type = 1 OR o.pay_type IS NULL)", "AND (o.pay_type = 1 OR o.pay_type IS NULL)",
"<if test='p.tourismId != null'>", "<if test='p.tourismId != null'>",
" AND o.tourism_id = #{p.tourismId}", " AND o.tourism_id = #{p.tourismId}",
@@ -62,7 +62,7 @@ public interface DashboardMapper {
" AND q.is_test = 0", " AND q.is_test = 0",
"</if>", "</if>",
"AND DATE(o.create_time) = CURDATE()", "AND DATE(o.create_time) = CURDATE()",
"AND o.order_status IN (1, 3, 4, 5, 7, 8, 9)", "AND o.order_status IN (1, 3, 4, 5, 7, 8, 9,10)",
"AND (o.pay_type = 1 OR o.pay_type IS NULL)", "AND (o.pay_type = 1 OR o.pay_type IS NULL)",
"<if test='p.tourismId != null'>", "<if test='p.tourismId != null'>",
" AND o.tourism_id = #{p.tourismId}", " AND o.tourism_id = #{p.tourismId}",
@@ -90,7 +90,7 @@ public interface DashboardMapper {
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>", "<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
" AND q.is_test = 0", " AND q.is_test = 0",
"</if>", "</if>",
"AND o.order_status = 8", "AND o.order_status IN ( 8,10)",
"AND (o.pay_type = 1 OR o.pay_type IS NULL)", "AND (o.pay_type = 1 OR o.pay_type IS NULL)",
"<if test='p.tourismId != null'>", "<if test='p.tourismId != null'>",
" AND o.tourism_id = #{p.tourismId}", " AND o.tourism_id = #{p.tourismId}",
@@ -129,7 +129,7 @@ public interface DashboardMapper {
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>", "<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
" AND q.is_test = 0", " AND q.is_test = 0",
"</if>", "</if>",
"AND o.order_status = 8", "AND o.order_status IN ( 8,10)",
"AND DATE(o.create_time) = CURDATE()", "AND DATE(o.create_time) = CURDATE()",
"<if test='p.tourismId != null'>", "<if test='p.tourismId != null'>",
" AND o.tourism_id = #{p.tourismId}", " AND o.tourism_id = #{p.tourismId}",
@@ -151,7 +151,7 @@ public interface DashboardMapper {
@Select({ @Select({
"<script>", "<script>",
"SELECT", "SELECT",
" SUM(CASE WHEN o.order_status IN (1, 3, 4, 5, 7) THEN 1 ELSE 0 END) as count", " SUM(CASE WHEN o.order_status IN (1, 3, 4, 5, 7,9) THEN 1 ELSE 0 END) as count",
"FROM orders o", "FROM orders o",
"JOIN qrcodes q ON o.code_id = q.code_id", "JOIN qrcodes q ON o.code_id = q.code_id",
"WHERE 1=1", "WHERE 1=1",
@@ -190,7 +190,7 @@ public interface DashboardMapper {
@Select({ @Select({
"<script>", "<script>",
"SELECT", "SELECT",
" SUM(CASE WHEN o.order_status IN (1, 3, 4, 5, 7) THEN 1 ELSE 0 END) as count", " SUM(CASE WHEN o.order_status IN (1, 3, 4, 5, 7,9) THEN 1 ELSE 0 END) as count",
"FROM orders o", "FROM orders o",
"JOIN qrcodes q ON o.code_id = q.code_id", "JOIN qrcodes q ON o.code_id = q.code_id",
"WHERE 1=1", "WHERE 1=1",
@@ -319,7 +319,7 @@ public interface DashboardMapper {
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>", "<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
" AND q.is_test = 0", " AND q.is_test = 0",
"</if>", "</if>",
"AND o.order_status = 8", "AND o.order_status IN (8,10)",
"<if test='p.tourismId != null'>", "<if test='p.tourismId != null'>",
" AND o.tourism_id = #{p.tourismId}", " AND o.tourism_id = #{p.tourismId}",
"</if>", "</if>",
@@ -355,7 +355,7 @@ public interface DashboardMapper {
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>", "<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
" AND q.is_test = 0", " AND q.is_test = 0",
"</if>", "</if>",
"AND o.order_status IN (1, 3, 4, 5, 6, 7, 8, 9)", "AND o.order_status IN (1, 3, 4, 5, 6, 7, 8, 9,10)",
"AND (o.pay_type = 1 OR o.pay_type IS NULL)", "AND (o.pay_type = 1 OR o.pay_type IS NULL)",
"<if test='p.tourismId != null'>", "<if test='p.tourismId != null'>",
" AND o.tourism_id = #{p.tourismId}", " AND o.tourism_id = #{p.tourismId}",
@@ -390,7 +390,7 @@ public interface DashboardMapper {
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>", "<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
" AND q.is_test = 0", " AND q.is_test = 0",
"</if>", "</if>",
"AND o.order_status = 8", "AND o.order_status IN ( 8,10)",
"AND (o.pay_type = 1 OR o.pay_type IS NULL)", "AND (o.pay_type = 1 OR o.pay_type IS NULL)",
"<if test='p.tourismId != null'>", "<if test='p.tourismId != null'>",
" AND o.tourism_id = #{p.tourismId}", " AND o.tourism_id = #{p.tourismId}",
@@ -432,7 +432,7 @@ public interface DashboardMapper {
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>", "<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
" AND q.is_test = 0", " AND q.is_test = 0",
"</if>", "</if>",
"AND o.order_status IN (1, 3, 4, 5, 7, 8, 9)", "AND o.order_status IN (1, 3, 4, 5, 7, 8, 9,10)",
"AND (o.pay_type = 1 OR o.pay_type IS NULL)", "AND (o.pay_type = 1 OR o.pay_type IS NULL)",
"<if test='p.startTime != null and p.startTime != \"\"'>", "<if test='p.startTime != null and p.startTime != \"\"'>",
" AND o.create_time >= #{p.startTime}", " AND o.create_time >= #{p.startTime}",
@@ -516,7 +516,7 @@ public interface DashboardMapper {
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>", "<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
" AND q.is_test = 0", " AND q.is_test = 0",
"</if>", "</if>",
" AND o.order_status = 8", " AND o.order_status IN ( 8,10)",
"AND (o.pay_type = 1 OR o.pay_type IS NULL)", "AND (o.pay_type = 1 OR o.pay_type IS NULL)",
"<if test='p.startTime != null and p.startTime != \"\"'>", "<if test='p.startTime != null and p.startTime != \"\"'>",
" AND o.create_time >= #{p.startTime}", " AND o.create_time >= #{p.startTime}",
@@ -592,7 +592,7 @@ public interface DashboardMapper {
" <if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'> AND q.is_test = 0 </if>", " <if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'> AND q.is_test = 0 </if>",
" AND q.is_del = 0", " AND q.is_del = 0",
"LEFT JOIN orders o ON q.code_id = o.code_id", "LEFT JOIN orders o ON q.code_id = o.code_id",
" AND o.order_status IN (3, 7)", " AND o.order_status IN (3, 7 ,9)",
" AND (o.pay_type = 1 OR o.pay_type IS NULL)", " AND (o.pay_type = 1 OR o.pay_type IS NULL)",
" <if test='p.startTime != null and p.startTime != \"\"'> AND o.create_time &gt;= #{p.startTime} </if>", " <if test='p.startTime != null and p.startTime != \"\"'> AND o.create_time &gt;= #{p.startTime} </if>",
" <if test='p.endTime != null and p.endTime != \"\"'> AND o.create_time &lt;= #{p.endTime} </if>", " <if test='p.endTime != null and p.endTime != \"\"'> AND o.create_time &lt;= #{p.endTime} </if>",
@@ -622,7 +622,7 @@ public interface DashboardMapper {
" AND q.is_test = 0", " AND q.is_test = 0",
"</if>", "</if>",
"AND DATE(o.create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)", "AND DATE(o.create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)",
"AND o.order_status IN (1, 3, 4, 5, 7, 8, 9)", "AND o.order_status IN (1, 3, 4, 5, 7, 8, 9,10)",
"AND (o.pay_type = 1 OR o.pay_type IS NULL)", "AND (o.pay_type = 1 OR o.pay_type IS NULL)",
"<if test='p.tourismId != null'>", "<if test='p.tourismId != null'>",
" AND o.tourism_id = #{p.tourismId}", " AND o.tourism_id = #{p.tourismId}",
@@ -692,7 +692,7 @@ public interface DashboardMapper {
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>", "<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
" AND q.is_test = 0", " AND q.is_test = 0",
"</if>", "</if>",
"AND o.order_status IN (1, 3, 4, 5, 7, 8, 9)", "AND o.order_status IN (1, 3, 4, 5, 7, 8, 9 ,10)",
"AND (o.pay_type = 1 OR o.pay_type IS NULL)", "AND (o.pay_type = 1 OR o.pay_type IS NULL)",
"<if test='p.startTime != null and p.startTime != \"\"'>", "<if test='p.startTime != null and p.startTime != \"\"'>",
" AND o.create_time &gt;= #{p.startTime}", " AND o.create_time &gt;= #{p.startTime}",
@@ -734,7 +734,7 @@ public interface DashboardMapper {
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>", "<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
" AND q.is_test = 0", " AND q.is_test = 0",
"</if>", "</if>",
"AND o.order_status IN (1, 3, 4, 5, 6, 7, 8, 9)", "AND o.order_status IN (1, 3, 4, 5, 6, 7, 8, 9 ,10)",
"AND (o.pay_type = 1 OR o.pay_type IS NULL)", "AND (o.pay_type = 1 OR o.pay_type IS NULL)",
"<if test='p.startTime != null and p.startTime != \"\"'>", "<if test='p.startTime != null and p.startTime != \"\"'>",
" AND o.create_time &gt;= #{p.startTime}", " AND o.create_time &gt;= #{p.startTime}",
@@ -862,6 +862,7 @@ public interface DashboardMapper {
" WHEN 7 THEN '退款中'", " WHEN 7 THEN '退款中'",
" WHEN 8 THEN '已退款'", " WHEN 8 THEN '已退款'",
" WHEN 9 THEN '退款失败'", " WHEN 9 THEN '退款失败'",
" WHEN 10 THEN '部分退款'",
" ELSE '其他'", " ELSE '其他'",
" END as type,", " END as type,",
" COUNT(*) as value", " COUNT(*) as value",
@@ -900,7 +901,7 @@ public interface DashboardMapper {
"<script>", "<script>",
"SELECT", "SELECT",
" '平台分账' as type,", " '平台分账' as type,",
" COALESCE(SUM(CASE WHEN o.order_status IN (1, 3, 4, 5, 6, 7, 8, 9) THEN o.order_amount * 0.3 ELSE 0 END), 0) as value", " COALESCE(SUM(CASE WHEN o.order_status IN (1, 3, 4, 5, 6, 7, 8, 9 ,10) THEN o.order_amount * 0.3 ELSE 0 END), 0) as value",
"FROM orders o", "FROM orders o",
"JOIN qrcodes q ON o.code_id = q.code_id", "JOIN qrcodes q ON o.code_id = q.code_id",
"WHERE 1=1", "WHERE 1=1",
+5 -4
View File
@@ -23,13 +23,14 @@ const STATUS_OPTIONS: { value: number; label: string; color?: string }[] = [
{ value: 0, label: '待支付' }, { value: 0, label: '待支付' },
{ value: 1, label: '排队中', color: 'gold' }, { value: 1, label: '排队中', color: 'gold' },
{ value: 2, label: '已取消', color: 'red' }, { value: 2, label: '已取消', color: 'red' },
{ value: 3, label: '设备执行完成', color: 'green' }, { value: 3, label: '任务完成', color: 'green' },
{ value: 4, label: '正在服务', color: 'blue' }, { value: 4, label: '正在服务', color: 'blue' },
{ value: 5, label: '素材上传', color: 'geekblue' }, { value: 5, label: '素材上传', color: 'geekblue' },
{ value: 6, label: '任务完成', color: 'purple' }, { value: 6, label: '素材上传完成', color: 'purple' },
{ value: 7, label: '退款中', color: 'orange' }, { value: 7, label: '退款中', color: 'orange' },
{ value: 8, label: '退款成功', color: 'lime' }, { value: 8, label: '全额退款', color: 'lime' },
{ value: 9, label: '退款失败', color: 'red' }, { value: 9, label: '拒绝退款', color: 'red' },
{ value: 10,label: '部分退款', color: 'plum' },
]; ];
const Welcome: React.FC = () => { const Welcome: React.FC = () => {
@@ -28,8 +28,9 @@ const RefundReviewModal: React.FC<RefundReviewModalProps> = ({
// 审核结果选项 // 审核结果选项
const reviewResults = [ const reviewResults = [
{ label: '审核通过', value: 1 }, { label: '部分退款', value: 3 },
{ label: '审核拒绝', value: 2 }, { label: '全额退款', value: 1 },
{ label: '拒绝退款', value: 2 },
]; ];
// 格式化金额(分转元) // 格式化金额(分转元)
@@ -63,6 +64,7 @@ const RefundReviewModal: React.FC<RefundReviewModalProps> = ({
0: { text: '审核中', bgColor: '#fff7e6', textColor: '#d46b08' }, // orange 0: { text: '审核中', bgColor: '#fff7e6', textColor: '#d46b08' }, // orange
1: { text: '审核通过', bgColor: '#f6ffed', textColor: '#52c41a' }, // lime 1: { text: '审核通过', bgColor: '#f6ffed', textColor: '#52c41a' }, // lime
2: { text: '审核失败', bgColor: '#fff1f0', textColor: '#f5222d' }, // red 2: { text: '审核失败', bgColor: '#fff1f0', textColor: '#f5222d' }, // red
3: { text: '部分退款', bgColor: '#EE82EE', textColor: '#EE82EE' }, // Violet
}; };
return statusMap[state] || { text: '未知状态', bgColor: '#f5f5f5', textColor: '#666' }; return statusMap[state] || { text: '未知状态', bgColor: '#f5f5f5', textColor: '#666' };
}; };
@@ -341,8 +343,8 @@ const RefundReviewModal: React.FC<RefundReviewModalProps> = ({
<Form form={form} layout="vertical"> <Form form={form} layout="vertical">
<Form.Item <Form.Item
name="reviewResult" name="reviewResult"
label="审核结果" label="退款类型"
rules={[{ required: true, message: '请选择审核结果' }]} rules={[{ required: true, message: '请选择退款类型' }]}
> >
<Select placeholder="请选择" options={reviewResults} /> <Select placeholder="请选择" options={reviewResults} />
</Form.Item> </Form.Item>
@@ -15,8 +15,9 @@ export const ORDER_STATUS_OPTIONS: { label: string; value: number; color?: strin
{ label: '素材上传中', value: 5, color: 'geekblue' }, { label: '素材上传中', value: 5, color: 'geekblue' },
{ label: '素材上传完成', value: 6, color: 'green' }, { label: '素材上传完成', value: 6, color: 'green' },
{ label: '退款中', value: 7, color: 'orange' }, { label: '退款中', value: 7, color: 'orange' },
{ label: '退款成功', value: 8, color: 'lime' }, { label: '全额退款', value: 8, color: 'lime' },
{ label: '退款失败', value: 9, color: 'red' }, { label: '拒绝退款', value: 9, color: 'red' },
{ label: '部分退款', value: 10, color: 'plum' },
]; ];
export const findLabel = (arr: { label: string; value: number }[], v?: number) => arr.find(o => o.value === v)?.label || '未知'; export const findLabel = (arr: { label: string; value: number }[], v?: number) => arr.find(o => o.value === v)?.label || '未知';