feat: Rock 回库支持上游校验与强制释放,新增 Token 状态历史
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
ExportOutlined,
|
||||
EyeOutlined,
|
||||
FileTextOutlined,
|
||||
HistoryOutlined,
|
||||
StopOutlined,
|
||||
SyncOutlined,
|
||||
UndoOutlined,
|
||||
@@ -88,7 +89,8 @@ export interface TokenColumnHandlers {
|
||||
onEditUid: (state: UidEditState) => void
|
||||
onViewRawData: (record: RockTokenItem) => void
|
||||
onResetToken: (id: number) => void
|
||||
onReleaseToken: (id: number) => void
|
||||
onReleaseToken: (record: RockTokenItem) => void
|
||||
onViewStatusLogs: (record: RockTokenItem) => void
|
||||
onUpdateRemark: (id: number, remark: string, status?: string) => void
|
||||
onMarkAbnormal: (id: number, remark?: string) => void
|
||||
}
|
||||
@@ -108,6 +110,7 @@ export function buildTokenColumns({
|
||||
onViewRawData,
|
||||
onResetToken,
|
||||
onReleaseToken,
|
||||
onViewStatusLogs,
|
||||
onUpdateRemark,
|
||||
onMarkAbnormal,
|
||||
}: TokenColumnHandlers): ColumnsType<RockTokenItem> {
|
||||
@@ -500,9 +503,19 @@ export function buildTokenColumns({
|
||||
</span>
|
||||
</Tooltip>
|
||||
)
|
||||
const historyButton = (
|
||||
<Button
|
||||
size="small"
|
||||
type="text"
|
||||
icon={<HistoryOutlined />}
|
||||
onClick={() => onViewStatusLogs(record)}
|
||||
>
|
||||
历史
|
||||
</Button>
|
||||
)
|
||||
if (record.status === 'mismatch') {
|
||||
return (
|
||||
<Space direction="vertical" size={4}>
|
||||
<Space size={4} wrap>
|
||||
{refreshButton}
|
||||
{upstreamButton}
|
||||
<Button
|
||||
@@ -542,12 +555,13 @@ export function buildTokenColumns({
|
||||
解冻重置
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
{historyButton}
|
||||
</Space>
|
||||
)
|
||||
}
|
||||
if (record.status === 'abnormal') {
|
||||
return (
|
||||
<Space direction="vertical" size={4}>
|
||||
<Space size={4} wrap>
|
||||
<Text type="secondary" style={{ fontSize: 11 }}>已失效作废</Text>
|
||||
{upstreamButton}
|
||||
<Popconfirm
|
||||
@@ -562,42 +576,35 @@ export function buildTokenColumns({
|
||||
恢复回库存
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
{historyButton}
|
||||
</Space>
|
||||
)
|
||||
}
|
||||
if (record.status === 'using') {
|
||||
const canRelease = !record.bound_at && !record.actual_role_id
|
||||
return (
|
||||
<Space direction="vertical" size={4}>
|
||||
<Space size={4} wrap>
|
||||
{refreshButton}
|
||||
{upstreamButton}
|
||||
{canRelease && (
|
||||
<Popconfirm
|
||||
title="释放这条未绑定的提货链接?"
|
||||
description="仅在买家没有扫码绑定时可以释放。系统会先向上游确认;确认未绑定后,链接回到可用库存,可以分给下一单。请先确认该订单已退款。原发货页若仍打开,买家再次获取二维码会重新占用一条库存。"
|
||||
okText="确认释放"
|
||||
cancelText="取消"
|
||||
onConfirm={() => onReleaseToken(record.id)}
|
||||
>
|
||||
<Button size="small" icon={<UndoOutlined />}>
|
||||
释放回库存
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
)}
|
||||
<Button size="small" icon={<UndoOutlined />} onClick={() => onReleaseToken(record)}>
|
||||
释放回库存
|
||||
</Button>
|
||||
{historyButton}
|
||||
</Space>
|
||||
)
|
||||
}
|
||||
if (record.status === 'bound') {
|
||||
return (
|
||||
<Space direction="vertical" size={4}>
|
||||
<Space size={4} wrap>
|
||||
{refreshButton}
|
||||
{upstreamButton}
|
||||
{historyButton}
|
||||
</Space>
|
||||
)
|
||||
}
|
||||
return (
|
||||
<Space direction="vertical" size={4}>
|
||||
<Space size={4} wrap>
|
||||
{upstreamButton}
|
||||
{historyButton}
|
||||
</Space>
|
||||
)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user