diff --git a/.umirc.ts b/.umirc.ts index 23bb8be..8c2f471 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -124,27 +124,27 @@ export default defineConfig({ }, ], }, - // { - // name: '物流管理', - // path: '/logistics', - // routes: [ - // { - // name: '服务商', - // path: '/logistics/services', - // component: './Logistics/Services', - // }, - // { - // name: '地址管理', - // path: '/logistics/address', - // component: './Logistics/Address', - // }, - // { - // name: '物流列表', - // path: '/logistics/list', - // component: './Logistics/List', - // }, - // ], - // }, + { + name: '物流管理', + path: '/logistics', + routes: [ + { + name: '服务商', + path: '/logistics/services', + component: './Logistics/Services', + }, + { + name: '地址管理', + path: '/logistics/address', + component: './Logistics/Address', + }, + { + name: '物流列表', + path: '/logistics/list', + component: './Logistics/List', + }, + ], + }, { name: '数据统计', path: '/statistics', diff --git a/src/pages/Logistics/List/index.tsx b/src/pages/Logistics/List/index.tsx index b2d6176..b4b5837 100644 --- a/src/pages/Logistics/List/index.tsx +++ b/src/pages/Logistics/List/index.tsx @@ -26,7 +26,7 @@ const ListPage: React.FC = () => { { title: '仓库', dataIndex: 'stockPointId', - hideInTable: true, + // hideInTable: true, valueType: 'select', request: async () => { const { data = [] } = await stockcontrollerGetallstockpoints(); @@ -42,11 +42,11 @@ const ListPage: React.FC = () => { render(_, record) { return ( <> - {record.primary_tracking_number} + {record.unique_id} { try { - await navigator.clipboard.writeText(record.tracking_url); + await navigator.clipboard.writeText(record.unique_id); message.success('复制成功!'); } catch (err) { message.error('复制失败!'); diff --git a/src/pages/Logistics/Services/index.tsx b/src/pages/Logistics/Services/index.tsx index 79f1594..f88e995 100644 --- a/src/pages/Logistics/Services/index.tsx +++ b/src/pages/Logistics/Services/index.tsx @@ -68,23 +68,23 @@ const ListPage: React.FC = () => { actionRef={actionRef} rowKey="id" toolBarRender={() => [ - , + // , ]} request={async (values) => { console.log(values); diff --git a/src/pages/Order/List/index.tsx b/src/pages/Order/List/index.tsx index 7f751c4..622f641 100644 --- a/src/pages/Order/List/index.tsx +++ b/src/pages/Order/List/index.tsx @@ -1027,7 +1027,6 @@ const Shipping: React.FC<{ const [rates, setRates] = useState([]); const [ratesLoading, setRatesLoading] = useState(false); const { message } = App.useApp(); - const [serviceType, setServiceType] = useState(''); return ( - + {/* - + */} @@ -1729,62 +1727,6 @@ const Shipping: React.FC<{ } }} - - { - console.log(e.target.value); - const type = rates.find( - (v) => v.service_id === e.target.value, - )?.type; - setServiceType(type); - }, - }} - options={rates - ?.sort((a, b) => Number(a?.total?.value) - Number(b?.total?.value)) - ?.map((rate) => { - return { - label: `${rate.carrier_name} ${rate.service_name} : ${ - rate?.total?.value / 100 - }${rate?.total?.currency}(${rate.transit_time_days}天)`, - value: rate.service_id, - }; - })} - /> ); }; diff --git a/src/servers/api/typings.d.ts b/src/servers/api/typings.d.ts index 04c7855..6baaa33 100644 --- a/src/servers/api/typings.d.ts +++ b/src/servers/api/typings.d.ts @@ -984,7 +984,7 @@ declare namespace API { type ShipmentBookDTO = { sales?: OrderSale[]; - payment_method_id?: string; + // payment_method_id?: string; service_id?: string; service_type?: string; details?: ShippingDetailsDTO; diff --git a/src/utils/format.ts b/src/utils/format.ts index 53120bf..869159e 100644 --- a/src/utils/format.ts +++ b/src/utils/format.ts @@ -55,6 +55,12 @@ export function formatShipmentState(state: string) { return '丢失'; case 'cancelled': return '取消'; + case '190': // ORDER_RECEIVED + return '订单待发送'; + case '202': // IN_TRANSIT + return '在途中'; + case '203': // DELIVERED + return '订单已送达'; default: return ''; }