diff --git a/inventory-web/src/api/purchase.ts b/inventory-web/src/api/purchase.ts index cb47a7d..7e854e3 100644 --- a/inventory-web/src/api/purchase.ts +++ b/inventory-web/src/api/purchase.ts @@ -163,3 +163,46 @@ export function getApprovedUnstockedRequests(params: { params }) } + +// 待采购池的单条物料(防重复采购) +export interface PendingPoolItem { + material_id: number + name: string + spec_model: string + unit: string + category: string + material_type: string + company_name: string + image: string + purchase_link: string + reference_price: number | null + inventory_count: number + available_count: number + // 在途量 = 该物料所有活跃采购单的剩余待入库量之和 + in_transit_qty: number + // 有效供给 = 库存 + 在途。判缺货与算建议量都基于它 + effective_supply: number + warning_status: number // 0=正常 1=黄色 2=红色(进池的必然非 0) + warning_red: number | null + warning_yellow: number | null + target_threshold: number | null + suggested_qty: number | null + is_ordered: boolean +} + +// 待采购清单:库存已触及预警线、且没有活跃采购单的物料。 +// 物料一旦有在途采购单(待审批/已通过/部分到货未齐)就会从这里消失。 +export function getPendingPurchasePool(params: { + page?: number + limit?: number + keyword?: string + category?: string + type?: string + warning_status?: number +}) { + return request({ + url: '/purchase/pending-pool', + method: 'get', + params + }) +} diff --git a/inventory-web/src/router/index.ts b/inventory-web/src/router/index.ts index 38d9fd7..4a98540 100644 --- a/inventory-web/src/router/index.ts +++ b/inventory-web/src/router/index.ts @@ -213,6 +213,8 @@ const routes: Array = [ { path: '/purchase', component: Layout, + // ★ 父路由**不加** permissions:加了会让没有 pending_pool 权限的用户 + // 整个「采购管理」模块从侧边栏消失。 meta: { title: '采购管理', icon: 'ShoppingCart' }, children: [ { @@ -220,6 +222,12 @@ const routes: Array = [ name: 'PurchaseList', component: () => import('@/views/purchase/index.vue'), meta: { title: '采购申请' } + }, + { + path: 'pending', + name: 'PurchasePendingPool', + component: () => import('@/views/purchase/PendingPool.vue'), + meta: { title: '待采购清单', permissions: ['inbound_purchase:pending_pool'] } } ] }, diff --git a/inventory-web/src/views/purchase/PendingPool.vue b/inventory-web/src/views/purchase/PendingPool.vue new file mode 100644 index 0000000..97d9c53 --- /dev/null +++ b/inventory-web/src/views/purchase/PendingPool.vue @@ -0,0 +1,458 @@ + + + + +