feat(consignment): 寄售仓库按寄卖分类筛选并支持动态规格过滤
This commit is contained in:
@@ -22,16 +22,27 @@ function resolveScoreTag(pair: PendingPistolMatchPair) {
|
||||
export default function ConsignmentPendingMatchModal({
|
||||
open,
|
||||
onClose,
|
||||
categoryId,
|
||||
categoryName,
|
||||
}: {
|
||||
open: boolean
|
||||
onClose: () => void
|
||||
/** 只统计该寄卖分类;不传 = 全部 */
|
||||
categoryId?: number | null
|
||||
categoryName?: string
|
||||
}) {
|
||||
const [keyword, setKeyword] = useState('')
|
||||
const [includeConflicts, setIncludeConflicts] = useState(false)
|
||||
|
||||
const query = useQuery({
|
||||
queryKey: ['admin-pending-pistol-matches', keyword, includeConflicts],
|
||||
queryFn: () => fetchPendingPistolMatches({ keyword, includeConflicts, limit: 300 }),
|
||||
queryKey: ['admin-pending-pistol-matches', categoryId ?? null, keyword, includeConflicts],
|
||||
queryFn: () =>
|
||||
fetchPendingPistolMatches({
|
||||
categoryId: categoryId ?? undefined,
|
||||
keyword,
|
||||
includeConflicts,
|
||||
limit: 300,
|
||||
}),
|
||||
enabled: open,
|
||||
refetchOnWindowFocus: false,
|
||||
retry: false,
|
||||
@@ -187,7 +198,7 @@ export default function ConsignmentPendingMatchModal({
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title="匹配 · 待抢单 × 在库现货"
|
||||
title={categoryName ? `匹配 · ${categoryName} 待抢单 × 在库现货` : '匹配 · 待抢单 × 在库现货'}
|
||||
open={open}
|
||||
width="min(1320px, 94vw)"
|
||||
footer={null}
|
||||
@@ -198,11 +209,16 @@ export default function ConsignmentPendingMatchModal({
|
||||
<Alert
|
||||
type="info"
|
||||
showIcon
|
||||
message="按寄卖配置匹配全部待抢单 × 在库待匹配现货,不直接改单。"
|
||||
description="有寄卖配置的订单按该分类的规格逐项判定(精确 / 非精确 / 不匹配);拼单订单按剩余份数展示。未配置寄卖的订单仍按旧手枪口径兜底。"
|
||||
message={
|
||||
categoryName
|
||||
? `只统计「${categoryName}」分类下的待抢单 × 在库待匹配现货,不直接改单。`
|
||||
: '按寄卖配置匹配全部待抢单 × 在库待匹配现货,不直接改单。'
|
||||
}
|
||||
description="有寄卖配置的订单按该分类的规格逐项判定(精确 / 非精确 / 不匹配);拼单订单按剩余份数展示。"
|
||||
/>
|
||||
|
||||
<Space wrap size={12}>
|
||||
{categoryName ? <Tag color="blue">分类:{categoryName}</Tag> : null}
|
||||
<Tag>待抢单 {data?.pendingOrderCount ?? 0} 单</Tag>
|
||||
<Tag>在库待匹配 {data?.inStockInventoryCount ?? 0} 件</Tag>
|
||||
<Tag color="blue">匹配组合 {data?.pairCount ?? 0} 条</Tag>
|
||||
@@ -267,8 +283,8 @@ export default function ConsignmentPendingMatchModal({
|
||||
<Empty
|
||||
description={
|
||||
includeConflicts
|
||||
? '没有可展示的配对'
|
||||
: '没有有分匹配;可勾选「显示 0 分不匹配项」查看冲突'
|
||||
? '当前分类下没有可展示的配对'
|
||||
: '当前分类下没有可匹配组合;可勾选「显示 0 分不匹配项」查看冲突'
|
||||
}
|
||||
/>
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user