import { createRouter, createWebHistory } from 'vue-router' import type { RouteRecordRaw } from 'vue-router' import Layout from '@/layout/index.vue' const routes: RouteRecordRaw[] = [ { path: '/login', name: 'Login', component: () => import('@/views/Login.vue'), meta: { title: '登录' } }, { path: '/', component: Layout, redirect: '/dashboard', children: [ { path: 'dashboard', name: 'Dashboard', component: () => import('@/views/Dashboard.vue'), meta: { title: '首页' } } ] }, { path: '/sales', component: Layout, redirect: '/sales/customer', meta: { title: '销售管理' }, children: [ { path: 'customer', name: 'CustomerList', component: () => import('@/views/Sales/Customer/index.vue'), meta: { title: '客户档案' } }, { path: 'contract', name: 'ContractList', component: () => import('@/views/Sales/Contract/index.vue'), meta: { title: '销售合同' } }, { path: 'contract/new', name: 'ContractNew', component: () => import('@/views/Sales/Contract/form.vue'), meta: { title: '新增销售合同' } }, { path: 'contract/view/:id', name: 'ContractView', component: () => import('@/views/Sales/Contract/form.vue'), meta: { title: '合同详情' } }, { path: 'order', name: 'SalesOrderList', component: () => import('@/views/Sales/Order/index.vue'), meta: { title: '销售订单' } }, { path: 'order/form', name: 'SalesOrderNew', component: () => import('@/views/Sales/Order/form.vue'), meta: { title: '新增销售订单' } }, { path: 'order/form/:id', name: 'SalesOrderEdit', component: () => import('@/views/Sales/Order/form.vue'), meta: { title: '编辑销售订单' } }, { path: 'order/view/:id', name: 'SalesOrderView', component: () => import('@/views/Sales/Order/view.vue'), meta: { title: '销售订单详情' } }, { path: 'order/progress/:id', name: 'SalesOrderProgress', component: () => import('@/views/Sales/Order/index.vue'), meta: { title: '生产进度' } }, { path: 'hold-order', name: 'HoldOrderList', component: () => import('@/views/Sales/Order/index.vue'), meta: { title: '备货订单' } }, { path: 'deliver', name: 'DeliverList', component: () => import('@/views/Sales/Deliver/index.vue'), meta: { title: '发货通知单' } }, { path: 'deliver/new', name: 'DeliverNew', component: () => import('@/views/Sales/Deliver/form.vue'), meta: { title: '新增发货通知单' } }, { path: 'invoice', name: 'InvoiceList', component: () => import('@/views/Sales/Invoice/index.vue'), meta: { title: '开票结算单' } }, { path: 'invoice/new', name: 'InvoiceNew', component: () => import('@/views/Sales/Invoice/form.vue'), meta: { title: '新增开票结算单' } }, { path: 'saleback', name: 'SalebackList', component: () => import('@/views/Sales/Saleback/index.vue'), meta: { title: '退货通知单' } }, { path: 'saleback/new', name: 'SalebackNew', component: () => import('@/views/Sales/Saleback/form.vue'), meta: { title: '新增退货通知单' } }, { path: 'plan', name: 'PlanReport', component: () => import('@/views/Sales/Reports/PlanReport.vue'), meta: { title: '销售订单计划表' } }, { path: 'detail', name: 'DetailReport', component: () => import('@/views/Sales/Reports/DetailReport.vue'), meta: { title: '销售订单明细表' } }, { path: 'seven-day', name: 'SevenDayReport', component: () => import('@/views/Sales/Reports/SevenDayReport.vue'), meta: { title: '7天交货明细表' } } ] }, { path: '/purchasing', component: Layout, redirect: '/purchasing/supplier', meta: { title: '采购管理' }, children: [ { path: 'supplier', name: 'SupplierList', component: () => import('@/views/Purchasing/Supplier/index.vue'), meta: { title: '供应商' } }, { path: 'order', name: 'PurchaseOrderList', component: () => import('@/views/Purchasing/Order/index.vue'), meta: { title: '采购订单' } }, { path: 'order/new', name: 'PurchaseOrderNew', component: () => import('@/views/Purchasing/Order/form.vue'), meta: { title: '新增采购订单' } }, { path: 'order/edit/:id', name: 'PurchaseOrderEdit', component: () => import('@/views/Purchasing/Order/form.vue'), meta: { title: '编辑采购订单' } }, { path: 'order/view/:id', name: 'PurchaseOrderView', component: () => import('@/views/Purchasing/Order/form.vue'), meta: { title: '采购订单详情' } }, { path: 'stock-order', name: 'StockOrderList', component: () => import('@/views/Purchasing/Order/index.vue'), meta: { title: '备库订单' } }, { path: 'checkin', name: 'CheckinList', component: () => import('@/views/Purchasing/Checkin/index.vue'), meta: { title: '采购到货单' } }, { path: 'invoice', name: 'PurchaseInvoiceList', component: () => import('@/views/Purchasing/Invoice/index.vue'), meta: { title: '采购发票' } }, { path: 'reject', name: 'RejectList', component: () => import('@/views/Purchasing/Reject/index.vue'), meta: { title: '采购退货单' } }, { path: 'report/detail', name: 'PoDetailReport', component: () => import('@/views/Purchasing/Reports/DetailReport.vue'), meta: { title: '采购执行明细表' } }, { path: 'report/total', name: 'PoTotalReport', component: () => import('@/views/Purchasing/Reports/TotalReport.vue'), meta: { title: '采购执行汇总表' } }, { path: 'report/checkin', name: 'PoCheckinReport', component: () => import('@/views/Purchasing/Reports/CheckinReport.vue'), meta: { title: '采购到货明细表' } }, { path: 'report/fapiao', name: 'PoInvoiceReport', component: () => import('@/views/Purchasing/Reports/InvoiceReport.vue'), meta: { title: '采购发票明细表' } } ] }, { path: '/production', component: Layout, redirect: '/production/plan-order', meta: { title: '生产计划' }, children: [ { path: 'plan-order', name: 'ProductionPlanList', component: () => import('@/views/Production/PlanOrder/index.vue'), meta: { title: '生产计划单' } }, { path: 'plan-order/new', name: 'ProductionPlanNew', component: () => import('@/views/Production/PlanOrder/form.vue'), meta: { title: '新增生产计划单' } }, { path: 'plan-order/edit/:id', name: 'ProductionPlanEdit', component: () => import('@/views/Production/PlanOrder/form.vue'), meta: { title: '编辑生产计划单' } }, { path: 'plan-order/view/:id', name: 'ProductionPlanView', component: () => import('@/views/Production/PlanOrder/form.vue'), meta: { title: '生产计划单详情' } }, { path: 'work-order', name: 'WorkOrderList', component: () => import('@/views/Production/WorkOrder/index.vue'), meta: { title: '生产订单' } }, { path: 'work-order/new', name: 'WorkOrderNew', component: () => import('@/views/Production/WorkOrder/form.vue'), meta: { title: '新增生产工单' } }, { path: 'work-order/edit/:id', name: 'WorkOrderEdit', component: () => import('@/views/Production/WorkOrder/form.vue'), meta: { title: '编辑生产工单' } }, { path: 'work-order/view/:id', name: 'WorkOrderView', component: () => import('@/views/Production/WorkOrder/form.vue'), meta: { title: '查看生产工单' } }, { path: 'parts', name: 'PartsOrderList', component: () => import('@/views/Production/Parts/index.vue'), meta: { title: '零部件订单' } }, { path: 'mbom', name: 'MbomList', component: () => import('@/views/Production/Mbom/index.vue'), meta: { title: '物料清单' } }, { path: 'mbom/view/:id', name: 'MbomView', component: () => import('@/views/Production/Mbom/form.vue'), meta: { title: '查看物料清单' } }, { path: 'mbom/edit/:id', name: 'MbomEdit', component: () => import('@/views/Production/Mbom/form.vue'), meta: { title: '编辑物料清单' } }, { path: 'purchase-plan', name: 'PurchasePlanList', component: () => import('@/views/Production/PurchasePlan/index.vue'), meta: { title: '采购计划单' } }, { path: 'purchase-plan/new', name: 'PurchasePlanNew', component: () => import('@/views/Production/PurchasePlan/form.vue'), meta: { title: '新增采购计划' } }, { path: 'purchase-plan/edit/:id', name: 'PurchasePlanEdit', component: () => import('@/views/Production/PurchasePlan/form.vue'), meta: { title: '编辑采购计划' } }, { path: 'purchase-plan/view/:id', name: 'PurchasePlanView', component: () => import('@/views/Production/PurchasePlan/form.vue'), meta: { title: '查看采购计划' } }, { path: 'stock-plan', name: 'StockPlanList', component: () => import('@/views/Production/PurchasePlan/index.vue'), meta: { title: '备库计划单' } }, { path: 'report/detail', name: 'MpDetailReport', component: () => import('@/views/Production/Reports/DetailReport.vue'), meta: { title: '计划执行明细表' } }, { path: 'report/total', name: 'MpTotalReport', component: () => import('@/views/Production/Reports/TotalReport.vue'), meta: { title: '计划执行汇总表' } }, { path: 'report/need', name: 'PurchaseNeedReport', component: () => import('@/views/Production/Reports/NeedReport.vue'), meta: { title: '采购计划需求表' } } ] }, { path: '/system', component: Layout, redirect: '/system/user', meta: { title: '组织架构' }, children: [ { path: 'user', name: 'UserList', component: () => import('@/views/System/User/index.vue'), meta: { title: '用户管理' } }, { path: 'role', name: 'RoleList', component: () => import('@/views/System/Role/index.vue'), meta: { title: '角色管理' } }, { path: 'dept', name: 'DeptList', component: () => import('@/views/System/Dept/index.vue'), meta: { title: '部门管理' } }, { path: 'post', name: 'PostList', component: () => import('@/views/System/Post/index.vue'), meta: { title: '岗位管理' } }, { path: 'user-auth/role/:userId', name: 'UserAuthRole', component: () => import('@/views/System/User/index.vue'), meta: { title: '分配角色' } }, { path: 'role-auth/user/:roleId', name: 'RoleAuthUser', component: () => import('@/views/System/Role/index.vue'), meta: { title: '分配用户' } } ] }, { path: '/rd', component: Layout, redirect: '/rd/ebom', meta: { title: '研发管理' }, children: [ { path: 'ebom', name: 'EbomList', component: () => import('@/views/RD/Ebom/index.vue'), meta: { title: '产品BOM' } }, { path: 'ebom/new', name: 'EbomNew', component: () => import('@/views/RD/Ebom/form.vue'), meta: { title: '新增EBOM' } }, { path: 'ebom/edit/:id', name: 'EbomEdit', component: () => import('@/views/RD/Ebom/form.vue'), meta: { title: '编辑EBOM' } }, { path: 'ebom/view/:id', name: 'EbomView', component: () => import('@/views/RD/Ebom/form.vue'), meta: { title: 'EBOM详情' } } ] }, { path: '/masterdata', component: Layout, redirect: '/masterdata/item', meta: { title: '主数据' }, children: [ { path: 'item', name: 'MdItemList', component: () => import('@/views/MasterData/Item/index.vue'), meta: { title: '物料管理' } }, { path: 'itemtype', name: 'ItemTypeList', component: () => import('@/views/MasterData/ItemType/index.vue'), meta: { title: '物料分类' } }, { path: 'unit', name: 'UnitList', component: () => import('@/views/MasterData/Unit/index.vue'), meta: { title: '计量单位' } }, { path: 'workshop', name: 'WorkshopList', component: () => import('@/views/MasterData/Workshop/index.vue'), meta: { title: '车间管理' } }, { path: 'workstation', name: 'WorkstationList', component: () => import('@/views/MasterData/Workstation/index.vue'), meta: { title: '工作站管理' } }, { path: 'bom', name: 'BomList', component: () => import('@/views/MasterData/Bom/list.vue'), meta: { title: '产品BOM' } }, { path: 'bom/new', name: 'BomNew', component: () => import('@/views/MasterData/Bom/form.vue'), meta: { title: '新增产品BOM' } }, { path: 'bom/edit/:id', name: 'BomEdit', component: () => import('@/views/MasterData/Bom/form.vue'), meta: { title: '编辑产品BOM' } }, { path: 'bom/view/:id', name: 'BomView', component: () => import('@/views/MasterData/Bom/form.vue'), meta: { title: '产品BOM详情' } } ] }, { path: '/warehouse', component: Layout, redirect: '/warehouse/issue', meta: { title: '仓储管理' }, children: [ { path: 'issue', name: 'IssueList', component: () => import('@/views/Warehouse/Issue/index.vue'), meta: { title: '生产领料' } }, { path: 'issue/new', name: 'IssueNew', component: () => import('@/views/Warehouse/Issue/form.vue'), meta: { title: '新增领料单' } }, { path: 'issue/edit/:id', name: 'IssueEdit', component: () => import('@/views/Warehouse/Issue/form.vue'), meta: { title: '编辑领料单' } }, { path: 'issue/view/:id', name: 'IssueView', component: () => import('@/views/Warehouse/Issue/form.vue'), meta: { title: '查看领料单' } } ] } ] const router = createRouter({ history: createWebHistory(), routes }) export default router