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.

253 lines
6.2 KiB

3 years ago
import Vue from 'vue'
import Router from 'vue-router'
/* Layout */
import Layout from '@/layout'
3 years ago
// import codemenu from './codemenu.js'
3 years ago
Vue.use(Router)
/* 所有角色可以访问/没有权限要求的基页 */
export const constantRoutes = [{
3 years ago
path: '/redirect',
component: Layout,
hidden: true,
children: [{
path: '/redirect/:path(.*)',
component: () => import('@/views/redirect/index.vue')
}]
}, {
3 years ago
path: '/',
redirect: 'index'
}, {
3 years ago
path: '/login',
component: () => import('@/views/login/login.vue')
}, {
3 years ago
path: '/home',
component: () => import('@/views/Home/Home.vue'),
name: 'home'
}, {
path: '/index',
component: Layout,
redirect: '/index',
meta: {
title: '首页'
},
3 years ago
children: [{
path: '/index',
component: () => import('@/views/index.vue'),
3 years ago
name: 'index',
meta: {
title: '主页',
noCache: true,
affix: true
}
}]
},
3 years ago
// 客户中心
{
path: '/customer',
component: Layout,
meta: {
title: '客户中心'
},
children: [{
path: 'cgsq',
component: () => import('@/views/customer/index.vue'),
meta: {
title: '采购申请'
},
children: [{
path: 'PurchaseApplicationManagement',
component: () => import('@/views/supervise/purchaseapplicationmanagement/purchaseapplicationmanagement.vue'),
name: 'PurchaseApplicationManagement',
meta: { title: '采购申请管理', noCache: true }
}, {
3 years ago
path: 'kfpurchaserequisitionAdd',
component: () => import('@/views/supervise/kfpurchaserequisition/kfpurchaserequisitionAdd.vue'),
name: 'KfPurchaseRequisitionAdd',
meta: {
title: '采购订单上传',
noCache: true
}
}, {
path: 'kfpurchaserequisitionInfo',
component: () => import('@/views/supervise/kfpurchaserequisition/kfpurchaserequisitionInfo.vue'),
name: 'KfPurchaseRequisitionInfo',
meta: {
title: '采购申请回执',
noCache: true
}
}]
}, {
path: 'crksq',
component: () => import('@/views/customer/index.vue'),
meta: { title: '出入库申请' },
children: [{
path: 'rksq',
component: () => import('@/views/xiaoshou/xstj/tj.vue'),
name: 'KfPurchaseRequisitionAdd',
meta: {
title: '入库申请',
noCache: true
}
}, {
path: 'cksq',
component: () => import('@/views/xiaoshou/xstj/tj.vue'),
name: 'KfPurchaseRequisitionInfo',
meta: {
title: '出库申请',
noCache: true
}
}]
}, {
path: 'sjsb',
component: () => import('@/views/customer/index.vue'),
meta: { title: '数据上报' },
children: [{
path: 'rkmxsq',
component: () => import('@/views/xiaoshou/xstj/tj.vue'),
name: 'KfPurchaseRequisitionAdd',
meta: {
title: '入库明细上传',
noCache: true
}
}, {
path: 'xsbbsq',
component: () => import('@/views/xiaoshou/xstj/tj.vue'),
name: 'KfPurchaseRequisitionInfo',
meta: {
title: '销售报表上传',
noCache: true
}
}]
}, {
path: 'gysgl',
component: () => import('@/views/customer/index.vue'),
meta: { title: '供应商管理' },
children: [{
path: 'xzgys',
component: () => import('@/views/supervise/supplierbankinfo/supplierbankinfo.vue'),
name: 'SupplierBankInfoIndex',
meta: {
title: '供应商管理',
3 years ago
noCache: true
}
}, {
path: 'htsq',
component: () => import('@/views/xiaoshou/xstj/tj.vue'),
name: 'KfPurchaseRequisitionInfo',
meta: {
title: '合同上传',
noCache: true
}
}]
}]
},
// 1销售统计
3 years ago
{
path: '/xiaoshou',
3 years ago
component: Layout,
meta: {
title: '销售统计'
3 years ago
},
children: [{
path: 'xstj/index',
component: () => import('@/views/xiaoshou/xstj/index.vue'),
name: 'XiaoshouXstjIndex',
meta: {
title: '销售数据导入',
noCache: true
}
}, {
path: 'xstj/tj',
component: () => import('@/views/xiaoshou/xstj/tj.vue'),
name: 'XiaoshouXstjTj',
meta: {
title: '销售数据统计',
noCache: true
}
}]
3 years ago
},
// 2库存信息
3 years ago
{
path: '/kucun',
3 years ago
component: Layout,
meta: {
title: '库存信息'
3 years ago
},
children: [{
path: 'kcxxcx',
component: () => import('@/views/kucun/kcxxcx/index.vue'),
name: 'KucunKcxxcxIndex',
meta: {
title: '库存数据导入',
noCache: true
}
}, {
path: 'rkmx',
component: () => import('@/views/kucun/rkmx/index.vue'),
name: 'KucunRkmxIndex',
meta: {
title: '入库明细',
noCache: true
}
}, {
path: 'ckmx',
component: () => import('@/views/kucun/ckmx/index.vue'),
name: 'KucunCkmxIndex',
meta: {
title: '出库明细',
noCache: true
}
3 years ago
}]
},
// 3库存信息
{
path: '/report',
component: Layout,
meta: {
title: '报表中心'
},
children: [{
path: 'xsbb',
component: () => import('@/views/report/salesreport/index.vue'),
meta: { title: '销售报表' },
children: [{
path: 'xsmx',
component: () => import('@/views/report/xsmx/index.vue'),
name: 'ReportXsmxIndex',
meta: { title: '销售明细', noCache: true }
}]
}]
},
3 years ago
// codemenu,
{
path: '/404',
component: () =>
import('@/views/404'),
hidden: true
}
// 404 page must be placed at the end !!!
// { path: '*', redirect: '/404', hidden: true }
3 years ago
]
const createRouter = () => new Router({
// mode: 'history', // require service support
scrollBehavior: () => ({
y: 0
}),
routes: constantRoutes
3 years ago
})
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
3 years ago
}
export default router