From c65bc1fe1433e1da0f05180ac9fee500932469a8 Mon Sep 17 00:00:00 2001 From: duan Date: Thu, 8 Sep 2022 10:26:10 +0800 Subject: [PATCH] =?UTF-8?q?feat(standard):=20=E6=96=B0=E5=A2=9E=E6=A0=87?= =?UTF-8?q?=E5=87=86=E5=93=81=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/permission.js | 1 + src/router/modules/standard.js | 260 +++++++++++++++++++++++++++++++++ src/utils/index.js | 9 ++ 3 files changed, 270 insertions(+) create mode 100644 src/router/modules/standard.js diff --git a/src/permission.js b/src/permission.js index fd4c991..3bea853 100644 --- a/src/permission.js +++ b/src/permission.js @@ -30,6 +30,7 @@ router.beforeEach(async(to, from, next) => { const pathMap = { 'reagent': 'reagent', 'user': 'user', + 'standard': 'standard', 'userinfo': store.getters.classification } const pat = pathMap[pa] diff --git a/src/router/modules/standard.js b/src/router/modules/standard.js new file mode 100644 index 0000000..304e01a --- /dev/null +++ b/src/router/modules/standard.js @@ -0,0 +1,260 @@ +import Layout from '@/layout' + +const standardRouter = [ + // { + // path: '/standard', + // hidden: true, + // redirect: '/reagent/mainoverview/index', + // meta: { classification: 'standard', module_code: 'MainOverview' } + // }, + { + path: '/standard/mainoverview', + component: Layout, + redirect: '/standard/mainoverview/index', + meta: { classification: 'standard', module_code: 'MainOverview' }, + children: [ + { + path: 'index', + name: 'MainOverview', + meta: { title: '主预览', icon: '主概览', classification: 'standard' }, + component: () => import('@/views/reagent/mainoverview/index') + } + ] + }, + { + path: '/standard/report', + component: Layout, + redirect: '/standard/report/index', + meta: { classification: 'standard', module_code: 'DataReportIndex' }, + children: [ + { + path: 'index', + name: 'Report', + component: () => import('@/views/reagent/report/index'), + meta: { title: '报告统计', icon: '报表统计', classification: 'standard' } + }, + { + path: 'storeinfo', + name: 'StoreInfo', + component: () => import('@/views/reagent/report/storeinfo/index'), + hidden: true, + meta: { title: '库存信息总览', icon: '报表统计', classification: 'standard', activeMenu: '/standard/report/index' } + }, + { + path: 'standardinfo', + name: 'standardInfo', + component: () => import('@/views/reagent/report/reagentinfo/index'), + hidden: true, + meta: { title: '试剂信息详情', icon: '报表统计', classification: 'standard', activeMenu: '/standard/report/index' } + }, + { + path: 'warehousinginfo', + name: 'WarehousingInfo', + component: () => import('@/views/reagent/report/warehousinginfo/index'), + hidden: true, + meta: { title: '入库信息查询', icon: '报表统计', classification: 'standard', activeMenu: '/standard/report/index' } + }, + { + path: 'inventoryconsuminfo', + name: 'InventoryConsumInfo', + component: () => import('@/views/reagent/report/inventoryconsum/index'), + hidden: true, + meta: { title: '库存消耗', icon: '报表统计', classification: 'standard', activeMenu: '/standard/report/index' } + }, + { + path: 'standardconsuminfo', + name: 'standardConsumInfo', + component: () => import('@/views/reagent/report/reagentconsum/index'), + hidden: true, + meta: { title: '标准品消耗', icon: '报表统计', classification: 'standard', activeMenu: '/standard/report/index' } + }, + { + path: 'userconsuminfo', + name: 'UserConsumInfo', + component: () => import('@/views/reagent/report/userconsum/index'), + hidden: true, + meta: { title: '人员用量消耗', icon: '报表统计', classification: 'standard', activeMenu: '/standard/report/index' } + }, + { + path: 'usefrequencyinfo', + name: 'UseFrequencyInfo', + component: () => import('@/views/reagent/report/usefrequency/index'), + hidden: true, + meta: { title: '使用频率', icon: '报表统计', classification: 'standard', activeMenu: '/standard/report/index' } + }, + { + path: 'recordinfo/:t', + name: 'RecordInfo', + component: () => import('@/views/reagent/report/record/index'), + hidden: true, + meta: { title: '记录', icon: '报表统计', classification: 'standard', activeMenu: '/standard/report/index' } + } + ] + }, + { + path: '/standard/warehousing', + component: Layout, + redirect: '/standard/warehousing/index', + meta: { classification: 'standard', module_code: 'DataReportIndex' }, + children: [ + { + path: 'index', + name: 'Warehousing', + component: () => import('@/views/reagent/warehousing/index'), + meta: { title: '标准品入库', icon: '试剂入库', classification: 'standard' } + } + ] + }, + { + path: '/standard/receiving', + component: Layout, + redirect: '/standard/receiving/index', + meta: { classification: 'standard', module_code: 'DrugUseView' }, + children: [ + { + path: 'index', + name: 'Receiving', + component: () => import('@/views/reagent/receivingandreturn/index'), + meta: { title: '标准品领用', icon: '试剂领用', classification: 'standard' } + } + ] + }, + { + path: '/standard/sendback', + component: Layout, + redirect: '/standard/sendback/index', + meta: { classification: 'standard', module_code: 'DrugReturnView' }, + children: [ + { + path: 'index', + name: 'SendBack', + component: () => import('@/views/reagent/receivingandreturn/index'), + meta: { title: '标准品归还', icon: '试剂归还', classification: 'standard' } + } + ] + }, + { + path: '/standard/weighing', + component: Layout, + redirect: '/standard/weighing/index', + meta: { classification: 'standard', module_code: 'DrugWeigh' }, + children: [ + { + path: 'index', + name: 'weighing', + component: () => import('@/views/reagent/weighing/index'), + meta: { title: '标准品称重', icon: '试剂称重', classification: 'standard' } + } + ] + }, + { + path: '/standard/inventory', + component: Layout, + redirect: '/standard/inventory/index', + meta: { classification: 'standard', module_code: 'StockTakingIndex' }, + children: [ + { + path: 'index', + name: 'Inventory', + component: () => import('@/views/reagent/inventory/index'), + meta: { title: '标准品盘点', icon: '库存盘点', classification: 'standard' } + } + ] + }, + { + path: '/standard/database', + component: Layout, + redirect: '/standard/database/msds', + meta: { title: '化学品数据库', icon: '化学品数据库', classification: 'standard', module_code: 'ChemicaDatabase' }, + children: [ + { + path: 'msds', + name: 'MSDS', + component: () => import('@/views/reagent/database/index'), + meta: { title: 'MSDS数据库', classification: 'standard' } + }, + { + path: 'dangerous', + name: 'Dangerous', + component: () => import('@/views/reagent/database/index'), + meta: { title: '危化品数据库', classification: 'standard' } + } + ] + }, + { + path: '/standard/management', + component: Layout, + redirect: '/standard/management/index', + meta: { classification: 'standard', module_code: 'DrugIndex' }, + children: [ + { + path: 'index', + name: 'Management', + component: () => import('@/views/reagent/management/index'), + meta: { title: '标准品管理', icon: '试剂管理', classification: 'standard' } + } + ] + }, + { + path: '/standard/client', + component: Layout, + redirect: '/standard/client/index', + meta: { classification: 'standard', module_code: 'CabinetIndex' }, + children: [ + { + path: 'index', + name: 'Client', + component: () => import('@/views/reagent/client/index'), + meta: { title: '柜体管理', icon: '柜体管理', classification: 'standard' } + } + ] + }, + { + path: '/standard/envrecord', + component: Layout, + redirect: '/standard/envrecord/index', + meta: { classification: 'standard', module_code: 'HumitureIndex' }, + children: [ + { + path: 'index', + name: 'EnvRecord', + component: () => import('@/views/reagent/envrecord/index'), + meta: { title: '环境记录', icon: '雪花', classification: 'standard' } + } + ] + }, + { + path: '/standard/form', + component: Layout, + redirect: '/standard/form/index', + meta: { classification: 'standard', module_code: 'DrugCustomForm' }, + children: [ + { + path: 'index', + name: 'Form', + component: () => import('@/views/reagent/customform/index'), + meta: { title: '标准品表单自定义', icon: '表单', classification: 'standard' } + } + ] + }, + // { + // path: '/standard/buy', + // component: Layout, + // meta: { classification: 'standard' }, + // children: [ + // { + // path: 'index', + // name: 'Buy', + // component: () => import('@/views/reagent/buy/index'), + // meta: { title: '请购', icon: '请购', classification: 'standard' } + // } + // ] + // }, + { + path: '/gotohome', + redirect: '/home', + meta: { title: '返回主页', icon: 'el-icon-arrow-left', classification: 'standard' } + } +] + +export default standardRouter diff --git a/src/utils/index.js b/src/utils/index.js index 6f16d2a..30638dc 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -4,6 +4,7 @@ import reagentRouter from '@/router/modules/reagent' import userRouter from '@/router/modules/user' +import standardRouter from '@/router/modules/standard' /** * Parse the time to string @@ -167,9 +168,12 @@ export function getALLRouter(data) { // TODO: 其他路由都在此操作 const rasr = filterAsyncRoutes(reagentRouter, data.drug_manage) const uasr = filterAsyncRoutes(userRouter, data.drug_manage) + // const standard = filterAsyncRoutes(standardRouter, data.drug_manage) const asyncRoutes = [ ...rasr, ...uasr, + // ...standard, + ...standardRouter, // 404 page must be placed at the end !!! { path: '*', redirect: '/404', hidden: true } ] @@ -179,6 +183,11 @@ export function getALLRouter(data) { router: rasr[0], title: '试剂管理' }, + { + name: 'standard', + router: standardRouter[0], + title: '标准品管理' + }, { name: 'user', router: uasr[0],