feat(scrap): 报废作业页重构为「按单扫码执行」,对齐出库版式
create.vue 由「直接报废」页(492 行)重写为按单执行页:
· 顶部选择已批准申请单(scope=executable, status=1);
· 载入 items_json 为待执行清单,逐项显示批准数量与已扫数量;
· 扫码头按 (source_table, stock_id) 匹配批准明细,
不在单内或超批准量时红色 toast + 震动阻断,禁止入车;
· 支持 ?requestId= 深链直达;提交实扫 payload 到 execute 接口。
审批页的「执行报废」由弹窗盲执行改为跳转本页(router.push + query.requestId),
移除 executeVisible/confirmExecute 等已失效代码;路由标题改为「按单报废执行」。
executeScrapByRequest 增加 items 参数。
This commit is contained in:
@ -94,10 +94,18 @@ export function approveScrapRequest(id: number, data: { action: 'approve' | 'rej
|
||||
})
|
||||
}
|
||||
|
||||
// 9. 按单报废执行(扣减库存)
|
||||
export function executeScrapByRequest(id: number) {
|
||||
// 9. 按单报废执行(提交实扫明细,扣减库存)
|
||||
// items 必须是该申请单批准明细的子集,且累计数量不得超过批准数量
|
||||
export function executeScrapByRequest(id: number, items: Array<{
|
||||
source_table: string
|
||||
stock_id: number
|
||||
quantity: number
|
||||
sku?: string
|
||||
name?: string
|
||||
}>) {
|
||||
return request({
|
||||
url: `/v1/scrap/request/${id}/execute`,
|
||||
method: 'post'
|
||||
method: 'post',
|
||||
data: { items }
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user