diff --git a/apps/admin-web/src/pages/CityWarehousesPage.tsx b/apps/admin-web/src/pages/CityWarehousesPage.tsx index 095f2a7..874b0d8 100644 --- a/apps/admin-web/src/pages/CityWarehousesPage.tsx +++ b/apps/admin-web/src/pages/CityWarehousesPage.tsx @@ -11,6 +11,7 @@ import { Popconfirm, Select, Space, + Switch, Table, Tag, Typography, @@ -59,29 +60,54 @@ type PartnerOption = { id: string; companyName: string }; const MANAGER_OPTIONS = Object.entries(WAREHOUSE_MANAGER_LABELS).map(([value, label]) => ({ value, label })); const STATUS_OPTIONS = Object.entries(WAREHOUSE_STATUS_LABELS).map(([value, label]) => ({ value, label })); -const FULFILLMENT_MODE_OPTIONS = Object.entries(WAREHOUSE_FULFILLMENT_MODE_LABELS).map(([value, label]) => ({ - value, - label, -})); - function FulfillmentFields({ mode, providerOptions, + onModeChange, }: { mode: WarehouseFulfillmentMode; providerOptions: FulfillmentProviderDto[]; + onModeChange: (mode: WarehouseFulfillmentMode) => void; }) { + const autoShip = mode === WarehouseFulfillmentMode.API_AUTO; return ( <> - {mode === WarehouseFulfillmentMode.API_AUTO && ( - + ({ checked: v === WarehouseFulfillmentMode.API_AUTO })} + getValueFromEvent={(checked: boolean) => + checked ? WarehouseFulfillmentMode.API_AUTO : WarehouseFulfillmentMode.MANUAL + } + > + { + onModeChange( + checked ? WarehouseFulfillmentMode.API_AUTO : WarehouseFulfillmentMode.MANUAL, + ); + }} + /> + + {autoShip && ( + @@ -183,18 +209,17 @@ export default function CityWarehousesPage() { } function onManagerTypeChange( - type: WarehouseManagerType, - form: typeof createForm | typeof editForm, - setType: (v: WarehouseManagerType) => void, + v: WarehouseManagerType, + form: typeof createForm, + setType: (t: WarehouseManagerType) => void, ) { - setType(type); - if (type !== WarehouseManagerType.PARTNER) { + setType(v); + if (v !== WarehouseManagerType.PARTNER) { form.setFieldValue('partnerAccountId', undefined); } } const columns: ColumnsType = [ - { title: '仓库名', dataIndex: 'name', ellipsis: true, width: 140 }, { title: '城市', width: 100, @@ -204,17 +229,17 @@ export default function CityWarehousesPage() { ), }, - { title: '地址', dataIndex: 'address', ellipsis: true }, + { title: '仓库', dataIndex: 'name', width: 140, ellipsis: true }, + { title: '地址', dataIndex: 'address', width: 180, ellipsis: true }, { title: '联系人', dataIndex: 'contactName', width: 90 }, { title: '电话', dataIndex: 'contactPhone', width: 120 }, { - title: '管仓类型', - dataIndex: 'managerType', - width: 100, - render: (v) => WAREHOUSE_MANAGER_LABELS[v as WarehouseManagerType] || v, + title: '管仓', + width: 90, + render: (_, row) => WAREHOUSE_MANAGER_LABELS[row.managerType] || row.managerType, }, { - title: '管仓合伙人', + title: '合伙人', dataIndex: 'partnerCompanyName', width: 120, ellipsis: true, @@ -226,12 +251,14 @@ export default function CityWarehousesPage() { ), }, { - title: '履约', - width: 120, + title: '自动发货', + width: 130, render: (_, row) => - row.fulfillmentMode === 'API_AUTO' - ? row.fulfillmentProviderName || 'API' - : WAREHOUSE_FULFILLMENT_MODE_LABELS[WarehouseFulfillmentMode.MANUAL], + row.fulfillmentMode === 'API_AUTO' ? ( + {row.fulfillmentProviderName || '自动'} + ) : ( + {WAREHOUSE_FULFILLMENT_MODE_LABELS[WarehouseFulfillmentMode.MANUAL]} + ), }, { title: '状态', @@ -274,21 +301,23 @@ export default function CityWarehousesPage() { return (
- - 仓库管理 - + 仓库 @@ -296,7 +325,7 @@ export default function CityWarehousesPage() { type="info" showIcon style={{ marginBottom: 16 }} - message="管仓合伙人仅可在此页面分配;城市合伙人详情中的管仓仓库为只读展示。" + message="同城有仓订单:支付后按「自动发货」开关决定是否推仓配 API;关闭则待人工填单。跨城/无仓仍走总部快递填单。" />
- + + + + - - - -