路由位置
--------
放在「采购管理」之后,作为独立一级模块:
采购管理
我的申请单 ← 新增(icon: Tickets)
借库管理
★ 独立模块而非挂在某个业务页下:申请人可能提交出库/借库/报废三类单据,
放在任一业务模块下都会让其它模块的人找不到。
页面功能
--------
· 类型筛选:全部 / 出库 / 借库 / 报废
· 状态筛选:全部 / 待审批 / 已通过 / 已驳回 / 已完成 / 已撤回
· 展开行显示物料明细(数量字段已由后端归一化)
· 撤回按钮仅对 status 0/1 可见(已预占但未执行)
撤回不硬编码 URL —— 使用后端回传的 withdraw_endpoint 分发:
const res = await request({ url: row.withdraw_endpoint, method: 'post' })
这样将来模块端点调整(如借库从 close 换成正式 withdraw),前端无需改动。
权限说明
--------
菜单不做权限过滤(Sidebar 只过滤 meta.hidden),所有角色都会看到本页。
这正是预期 —— 申请人本就不应需要任何权限码。数据由后端强制按
applicant_id 过滤,看不到他人单据。
顺带清理
--------
移除先前加在 Selection.vue 的重复实现(约 110 行模板/脚本/样式),
改为一个跳转链接「查看我的申请单 >」;并移除随之失效的 3 个导入
(onMounted / Refresh / 两个 API 函数)。
验证:新页面 SFC 编译零告警;Selection.vue 清理后编译通过。
Vue 3 + TypeScript + Vite
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 <script setup> SFCs, check out the script setup docs to learn more.
Learn more about the recommended Project Setup and IDE Support in the Vue Docs TypeScript Guide.