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 && (
+
)}
- {mode === 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;关闭则待人工填单。跨城/无仓仍走总部快递填单。"
/>
-
+
-
-
+
+
-
+
-
-
-
-
+
`共 ${t} 条`,
onChange: (p, ps) => {
setPage(p);
setPageSize(ps);
@@ -366,7 +381,7 @@ export default function CityWarehousesPage() {
/>
setCreateOpen(false)}
@@ -425,13 +440,11 @@ export default function CityWarehousesPage() {
-
-
-
+
@@ -490,13 +503,11 @@ export default function CityWarehousesPage() {
-
-
-
+
diff --git a/packages/shared-types/src/enums.ts b/packages/shared-types/src/enums.ts
index 35f1f81..96d0b61 100644
--- a/packages/shared-types/src/enums.ts
+++ b/packages/shared-types/src/enums.ts
@@ -194,8 +194,8 @@ export const FULFILLMENT_PROVIDER_STATUS_LABELS: Record = {
- [WarehouseFulfillmentMode.API_AUTO]: 'API 自动推单',
- [WarehouseFulfillmentMode.MANUAL]: '自管手工填单',
+ [WarehouseFulfillmentMode.API_AUTO]: '自动发货',
+ [WarehouseFulfillmentMode.MANUAL]: '关闭(手工填单)',
};
export enum AccountStatus {
diff --git a/server/dukang-api/prisma/seed-v31.ts b/server/dukang-api/prisma/seed-v31.ts
index e88b2eb..026dd37 100644
--- a/server/dukang-api/prisma/seed-v31.ts
+++ b/server/dukang-api/prisma/seed-v31.ts
@@ -177,7 +177,7 @@ async function main() {
- const xfxProvider = await prisma.fulfillmentProvider.create({
+ await prisma.fulfillmentProvider.create({
data: {
code: 'XFX',
name: '小飞侠',
@@ -218,9 +218,9 @@ async function main() {
status: 'ACTIVE',
- fulfillmentMode: 'API_AUTO',
+ fulfillmentMode: 'MANUAL',
- fulfillmentProviderId: xfxProvider.id,
+ fulfillmentProviderId: null,
lng: 113.665,