From 87534c4d2261432d34f7c6a8d2c63e016afa25e0 Mon Sep 17 00:00:00 2001 From: tikkhun Date: Tue, 14 Oct 2025 11:13:06 +0800 Subject: [PATCH] =?UTF-8?q?refactor(Order/List):=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E9=80=80=E6=AC=BE=E7=9B=B8=E5=85=B3=E7=8A=B6=E6=80=81=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E4=B8=BA=E6=9B=B4=E7=AE=80=E6=B4=81=E7=9A=84=E8=A1=A8?= =?UTF-8?q?=E8=BE=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refund_approved 已退款 refund_cancelled 已完成 --- src/pages/Order/List/index.tsx | 75 ++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 36 deletions(-) diff --git a/src/pages/Order/List/index.tsx b/src/pages/Order/List/index.tsx index 4d5e162..2e2aff3 100644 --- a/src/pages/Order/List/index.tsx +++ b/src/pages/Order/List/index.tsx @@ -128,11 +128,13 @@ const ListPage: React.FC = () => { }, { key: 'refund_approved', - label: '退款申请已通过', + label: "已退款", + // label: '退款申请已通过', }, { key: 'refund_cancelled', - label: '已取消退款', + label: "已完成" + // label: '已取消退款', }, // { // key: 'pending_refund', @@ -289,7 +291,7 @@ const ListPage: React.FC = () => { record.orderStatus, ) ? ( <> - + ) : ( @@ -419,7 +421,7 @@ const ListPage: React.FC = () => { actionRef={actionRef} rowKey="id" rowClassName={(record) => { - return record.id === activeLine ? styles['selected-line-order-protable']: ''; + return record.id === activeLine ? styles['selected-line-order-protable'] : ''; }} toolBarRender={() => [ , @@ -763,16 +765,17 @@ const Detail: React.FC<{ valueEnum={ORDER_STATUS_ENUM} /> - - { return ( -
- - {record?.shipping?.phone || record?.billing?.phone || '-'} - -
- ); - }} /> + + { + return ( +
+ + {record?.shipping?.phone || record?.billing?.phone || '-'} + +
+ ); + }} /> @@ -905,7 +908,7 @@ const Detail: React.FC<{ ); }} /> - { @@ -1389,16 +1392,16 @@ const Shipping: React.FC<{ - // value && value.length > 0 - // ? Promise.resolve() - // : Promise.reject('至少需要一个商品'), - // }, - // ]} + // rules={[ + // { + // required: true, + // message: '至少需要一个商品', + // validator: (_, value) => + // value && value.length > 0 + // ? Promise.resolve() + // : Promise.reject('至少需要一个商品'), + // }, + // ]} > { - let idx = acc.findIndex((v: any) => v.productId === cur.productId); - if (idx === -1) { - acc.push(cur); - } else { - acc[idx].quantity += cur.quantity; - } - return acc; - }, + let idx = acc.findIndex((v: any) => v.productId === cur.productId); + if (idx === -1) { + acc.push(cur); + } else { + acc[idx].quantity += cur.quantity; + } + return acc; + }, [], ); // setOptions( @@ -1990,11 +1993,11 @@ const SalesChange: React.FC<{ }} onFinish={async (formData: any) => { const { sales } = formData; - const res = await ordercontrollerUpdateorderitems({orderId:id}, sales); + const res = await ordercontrollerUpdateorderitems({ orderId: id }, sales); if (!res.success) { message.error(`更新货物信息失败: ${res.message}`); return false; - } + } message.success('更新成功') detailRef?.current?.reload(); return true; @@ -2006,7 +2009,7 @@ const SalesChange: React.FC<{ > { try { const { data } = await productcontrollerSearchproducts({