feat(purchase): 新增「待采购清单」页面

路由 router/index.ts:
  /purchase 下新增子路由 pending(name: PurchasePendingPool)。
  ★ 父路由刻意不加 permissions —— 加了会让没有 pending_pool 权限的用户
    整个「采购管理」模块从侧边栏消失。

页面 views/purchase/PendingPool.vue:
  筛选栏 + 表格 + 分页,列含产品图、规格、当前库存、在途、有效供给、
  预警、建议采购量(tooltip 展示完整算式)、参考单价、采购链接、操作。
  采购链接渲染走 safeHref 白名单,非法地址不渲染成可点击链接。

api/purchase.ts:
  新增 getPendingPurchasePool 与 PendingPoolItem 类型。

★ 需告知业务方的可见变化:「采购管理」从扁平单项变为可展开子菜单
  (Sidebar 在子路由只有 1 个时渲染 el-menu-item,2 个时渲染 el-sub-menu)。
This commit is contained in:
yueli
2026-09-18 14:31:07 +08:00
parent b4445f07d9
commit 690ee2c81d
3 changed files with 509 additions and 0 deletions

View File

@ -213,6 +213,8 @@ const routes: Array<RouteRecordRaw> = [
{
path: '/purchase',
component: Layout,
// ★ 父路由**不加** permissions:加了会让没有 pending_pool 权限的用户
// 整个「采购管理」模块从侧边栏消失。
meta: { title: '采购管理', icon: 'ShoppingCart' },
children: [
{
@ -220,6 +222,12 @@ const routes: Array<RouteRecordRaw> = [
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'] }
}
]
},