forked from yoone/WEB
feat(订单): 添加快递公司选择字段并优化发货信息处理
在发货表单中添加快递公司选择字段,支持多种快递公司选项 优化发货信息处理逻辑,包括邮件地址和联系信息的正确处理
This commit is contained in:
parent
9263841890
commit
3c7a5d815e
|
|
@ -130,7 +130,7 @@ const ListPage: React.FC = () => {
|
|||
label: '已申请退款',
|
||||
},
|
||||
{
|
||||
|
||||
|
||||
key: 'refund_approved',
|
||||
label: "已退款",
|
||||
// label: '退款申请已通过',
|
||||
|
|
@ -174,7 +174,7 @@ const ListPage: React.FC = () => {
|
|||
hideInTable: true,
|
||||
valueType: 'dateRange',
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
title: '订阅',
|
||||
dataIndex: 'isSubscription',
|
||||
|
|
@ -215,7 +215,7 @@ const ListPage: React.FC = () => {
|
|||
dataIndex: 'keyword',
|
||||
hideInTable: true,
|
||||
},
|
||||
{
|
||||
{
|
||||
title: '订单ID',
|
||||
dataIndex: 'externalOrderId',
|
||||
},
|
||||
|
|
@ -253,7 +253,7 @@ const ListPage: React.FC = () => {
|
|||
dataIndex: 'billing_phone',
|
||||
render: (_, record) => record.shipping?.phone || record.billing?.phone,
|
||||
},
|
||||
{
|
||||
{
|
||||
title: '换货次数',
|
||||
dataIndex: 'exchange_frequency',
|
||||
hideInSearch: true,
|
||||
|
|
@ -919,7 +919,7 @@ const Detail: React.FC<{
|
|||
<ul>
|
||||
{record?.items?.map((item: any) => (
|
||||
<li key={item.id}>
|
||||
{item.name}:{item.quantity}
|
||||
{item.name}:{item.quantity}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
|
@ -927,13 +927,13 @@ const Detail: React.FC<{
|
|||
}}
|
||||
/>
|
||||
{/* 显示 related order */}
|
||||
<ProDescriptions.Item
|
||||
label="关联"
|
||||
span={3}
|
||||
render={(_, record) => {
|
||||
return <RelatedOrders data={record?.related} />;
|
||||
}}
|
||||
/>
|
||||
<ProDescriptions.Item
|
||||
label="关联"
|
||||
span={3}
|
||||
render={(_, record) => {
|
||||
return <RelatedOrders data={record?.related} />;
|
||||
}}
|
||||
/>
|
||||
{/* 订单内容 */}
|
||||
<ProDescriptions.Item
|
||||
label="订单内容"
|
||||
|
|
@ -1197,10 +1197,16 @@ const Shipping: React.FC<{
|
|||
const [rates, setRates] = useState<API.RateDTO[]>([]);
|
||||
const [ratesLoading, setRatesLoading] = useState(false);
|
||||
const { message } = App.useApp();
|
||||
const [shipmentPlatforms, setShipmentPlatforms] = useState([
|
||||
const [shipmentPlatforms, setShipmentPlatforms] = useState([
|
||||
{ label: 'uniuni', value: 'uniuni' },
|
||||
{ label: 'tms.freightwaves', value: 'freightwaves' },
|
||||
]);
|
||||
]);
|
||||
const [courierCompany, setCourierCompany] = useState([
|
||||
{ label: 'UNIUNI', value: 'UNIUNI' },
|
||||
{ label: 'PuroYYZ', value: 'PuroYYZ' },
|
||||
{ label: 'CPYYZ', value: 'CPYYZ' },
|
||||
{ label: 'UPSYYZ7000NEW', value: 'UPSYYZ7000NEW' },
|
||||
]);
|
||||
return (
|
||||
<ModalForm
|
||||
formRef={formRef}
|
||||
|
|
@ -1252,6 +1258,7 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
|
|||
if (shipmentInfo) shipmentInfo = JSON.parse(shipmentInfo);
|
||||
return {
|
||||
shipmentPlatform: 'freightwaves',
|
||||
courierCompany: 'UNIUNI',
|
||||
...data,
|
||||
// payment_method_id: shipmentInfo?.payment_method_id,
|
||||
stockPointId: shipmentInfo?.stockPointId,
|
||||
|
|
@ -1278,7 +1285,7 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
|
|||
},
|
||||
origin: {
|
||||
name: data?.siteName,
|
||||
email_addresses: data?.email,
|
||||
email_addresses: shipmentInfo?.email_addresses,
|
||||
contact_name: data?.siteName,
|
||||
phone_number: shipmentInfo?.phone_number,
|
||||
address: {
|
||||
|
|
@ -1345,6 +1352,7 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
|
|||
postal_code: details.origin.address.postal_code,
|
||||
address_line_1: details.origin.address.address_line_1,
|
||||
phone_number: details.origin.phone_number,
|
||||
email_addresses: details.origin.email_addresses,
|
||||
}),
|
||||
);
|
||||
|
||||
|
|
@ -1366,17 +1374,25 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
|
|||
}}
|
||||
>
|
||||
|
||||
<Row gutter={16}>
|
||||
<Row gutter={16}>
|
||||
<Col span={8}>
|
||||
<ProFormSelect
|
||||
name="shipmentPlatform"
|
||||
label="发货平台"
|
||||
options={shipmentPlatforms}
|
||||
placeholder="请选择发货平台"
|
||||
rules={[{ required: true, message: '请选择一个选项' }]}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
<ProFormSelect
|
||||
name="shipmentPlatform"
|
||||
label="发货平台"
|
||||
options={shipmentPlatforms}
|
||||
placeholder="请选择发货平台"
|
||||
rules={[{ required: true, message: '请选择一个选项' }]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormSelect
|
||||
name="courierCompany"
|
||||
label="快递公司"
|
||||
options={courierCompany}
|
||||
placeholder="请选择快递公司"
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
<ProFormText
|
||||
label="订单号"
|
||||
readonly
|
||||
|
|
@ -2043,14 +2059,14 @@ 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;
|
||||
|
|
@ -2064,14 +2080,14 @@ const SalesChange: React.FC<{
|
|||
return true;
|
||||
}}
|
||||
>
|
||||
<ProFormList
|
||||
<ProFormList
|
||||
label="换货订单"
|
||||
name="items"
|
||||
>
|
||||
<ProForm.Group>
|
||||
|
||||
<ProFormSelect
|
||||
params={{ }}
|
||||
params={{}}
|
||||
request={async ({ keyWords }) => {
|
||||
try {
|
||||
const { data } = await wpproductcontrollerSearchproducts({
|
||||
|
|
@ -2110,7 +2126,7 @@ const SalesChange: React.FC<{
|
|||
precision: 0,
|
||||
}}
|
||||
/>
|
||||
|
||||
|
||||
</ProForm.Group>
|
||||
</ProFormList>
|
||||
|
||||
|
|
@ -2120,7 +2136,7 @@ const SalesChange: React.FC<{
|
|||
>
|
||||
<ProForm.Group>
|
||||
|
||||
|
||||
|
||||
<ProFormSelect
|
||||
params={{}}
|
||||
request={async ({ keyWords }) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue