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.
378 lines
8.8 KiB
378 lines
8.8 KiB
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: 'login'
|
|
},
|
|
{
|
|
path: '/login',
|
|
component: () => import('@/views/login/login.vue')
|
|
},
|
|
// {
|
|
// path: '/',
|
|
// redirect: 'index'
|
|
// },
|
|
// {
|
|
// path: '/index',
|
|
// component: () => import('@/views/index.vue'),
|
|
// name: 'index'
|
|
// },
|
|
{
|
|
path: '/index',
|
|
component: Layout,
|
|
redirect: '/index',
|
|
children: [{
|
|
path: '/index',
|
|
component: () =>
|
|
import('@/views/index.vue'),
|
|
name: 'index',
|
|
meta: {
|
|
title: '主页',
|
|
noCache: true,
|
|
affix: true
|
|
}
|
|
}]
|
|
},
|
|
|
|
{
|
|
path: '/baseInfo',
|
|
component: Layout,
|
|
redirect: null,
|
|
meta: {
|
|
title: '基础信息'
|
|
},
|
|
children: [{
|
|
path: '/warehouses/warehouse',
|
|
name: 'Warehouse',
|
|
component: () => import('@/views/baseInfo/warehouses/warehouse/index'),
|
|
meta: {
|
|
title: '仓库管理',
|
|
icon: 'product-add'
|
|
},
|
|
hidden: true
|
|
},
|
|
{
|
|
path: '/warehouses/warehouseArea',
|
|
name: 'WarehouseArea',
|
|
component: () => import('@/views/baseInfo/warehouses/warehouseArea/index'),
|
|
meta: {
|
|
title: '库区管理',
|
|
icon: 'product-add'
|
|
},
|
|
hidden: true
|
|
},
|
|
{
|
|
path: '/warehouses/warehouseAreaType',
|
|
name: 'WarehouseAreaType',
|
|
component: () => import('@/views/baseInfo/warehouses/warehouseAreaType/index'),
|
|
meta: {
|
|
title: '库区类型管理',
|
|
icon: 'product-add'
|
|
},
|
|
hidden: true
|
|
},
|
|
{
|
|
path: '/warehouses/goodsShelves',
|
|
name: 'GoodsShelves',
|
|
component: () => import('@/views/baseInfo/warehouses/goodsShelves/index'),
|
|
meta: {
|
|
title: '库位管理',
|
|
icon: 'product-add'
|
|
},
|
|
hidden: true
|
|
},
|
|
{
|
|
path: '/supplier/supplier',
|
|
name: 'Supplier',
|
|
component: () => import('@/views/baseInfo/supplier/supplier/supplier'),
|
|
meta: {
|
|
title: '供应商管理',
|
|
icon: 'product-add'
|
|
},
|
|
hidden: true
|
|
},
|
|
{
|
|
path: '/supplier/suppliertype',
|
|
name: 'Suppliertype',
|
|
component: () => import('@/views/baseInfo/supplier/suppliertype/suppliertype'),
|
|
meta: {
|
|
title: '供应商类型管理',
|
|
icon: 'product-add'
|
|
},
|
|
hidden: true
|
|
},
|
|
|
|
]
|
|
},
|
|
{
|
|
path: '/goods',
|
|
component: Layout,
|
|
redirect: null,
|
|
meta: {
|
|
title: '商品管理'
|
|
},
|
|
children: [{
|
|
path: '/brands/index',
|
|
name: 'Brands',
|
|
component: () => import('@/views/goods/brands/index'),
|
|
meta: {
|
|
title: '品牌管理',
|
|
icon: 'product-add'
|
|
},
|
|
hidden: true
|
|
},
|
|
{
|
|
path: '/category/index',
|
|
name: 'Category',
|
|
component: () => import('@/views/goods/category/index'),
|
|
meta: {
|
|
title: '商品类别',
|
|
icon: 'product-add'
|
|
},
|
|
hidden: true
|
|
},
|
|
{
|
|
path: '/factory/index',
|
|
name: 'Factory',
|
|
component: () => import('@/views/goods/factory/index'),
|
|
meta: {
|
|
title: '厂家管理',
|
|
icon: 'product-add'
|
|
},
|
|
hidden: true
|
|
},
|
|
{
|
|
path: '/unit/index',
|
|
name: 'Unit',
|
|
component: () => import('@/views/goods/unit/index'),
|
|
meta: {
|
|
title: '计量单位',
|
|
icon: 'product-add'
|
|
},
|
|
hidden: true
|
|
},
|
|
{
|
|
path: '/goods/index',
|
|
name: 'Goods',
|
|
component: () => import('@/views/goods/goods/index'),
|
|
meta: {
|
|
title: '商品管理',
|
|
icon: 'product-add'
|
|
},
|
|
hidden: true
|
|
},
|
|
{
|
|
path: '/product/product',
|
|
name: 'Product',
|
|
component: () => import('@/views/goods/product/product'),
|
|
meta: {
|
|
title: '产品管理',
|
|
icon: 'product-add'
|
|
},
|
|
hidden: true
|
|
}
|
|
]
|
|
},
|
|
|
|
{
|
|
path: '/customerManagement',
|
|
component: Layout,
|
|
redirect: '/customerManagement',
|
|
meta: {
|
|
title: '客户管理'
|
|
},
|
|
children: [{
|
|
path: '/customerManagement/customerInformation',
|
|
component: () => import('@/views/customerManagement/customerInformation/customerInformation'),
|
|
name: 'CustomerInformation',
|
|
meta: {
|
|
title: '客户信息管理',
|
|
noCache: true
|
|
}
|
|
}]
|
|
},
|
|
{
|
|
path: '/sales',
|
|
component: Layout,
|
|
redirect: '/sales',
|
|
meta: {
|
|
title: '销售'
|
|
},
|
|
children: [{
|
|
path: '/sales/salesOrder',
|
|
component: () => import('@/views/sales/salesOrder/salesOrder'),
|
|
name: 'SalesOrder',
|
|
meta: {
|
|
title: '销售订单',
|
|
noCache: true
|
|
}
|
|
},
|
|
{
|
|
path: '/sales/salesOrderReview',
|
|
component: () => import('@/views/sales/salesOrderReview/salesOrderReview'),
|
|
name: 'SalesOrderReview',
|
|
meta: {
|
|
title: '订单审核',
|
|
noCache: true
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
path: '/merchandiseReturn',
|
|
component: Layout,
|
|
redirect: '/merchandiseReturn',
|
|
meta: {
|
|
title: '商品退货管理'
|
|
},
|
|
children: [{
|
|
path: '/merchandiseReturn/merchandiseReturn',
|
|
component: () => import('@/views/merchandiseReturn/merchandiseReturn'),
|
|
name: 'MerchandiseReturn',
|
|
meta: {
|
|
title: '商品退货管理',
|
|
noCache: true
|
|
}
|
|
}]
|
|
},
|
|
{
|
|
path: '/purchase',
|
|
component: Layout,
|
|
redirect: '/purchase',
|
|
meta: {
|
|
title: '采购管理'
|
|
},
|
|
children: [{
|
|
path: '/purchaseOrder/index',
|
|
component: () => import('@/views/purchase/purchaseOrder/index'),
|
|
name: 'PurchaseOrder',
|
|
meta: {
|
|
title: '采购订单',
|
|
noCache: true
|
|
}
|
|
},
|
|
{
|
|
path: '/purchaseReview/index',
|
|
component: () => import('@/views/purchase/purchaseReview/index'),
|
|
name: 'PurchaseReview',
|
|
meta: {
|
|
title: '订单审核',
|
|
noCache: true
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
path: '/system',
|
|
component: Layout,
|
|
redirect: '/system',
|
|
meta: {
|
|
title: '系统设置'
|
|
},
|
|
children: [{
|
|
path: '/organizationManage/organizationManage',
|
|
component: () =>
|
|
import('@/views/system/organizationManage/organizationManage.vue'),
|
|
name: 'OrganizationManage',
|
|
meta: {
|
|
icon: 'el-icon-menu',
|
|
title: '组织管理'
|
|
}
|
|
},
|
|
{
|
|
path: '/postManage/postManage',
|
|
component: () =>
|
|
import('@/views/system/postManage/postManage.vue'),
|
|
name: 'PostManage',
|
|
meta: {
|
|
icon: 'el-icon-menu',
|
|
title: '岗位管理'
|
|
}
|
|
},
|
|
{
|
|
path: '/userManage/userManage',
|
|
component: () =>
|
|
import('@/views/system/userManage/userManage.vue'),
|
|
name: 'UserManage',
|
|
meta: {
|
|
icon: 'el-icon-menu',
|
|
title: '用户管理'
|
|
}
|
|
}, {
|
|
path: '/roleAdminister/roleAdminister',
|
|
component: () => import('@/views/system/roleAdminister/roleAdminister.vue'),
|
|
name: 'RoleAdminister',
|
|
meta: {
|
|
icon: 'el-icon-menu',
|
|
title: '角色管理'
|
|
}
|
|
}, {
|
|
path: '/menuManage/menuManage',
|
|
component: () => import('@/views/system/menuManage/menuManage.vue'),
|
|
name: 'MenuManage',
|
|
meta: {
|
|
icon: 'el-icon-menu',
|
|
title: '菜单管理'
|
|
}
|
|
},
|
|
{
|
|
path: '/dictManage/dictManage',
|
|
component: () => import('@/views/system/dictManage/dictManage.vue'),
|
|
name: 'DictManage',
|
|
meta: {
|
|
icon: 'el-icon-menu',
|
|
title: '数据字典'
|
|
}
|
|
},
|
|
{
|
|
path: '/logManage/logManage',
|
|
component: () =>
|
|
import('@/views/system/logManage/logManage.vue'),
|
|
name: 'LogManage',
|
|
meta: {
|
|
icon: 'el-icon-menu',
|
|
title: '日志管理'
|
|
}
|
|
}
|
|
]
|
|
},
|
|
|
|
// ...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
|
|
|