fix(consignment): 内部库存匹配仅允许待分配和待抢单
This commit is contained in:
@@ -61,6 +61,9 @@ export default function ConsignmentWorkOrderMatchModal({
|
||||
queryKey: ['admin-consignment-match-candidates', workOrderId],
|
||||
queryFn: () => fetchAdminConsignmentMatchCandidates(Number(workOrderId)),
|
||||
enabled: open && Boolean(workOrderId),
|
||||
// 409 等业务拒绝对话框要直接把原因展示出来,不能重试后再被误判成“没有库存”。
|
||||
retry: false,
|
||||
refetchOnWindowFocus: false,
|
||||
})
|
||||
const data = candidatesQuery.data?.data
|
||||
const options = useMemo(() => data?.options || [], [data?.options])
|
||||
@@ -222,10 +225,25 @@ export default function ConsignmentWorkOrderMatchModal({
|
||||
}
|
||||
>
|
||||
{candidatesQuery.isLoading ? <Card loading /> : null}
|
||||
{!candidatesQuery.isLoading && options.length === 0 ? (
|
||||
{candidatesQuery.isError ? (
|
||||
<Alert
|
||||
type="error"
|
||||
showIcon
|
||||
message="读取可匹配寄卖库存失败"
|
||||
description={
|
||||
candidatesQuery.error instanceof Error ? candidatesQuery.error.message : '请稍后重试'
|
||||
}
|
||||
action={
|
||||
<Button size="small" onClick={() => void candidatesQuery.refetch()}>
|
||||
重试
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
) : null}
|
||||
{!candidatesQuery.isLoading && !candidatesQuery.isError && options.length === 0 ? (
|
||||
<Empty description="没有同配置的在库寄卖库存" />
|
||||
) : null}
|
||||
{options.length > 0 ? (
|
||||
{!candidatesQuery.isError && options.length > 0 ? (
|
||||
<Space direction="vertical" size={12} style={{ width: '100%' }}>
|
||||
{data?.matchingMode === 'off' ? (
|
||||
<Alert
|
||||
@@ -239,7 +257,7 @@ export default function ConsignmentWorkOrderMatchModal({
|
||||
type={remainingNeeded <= 0 ? 'warning' : 'info'}
|
||||
showIcon
|
||||
message={infoMessage}
|
||||
description="系统候选按寄卖配置打分;非精确/冲突库存必须人工勾选并填写原因。拼单必须一次拼满,失败不会占用任何库存。"
|
||||
description="待分配工单也可直接人工匹配;候选仍按寄卖配置打分,非精确/冲突库存必须人工勾选并填写原因。拼单必须一次拼满,失败不会占用任何库存。"
|
||||
/>
|
||||
<Space wrap size={8}>
|
||||
<Tag color="blue">
|
||||
|
||||
Reference in New Issue
Block a user