import Vue from "vue";
import VueRouter from "vue-router";

if (process.env.NODE_ENV === "development") {
    Vue.use(VueRouter);
}

import {ROUTER_MODE} from "../config/app";

import Home from "../views/home/index.vue";
import Empty from "../views/home/Empty.vue";

import showText from "../views/utils/showText";

// 权限管理相关
import adminRouter from "../views/userManage/admin/router.vue";
import authAdmin from "../views/userManage/admin/authAdmin.vue";
import authRole from "../views/userManage/admin/authRole.vue";
import authPermissionRule from "../views/userManage/admin/authPermissionRule.vue";
import authDept from "../views/userManage/authDept.vue";
import systemParamConfig from "../views/userManage/param/systemParamConfig.vue";
import basicProductConfig from "../views/userManage/param/basicProductConfig.vue";
import registerManage from "../views/userManage/registerManage.vue";
import phoneRegisterManage from "../views/userManage/phoneRegisterManage.vue";
import userAccountManage from "../views/userManage/userAccountManage.vue";
import customerManage from "../views/userManage/customerManage.vue";
import customerFileManage from "../views/userManage/customerFileManage";
import customerApplyUpdateManage from "../views/userManage/customerApplyUpdateManage";
import customerAuditedManage from "../views/userManage/customerAuditedManage";
import systemPDFTemplate from "../views/userManage/param/systemPDFTemplate";
import systemPDFModule from "../views/userManage/param/systemPDFModule";
//供应商
import suppliersEnterpriseBasic from "../views/userManage/suppliersEnterpriseBasic.vue"

//菜单管理
import basicCompany from "../views/basic/basicCompany.vue";
import basicCompanyProduct from "../views/basic/basicCompanyProduct.vue";
import basicCompanyProducts from "../views/basic/basicCompanyProducts.vue";
import basicCompanySalesmanUpdateLog from "../views/basic/basicCompanySalesmanUpdateLog";
import basicCompanySalesmanUpdateLogTotal from "../views/basic/basicCompanySalesmanUpdateLogTotal";
import basicCompanyUpdateLog from "../views/basic/basicCompanyUpdateLog";
import basicCompanyUpdateLogTotal from "../views/basic/basicCompanyUpdateLogTotal";
import basicUnitMaintain from "../views/basic/CorpMaintain.vue";
import company from "../views/warehouse/company.vue";
import inout from "../views/warehouse/IOSearchOrder.vue";
import errorOrder from "../views/warehouse/IONewOrder.vue";
import udiTrace from "../views/warehouse/UdiCodeTrace.vue";
import ioErrorOrder from "../views/warehouse/IOErrorOrder.vue";
import ioCheckOrder from "../views/warehouse/IOCheckErrOrder.vue";
import waitOrder from "../views/warehouse/IOWaitOrder.vue";
import stockOrder from "../views/warehouse/stockOrder";
import stockOrderInCode from "../views/warehouse/stockOrderInCode";
import stockOrderDelSearch from "../views/warehouse/stockOrderDelSearch";
import stockOrderInvSearch from "../views/warehouse/stockOrderInvSearch";
import stockOrderDelete from "../views/warehouse/stockOrderDelete";
import stockOrderChange from "../views/warehouse/stockOrderChange";
import stockOrderEditor from "../views/warehouse/stockOrderEditor";
import stockOrderSearch from "../views/warehouse/stockOrderSearch";
import stockOrderNew from "../views/warehouse/stockOrderNew";
import stockOrderWaitCheck from "../views/warehouse/stockOrderWaitCheck";

import stockOrderError from "../views/warehouse/stockOrderError";
import stockOrderPrint from "../views/warehouse/stockOrderPrint";
import stockDeliveryOrder from "../views/warehouse/stockDeliveryOrder";
import BussinessType from "../views/basic/BussinessType.vue";
import BussinessTypeLocl from "../views/basic/BussinessTypeLocl.vue";
import bussinessTypeThird from "../views/basic/BussinessTypeThird.vue";
import otherTypeChange from "../views/basic/OtherTypeChange.vue";
import bussinessTypeChange from "../views/basic/BusTypeChange.vue";

//基础数据维护
import invWarehouse from "../views/basic/invWarehouse"

import udiInfoExport from "../views/basic/UdiinfoExport.vue";
import UdiInfoManage from "../views/basic/UdiInfoManage.vue";
import UdiInfoManageSp from "../views/basic/UdiInfoManageSp.vue"
import diSearch from "../views/basic/UdiInfoSearch.vue"
import UdiInfoImport from "../views/basic/UdiInfoImport.vue";
import corpImport from "../views/basic/CorpImport.vue";
import corpExport from "../views/basic/CorpExport.vue";


//第三方数据管理
import thrProducts from "../views/thrsys/ThrProducts.vue";
import thrProductsCheck from "../views/thrsys/ThrProductsCheck.vue";
import thrDiProductsCheck from "@/views/thrsys/ThrDiProductsCheck";
import thrProductsSubmit from "../views/thrsys/ThrProductsSubmit.vue";
import thrProductsImport from "../views/thrsys/ThrProductsImport.vue";
import ThrOrders from "../views/thrsys/ThrOrder.vue";
import thrOrderImport from "../views/thrsys/ThrOrderImport.vue";
import thirdSys from "../views/basic/BasicThirdSys";
import udplatGoods from "../views/thrsys/UdplatGoods"
import udplatGoodsImport from "../views/thrsys/UdplatGoodsImport";
import ThrCorps from "../views/thrsys/ThrCorps.vue";
import thrCorpsExport from "../views/thrsys/ThrCorpsExport.vue";
import thrCorpsImport from "../views/thrsys/ThrCorpsImport.vue";
import receiveOrderNew from "../views/thrsys/ThrOrdedrReceiveAdd.vue";
import receiveOrderSearch from "../views/thrsys/ThrOrdedrReceiveSearch.vue";
import spsSyncData from "../views/thrsys/SysUdimsData.vue";
import syncConfig from "../views/thrsys/SysUdimsConfig.vue";
import BasicEntrutsRece from "../views/basic/BasicEntrutsRece.vue";

//库存
import invProducts from "../views/inventory/InvProducts.vue";
import invPreProducts from "../views/inventory/invPreProducts"
import invPreInProducts from "../views/inventory/invPreInProducts"

import supInvProducts from "../views/inventory/supInvProducts.vue";
import supInvPreProducts from "../views/inventory/supInvPreProducts"
import supInvPreInProducts from "../views/inventory/supInvPreInProducts"
import invUdiTrace from "@/views/inventory/invUdiTrace";
import invUdiTraceOrder from "@/views/inventory/invUdiTraceOrder";
import sickerUdiTraceOrder from "@/views/inventory/sickerUdiTraceOrder";
import additionalOrder from "@/views/warehouse/AdditionalOrder";
import invStatistics from "@/views/inventory/InvStatistics";
import thrInvWarehouse from "@/views/thrsys/ThrInvWarehouse";

//同步管理
import sysUdimsDownloadData from "../views/thrsys/SysUdimsDownloadData";
import thrProductsAddDi from "@/views/thrsys/ThrProductsAddDi";


//资质审核
import supCompany from "../views/purchase/supCompanyAdd.vue";
import supCompanyAudit from "../views/purchase/supCompanyAudit.vue";
import supCompanySearch from "../views/purchase/supCompanySearch.vue";
import supManufacturer from "../views/purchase/supManufacturerAdd.vue";
import supManufacturerAudit from "../views/purchase/supManufacturerAudit.vue";
import supManufacturerSearch from "../views/purchase/supManufacturerSearch.vue";
import supProduct from "../views/purchase/supProductAdd.vue";
import supProductAudit from "../views/purchase/supProductAudit.vue";
import supProductSearch from "../views/purchase/supProductSearch.vue";
import supCertAudit from "../views/purchase/supCertAudit.vue";
import supCertSearch from "../views/purchase/supCertSearch.vue";
import supCertSet from "../views/purchase/supCertSet.vue";
import supCertificationAdd from "../views/purchase/supCertificationAdd.vue";

//采购管理

import purApply from "../views/purchase/purApply";
import pureApplyAudit from "../views/purchase/pureApplyAudit";
import pureApplySearch from "../views/purchase/pureApplySearch";
import purPlan from "../views/purchase/purPlan";
import purPlanAudit from "../views/purchase/purPlanAudit";
import purPlanSearch from "../views/purchase/purPlanSearch";


const err401 = r =>
    require.ensure([], () => r(require("../views/error/err401.vue")), "home");

const register = r =>
    require.ensure([], () => r(require("../views/userManage/register.vue")), "home");

const registerApp = r =>
    require.ensure([], () => r(require("../views/userManage/registerApp.vue")), "home");

const forgetPasswd = r =>
    require.ensure([], () => r(require("../views/userManage/forgetPasswd.vue")), "home");

const err404 = r =>
    require.ensure([], () => r(require("../views/error/err404.vue")), "home");
const login = r =>
    require.ensure([], () => r(require("../views/login/index.vue")), "home");
const main = r =>
    require.ensure([], () => r(require("../views/home/main.vue")), "home");

// 注意 权限字段 authRule （严格区分大小写）
export const constantRouterMap = [
    {
        path: "*",
        component: err404,
        hidden: true
    },
    {
        path: "/401",
        component: err401,
        name: "401",
        hidden: true
    },
    {
        path: "/404",
        component: err404,
        name: "404",
        hidden: true
    },
    {
        path: "/500",
        component: err404,
        name: "500",
        hidden: true
    },

    {
        path: "/login",
        component: login,
        name: "登录",
        hidden: true
    },
    {
        path: "/register",
        component: register,
        name: "注册",
        hidden: true
    },
    {
        path: "/registerApp",
        component: registerApp,
        name: "注册",
        hidden: true
    },

    {
        path: "/forgetPasswd",
        component: forgetPasswd,
        name: "忘记密码",
        hidden: true
    },


    {
        path: "/",
        icon: "shouye",
        component: Home,
        redirect: "main",
        name: "首页",
        hidden: true,
        noDropdown: true,
        children: [
            {
                path: "main",
                component: main,
                name: "首页",
            },
        ]
    },

    {
        path: "/",
        icon: "showText",
        component: showText,
        redirect: "showText",
        name: "文本",
        hidden: true,
        noDropdown: true,
        children: [
            {
                path: "showText",
                component: showText,
                name: "文本",
            },
        ]
    },


];

export default new VueRouter({
    // mode: 'history', //后端支持可开
    mode: ROUTER_MODE,
    routes: constantRouterMap,
    strict: process.env.NODE_ENV !== "production"
});

export const asyncRouterMap = [

    {
        path: "/userManage",
        redirect: "/userManage/adminManage/index",
        component: Home,
        icon: "guanliyuan1",
        name: "系统管理",
        hidden: false,
        meta: {
            authRule: ["user_manage"]
        },

        // noDropdown: true,
        children: [


            {
                path: "/authMange",
                component: Empty,
                name: "权限管理",
                redirect: "/authMange/authAdmin",
                icon: "",
                meta: {
                    authRule: ["authMange/home"]
                },
                children: [
                    {
                        path: "authAdmin",
                        component: authAdmin,
                        name: "用户管理",
                        icon: "",
                        meta: {
                            authRule: ["authMange/auth_admin"]
                        }
                    },


                    {
                        path: "authRole",
                        component: authRole,
                        name: "角色管理",
                        icon: "",
                        meta: {
                            authRule: ["authMange/auth_role"]
                        }
                    },
                    {
                        path: "authPermissionRule",
                        component: authPermissionRule,
                        name: "功能配置",
                        icon: "",
                        meta: {
                            authRule: ["authMange/auth_permission_rule"]
                        }
                    },
                    {
                        path: "authDept",
                        component: authDept,
                        name: "科室管理",
                        icon: "",
                        meta: {
                            authRule: ["authMange/authDept"]
                        }
                    },
                ]
            },


            {
                path: "/systemParam",
                component: Empty,
                name: "系统参数",
                redirect: "/systemParam/systemParamConfig",
                icon: "",
                meta: {
                    authRule: ["systemParam/systemParamConfig"]
                },
                children: [
                    {
                        path: "phoneRegisterManage",
                        component: phoneRegisterManage,
                        name: "设备管理",
                        icon: "",
                        meta: {
                            authRule: ["admin/phoneRegisterManage"]
                        }
                    },
                    {
                        path: "systemParamConfig",
                        component: systemParamConfig,
                        name: "运行参数",
                        icon: "",
                        meta: {
                            authRule: ["admin/systemParamConfig"]
                        },
                    },
                    {
                        path: "basicPrdouctConfig",
                        component: basicProductConfig,
                        name: "耗材字典设置",
                        icon: "",
                        meta: {
                            authRule: ["admin/basicPrdouctConfig"]
                        },
                    },

                    {
                        path: "bussinessType",
                        name: "扫码单据类型",
                        component: BussinessType,
                        meta: {
                            authRule: ["product/bussinessType"]
                        }
                    },
                    {
                        path: "bussinessTypeLocl",
                        name: "业务单据类型",
                        component: BussinessTypeLocl,
                        meta: {
                            authRule: ["product/BussinessTypeLocl"]
                        }
                    },
                    {
                        path: "bussinessTypeChange",
                        name: "单据流转设置",
                        component: bussinessTypeChange,
                        meta: {
                            authRule: ["admin/bussinessTypeChange"]
                        }
                    },

                    {
                        path: "otherTypeChange",
                        name: "耗材领用设置",
                        component: otherTypeChange,
                        meta: {
                            authRule: ["admin/otherTypeChange"]
                        }
                    },


                ]
            },
            {
                path: "/systemPDFTemplate",
                component: Empty,
                name: "打印模板",
                redirect: "/systemPDFTemplate/template",
                icon: "",
                meta: {
                    authRule: ["systemParam/systemPDFTemplate"]
                },
                children: [
                    {
                        path: "template",
                        component: systemPDFTemplate,
                        name: "模板管理",
                        icon: "",
                        meta: {
                            authRule: ["pdf/template"]
                        }
                    },
                    {
                        path: "module",
                        component: systemPDFModule,
                        name: "打印设置",
                        icon: "",
                        meta: {
                            authRule: ["pdf/module"]
                        }
                    },
                ]
            },


            {
                path: "/spsSyncMange",
                component: Empty,
                name: "同步管理",
                redirect: "/spsSyncMange/spsSyncData",
                icon: "",
                meta: {
                    authRule: ["spsSyncMange/manage"]
                },
                children: [
                    {
                        path: "syncConfig",
                        name: "同步设置",
                        component: syncConfig,
                        meta: {
                            authRule: ["spsSyncMange/syncConfig"]
                        }
                    },
                    {
                        path: "spsSyncData",
                        component: spsSyncData,
                        name: "同步任务",
                        icon: "",
                        meta: {
                            authRule: ["spsSyncMange/spsSyncData"]
                        }
                    },
                    {
                        path: "sysUdimsDownloadData",
                        component: sysUdimsDownloadData,
                        name: "下载记录",
                        icon: "",
                        meta: {
                            authRule: ["spsSyncMange/sysUdimsDownloadData"]
                        }
                    },
                ]
            },


            {
                path: "/thrsysMange",
                component: Empty,
                name: "第三方系统",
                redirect: "/thrsysMange/bussinessTypeThird",
                icon: "",
                meta: {
                    authRule: ["thrsysMange/manage"]
                },
                children: [
                    {
                        path: "bussinessTypeThird",
                        name: "单据类型",
                        component: bussinessTypeThird,
                        meta: {
                            authRule: ["thrsysMange/bussinessTypeThird"]
                        }
                    },
                    {
                        path: "thirdSys",
                        name: "接口设置",
                        component: thirdSys,
                        meta: {
                            authRule: ["thrsysMange/thirdSys"]
                        }
                    },
                ]
            },


        ]
    },
    {
        path: "/basicProduct",
        redirect: "/udiInfo/UdiInfoManage",
        component: Home,
        icon: "tongyong",
        name: "基础数据",
        hidden: false,
        noDropdown: false,
        meta: {
            authRule: ["basicProduct"]
        },
        children: [
            {
                path: "invWarehouse",
                component: invWarehouse,
                name: "仓库/科室字典",
                icon: "",
                meta: {
                    authRule: ["basicProduct/invWarehouse"]
                }
            },

            {
                path: "/udiInfo",
                redirect: "/udiInfo/manage",
                name: "耗材字典",
                component: Empty,
                meta: {
                    authRule: ["udiInfo/manage"]
                },
                children: [

                    {
                        path: "UdiInfoManage",
                        name: "耗材字典维护",
                        component: UdiInfoManage,
                        meta: {
                            authRule: ["product/UdiInfoManage"]
                        }
                    },

                    {
                        path: "udiImport",
                        name: "耗材字典导入",
                        component: UdiInfoImport,
                        meta: {
                            authRule: ["product/udiImport"]
                        }
                    },
                    {
                        path: "udiinfoExport",
                        name: "耗材字典导出",
                        component: udiInfoExport,
                        meta: {
                            authRule: ["product/udiinfoExport"]
                        }
                    },

                    {
                        path: "UdiInfoManageSp",
                        name: "供应商器械信息",
                        component: UdiInfoManageSp,
                        meta: {
                            authRule: ["product/UdiInfoManageSp"]
                        }
                    },
                    {
                        path: "diSearch",
                        name: "DI信息查询",
                        component: diSearch,
                        meta: {
                            authRule: ["product/diSearch"]
                        }
                    },
                    {
                        path: "thrDIProductsCheck",
                        name: "新增配送产品审核",
                        component: thrDiProductsCheck,
                        meta: {
                            authRule: ["product/thrAddProducts"]
                        }
                    },

                    {
                        path: "thrProductsCheck",
                        name: "第三方产品维护审核",
                        component: thrProductsCheck,
                        meta: {
                            authRule: ["product/thrAddProducts"]
                        }
                    },

                ]
            },

            {
                path: "/basicCorp",
                redirect: "/basicCorp/manage",
                name: "往来单位字典",
                component: Empty,
                meta: {
                    authRule: ["basicCorp/manage"]
                },
                children: [
                    {
                        path: "basicUnitMaintain",
                        name: "往来单位信息维护",
                        component: basicUnitMaintain,
                        meta: {
                            authRule: ["basicCorp/basicUnitMaintain"]
                        }
                    },
                    {
                        path: "corpImport",
                        name: "往来单位信息导入",
                        component: corpImport,
                        meta: {
                            authRule: ["basicCorp/corpImport"]
                        }
                    },

                    {
                        path: "corpExport",
                        name: "往来单位信息导出",
                        component: corpExport,
                        meta: {
                            authRule: ["basicCorp/corpExport"]
                        }
                    },
                ]
            },


        ]
    },

    {
        path: "/firstCamp",
        component: Home,
        redirect: "/firstCamp/certAdd",
        icon: "tongyong",
        name: "首营资质",
        noDropdown: false,
        meta: {
            authRule: ["firstCamp"]
        },
        children: [


            {
                path: "/certAdd",
                redirect: "/certAdd/supplierAdd",
                name: "资质新增",
                hidden: true,
                component: Empty,
                meta: {
                    authRule: ["firstCamp/certAdd"]
                },
                children: [
                    {
                        path: "supplierAdd",
                        name: "供应商资质新增",
                        component: supCompany,
                        meta: {
                            authRule: ["firstCamp/certAdd/supplierAdd"]
                        }
                    },
                    {
                        path: "manufacturerAdd",
                        name: "生产企业资质新增",
                        component: supManufacturer,
                        meta: {
                            authRule: ["firstCamp/certAdd/manufacturerAdd"]
                        }
                    },

                    {
                        path: "productAdd",
                        name: "产品资质新增",
                        component: supProduct,
                        meta: {
                            authRule: ["firstCamp/certAdd/productAdd"]
                        }
                    },
                ]
            },


            {
                path: "certAudit",
                component: supCertAudit,
                name: "资质审核",
                icon: "",
                meta: {
                    authRule: ["firstCamp/certAudit"]
                }
            },

            {
                path: "certSearch",
                component: supCertSearch,
                name: "资质查询",
                icon: "",
                meta: {
                    authRule: ["firstCamp/certSearch"]
                }
            },


            {
                path: "certSet",
                component: supCertSet,
                name: "资质上传设置",
                icon: "",
                meta: {
                    authRule: ["firstCamp/certSet"]
                }
            },


            {
                path: "/supplierManage",
                redirect: "/supplierManage/supplierAdd",
                name: "供应商资质管理",
                component: Empty, hidden: true,
                meta: {
                    authRule: ["firstCamp/supplierManage"]
                },
                children: [
                    {
                        path: "supplierAdd",
                        name: "供应商资质新增",
                        component: supCompany,
                        meta: {
                            authRule: ["firstCamp/supplierManage/supplierAdd"]
                        }
                    },
                    {
                        path: "supplierAudit",
                        name: "供应商资质审核",
                        component: supCompanyAudit,
                        meta: {
                            authRule: ["firstCamp/supplierManage/supplierAudit"]
                        }
                    },

                    {
                        path: "supplierSearch",
                        name: "供应商资质查询",
                        component: supCompanySearch,
                        meta: {
                            authRule: ["firstCamp/supplierManage/supplierSearch"]
                        }
                    },
                ]
            },


            {
                path: "/manufacturerManage",
                redirect: "/manufacturerManage/manufacturerAdd",
                name: "生产企业资质管理", hidden: true,
                component: Empty,
                meta: {
                    authRule: ["firstCamp/manufacturerManage"]
                },
                children: [
                    {
                        path: "manufacturerAdd",
                        name: "生产企业资质新增",
                        component: supManufacturer,
                        meta: {
                            authRule: ["firstCamp/manufacturerManage/manufacturerAdd"]
                        }
                    },
                    {
                        path: "manufacturerAudit",
                        name: "生产企业资质审核",
                        component: supManufacturerAudit,
                        meta: {
                            authRule: ["firstCamp/manufacturerManage/manufacturerAudit"]
                        }
                    },

                    {
                        path: "manufacturerSearch",
                        name: "生产企业资质查询",
                        component: supManufacturerSearch,
                        meta: {
                            authRule: ["firstCamp/manufacturerManage/manufacturerSearch"]
                        }
                    },
                ]
            },

            {
                path: "/productManage",
                redirect: "/productManage/productAdd",
                name: "产品资质管理", hidden: true,
                component: Empty,
                meta: {
                    authRule: ["firstCamp/productManage"]
                },
                children: [
                    {
                        path: "productAdd",
                        name: "产品资质新增",
                        component: supProduct,
                        meta: {
                            authRule: ["firstCamp/productManage/productAdd"]
                        }
                    },
                    {
                        path: "supProductAudit",
                        name: "产品资质审核",
                        component: supProductAudit,
                        meta: {
                            authRule: ["firstCamp/productManage/supProductAudit"]
                        }
                    },

                    {
                        path: "supProductSearch",
                        name: "产品资质查询",
                        component: supProductSearch,
                        meta: {
                            authRule: ["firstCamp/productManage/supProductSearch"]
                        }
                    },
                ]
            },
        ]
    },

    {
        path: "/supplierManagement",
        redirect: "/supplierManagement/config/index",
        component: Home,
        icon: "tongyong",
        name: "供应商管理",
        hidden: false,
        meta: {
            authRule: ["supplierManagement"]
        },
        children: [
            {
                path: "registerManage",
                component: registerManage,
                name: "新用户审核",
                icon: "",
                meta: {
                    authRule: ["admin/registerManage"]
                }
            },
            {
                path: "customerManage",
                component: customerManage,
                name: "供应商信息管理",
                icon: "",
                meta: {
                    authRule: ["admin/customerManage"]
                }
            },
            {
                path: "/suppliers",
                redirect: "/suppliers/Enterprise",
                name: "首营资质管理",
                component: Empty,
                meta: {
                    authRule: ["suppliers/Enterprise"]
                },
                children: [
                    {
                        path: "customerFileManage",
                        component: customerFileManage,
                        name: "供应商资质审核",
                        icon: "",
                        meta: {
                            authRule: ["admin/customerFileManage"]
                        }
                    },
                    {
                        path: "customerApplyUpdateManage",
                        component: customerApplyUpdateManage,
                        name: "供应商变更审核",
                        icon: "",
                        meta: {
                            authRule: ["admin/customerApplyUpdateManage"]
                        }
                    },
                    {
                        path: "customerAuditedManage",
                        component: customerAuditedManage,
                        name: "供应商资质查询",
                        icon: "",
                        meta: {
                            authRule: ["admin/customerAuditedManage"]
                        }
                    },
                    {
                        path: "suppliersEnterpriseBasic",
                        component: suppliersEnterpriseBasic,
                        name: "生产企业资质",
                        icon: "",
                        meta: {
                            authRule: ["admin/suppliersEnterpriseBasic"]
                        }
                    },
                ]
            },
            {
                path: "/suppliersT",
                redirect: "/suppliersT/updateLog",
                name: "供应商审核记录",
                component: Empty,
                meta: {
                    authRule: ["suppliersT/updateLog"]
                },
                children: [
                    {
                        path: "basicCompanyUpdateLogTotal",
                        component: basicCompanyUpdateLogTotal,
                        name: "企业审核记录",
                        icon: "",
                        meta: {
                            authRule: ["basic/basicCompanyUpdateLogTotal"]
                        }
                    },
                    {
                        path: "basicCompanySalesmanUpdateLogTotal",
                        component: basicCompanySalesmanUpdateLogTotal,
                        name: "业务员审核记录",
                        icon: "",
                        meta: {
                            authRule: ["basic/basicCompanySalesmanUpdateLogTotal"]
                        }
                    },
                ]
            }
        ]
    },

    {
        path: "/purchase",
        component: Home,
        redirect: "/purchase/apply",
        icon: "tongyong",
        name: "采购管理",
        noDropdown: false,
        meta: {
            authRule: ["purchase"]
        },
        children: [

            {
                path: "/apply",
                component: Empty,
                name: "产品申购管理",
                redirect: "/apply/applyAdd",
                meta: {
                    authRule: ["purchase/apply"]
                },
                children: [
                    {
                        path: "applyAdd",
                        component: purApply,
                        name: "新增申购单据",
                        meta: {
                            authRule: ["purchase/apply/add"]
                        }
                    },
                    {
                        path: "applyAudit",
                        component: pureApplyAudit,
                        name: "申购单据审核",
                        meta: {
                            authRule: ["purchase/apply/audit"]
                        }
                    },
                    {
                        path: "applySearch",
                        component: pureApplySearch,
                        name: "申购单据查询",
                        meta: {
                            authRule: ["purchase/apply/search"]
                        }
                    },

                ]
            },

            {
                path: "/plan",
                component: Empty,
                name: "采购计划管理",
                redirect: "/plan/planAdd",
                meta: {
                    authRule: ["plan/planAdd"]
                },
                children: [
                    {
                        path: "planAdd",
                        component: purPlan,
                        name: "新增采购计划",
                        meta: {
                            authRule: ["purchase/plan/planAdd"]
                        }
                    },
                    {
                        path: "planAudit",
                        component: purPlanAudit,
                        name: "采购计划审核",
                        meta: {
                            authRule: ["purchase/plan/planAudit"]
                        }
                    },
                    {
                        path: "planSearch",
                        component: purPlanSearch,
                        name: "采购计划查询",
                        meta: {
                            authRule: ["purchase/plan/planSearch"]
                        }
                    },

                ]
            },


        ]
    },

    {
        path: "/inv",
        redirect: "/inv/invProducts",
        component: Home,
        icon: "tongyong",
        name: "仓库管理",
        hidden: false,
        noDropdown: false,
        meta: {
            authRule: ["inv"]
        },
        children: [
            {
                path: "invProducts",
                component: invProducts,
                name: "库存查询",
                icon: "",
                meta: {
                    authRule: ["inv/invProducts"]
                }
            },
            {
                path: "/invManage",
                component: Empty,
                name: "库存管理",
                icon: "",
                meta: {
                    authRule: ["inv/invManage"]
                },
                children: [
                    {
                        path: "BasicEntrutsRece",
                        name: "委托验收设置",
                        component: BasicEntrutsRece,
                        meta: {
                            authRule: ["basic/BasicEntrutsRece"]
                        }
                    },
                    {
                        path: "additionalOrder",
                        component: additionalOrder,
                        name: "补录单据查询",
                        meta: {
                            authRule: ["stock/additionalOrder"]
                        }
                    },
                    {
                        path: "stockOrderInvSearch",
                        component: stockOrderInvSearch,
                        name: "业务单据查询",
                        meta: {
                            authRule: ["inv/stockOrderInvSearch"]
                        }
                    },
                    {
                        path: "invStatistics",
                        component: invStatistics,
                        name: "库存统计",
                        icon: "",
                        meta: {
                            authRule: ["inv/invStatistics"]
                        }
                    },
                ]
            },
            {
                path: "/otherInvManage",
                component: Empty,
                name: "其他库管理",
                icon: "",
                meta: {
                    authRule: ["inv/otherInvManage"]
                },
                children: [
                    {
                        path: "invPreProducts",
                        component: invPreProducts,
                        name: "寄售库查询",
                        icon: "",
                        meta: {
                            authRule: ["inv/invPreProducts"]
                        }
                    },
                    {
                        path: "invPreInProducts",
                        component: invPreInProducts,
                        name: "预验收库查询",
                        icon: "",
                        meta: {
                            authRule: ["inv/invPreInProducts"]
                        }
                    },
                ]
            },
            {
                path: "udiTrace",
                component: invUdiTraceOrder,
                name: "UDI码流向",
                icon: "",
                meta: {
                    authRule: ["inv/udiTrace"]
                }
            },
            {
                path: "sickerTrace",
                component: sickerUdiTraceOrder,
                name: "患者使用溯源",
                icon: "",
                meta: {
                    authRule: ["inv/sickerUdiTraceOrder"]
                }
            },
        ]
    },
    {
        path: "/inout",
        component: Home,
        redirect: "/inout/scanOrder",
        icon: "tongyong",
        name: "单据管理",
        noDropdown: false,
        meta: {
            authRule: ["inout"]
        },
        children: [

            {
                path: "/receiveOrder",
                component: Empty,
                name: "耗材领用管理",
                redirect: "/receiveOrder/receiveOrderNew",
                meta: {
                    authRule: ["receiveOrder"]
                },
                children: [
                    {
                        path: "receiveOrderNew",
                        component: receiveOrderNew,
                        name: "新增领用单据",
                        meta: {
                            authRule: ["stock/receiveOrderNew"]
                        }
                    },
                    {
                        path: "receiveOrderSearch",
                        component: receiveOrderSearch,
                        name: "领用单查询",
                        meta: {
                            authRule: ["stock/receiveOrderSearch"]
                        }
                    },

                ]
            },

            {
                path: "/busOrder",
                component: Empty,
                name: "业务单据管理",
                redirect: "/busOrder/stockOrderNew",
                meta: {
                    authRule: ["inout/busOrder"]
                },
                children: [
                    {
                        path: "stockOrderNew",
                        component: stockOrderNew,
                        name: "新增业务单据",
                        meta: {
                            authRule: ["stock/stockOrderNew"]
                        }
                    },
                    {
                        path: "stockOrderEditor",
                        component: stockOrderEditor,
                        name: "单据配货管理",
                        meta: {
                            authRule: ["stock/stockOrderEditor"]
                        }
                    },
                    {
                        path: "stockOrderWaitCheck",
                        component: stockOrderWaitCheck,
                        name: "待校验业务单据",
                        meta: {
                            authRule: ["stock/stockOrderWaitCheck"]
                        }
                    },
                    {
                        path: "stockOrder",
                        component: stockOrder,
                        name: "内部码管理",
                        meta: {
                            authRule: ["stock/stockOrder"]
                        }
                    },
                    // {
                    //     path: "stockOrderPrint",
                    //     component: stockOrderPrint,
                    //     name: "打印订单",
                    //     meta: {
                    //         authRule: ["stock/stockOrderPrint"]
                    //     }
                    // },
                    // {
                    //     path: "stockOrderInCode",
                    //     component: stockOrderInCode,
                    //     name: "单据打印",
                    //     meta: {
                    //         authRule: ["stock/stockIOrderInCode"]
                    //     }
                    // },
                    // {
                    //     path: "stockOrderError",
                    //     component: stockOrderError,
                    //     name: "异常订单",
                    //     meta: {
                    //         authRule: ["stock/stockOrderError"]
                    //     }
                    // },
                    // {
                    //     path: "stockDeliveryOrder",
                    //     component: stockDeliveryOrder,
                    //     name: "送货单管理",
                    //     meta: {
                    //         authRule: ["stock/stockDeliveryOrder"]
                    //     }
                    // }
                ]
            },
            {
                path: "/scanOrder",
                component: Empty,
                name: "扫码单据管理",
                redirect: "/scanOrder/errorOrder",
                meta: {
                    authRule: ["inout/scanOrder"]
                },
                children: [
                    {
                        path: "errorOrder",
                        component: errorOrder,
                        name: "新增扫码单据",
                        meta: {
                            authRule: ["inout/errorOrder"]
                        }
                    },
                    {
                        path: "waitOrder",
                        name: "等待校验单据",
                        component: waitOrder,
                        meta: {
                            authRule: ["inout/waitOrder"]
                        }
                    },
                    {
                        path: "main",
                        name: "扫码单据查询",
                        component: inout,
                        meta: {
                            authRule: ["inout/main"]
                        }
                    },
                    {
                        path: "ioCheckOrder",
                        name: "校验异常单据",
                        component: ioCheckOrder,
                        meta: {
                            authRule: ["inout/ioCheckOrder"]
                        }
                    },
                ]
            },
            {
                path: "stockOrderSearch",
                component: stockOrderSearch,
                name: "未验收单据",
                meta: {
                    authRule: ["stock/stockOrderSearch"]
                }
            },
            {
                path: "stockOrderDelSearch",
                component: stockOrderDelSearch,
                name: "已验收单据",
                meta: {
                    authRule: ["stock/stockOrderDelSearch"]
                }
            },
            {
                path: "stockOrderEdit",
                component: stockOrderDelete,
                name: "单据编辑",
                meta: {
                    authRule: ["stock/stockOrderDelete"]
                }
            },

            {
                path: "stockOrderChange",
                component: stockOrderChange,
                name: "单据流转查询",
                meta: {
                    authRule: ["stock/stockOrderChange"]
                }
            },

        ]
    },


    // {
    //     path: "thrProductsExport",
    //     name: "产品信息导出",
    //     component: thrProductsExport,
    //     meta: {
    //         authRule: ["thrsys/thrProductsExport"]
    //     }
    // },

    // {
    //     path: "thrOrderExport",
    //     name: "业务单据导出",
    //     component: thrOrderExport,
    //     meta: {
    //         authRule: ["thrsys/thrOrderExport"]
    //     }
    // },
    // {
    //     path: "thirdSys",
    //     name: "参数设置",
    //     component: thirdSys,
    //     meta: {
    //         authRule: ["thrsys/thirdSys"]
    //     }
    // },

    {
        path: "/thrsys",
        redirect: "/thrsys/manage",
        name: "第三方数据",
        component: Home,
        icon: "tongyong",
        meta: {
            authRule: ["thrsys/manage"]
        },
        children: [
            {
                path: "thrInvWarehouse",
                component: thrInvWarehouse,
                name: "仓库信息",
                icon: "",
                meta: {
                    authRule: ["thrsys/thrInvWarehouse"]
                }
            },
            {
                path: "/corps",
                redirect: "/corps/ThrCorps",
                name: "往来单位",
                component: Empty,
                meta: {
                    authRule: ["thrsys/corp"]
                },
                children: [
                    {
                        path: "ThrCorps",
                        name: "往来单位查询",
                        component: ThrCorps,
                        meta: {
                            authRule: ["thrsys/ThrCorps"]
                        }
                    },

                    {
                        path: "thrCorpsImport",
                        name: "往来单位导入",
                        component: thrCorpsImport,
                        meta: {
                            authRule: ["thrsys/thrCorpsImport"]
                        }
                    },
                    // {
                    //     path: "thrCorpsExport",
                    //     name: "往来单位导出",
                    //     component: thrCorpsExport,
                    //     meta: {
                    //         authRule: ["thrsys/thrCorpsExport"]
                    //     }
                    // }
                ],
            },

            {
                path: "/products",
                redirect: "/products/thrProducts",
                name: "产品信息",
                component: Empty,
                meta: {
                    authRule: ["thrsys/products"]
                },
                children: [
                    {
                        path: "thrProducts",
                        name: "产品信息查询",
                        component: thrProducts,
                        meta: {
                            authRule: ["thrsys/thrProducts"]
                        }
                    },
                    {
                        path: "thrProductsImport",
                        name: "产品信息导入",
                        component: thrProductsImport,
                        meta: {
                            authRule: ["thrsys/thrProductsImport"]
                        }
                    },
                ],
            },

            {
                path: "/orders",
                redirect: "/orders/ThrOrders",
                name: "业务单据",
                component: Empty,
                meta: {
                    authRule: ["thrsys/orders"]
                },
                children: [
                    {
                        path: "ThrOrders",
                        name: "业务单据查询",
                        component: ThrOrders,
                        meta: {
                            authRule: ["thrsys/ThrOrders"]
                        }
                    },
                    {
                        path: "thrOrderImport",
                        name: "业务单据导入",
                        component: thrOrderImport,
                        meta: {
                            authRule: ["thrsys/thrOrderImport"]
                        }
                    },
                ],
            },
            {
                path: "/udplatGoods",
                redirect: "/udplatGoods/ThrOrders",
                name: "阳光采购平台",
                hidden: true,
                component: Empty,
                meta: {
                    authRule: ["thrsys/udplatGoods"]
                },
                children: [
                    {
                        path: "thrUdplatGoods",
                        name: "阳光采购平台查询",
                        component: udplatGoods,
                        meta: {
                            authRule: ["thrsys/thrUdplatGoods"]
                        }
                    },
                    {
                        path: "thrUdplatGoodsImport",
                        name: "阳光采购平台导入",
                        component: udplatGoodsImport,
                        meta: {
                            authRule: ["thrsys/thrUdplatGoodsImport"]
                        }
                    },
                ],
            },


        ]
    },

    {
        path: "/supplier",
        redirect: "/supplier/basicInstrumentMaintain",
        component: Home,
        icon: "tongyong",
        name: "我是供应商",
        hidden: false,
        noDropdown: false,
        meta: {
            authRule: ["supplier"]
        },
        children: [
            {
                path: "basicCompany",
                name: "本企业信息",
                component: basicCompany,
                meta: {
                    authRule: ["basic/basicCompany"]
                }
            },
            {
                path: "supCertificationAdd",
                name: "本企业资质",
                component: supCertificationAdd,
                meta: {
                    authRule: ["basic/supCertificationAdd"]
                }
            },
            {
                path: "basicCompanyProduct",
                name: "本企业产品",
                component: basicCompanyProducts,
                meta: {
                    authRule: ["basic/basicCompanyProduct"]
                }
            },

            {
                path: "/spDistribution",
                redirect: "/spDistribution/spDistributionDi",
                name: "新增配送产品",
                component: Empty,
                meta: {
                    authRule: ["spDistribution/local"]
                },
                children: [
                    {
                        path: "spDistributionDi",
                        name: "新增配送产品",
                        component: thrProductsAddDi,
                        meta: {
                            authRule: ["product/thrProductsSubmit"]
                        }
                    },
                    {
                        path: "spDistributionThr",
                        name: "维护第三方产品",
                        component: thrProductsSubmit,
                        meta: {
                            authRule: ["product/thrProductsAddDi"]
                        }
                    },
                ]
            },


            {
                path: "/spInv",
                redirect: "/spInv/spInvProducts",
                name: "本企业库存",
                component: Empty,
                meta: {
                    authRule: ["spInv/local"]
                },
                children: [
                    {
                        path: "spInvProducts",
                        component: supInvProducts,
                        name: "库存查询",
                        icon: "",
                        hidden: false,
                        meta: {
                            authRule: ["spInv/spInvProducts"]
                        }
                    },
                    // {
                    //     path: "spInvProducts",
                    //     component: supInvProducts,
                    //     name: "库存统计",
                    //     icon: "",
                    //     hidden: false,
                    //     meta: {
                    //         authRule: ["spInv/spInvProducts"]
                    //     }
                    // },
                    {
                        path: "spInvPreProducts",
                        component: supInvPreProducts,
                        name: "寄售库存查询",
                        icon: "",
                        hidden: false,
                        meta: {
                            authRule: ["spInv/spPreInvProducts"]
                        }
                    },
                    {
                        path: "supInvPreInProducts",
                        component: supInvPreInProducts,
                        name: "预验收库存查询",
                        icon: "",
                        hidden: false,
                        meta: {
                            authRule: ["spInv/supInvPreInProducts"]
                        }
                    },

                ]
            },


            {
                path: "userAccountManage",
                component: userAccountManage,
                name: "用户列表",
                icon: "",
                meta: {
                    authRule: ["basic/userAccountManage"]
                }
            },

            {
                path: "/suppliers",
                redirect: "/supplier/basicCompanyUpdateLog",
                name: "审核记录",
                component: Empty,
                meta: {
                    authRule: ["suppliers/updateLog"]
                },
                children: [
                    {
                        path: "basicCompanyUpdateLog",
                        component: basicCompanyUpdateLog,
                        name: "本企业审核记录",
                        icon: "",
                        meta: {
                            authRule: ["basic/basicCompanyUpdateLog"]
                        }
                    },
                    {
                        path: "basicCompanySalesmanUpdateLog",
                        component: basicCompanySalesmanUpdateLog,
                        name: "业务员审核记录",
                        icon: "",
                        meta: {
                            authRule: ["basic/basicCompanySalesmanUpdateLog"]
                        }
                    },
                ]
            }

        ]
    },
];
