-
斗鱼订单台账
- 系统正常订单由直播账号履约工作台维护;这里记录财务、异常和人工补登记
+ 斗鱼预售台账
+ 预售订单在直播账号履约工作台绑定完成后同步到这里;这里记录财务、异常和人工补登记
diff --git a/web/frontend/src/pages/PlatformFulfillmentPage.tsx b/web/frontend/src/pages/PlatformFulfillmentPage.tsx
index 3020841..aff7b67 100644
--- a/web/frontend/src/pages/PlatformFulfillmentPage.tsx
+++ b/web/frontend/src/pages/PlatformFulfillmentPage.tsx
@@ -2,7 +2,7 @@ import { useCallback, useEffect, useRef, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import dayjs from 'dayjs';
import type { Dayjs } from 'dayjs';
-import { Alert, Button, Card, Col, DatePicker, Descriptions, Drawer, Empty, Image, Input, InputNumber, Modal, QRCode, Row, Segmented, Select, Space, Switch, Table, Tag, Timeline, Typography } from 'antd';
+import { Alert, Button, Card, Col, DatePicker, Descriptions, Drawer, Empty, Image, Input, InputNumber, Modal, QRCode, Row, Segmented, Select, Space, Switch, Table, Tabs, Tag, Timeline, Typography } from 'antd';
import { CheckCircleOutlined, CopyOutlined, CreditCardOutlined, DownloadOutlined, GiftOutlined, LinkOutlined, QrcodeOutlined, ReloadOutlined, SettingOutlined, ShoppingOutlined, SyncOutlined, UndoOutlined, UserSwitchOutlined } from '@ant-design/icons';
import type { ColumnsType } from 'antd/es/table';
import { douyuApi, platformFulfillmentApi } from '../api/modules';
@@ -123,7 +123,16 @@ const MANUAL_REASON_LABELS: Record = {
const QUEUE_BUCKET_OPTIONS = [
{ value: 'current', label: '当前待办' },
{ value: 'pending_mapping', label: '待映射' },
+ { value: 'ready_for_fulfillment', label: '可履约' },
+ { value: 'needs_action', label: '需要人工' },
+ { value: 'completed', label: '已完成' },
+ { value: 'cancelled', label: '已取消' },
+];
+
+const PRESALE_QUEUE_BUCKET_OPTIONS = [
+ { value: 'current', label: '当前待办' },
{ value: 'presale_waiting', label: '预售待开放' },
+ { value: 'pending_mapping', label: '待映射' },
{ value: 'ready_for_fulfillment', label: '可履约' },
{ value: 'needs_action', label: '需要人工' },
{ value: 'completed', label: '已完成' },
@@ -454,7 +463,7 @@ export default function PlatformFulfillmentPage() {
const navigate = useNavigate();
const { can } = usePermissions(user);
const [queueBucket, setQueueBucket] = useState('current');
- const [saleModeFilter, setSaleModeFilter] = useState('');
+ const [saleModeTab, setSaleModeTab] = useState<'direct' | 'presale'>('direct');
const [keyword, setKeyword] = useState('');
const [page, setPage] = useState(1);
const [pageSize, setPageSize] = useState(20);
@@ -549,7 +558,7 @@ export default function PlatformFulfillmentPage() {
const result = await platformFulfillmentApi.listTasks({
status: queueBackedStatus,
queue_bucket: backendBucket,
- sale_mode: saleModeFilter || undefined,
+ sale_mode: saleModeTab,
keyword: keyword.trim() || undefined,
page,
page_size: pageSize,
@@ -561,7 +570,7 @@ export default function PlatformFulfillmentPage() {
} finally {
if (!silent) setLoading(false);
}
- }, [keyword, page, pageSize, queueBucket, saleModeFilter]);
+ }, [keyword, page, pageSize, queueBucket, saleModeTab]);
const loadDetail = useCallback(async (taskId: number, silent = false) => {
if (!silent) setDetailLoading(true);
@@ -709,7 +718,7 @@ export default function PlatformFulfillmentPage() {
const result = await platformFulfillmentApi.syncCollab(taskIds);
const syncedOrderNo =
result.items.find((item) => item.action === 'created' || item.action === 'updated')?.orderNo || '';
- const summary = `订单台账同步完成:新增 ${result.created},更新 ${result.updated}${
+ const summary = `斗鱼预售台账同步完成:新增 ${result.created},更新 ${result.updated}${
taskIds.length === 1 && syncedOrderNo ? `,订单 ${syncedOrderNo}` : ''
}`;
if (result.failed || result.skipped) {
@@ -1410,7 +1419,7 @@ export default function PlatformFulfillmentPage() {
),
},
{
- title: '订单台账',
+ title: '斗鱼预售台账',
key: 'collab',
width: 150,
render: (_, task) =>
@@ -1454,21 +1463,23 @@ export default function PlatformFulfillmentPage() {
- }
- loading={rowCollabSyncingId === task.id}
- disabled={
- !can('platform_fulfillment:use') ||
- task.bindingStatus !== 'bound' ||
- collabSyncing ||
- (rowCollabSyncingId !== null && rowCollabSyncingId !== task.id)
- }
- onClick={() => void performCollabSync([task.id], task.id)}
- >
- 同步到订单台账
-
+ {saleModeTab === 'presale' ? (
+ }
+ loading={rowCollabSyncingId === task.id}
+ disabled={
+ !can('platform_fulfillment:use') ||
+ task.bindingStatus !== 'bound' ||
+ collabSyncing ||
+ (rowCollabSyncingId !== null && rowCollabSyncingId !== task.id)
+ }
+ onClick={() => void performCollabSync([task.id], task.id)}
+ >
+ 同步到斗鱼预售台账
+
+ ) : null}
{task.executionStatus === 'pending_mapping' ? (
} disabled={!can('platform_fulfillment:admin')} onClick={() => void openMapping(task)}>
配置映射
@@ -1531,11 +1542,13 @@ export default function PlatformFulfillmentPage() {
},
];
- const centeredColumns = columns.map((column) => ({
- ...column,
- align: 'center' as const,
- onHeaderCell: () => ({ style: { textAlign: 'center' as const } }),
- }));
+ const centeredColumns = columns
+ .filter((column) => saleModeTab !== 'direct' || column.key !== 'collab')
+ .map((column) => ({
+ ...column,
+ align: 'center' as const,
+ onHeaderCell: () => ({ style: { textAlign: 'center' as const } }),
+ }));
const selectedCollabReady =
selectedRowKeys.length > 0 &&
@@ -1644,19 +1657,21 @@ export default function PlatformFulfillmentPage() {
} disabled={!can('platform_fulfillment:admin')} onClick={() => void openMapping()}>
商品映射
- }
- loading={collabSyncing}
- disabled={
- !can('platform_fulfillment:use') ||
- selectedRowKeys.length === 0 ||
- !selectedCollabReady ||
- rowCollabSyncingId !== null
- }
- onClick={() => void syncCollab()}
- >
- 同步到订单台账{selectedRowKeys.length > 0 ? `(${selectedRowKeys.length})` : ''}
-
+ {saleModeTab === 'presale' ? (
+ }
+ loading={collabSyncing}
+ disabled={
+ !can('platform_fulfillment:use') ||
+ selectedRowKeys.length === 0 ||
+ !selectedCollabReady ||
+ rowCollabSyncingId !== null
+ }
+ onClick={() => void syncCollab()}
+ >
+ 同步到斗鱼预售台账{selectedRowKeys.length > 0 ? `(${selectedRowKeys.length})` : ''}
+
+ ) : null}
} onClick={() => void sync()}>
同步待履约订单
@@ -1664,6 +1679,23 @@ export default function PlatformFulfillmentPage() {
+