You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
199 lines
4.6 KiB
199 lines
4.6 KiB
![]()
2 years ago
|
import Vue from 'vue'
|
||
|
import Router from 'vue-router'
|
||
|
|
||
|
Vue.use(Router)
|
||
|
|
||
|
/* Layout */
|
||
|
import Layout from '@/layout'
|
||
|
/* 所有角色可以访问/没有权限要求的基页 */
|
||
|
|
||
|
import codemenu from './modules/codemenu'
|
||
|
|
||
|
export const constantRoutes = [{
|
||
|
path: '/redirect',
|
||
|
component: Layout,
|
||
|
hidden: true,
|
||
|
children: [{
|
||
|
path: '/redirect/:path(.*)',
|
||
|
component: () => import('@/views/redirect/index.vue')
|
||
|
}]
|
||
|
},
|
||
|
{
|
||
|
path: '/',
|
||
|
redirect: 'login'
|
||
|
}, {
|
||
|
path: '/login',
|
||
|
component: () => import('@/views/login/login.vue')
|
||
|
}, {
|
||
|
path: '/home',
|
||
|
component: () => import('@/views/Home/Home.vue'),
|
||
|
name: 'home'
|
||
|
|
||
|
}, {
|
||
|
path: '/index',
|
||
|
component: Layout,
|
||
|
redirect: '/index',
|
||
|
children: [{
|
||
|
path: '/index',
|
||
|
component: () =>
|
||
|
import('@/views/index.vue'),
|
||
|
name: 'index',
|
||
|
meta: {
|
||
|
title: '主页',
|
||
|
noCache: true,
|
||
|
affix: true
|
||
|
}
|
||
|
}]
|
||
|
}, {
|
||
|
path: '/supervise',
|
||
|
component: Layout,
|
||
|
redirect: null,
|
||
|
meta: {
|
||
|
title: '进销存管理'
|
||
|
},
|
||
|
children: [{
|
||
|
path: '/supervise/oilTypeInBound',
|
||
|
component: () =>
|
||
|
import('@/views/supervise/oilTypeInBound/index.vue'),
|
||
|
name: 'index',
|
||
|
meta: {
|
||
|
title: '出库申请'
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
path: '/supervise/oilTypeOutBound',
|
||
|
component: () =>
|
||
|
import('@/views/supervise/oilTypeOutBound/index.vue'),
|
||
|
name: 'index',
|
||
|
meta: {
|
||
|
title: '出库记录列表'
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
path: '/supervise/recordOilTank',
|
||
|
component: () =>
|
||
|
import('@/views/supervise/recordOilTank/index.vue'),
|
||
|
name: 'index',
|
||
|
meta: {
|
||
|
title: '入库申请'
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
path: '/supervise/rukujilu',
|
||
|
component: () =>
|
||
|
import('@/views/supervise/rukujilu/index.vue'),
|
||
|
name: 'index',
|
||
|
meta: {
|
||
|
title: '入库记录列表'
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
path: '/supervise/churuku',
|
||
|
component: () =>
|
||
|
import('@/views/supervise/churuku/index.vue'),
|
||
|
name: 'index',
|
||
|
meta: {
|
||
|
title: '出入库记录'
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
path: '/supervise/inventory',
|
||
|
component: () =>
|
||
|
import('@/views/supervise/inventory/index.vue'),
|
||
|
name: 'index',
|
||
|
meta: {
|
||
|
title: '库存管理'
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
path: '/supervise/churukuHT',
|
||
|
component: () =>
|
||
|
import('@/views/supervise/churukuHT/index.vue'),
|
||
|
name: 'index',
|
||
|
meta: {
|
||
|
title: '出入库合同管理'
|
||
|
}
|
||
|
},
|
||
|
]
|
||
|
}, {
|
||
|
path: '/MaterialBrand',
|
||
|
component: Layout,
|
||
|
redirect: '/MaterialBrand/index',
|
||
|
children: [{
|
||
|
path: '/MaterialBrand/index',
|
||
|
component: () => import('@/views/MaterialBrand/index.vue'),
|
||
|
name: 'MaterialBrand',
|
||
|
meta: {
|
||
|
title: '物料品牌',
|
||
|
noCache: true
|
||
|
}
|
||
|
}]
|
||
|
},{
|
||
|
path: '/materialManagement',
|
||
|
component: Layout,
|
||
|
redirect: '/materialManagement/index',
|
||
|
children: [{
|
||
|
path: '/materialManagement/index',
|
||
|
component: () => import('@/views/materialManagement/index'),
|
||
|
name: 'materialManagement',
|
||
|
meta: {
|
||
|
title: '物料管理',
|
||
|
noCache: true
|
||
|
}
|
||
|
}]
|
||
|
},{
|
||
|
path: '/storeManagement',
|
||
|
component: Layout,
|
||
|
redirect: '/storeManagement/index',
|
||
|
children: [{
|
||
|
path: '/storeManagement/index',
|
||
|
component: () => import('@/views/storeManagement/index.vue'),
|
||
|
name: 'storeManagement',
|
||
|
meta: {
|
||
|
title: '仓库管理',
|
||
|
noCache: true
|
||
|
}
|
||
|
}]
|
||
|
},{
|
||
|
path: '/supplierManagement',
|
||
|
component: Layout,
|
||
|
redirect: '/supplierManagement/index',
|
||
|
children: [{
|
||
|
path: '/supplierManagement/index',
|
||
|
component: () => import('@/views/supplierManagement/index.vue'),
|
||
|
name: 'supplierManagement',
|
||
|
meta: {
|
||
|
title: '供应商管理',
|
||
|
noCache: true
|
||
|
}
|
||
|
}]
|
||
|
},
|
||
|
...codemenu,
|
||
|
{
|
||
|
path: '/404',
|
||
|
component: () =>
|
||
|
import('@/views/404'),
|
||
|
hidden: true
|
||
|
}
|
||
|
// 404 page must be placed at the end !!!
|
||
|
// { path: '*', redirect: '/404', hidden: true }
|
||
|
]
|
||
|
|
||
|
const createRouter = () => new Router({
|
||
|
// mode: 'history', // require service support
|
||
|
scrollBehavior: () => ({
|
||
|
y: 0
|
||
|
}),
|
||
|
routes: constantRoutes
|
||
|
})
|
||
|
|
||
|
const router = createRouter()
|
||
|
|
||
|
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
|
||
|
export function resetRouter() {
|
||
|
const newRouter = createRouter()
|
||
|
router.matcher = newRouter.matcher // reset router
|
||
|
}
|
||
|
|
||
|
export default router
|