diff --git a/src/pages/Order/List/index.tsx b/src/pages/Order/List/index.tsx index 2e2aff3..1e4d7b6 100644 --- a/src/pages/Order/List/index.tsx +++ b/src/pages/Order/List/index.tsx @@ -27,6 +27,7 @@ import { ordercontrollerUpdateorderitems, } from '@/servers/api/order'; import { productcontrollerSearchproducts } from '@/servers/api/product'; +import { wpproductcontrollerSearchproducts } from '@/servers/api/wpProduct'; import { sitecontrollerAll } from '@/servers/api/site'; import { stockcontrollerGetallstockpoints } from '@/servers/api/stock'; import { formatShipmentState, formatSource } from '@/utils/format'; @@ -224,6 +225,11 @@ const ListPage: React.FC = () => { title: '联系电话', dataIndex: 'billing_phone', render: (_, record) => record.shipping?.phone || record.billing?.phone, + }, + { + title: '换货次数', + dataIndex: 'exchange_frequency', + hideInSearch: true, }, { title: '州', @@ -765,17 +771,16 @@ const Detail: React.FC<{ valueEnum={ORDER_STATUS_ENUM} /> - - { - return ( -
- - {record?.shipping?.phone || record?.billing?.phone || '-'} - -
- ); - }} /> + + { return ( +
+ + {record?.shipping?.phone || record?.billing?.phone || '-'} + +
+ ); + }} /> @@ -1983,17 +1988,20 @@ const SalesChange: React.FC<{ }, [], ); + + // setOptions( // data.sales?.map((item) => ({ // label: item.name, // value: item.sku, // })) || [], // ); - return { ...data }; + return { ...data}; }} onFinish={async (formData: any) => { - const { sales } = formData; - const res = await ordercontrollerUpdateorderitems({ orderId: id }, sales); + const { sales,items } = formData; + const data ={sales,items } + const res = await ordercontrollerUpdateorderitems({orderId:id}, data); if (!res.success) { message.error(`更新货物信息失败: ${res.message}`); return false; @@ -2003,11 +2011,63 @@ const SalesChange: React.FC<{ return true; }} > + + + + { + try { + const { data } = await wpproductcontrollerSearchproducts({ + name: keyWords, + }); + return ( + data?.map((item) => { + return { + label: `${item.name}`, + value: item?.sku, + }; + }) + ); + } catch (error) { + return []; + } + }} + name="sku" + label="订单" + placeholder="请选择订单" + tooltip="至少输入3个字符" + fieldProps={{ + showSearch: true, + filterOption: false, + }} + debounceTime={300} // 防抖,减少请求频率 + rules={[{ required: true, message: '请选择订单' }]} + /> + + + + + + + {