diff --git a/inventory-web/src/api/scrap.ts b/inventory-web/src/api/scrap.ts index 946c3b5..92e0bfd 100644 --- a/inventory-web/src/api/scrap.ts +++ b/inventory-web/src/api/scrap.ts @@ -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 } }) } diff --git a/inventory-web/src/router/index.ts b/inventory-web/src/router/index.ts index 7b60018..2257144 100644 --- a/inventory-web/src/router/index.ts +++ b/inventory-web/src/router/index.ts @@ -261,7 +261,7 @@ const routes: Array = [ path: 'create', name: 'ScrapCreate', component: () => import('@/views/operation/scrap/create.vue'), - meta: { title: '新建报废' } + meta: { title: '按单报废执行' } }, { path: 'apply', diff --git a/inventory-web/src/views/operation/scrap/approval/index.vue b/inventory-web/src/views/operation/scrap/approval/index.vue index 6bee467..cc8e85b 100644 --- a/inventory-web/src/views/operation/scrap/approval/index.vue +++ b/inventory-web/src/views/operation/scrap/approval/index.vue @@ -159,45 +159,18 @@ - - - - - - - - - - - - - - - - - -