2026-01-26 17:00:12 +08:00
|
|
|
|
import { createRouter, createWebHistory } from 'vue-router'
|
2026-01-27 15:50:23 +08:00
|
|
|
|
// 核心修改点:使用 'type' 关键字导入 RouteRecordRaw,或者将其分开导入
|
|
|
|
|
|
import type { RouteRecordRaw } from 'vue-router'
|
|
|
|
|
|
import Layout from '@/layout/index.vue'
|
2026-01-26 17:00:12 +08:00
|
|
|
|
|
2026-01-27 15:50:23 +08:00
|
|
|
|
const routes: Array<RouteRecordRaw> = [
|
|
|
|
|
|
// 1. 首页 Dashboard
|
2026-01-26 17:00:12 +08:00
|
|
|
|
{
|
|
|
|
|
|
path: '/',
|
2026-01-27 15:50:23 +08:00
|
|
|
|
component: Layout,
|
|
|
|
|
|
redirect: '/dashboard',
|
|
|
|
|
|
children: [
|
|
|
|
|
|
{
|
|
|
|
|
|
path: 'dashboard',
|
|
|
|
|
|
name: 'Dashboard',
|
|
|
|
|
|
component: () => import('@/views/dashboard/index.vue'),
|
|
|
|
|
|
meta: { title: '首页', icon: 'HomeFilled' }
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
2026-01-26 17:00:12 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
2026-01-28 08:54:11 +08:00
|
|
|
|
// 2. 基础信息 (对应 views/material/list.vue)
|
2026-01-26 17:00:12 +08:00
|
|
|
|
{
|
2026-01-27 15:50:23 +08:00
|
|
|
|
path: '/material',
|
|
|
|
|
|
component: Layout,
|
|
|
|
|
|
redirect: '/material/index',
|
|
|
|
|
|
children: [
|
|
|
|
|
|
{
|
|
|
|
|
|
path: 'index',
|
|
|
|
|
|
name: 'MaterialBase',
|
2026-01-28 08:54:11 +08:00
|
|
|
|
// 基础信息列表
|
2026-01-27 15:50:23 +08:00
|
|
|
|
component: () => import('@/views/material/list.vue'),
|
2026-01-28 08:54:11 +08:00
|
|
|
|
meta: { title: '基础信息', icon: 'Box' }
|
2026-01-27 15:50:23 +08:00
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 3. 库存管理 (采购/半成品/成品/权益)
|
|
|
|
|
|
{
|
|
|
|
|
|
path: '/inventory',
|
|
|
|
|
|
component: Layout,
|
|
|
|
|
|
meta: { title: '库存管理', icon: 'Shop' },
|
|
|
|
|
|
redirect: '/inventory/buy',
|
|
|
|
|
|
children: [
|
|
|
|
|
|
{
|
|
|
|
|
|
path: 'buy',
|
|
|
|
|
|
name: 'InventoryBuy',
|
|
|
|
|
|
// 采购入库页面
|
|
|
|
|
|
component: () => import('@/views/stock/inbound/buy.vue'),
|
|
|
|
|
|
meta: { title: '采购件' }
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
path: 'semi',
|
|
|
|
|
|
name: 'InventorySemi',
|
|
|
|
|
|
// 半成品页面
|
|
|
|
|
|
component: () => import('@/views/stock/inbound/semi.vue'),
|
|
|
|
|
|
meta: { title: '半成品' }
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
path: 'product',
|
|
|
|
|
|
name: 'InventoryProduct',
|
|
|
|
|
|
// 成品页面
|
|
|
|
|
|
component: () => import('@/views/stock/inbound/product.vue'),
|
|
|
|
|
|
meta: { title: '成品' }
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
path: 'service',
|
|
|
|
|
|
name: 'InventoryService',
|
|
|
|
|
|
// 服务权益页面
|
|
|
|
|
|
component: () => import('@/views/stock/inbound/service.vue'),
|
|
|
|
|
|
meta: { title: '服务权益' }
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 4. 业务操作 (借库/维修/报废)
|
|
|
|
|
|
{
|
|
|
|
|
|
path: '/operation',
|
|
|
|
|
|
component: Layout,
|
|
|
|
|
|
meta: { title: '业务操作', icon: 'Operation' },
|
|
|
|
|
|
redirect: '/operation/borrow',
|
|
|
|
|
|
children: [
|
|
|
|
|
|
{
|
|
|
|
|
|
path: 'borrow',
|
|
|
|
|
|
name: 'OpBorrow',
|
|
|
|
|
|
// 借库页面
|
|
|
|
|
|
component: () => import('@/views/transaction/borrow.vue'),
|
|
|
|
|
|
meta: { title: '借库' }
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
path: 'repair',
|
|
|
|
|
|
name: 'OpRepair',
|
|
|
|
|
|
// 维修页面 (指向 return.vue)
|
|
|
|
|
|
component: () => import('@/views/transaction/return.vue'),
|
|
|
|
|
|
meta: { title: '维修' }
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
path: 'scrap',
|
|
|
|
|
|
name: 'OpScrap',
|
|
|
|
|
|
// 报废页面
|
|
|
|
|
|
component: () => import('@/views/transaction/scrap.vue'),
|
|
|
|
|
|
meta: { title: '报废' }
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
/* * 暂时屏蔽 BOM 和 系统管理
|
|
|
|
|
|
*/
|
|
|
|
|
|
// {
|
|
|
|
|
|
// path: '/bom',
|
|
|
|
|
|
// component: Layout,
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
// {
|
|
|
|
|
|
// path: 'index',
|
|
|
|
|
|
// name: 'BOM',
|
|
|
|
|
|
// component: () => import('@/views/bom/index.vue'),
|
|
|
|
|
|
// meta: { title: 'BOM管理', icon: 'List' }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// ]
|
|
|
|
|
|
// },
|
|
|
|
|
|
// {
|
|
|
|
|
|
// path: '/system',
|
|
|
|
|
|
// component: Layout,
|
|
|
|
|
|
// meta: { title: '系统管理', icon: 'Setting' },
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
// {
|
|
|
|
|
|
// path: 'user',
|
|
|
|
|
|
// name: 'UserManage',
|
|
|
|
|
|
// component: () => import('@/views/system/user.vue'),
|
|
|
|
|
|
// meta: { title: '用户管理', icon: 'User' }
|
|
|
|
|
|
// },
|
|
|
|
|
|
// {
|
|
|
|
|
|
// path: 'log',
|
|
|
|
|
|
// name: 'OpLog',
|
|
|
|
|
|
// component: () => import('@/views/system/log.vue'),
|
|
|
|
|
|
// meta: { title: '操作日志', icon: 'Document' }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// ]
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
|
|
|
// 404 路由
|
|
|
|
|
|
{
|
|
|
|
|
|
path: '/:pathMatch(.*)*',
|
|
|
|
|
|
redirect: '/dashboard',
|
|
|
|
|
|
meta: { hidden: true }
|
2026-01-26 17:00:12 +08:00
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
const router = createRouter({
|
|
|
|
|
|
history: createWebHistory(),
|
|
|
|
|
|
routes
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
export default router
|