fix(consignment): 复核修复——占库撞 080 CHECK 必 500、指派非卖家双付货款、手动匹配权限门控
- 占库默认 allocation_status 从自由文本改为「已安排」,不再撞 080 的
CHECK ('待安排','已安排');加静态守卫测试(剥注释断言枚举内默认值)
- resolveConsignmentAssignRewardFen 加 assigneeIsSupplier:指派供货卖家本人
→ 报酬=结算价(货款走报酬渠道);指派别的打手 → 报酬保持原值(货款走
供货货款渠道),两条渠道互斥,封住平台双付;补行为级测试 + 调用点钉住
- 手动匹配两处入口(库存面板行内按钮、拦截弹窗 footer)统一按
consignment.fulfill 门控,编辑/作废仍为 manage,与后端权限一一对应
- docs/寄卖系统优化方案.md 记录批次 U
后端 473(+3)/ 前端 49(+1)测试全绿,typecheck / lint / format / check:sql / build 通过
This commit is contained in:
@@ -158,6 +158,7 @@ export default function ConsignmentInventoryPanel() {
|
||||
})
|
||||
const sessionPermissions = adminSessionQuery.data?.data.user.permissions
|
||||
const canManageConsignment = resolveAdminPermission(sessionPermissions, 'consignment.manage')
|
||||
const canFulfillConsignment = resolveAdminPermission(sessionPermissions, 'consignment.fulfill')
|
||||
|
||||
// 查询活跃打手列表用于指派与关联
|
||||
const workersQuery = useQuery({
|
||||
@@ -552,24 +553,28 @@ export default function ConsignmentInventoryPanel() {
|
||||
>
|
||||
详情
|
||||
</Button>
|
||||
{record.status === 'in_stock' && canFulfillConsignment ? (
|
||||
// 手动匹配是履约动作:提交打到要求 consignment.fulfill 的 /fulfill、/assign-worker。
|
||||
// 以前挂在 manage 门下,只有 manage 的人能点进去但提交必 403(本面板注释自己要求避免的口径)
|
||||
<Tooltip
|
||||
title={
|
||||
record.allowMatching
|
||||
? '从待匹配订单里人工挑一单(支持规格冲突强制匹配,需填原因)'
|
||||
: '该物品已暂停匹配,先打开上方「允许匹配」开关'
|
||||
}
|
||||
>
|
||||
<Button
|
||||
size="small"
|
||||
type="link"
|
||||
disabled={!record.allowMatching}
|
||||
onClick={() => setManualMatchItem(record)}
|
||||
>
|
||||
手动匹配订单
|
||||
</Button>
|
||||
</Tooltip>
|
||||
) : null}
|
||||
{record.status === 'in_stock' && canManageConsignment ? (
|
||||
<>
|
||||
<Tooltip
|
||||
title={
|
||||
record.allowMatching
|
||||
? '从待匹配订单里人工挑一单(支持规格冲突强制匹配,需填原因)'
|
||||
: '该物品已暂停匹配,先打开上方「允许匹配」开关'
|
||||
}
|
||||
>
|
||||
<Button
|
||||
size="small"
|
||||
type="link"
|
||||
disabled={!record.allowMatching}
|
||||
onClick={() => setManualMatchItem(record)}
|
||||
>
|
||||
手动匹配订单
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<Button
|
||||
size="small"
|
||||
type="link"
|
||||
|
||||
@@ -2987,23 +2987,27 @@ export default function WorkOrdersPanel() {
|
||||
})
|
||||
}}
|
||||
footer={[
|
||||
<Button
|
||||
key="manual-match"
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
const currentOrder = consignmentInterceptModal.order
|
||||
if (!currentOrder) return
|
||||
setConsignmentInterceptModal({
|
||||
open: false,
|
||||
order: null,
|
||||
matchData: null,
|
||||
submitting: false,
|
||||
})
|
||||
setManualMatchOrder(currentOrder)
|
||||
}}
|
||||
>
|
||||
手动指定现货匹配
|
||||
</Button>,
|
||||
// 手动指定现货会直接提交履约/指派(要求 consignment.fulfill),
|
||||
// 与行内入口(canFulfillConsignment 门控)保持一致,无权限不显示
|
||||
canFulfillConsignment ? (
|
||||
<Button
|
||||
key="manual-match"
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
const currentOrder = consignmentInterceptModal.order
|
||||
if (!currentOrder) return
|
||||
setConsignmentInterceptModal({
|
||||
open: false,
|
||||
order: null,
|
||||
matchData: null,
|
||||
submitting: false,
|
||||
})
|
||||
setManualMatchOrder(currentOrder)
|
||||
}}
|
||||
>
|
||||
手动指定现货匹配
|
||||
</Button>
|
||||
) : null,
|
||||
<Button
|
||||
key="ignore-and-publish"
|
||||
onClick={() => {
|
||||
|
||||
Reference in New Issue
Block a user