forked from yoone/WEB
1
0
Fork 0

Compare commits

...

2 Commits

Author SHA1 Message Date
zhuotianyuan 724f7c2025 style: 格式化订单列表页代码缩进和换行 2026-01-27 17:09:30 +08:00
zhuotianyuan 9c63e80ca2 feat(订单列表): 添加快递公司选择字段
新增快递公司选择下拉框,并默认设置 UNIUNI 为初始值。同时修正发货信息中 email_addresses 字段的取值逻辑
2026-01-27 17:04:59 +08:00
1 changed files with 320 additions and 304 deletions

View File

@ -1381,10 +1381,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}
@ -1413,7 +1419,7 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
await ordercontrollerGetorderdetail({ await ordercontrollerGetorderdetail({
orderId: id, orderId: id,
}); });
console.log('success data',success,data) console.log('success data', success, data)
if (!success || !data) return {}; if (!success || !data) return {};
data.sales = data.sales?.reduce( data.sales = data.sales?.reduce(
(acc: API.OrderSale[], cur: API.OrderSale) => { (acc: API.OrderSale[], cur: API.OrderSale) => {
@ -1438,6 +1444,7 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
if (shipmentInfo) shipmentInfo = JSON.parse(shipmentInfo); if (shipmentInfo) shipmentInfo = JSON.parse(shipmentInfo);
const a = { const a = {
shipmentPlatform: 'uniuni', shipmentPlatform: 'uniuni',
courierCompany: 'UNIUNI',
...data, ...data,
// payment_method_id: shipmentInfo?.payment_method_id, // payment_method_id: shipmentInfo?.payment_method_id,
stockPointId: shipmentInfo?.stockPointId, stockPointId: shipmentInfo?.stockPointId,
@ -1464,7 +1471,7 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
}, },
origin: { origin: {
name: data?.name, name: data?.name,
email_addresses: data?.email, email_addresses: shipmentInfo?.email_addresses,
contact_name: data?.name, contact_name: data?.name,
phone_number: shipmentInfo?.phone_number, phone_number: shipmentInfo?.phone_number,
address: { address: {
@ -1541,6 +1548,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,
}), }),
); );
@ -1571,6 +1579,14 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
rules={[{ required: true, message: '请选择一个选项' }]} rules={[{ required: true, message: '请选择一个选项' }]}
/> />
</Col> </Col>
<Col span={8}>
<ProFormSelect
name="courierCompany"
label="快递公司"
options={courierCompany}
placeholder="请选择快递公司"
/>
</Col>
</Row> </Row>
<ProFormText label="订单号" readonly name='externalOrderId' /> <ProFormText label="订单号" readonly name='externalOrderId' />
<ProFormText label="客户备注" readonly name="customer_note" /> <ProFormText label="客户备注" readonly name="customer_note" />
@ -1718,7 +1734,7 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
// address_id: row.id, // address_id: row.id,
details: { details: {
origin: { origin: {
email_addresses:email, email_addresses: email,
address, address,
phone_number: { phone_number: {
phone: phone_number, phone: phone_number,
@ -2604,7 +2620,7 @@ const AddressPicker: React.FC<{
}, },
{ {
title: '邮箱', title: '邮箱',
dataIndex: [ 'email'], dataIndex: ['email'],
hideInSearch: true, hideInSearch: true,
}, },
]; ];