feat(订单): 添加快递公司选择字段并优化发货信息处理
在发货表单中添加快递公司选择字段,支持多种快递公司选项 优化发货信息处理逻辑,包括邮件地址和联系信息的正确处理
This commit is contained in:
parent
f733f06109
commit
2d0f12d0cd
|
|
@ -215,7 +215,7 @@ const ListPage: React.FC = () => {
|
||||||
dataIndex: 'keyword',
|
dataIndex: 'keyword',
|
||||||
hideInTable: true,
|
hideInTable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '订单ID',
|
title: '订单ID',
|
||||||
dataIndex: 'externalOrderId',
|
dataIndex: 'externalOrderId',
|
||||||
},
|
},
|
||||||
|
|
@ -253,7 +253,7 @@ const ListPage: React.FC = () => {
|
||||||
dataIndex: 'billing_phone',
|
dataIndex: 'billing_phone',
|
||||||
render: (_, record) => record.shipping?.phone || record.billing?.phone,
|
render: (_, record) => record.shipping?.phone || record.billing?.phone,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '换货次数',
|
title: '换货次数',
|
||||||
dataIndex: 'exchange_frequency',
|
dataIndex: 'exchange_frequency',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
|
|
@ -927,13 +927,13 @@ const Detail: React.FC<{
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/* 显示 related order */}
|
{/* 显示 related order */}
|
||||||
<ProDescriptions.Item
|
<ProDescriptions.Item
|
||||||
label="关联"
|
label="关联"
|
||||||
span={3}
|
span={3}
|
||||||
render={(_, record) => {
|
render={(_, record) => {
|
||||||
return <RelatedOrders data={record?.related} />;
|
return <RelatedOrders data={record?.related} />;
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/* 订单内容 */}
|
{/* 订单内容 */}
|
||||||
<ProDescriptions.Item
|
<ProDescriptions.Item
|
||||||
label="订单内容"
|
label="订单内容"
|
||||||
|
|
@ -1197,10 +1197,16 @@ const Shipping: React.FC<{
|
||||||
const [rates, setRates] = useState<API.RateDTO[]>([]);
|
const [rates, setRates] = useState<API.RateDTO[]>([]);
|
||||||
const [ratesLoading, setRatesLoading] = useState(false);
|
const [ratesLoading, setRatesLoading] = useState(false);
|
||||||
const { message } = App.useApp();
|
const { message } = App.useApp();
|
||||||
const [shipmentPlatforms, setShipmentPlatforms] = useState([
|
const [shipmentPlatforms, setShipmentPlatforms] = useState([
|
||||||
{ label: 'uniuni', value: 'uniuni' },
|
{ label: 'uniuni', value: 'uniuni' },
|
||||||
{ label: 'tms.freightwaves', value: 'freightwaves' },
|
{ 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 (
|
return (
|
||||||
<ModalForm
|
<ModalForm
|
||||||
formRef={formRef}
|
formRef={formRef}
|
||||||
|
|
@ -1252,6 +1258,7 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
|
||||||
if (shipmentInfo) shipmentInfo = JSON.parse(shipmentInfo);
|
if (shipmentInfo) shipmentInfo = JSON.parse(shipmentInfo);
|
||||||
return {
|
return {
|
||||||
shipmentPlatform: 'freightwaves',
|
shipmentPlatform: 'freightwaves',
|
||||||
|
courierCompany: 'UNIUNI',
|
||||||
...data,
|
...data,
|
||||||
// payment_method_id: shipmentInfo?.payment_method_id,
|
// payment_method_id: shipmentInfo?.payment_method_id,
|
||||||
stockPointId: shipmentInfo?.stockPointId,
|
stockPointId: shipmentInfo?.stockPointId,
|
||||||
|
|
@ -1278,7 +1285,7 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
|
||||||
},
|
},
|
||||||
origin: {
|
origin: {
|
||||||
name: data?.siteName,
|
name: data?.siteName,
|
||||||
email_addresses: data?.email,
|
email_addresses: shipmentInfo?.email_addresses,
|
||||||
contact_name: data?.siteName,
|
contact_name: data?.siteName,
|
||||||
phone_number: shipmentInfo?.phone_number,
|
phone_number: shipmentInfo?.phone_number,
|
||||||
address: {
|
address: {
|
||||||
|
|
@ -1345,6 +1352,7 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
|
||||||
postal_code: details.origin.address.postal_code,
|
postal_code: details.origin.address.postal_code,
|
||||||
address_line_1: details.origin.address.address_line_1,
|
address_line_1: details.origin.address.address_line_1,
|
||||||
phone_number: details.origin.phone_number,
|
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}>
|
<Col span={8}>
|
||||||
<ProFormSelect
|
<ProFormSelect
|
||||||
name="shipmentPlatform"
|
name="shipmentPlatform"
|
||||||
label="发货平台"
|
label="发货平台"
|
||||||
options={shipmentPlatforms}
|
options={shipmentPlatforms}
|
||||||
placeholder="请选择发货平台"
|
placeholder="请选择发货平台"
|
||||||
rules={[{ required: true, message: '请选择一个选项' }]}
|
rules={[{ required: true, message: '请选择一个选项' }]}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
<Col span={8}>
|
||||||
|
<ProFormSelect
|
||||||
|
name="courierCompany"
|
||||||
|
label="快递公司"
|
||||||
|
options={courierCompany}
|
||||||
|
placeholder="请选择快递公司"
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
<ProFormText
|
<ProFormText
|
||||||
label="订单号"
|
label="订单号"
|
||||||
readonly
|
readonly
|
||||||
|
|
@ -2050,7 +2066,7 @@ const SalesChange: React.FC<{
|
||||||
// value: item.sku,
|
// value: item.sku,
|
||||||
// })) || [],
|
// })) || [],
|
||||||
// );
|
// );
|
||||||
return { ...data};
|
return { ...data };
|
||||||
}}
|
}}
|
||||||
onFinish={async (formData: any) => {
|
onFinish={async (formData: any) => {
|
||||||
const { sales } = formData;
|
const { sales } = formData;
|
||||||
|
|
@ -2064,14 +2080,14 @@ const SalesChange: React.FC<{
|
||||||
return true;
|
return true;
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ProFormList
|
<ProFormList
|
||||||
label="换货订单"
|
label="换货订单"
|
||||||
name="items"
|
name="items"
|
||||||
>
|
>
|
||||||
<ProForm.Group>
|
<ProForm.Group>
|
||||||
|
|
||||||
<ProFormSelect
|
<ProFormSelect
|
||||||
params={{ }}
|
params={{}}
|
||||||
request={async ({ keyWords }) => {
|
request={async ({ keyWords }) => {
|
||||||
try {
|
try {
|
||||||
const { data } = await wpproductcontrollerSearchproducts({
|
const { data } = await wpproductcontrollerSearchproducts({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue