import Vue from "vue"; import VueRouter from "vue-router"; // import HomeView from "../views/HomeView.vue"; import login from "@/views/login/Login.vue"; Vue.use(VueRouter); // const originalpush = VueRouter.prototype.push // VueRouter.prototype.push = function (location) { // return originalpush.call(this, location).catch(err => err) // } const routes = [{ path: "/", component: login, }, { path: "/login", name: "login", component: () => import ("../views/login/Login.vue"), }, { path: "/home", name: "home", component: () => import ("../views/Home.vue"), children: [{ path: "/role", component: () => import ("../views/user-list/Role.vue"), }, { path: "/user-list", component: () => import ("../views/user-list/UserList.vue"), }, { path: "/organization-units", component: () => import ("../views/user-list/OrganizationUnits.vue"), }, { path: "/audit-log", component: () => import ("../views/user-list/AuditLog.vue"), }, { path: "/guide-type", component: () => import ("../views/basic-dictionary/GuideType.vue"), }, { path: "/medical-report-type", component: () => import ("../views/basic-dictionary/MedicalReportType.vue"), }, { path: "/sex", component: () => import ("../views/basic-dictionary/Sex.vue"), }, { path: "/marital-status", component: () => import ("../views/basic-dictionary/MaritalStatus.vue"), }, { path: "/nation", component: () => import ("../views/basic-dictionary/Nation.vue"), }, { path: "/birth-place", component: () => import ("../views/basic-dictionary/BirthPlace.vue"), }, { path: "/result-status", component: () => import ("../views/basic-dictionary/ResultStatus.vue"), }, { path: "/medical-type", component: () => import ("../views/basic-dictionary/MedicalType.vue"), }, { path: "/personnel-type", component: () => import ("../views/basic-dictionary/PersonnelType.vue"), }, { path: "/device-type", component: () => import ("../views/basic-dictionary/DeviceType.vue"), }, { path: "/sample-type", component: () => import ("../views/basic-dictionary/SampleType.vue"), }, { path: "/unit", component: () => import ("../views/basic-dictionary/Unit.vue"), }, { path: "/diagnosis-postfix", component: () => import ("../views/basic-dictionary/DiagnosisPostfix.vue"), }, { path: "/medical-conclusion-type", component: () => import ("../views/basic-dictionary/MedicalConclusionType.vue"), }, { path: "/medical-conclusion", component: () => import ("../views/basic-dictionary/MedicalConclusion.vue"), }, { path: "/sample-container", component: () => import ("../views/basic-dictionary/SampleContainer.vue"), }, { path: "/common-char-type", component: () => import ("../views/basic-dictionary/CommonCharType.vue"), }, { path: "/common-char", component: () => import ("../views/basic-dictionary/CommonChar.vue"), }, { path: "/customer-org-type", component: () => import ("../views/basic-dictionary/CustomerOrgType.vue"), }, { path: "/item-default-result", component: () => import ("../views/basic-dictionary/ItemDefaultResult.vue"), }, { path: "/diagnosis-level", component: () => import ("../views/basic-dictionary/DiagnosisLevel.vue"), }, { path: "/diagnosisSet", name:'诊断建议设置', component: () => import ("../views/diagnosis/diagnosis.vue"), }, //---------------------- 收费设置 start ---------------------- { path: "/invoice-item-type", component: () => import ("../views/fee-settings/InvoiceItemType.vue"), }, { path: "/pay-mode", component: () => import ("../views/fee-settings/PayMode.vue"), }, { path: "/cardType", name: "会员卡类别", component: () => import ("../views/fee-settings/cardType.vue"), }, { path: "/cardRegister", name: "会员卡登记", component: () => import ("../views/fee-settings/cardRegister.vue"), }, { path: "/cardBill", name: "会员卡记账", component: () => import ("../views/fee-settings/cardBill.vue"), }, //---------------------- 收费设置 start ---------------------- { path: "/item-type", component: () => import ("../views/common-settings/ItemType.vue"), }, { path: "/sample-group", name:'条码分组', component: () => import ("../views/common-settings/SampleGroup.vue"), }, { path: "/asbitem", component: () => import ("../views/fee-settings/Asbitem.vue"), }, { path: "/item", component: () => import ("../views/fee-settings/Item.vue"), }, { path: "/reference-range", component: () => import ("../views/fee-settings/ReferenceRange.vue"), }, { path: "/diagnosis", component: () => import ("../views/fee-settings/Diagnosis.vue"), hidden: true, // meta: { // title: '诊断', // menu // } meat: { title: "诊断", noCache: true, menus: ["diagosis:advertDemandRelease"], }, }, { path: "/item-result-template", component: () => import ("../views/fee-settings/ItemResultTemplate.vue"), }, { path: "/item-result-match", component: () => import ("../views/fee-settings/ItemResultMatch.vue"), }, { path: "/item-template", component: () => import ("../views/fee-settings/ItemTemplate.vue"), }, { path: "/medicalPackage", // medical-package name:"套餐设置", component: () => import ("../views/common-settings/medicalPackage.vue"), //../views/fee-settings/MedicalPackage.vue }, { path: "/sex-hormone-reference-range", component: () => import ("../views/fee-settings/SexHormoneReferenceRange.vue"), }, { path: "/diagnosis-template", component: () => import ("../views/fee-settings/DiagnosisTemplate.vue"), }, { path: "/sys-parm-type", component: () => import ("../views/fee-settings/SysParmSet.vue"), //../views/fee-settings/SysParmType.vue }, //---------------------- 体检登记 start ---------------------- { path: "/customerOrg", name: "体检单位设置", component: () => import ("../views/customerOrg/customerOrg.vue"), }, { path: "/customerOrgGroup", name: "单位分组设置", component: () => import ("../views/customerOrg/customerOrgGroup.vue"), }, { path: "/patientRegister", name: "体检人员登记", component: () => import ("../views/customerOrg/patientRegister.vue"), }, { path: "/patientRegisterSign", name: "体检人员签到", component: () => import ("../views/customerOrg/patientRegisterSign.vue"), }, { path: "/patientRegisterBatch", name: "人员批量登记", component: () => import ("../views/customerOrg/patientRegisterImport.vue"), //../views/doctorCheck/personnelBatch.vue }, { path: "/patientRegisterRecover", name: "体检表回收", component: () => import ("../views/customerOrg/patientRegisterRecover.vue"), }, { path: "/patientRegisterRefuse", name: "弃检登记", component: () => import ("../views/customerOrg/patientRegisterRefuse.vue"), }, { path: "/charge", name: "体检收费", component: () => import ("../views/charge/charge.vue"), }, //---------------------- 体检登记 start ---------------------- //---------------------- 体 检 start ---------------------- { path: "/doctorCheck", name: "体检医生诊台", component: () => import ("../views/doctorCheck/doctorCheck.vue"), }, { path: "/sumDoctorCheck", name: "总检医生诊台", component: () => import ("../views/doctorCheck/sumDoctorCheck.vue"), }, //---------------------- 体 检 end ---------------------- //---------------------- 体检查询 start ---------------------- { path: "/report", name: "体检报告", component: () => import ("../views/report/report.vue"), }, { path: "/checkStatus", name: "组合项目检查状态", component: () => import ("../views/report/checkStatus.vue"), }, { path: "/chargeAsbitem", name: "人员费用组合项目", component: () => import ("../views/report/chargeAsbitem.vue"), }, { path: "/unCheckAsbitem", name: "人员未检组合项目", component: () => import ("../views/report/unCheckAsbitem.vue"), }, //---------------------- 体检查询 end ---------------------- //---------------------- 体 检 end ---------------------- //---------------------- 疾病人数登记 ---------------------- { path: "/diseaseStatistics", name: "疾病人数统计", component: () => import ("../views/customerReport/diseaseStatistics.vue"), }, { path: "/positiveResultsList", name: "阳性结果清单", component: () => import ("../views/customerReport/positiveResultsList.vue"), }, { path: "/unitphysicalexamination", name: "单位体检报表", component: () => import ("../views/doctorCheck/unitphysicalexamination.vue"), }, { path: "/personnelPositive", name: "人员阳性结果", component: () => import ("../views/customerReport/personnelPositive.vue") }, //---------------------- 工作量登记 ---------------------- { path: "/registrar", name: "登记员工作量", component: () => import ("../views/workload/registrar.vue"), }, { path: "/doctorstaionworkload", name: "登记员工作量", component: () => import ("../views/workload/doctorstaionworkload.vue"), }, { path: "/directordoctor", name: "总检医生工作量", component: () => import ("../views/workload/directordoctor.vue"), }, { path: "/deskwork", name: "总检医生工作量", component: () => import ("../views/workload/deskwork.vue"), }, { path: "/tollcollector", name: "收费员", component: () => import ("../views/workload/tollcollector.vue"), }, { path: "/individualfeedetails", name: "个人收费明细", component: () => import ("../views/workload/individualfeedetails.vue"), }, { path: "/membershipcard", name: "会员卡分类统计", component: () => import ("../views/workload/membershipcard.vue"), }, ], }, ]; const router = new VueRouter({ //mode: "history", //base: process.env.BASE_URL, routes, }); router.beforeEach((to, form, next) => { let token = window.sessionStorage.getItem("token"); let tokentype = window.sessionStorage.getItem("tokentype"); if (to.path === "/login") { if (token != null) { next({ path: "/", }); } else { next(); } } else { if (token == null) { next({ path: "/login", }); } else { next(); } } }); export default router;