feat: add manual fulfillment order creation
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Button, Card, Col, Form, Input, Popconfirm, Row, Select, Space, Table, Tag, Typography, message } from 'antd'
|
||||
import { Button, Card, Col, Form, Input, Popconfirm, Row, Select, Space, Table, Tabs, Tag, Typography, message } from 'antd'
|
||||
import type { FormInstance } from 'antd'
|
||||
import {
|
||||
ClockCircleOutlined,
|
||||
@@ -168,8 +168,10 @@ export function ProductsTab({
|
||||
export function OrdersTab({
|
||||
loading,
|
||||
orders,
|
||||
orderSource,
|
||||
canManage,
|
||||
onCreateTestOrder,
|
||||
onCreateManualOrder,
|
||||
onOrderSourceChange,
|
||||
onLoadOrders,
|
||||
onCopyLink,
|
||||
onOpenLink,
|
||||
@@ -178,8 +180,10 @@ export function OrdersTab({
|
||||
}: {
|
||||
loading: boolean
|
||||
orders: PageResult<FulfillmentOrder>
|
||||
orderSource: 'api' | 'manual'
|
||||
canManage: boolean
|
||||
onCreateTestOrder: () => void
|
||||
onCreateManualOrder: () => void
|
||||
onOrderSourceChange: (source: 'api' | 'manual') => void
|
||||
onLoadOrders: (page?: number, size?: number) => void
|
||||
onCopyLink: (orderNo: string) => void
|
||||
onOpenLink: (orderNo: string) => void
|
||||
@@ -232,12 +236,17 @@ export function OrdersTab({
|
||||
|
||||
return (
|
||||
<Space direction="vertical" style={{ width: '100%' }} size="middle">
|
||||
<Space style={{ width: '100%', justifyContent: 'space-between' }}>
|
||||
<Typography.Text type="secondary">发货链接由后端生成并带签名,用户只填写游戏 UID。</Typography.Text>
|
||||
<Space wrap style={{ width: '100%', justifyContent: 'space-between' }}>
|
||||
<Tabs
|
||||
activeKey={orderSource}
|
||||
onChange={(key) => onOrderSourceChange(key as 'api' | 'manual')}
|
||||
items={[{ key: 'api', label: 'API 订单' }, { key: 'manual', label: '手动订单' }]}
|
||||
style={{ minWidth: 220 }}
|
||||
/>
|
||||
{canManage && (
|
||||
<Space>
|
||||
<Button type="primary" icon={<PlusOutlined />} onClick={onCreateTestOrder}>
|
||||
创建测试订单
|
||||
<Button type="primary" icon={<PlusOutlined />} onClick={onCreateManualOrder}>
|
||||
创建手动订单
|
||||
</Button>
|
||||
</Space>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user