Compare commits
No commits in common. "4da8fbfdc83bfbe6327df6446a5b12988acd1afb" and "df374c4b3571bf9ae1cd4c55b5ce2a4eb8f63030" have entirely different histories.
4da8fbfdc8
...
df374c4b35
|
|
@ -2,7 +2,6 @@ import InternationalPhoneInput from '@/components/InternationalPhoneInput';
|
|||
import { ORDER_STATUS_ENUM } from '@/constants';
|
||||
import {
|
||||
logisticscontrollerCreateshipment,
|
||||
logisticscontrollerGetShipmentFee,
|
||||
logisticscontrollerDelshipment,
|
||||
logisticscontrollerGetpaymentmethods,
|
||||
logisticscontrollerGetratelist,
|
||||
|
|
@ -59,7 +58,6 @@ import {
|
|||
Button,
|
||||
Card,
|
||||
Col,
|
||||
Descriptions,
|
||||
Divider,
|
||||
Drawer,
|
||||
Dropdown,
|
||||
|
|
@ -71,7 +69,6 @@ import {
|
|||
Tabs,
|
||||
TabsProps,
|
||||
} from 'antd';
|
||||
import Item from 'antd/es/list/Item';
|
||||
import dayjs from 'dayjs';
|
||||
import React, { useMemo, useRef, useState } from 'react';
|
||||
|
||||
|
|
@ -1028,7 +1025,6 @@ const Shipping: React.FC<{
|
|||
const [options, setOptions] = useState<any[]>([]);
|
||||
const formRef = useRef<ProFormInstance>();
|
||||
|
||||
const [shipmentFee, setShipmentFee] = useState<number>(0);
|
||||
const [rates, setRates] = useState<API.RateDTO[]>([]);
|
||||
const [ratesLoading, setRatesLoading] = useState(false);
|
||||
const { message } = App.useApp();
|
||||
|
|
@ -1122,11 +1118,11 @@ const Shipping: React.FC<{
|
|||
{
|
||||
measurements: {
|
||||
weight: {
|
||||
unit: 'KGS',
|
||||
unit: 'lb',
|
||||
value: 1,
|
||||
},
|
||||
cuboid: {
|
||||
unit: 'CM',
|
||||
unit: 'in',
|
||||
l: 6,
|
||||
w: 4,
|
||||
h: 4,
|
||||
|
|
@ -1137,7 +1133,6 @@ const Shipping: React.FC<{
|
|||
],
|
||||
},
|
||||
},
|
||||
|
||||
};
|
||||
}}
|
||||
onFinish={async ({ customer_note, notes, items, details, ...data }) => {
|
||||
|
|
@ -1658,9 +1653,11 @@ const Shipping: React.FC<{
|
|||
label="单位"
|
||||
name={['measurements', 'cuboid', 'unit']}
|
||||
valueEnum={{
|
||||
CM: '厘米',
|
||||
IN: '英寸',
|
||||
FT: '英尺',
|
||||
mm: '毫米',
|
||||
cm: '厘米',
|
||||
m: '米',
|
||||
in: '英寸',
|
||||
ft: '英尺',
|
||||
}}
|
||||
placeholder="请输入单位"
|
||||
rules={[{ required: true, message: '请输入单位' }]}
|
||||
|
|
@ -1676,7 +1673,7 @@ const Shipping: React.FC<{
|
|||
<ProFormSelect
|
||||
label="单位"
|
||||
name={['measurements', 'weight', 'unit']}
|
||||
valueEnum={{ KGS: '千克', LBS: '磅', OZS: '盎司' }}
|
||||
valueEnum={{ kg: '千克', lb: '磅', g: '克', oz: '盎司' }}
|
||||
placeholder="请输入单位"
|
||||
rules={[{ required: true, message: '请输入单位' }]}
|
||||
/>
|
||||
|
|
@ -1733,52 +1730,6 @@ const Shipping: React.FC<{
|
|||
}
|
||||
}}
|
||||
</ProFormDependency>
|
||||
<Button
|
||||
loading={ratesLoading}
|
||||
onClick={async () => {
|
||||
try {
|
||||
console.log('test', formRef.current?.getFieldsValue());
|
||||
const { customer_note, notes, items, details, ...data } = formRef.current?.getFieldsValue();
|
||||
const originEmail = details.origin.email_addresses;
|
||||
const destinationEmail = details.destination.email_addresses;
|
||||
details.origin.email_addresses =
|
||||
details.origin.email_addresses.split(',');
|
||||
details.destination.email_addresses =
|
||||
details.destination.email_addresses.split(',');
|
||||
details.destination.phone_number.number =
|
||||
details.destination.phone_number.phone;
|
||||
details.origin.phone_number.number = details.origin.phone_number.phone;
|
||||
const res =
|
||||
await logisticscontrollerGetShipmentFee(
|
||||
{
|
||||
details,
|
||||
...data
|
||||
},
|
||||
);
|
||||
console.log('res', res.data);
|
||||
if (!res?.success) throw new Error(res?.errMsg);
|
||||
const fee = res.data;
|
||||
setShipmentFee(fee);
|
||||
details.origin.email_addresses = originEmail;
|
||||
details.destination.email_addresses = destinationEmail;
|
||||
formRef.current?.setFieldValue("details", {
|
||||
...details,
|
||||
shipmentFee: fee
|
||||
});
|
||||
} catch (error) {
|
||||
message.error(error?.message || '获取运费失败');
|
||||
}
|
||||
}}
|
||||
>
|
||||
获取运费
|
||||
</Button>
|
||||
<ProFormText
|
||||
readonly
|
||||
name={["details", "shipmentFee"]}
|
||||
fieldProps={{
|
||||
value: (shipmentFee / 100.0).toFixed(2)
|
||||
}}
|
||||
/>
|
||||
</ModalForm>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -21,22 +21,6 @@ export async function logisticscontrollerCreateshipment(
|
|||
});
|
||||
}
|
||||
|
||||
/** 此处后端没有提供注释 POST /logistics/getShipmentFee */
|
||||
export async function logisticscontrollerGetShipmentFee(
|
||||
body: API.ShipmentBookDTO,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.BooleanRes>(`/logistics/getShipmentFee`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/** 此处后端没有提供注释 POST /logistics/getShipmentLabel/${param0} */
|
||||
export async function logisticscontrollerGetShipmentLabel(
|
||||
shipmentId: number
|
||||
|
|
|
|||
|
|
@ -1021,7 +1021,6 @@ declare namespace API {
|
|||
packaging_type?: 'pallet' | 'package' | 'courier-pak' | 'envelope';
|
||||
packaging_properties?: PackagingPackage[];
|
||||
reference_codes?: any;
|
||||
shipmentFee: number;
|
||||
};
|
||||
|
||||
type SiteConfig = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue