1
chenhaozhe
2026-04-04 35a0eb3cc4d6337e9d28747817df71e1ea34c9d2
src/store/modules/permission.js
@@ -4,7 +4,7 @@
import Layout from "@/layout/index";
import ParentView from "@/components/ParentView";
import InnerLink from "@/layout/components/InnerLink";
import { getLoginPageSource } from "@/utils/loginSource"; // 导入登录来源判断工具
const permission = {
  state: {
    routes: [],
@@ -31,6 +31,15 @@
  actions: {
    // 生成路由
    GenerateRoutes({ commit }) {
      // 示例:根据登录来源执行不同的逻辑
      const loginSource = getLoginPageSource();
      console.log(`用户从 ${loginSource} 页面登录`);
      var HIsHide = false;
      if(loginSource=="loginTMS"){
        HIsHide = true;
      }
      return new Promise((resolve) => {
        // 向后端请求路由数据
        let data = [
@@ -41,9 +50,83 @@
              icon: "build",
              link: null,
              noCache: false,
              title: "销售管理",
              title: "物流管理",
            },
            hidden: false,
            name: "Logistics",
            path: "/logistics",
            redirect: "noRedirect",
            children: [
              {
                meta: {
                  icon: "build",
                  link: null,
                  noCache: false,
                  title: "运输定位",
                },
                hidden: false,
                name: "TransportGPS",
                path: "transportGPS",
                redirect: "noRedirect",
                component: "Layout",
                children: [
                  {
                    meta: {
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "出运单",
                    },
                    component: () =>
                      import("@/views/logistics/transportGPS/WL_YayBill.vue"),
                    hidden: false,
                    name: "WL_YayBill",
                    path: "WL_YayBill",
                  },
                ],
              },
              {
                meta: {
                  icon: "build",
                  link: null,
                  noCache: false,
                  title: "运输定位",
                },
                hidden: HIsHide,
                name: "WayBillPaymentBill",
                path: "WayBillPaymentBill",
                redirect: "noRedirect",
                component: "Layout",
                children: [
                  {
                    meta: {
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "运单费用结算单",
                    },
                    component: () =>
                      import(
                        "@/views/logistics/WayBillPaymentBill/Pay_WayBillPaymentBillList.vue"
                      ),
                    hidden: HIsHide,
                    name: "payWayBillPaymentBillList",
                    path: "PayWayBillPaymentBillList",
                  },
                ],
              },
            ],
          },
          {
            alwaysShow: true,
            component: "Layout",
            meta: {
              icon: "build",
              link: null,
              noCache: false,
              title: "销售管理",
            },
            hidden: HIsHide,
            name: "Sell",
            path: "/sell",
            redirect: "noRedirect",
@@ -234,7 +317,10 @@
                      noCache: false,
                      title: "销售退货单维护",
                    },
                    component: () =>import ("@/views/sell/Kf_ICStockBillMainList/Kf_ICStockBillMainList.vue"),
                    component: () =>
                      import(
                        "@/views/sell/Kf_ICStockBillMainList/Kf_ICStockBillMainList.vue"
                      ),
                    hidden: false,
                    name: "KfICStockBillMainList",
                    path: "KfICStockBillMainList",
@@ -246,7 +332,10 @@
                      noCache: false,
                      title: "销售退货单",
                    },
                    component: () =>import ("@/views/sell/Kf_ICStockBillMainList/Kf_ICStockBillMainListEdit.vue"),
                    component: () =>
                      import(
                        "@/views/sell/Kf_ICStockBillMainList/Kf_ICStockBillMainListEdit.vue"
                      ),
                    hidden: false,
                    name: "KfICStockBillMainListEdit",
                    path: "KfICStockBillMainListEdit",
@@ -264,7 +353,7 @@
              noCache: false,
              title: "仓库管理",
            },
            hidden: false,
            hidden: HIsHide,
            name: "Warehouse",
            path: "/warehouse",
            redirect: "noRedirect",
@@ -290,7 +379,9 @@
                      title: "出库申请单维护",
                    },
                    component: () =>
                      import("@/views/warehouse/shipment/Kf_StockOutRequestBillList.vue"),
                      import(
                        "@/views/warehouse/shipment/Kf_StockOutRequestBillList.vue"
                      ),
                    hidden: false,
                    name: "Kf_StockOutRequestBillList",
                    path: "Kf_StockOutRequestBillList",
@@ -303,7 +394,9 @@
                      title: "出库申请单",
                    },
                    component: () =>
                      import("@/views/warehouse/shipment/Kf_StockOutRequestBill.vue"),
                      import(
                        "@/views/warehouse/shipment/Kf_StockOutRequestBill.vue"
                      ),
                    hidden: false,
                    name: "Kf_StockOutRequestBill",
                    path: "Kf_StockOutRequestBill",
@@ -331,7 +424,9 @@
                      title: "调拨申请单维护",
                    },
                    component: () =>
                      import("@/views/warehouse/transfer/Kf_MoveStockRequestBillList.vue"),
                      import(
                        "@/views/warehouse/transfer/Kf_MoveStockRequestBillList.vue"
                      ),
                    hidden: false,
                    name: "Kf_MoveStockRequestBillList",
                    path: "Kf_MoveStockRequestBillList",
@@ -344,7 +439,9 @@
                      title: "调拨申请单",
                    },
                    component: () =>
                      import("@/views/warehouse/transfer/Kf_MoveStockRequestBillEdit.vue"),
                      import(
                        "@/views/warehouse/transfer/Kf_MoveStockRequestBillEdit.vue"
                      ),
                    hidden: false,
                    name: "Kf_MoveStockRequestBillEdit",
                    path: "Kf_MoveStockRequestBillEdit",
@@ -357,7 +454,9 @@
                      title: "直接调拨单维护",
                    },
                    component: () =>
                      import("@/views/KCGL/MoveStockBill/Kf_MoveStockBillList.vue"),
                      import(
                        "@/views/KCGL/MoveStockBill/Kf_MoveStockBillList.vue"
                      ),
                    hidden: false,
                    name: "Kf_MoveStockBillList",
                    path: "Kf_MoveStockBillList",
@@ -370,7 +469,9 @@
                      title: "直接调拨单",
                    },
                    component: () =>
                      import("@/views/KCGL/MoveStockBill/Kf_MoveStockBillEdit.vue"),
                      import(
                        "@/views/KCGL/MoveStockBill/Kf_MoveStockBillEdit.vue"
                      ),
                    hidden: false,
                    name: "Kf_MoveStockBillEdit",
                    path: "Kf_MoveStockBillEdit",
@@ -398,10 +499,42 @@
                      title: "条码生成",
                    },
                    component: () =>
                      import("@/views/warehouse/barcodeMaster/Gy_BarCodeBill.vue"),
                      import(
                        "@/views/warehouse/barcodeMaster/Gy_BarCodeBill.vue"
                      ),
                    hidden: false,
                    name: "Gy_BarCodeBill",
                    path: "Gy_BarCodeBill",
                  },
                  {
                    meta: {
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "条码生成_锦隆",
                    },
                    component: () =>
                      import(
                        "@/views/warehouse/barcodeMaster/Gy_BarCodeBill_JinLong.vue"
                      ),
                    hidden: false,
                    name: "Gy_BarCodeBill_JinLong",
                    path: "Gy_BarCodeBill_JinLong",
                  },
                  {
                    meta: {
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "条码主档",
                    },
                    component: () =>
                      import(
                        "@/views/warehouse/barcodeMaster/Gy_BarCodeBillList.vue"
                      ),
                    hidden: false,
                    name: "Gy_BarCodeBillList",
                    path: "Gy_BarCodeBillList",
                  },
                ],
              },
@@ -428,7 +561,7 @@
                  noCache: false,
                  title: "生产资料",
                },
                hidden: false,
                hidden: HIsHide,
                name: "Production",
                path: "production",
                redirect: "noRedirect",
@@ -454,6 +587,36 @@
                  icon: "build",
                  link: null,
                  noCache: false,
                  title: "物流基础资料",
                },
                hidden: HIsHide,
                name: "Transport",
                path: "transport",
                redirect: "noRedirect",
                component: "Layout",
                children: [
                  {
                    meta: {
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "承运合同单据",
                    },
                    component: () =>
                      import(
                        "@/views/basic/gytransport/cgContractTransportBillList/Cg_ContractTransportBillList.vue"
                      ),
                    hidden: false,
                    name: "CgContractTransportBillList",
                    path: "cgContractTransportBillList",
                  },
                ],
              },
              {
                meta: {
                  icon: "build",
                  link: null,
                  noCache: false,
                  title: "公用资料",
                },
                hidden: false,
@@ -471,7 +634,7 @@
                    },
                    component: () =>
                      import("@/views/basic/gyWarehouse/gyWarehouse.vue"),
                    hidden: false,
                    hidden: HIsHide,
                    name: "GyWarehouse",
                    path: "gyWarehouse",
                  },
@@ -484,9 +647,48 @@
                    },
                    component: () =>
                      import("@/views/basic/gyStockPlace/gyStockPlace.vue"),
                    hidden: false,
                    hidden: HIsHide,
                    name: "GyStockPlace",
                    path: "gyStockPlace",
                  },
                  {
                    meta: {
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "车型列表",
                    },
                    component: () =>
                      import("@/views/basic/gyCartypelist/gyCartypelist.vue"),
                    hidden: false,
                    name: "GyCartypelist",
                    path: "gyCartypelist",
                  },
                  {
                    meta: {
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "费用项目列表",
                    },
                    component: () =>
                      import("@/views/basic/gyItemMoney/gyItemMoney.vue"),
                    hidden: HIsHide,
                    name: "GyItemMoney",
                    path: "gyItemMoney",
                  },
                  {
                    meta: {
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "车辆列表",
                    },
                    component: () =>
                      import("@/views/basic/gyCar/gyCarList.vue"),
                    hidden: false,
                    name: "GyCarList",
                    path: "gyCarList",
                  },
                  {
                    meta: {
@@ -497,7 +699,7 @@
                    },
                    component: () =>
                      import("@/views/basic/gyEmployee/gyEmployee.vue"),
                    hidden: false,
                    hidden: HIsHide,
                    name: "GyEmployee",
                    path: "gyEmployee",
                  },
@@ -510,9 +712,34 @@
                    },
                    component: () =>
                      import("@/views/basic/gy/gyDepartment.vue"),
                    hidden: false,
                    hidden: HIsHide,
                    name: "GyDepartment",
                    path: "gyDepartment",
                  },
                  {
                    meta: {
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "货币列表",
                    },
                    component: () =>
                      import("@/views/basic/gyCurrency/gyCurrency.vue"),
                    hidden: HIsHide,
                    name: "GyCurrency",
                    path: "gyCurrency",
                  },
                  {
                    meta: {
                      icon: "build",
                      link: null,
                      noCache: HIsHide,
                      title: "计量单位列表",
                    },
                    component: () => import("@/views/basic/gyUnit/gyUnit.vue"),
                    hidden: HIsHide,
                    name: "GyUnit",
                    path: "gyUnit",
                  },
                  {
                    meta: {
@@ -522,7 +749,7 @@
                      title: "供应商列表",
                    },
                    component: () => import("@/views/basic/gy/gySupplier.vue"),
                    hidden: false,
                    hidden: HIsHide,
                    name: "GySupplier",
                    path: "gySupplier",
                  },
@@ -535,7 +762,7 @@
                    },
                    component: () =>
                      import("@/views/gyMaterial/GyMaterial.vue"),
                    hidden: false,
                    hidden: HIsHide,
                    name: "GyMaterial",
                    path: "GyMaterial",
                  },
@@ -547,9 +774,22 @@
                      title: "客户列表",
                    },
                    component: () => import("@/views/GyCustomer/index.vue"),
                    hidden: false,
                    hidden: HIsHide,
                    name: "GyCustomer",
                    path: "GyCustomer",
                  },
                  {
                    meta: {
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "辅助属性列表",
                    },
                    component: () =>
                      import("@/views/basic/gyProperty/gyPropertyList.vue"),
                    hidden: HIsHide,
                    name: "GyProperty",
                    path: "gyProperty",
                  },
                ],
              },
@@ -564,7 +804,7 @@
              noCache: false,
              title: "采购管理",
            },
            hidden: false,
            hidden: HIsHide,
            name: "Purchase",
            path: "/purchase",
            redirect: "noRedirect",
@@ -750,7 +990,7 @@
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "采购退料单维护",
                      title: "采购退料单列表(已入库)",
                    },
                    component: () =>
                      import(
@@ -759,6 +999,23 @@
                    hidden: false,
                    name: "Kf_POStockInBackBillList",
                    path: "Kf_POStockInBackBillList",
                    query: '{"type":1}',
                  },
                  {
                    meta: {
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "采购退料单列表(未入库)",
                    },
                    component: () =>
                      import(
                        "@/views/purchase/postockInBack/Kf_POStockInBackBillList.vue"
                      ),
                    hidden: false,
                    name: "Kf_POStockInBackBillList",
                    path: "Kf_POStockInBackBillList0",
                    query: '{"type":0}',
                  },
                ],
              },
@@ -782,7 +1039,10 @@
                      noCache: false,
                      title: "其他出库单列表",
                    },
                    component: () => import("@/views/KCGL/OtherOutBill/Kf_OtherOutBillList.vue"),
                    component: () =>
                      import(
                        "@/views/KCGL/OtherOutBill/Kf_OtherOutBillList.vue"
                      ),
                    hidden: false,
                    name: "OtherOutBillList",
                    path: "OtherOutBillList",
@@ -794,7 +1054,10 @@
                      noCache: false,
                      title: "其他出库单",
                    },
                    component: () => import("@/views/KCGL/OtherOutBill/Kf_OtherOutBillEdit.vue"),
                    component: () =>
                      import(
                        "@/views/KCGL/OtherOutBill/Kf_OtherOutBillEdit.vue"
                      ),
                    hidden: false,
                    name: "OtherOutBillEdit",
                    path: "OtherOutBillEdit",
@@ -812,7 +1075,7 @@
              noCache: false,
              title: "生产管理",
            },
            hidden: false,
            hidden: HIsHide,
            name: "ICMO",
            path: "/icmo",
            redirect: "noRedirect",
@@ -865,7 +1128,7 @@
                },
                hidden: false,
                name: "ProductInBill",
                path: "ProductInBill",
                path: "productInBill",
                redirect: "noRedirect",
                component: "Layout",
                children: [
@@ -876,10 +1139,11 @@
                      noCache: false,
                      title: "生产入库列表",
                    },
                    component: () => import("@/views/ProductInBill/Kf_ProductInBillList.vue"),
                    component: () =>
                      import("@/views/ProductInBill/Kf_ProductInBillList.vue"),
                    hidden: false,
                    name: "ProductInBillList",
                    path: "ProductInBillList",
                    path: "productInBillList",
                  },
                  {
                    meta: {
@@ -888,11 +1152,54 @@
                      noCache: false,
                      title: "生产入库单",
                    },
                    component: () => import("@/views/ProductInBill/Kf_ProductInBillEdit.vue"),
                    component: () =>
                      import("@/views/ProductInBill/Kf_ProductInBillEdit.vue"),
                    hidden: false,
                    name: "ProductInBillEdit",
                    path: "ProductInBillEdit",
                    path: "productInBillEdit",
                  },
                ],
              },
              {
                meta: {
                  icon: "build",
                  link: null,
                  noCache: false,
                  title: "生产汇报",
                },
                hidden: false,
                name: "ScICMOReportBill",
                path: "scICMOReportBill",
                redirect: "noRedirect",
                component: "Layout",
                children: [
                  {
                    meta: {
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "生产汇报列表",
                    },
                    component: () =>
                      import(
                        "@/views/ICMO/ScICMOReportBill/ScICMOReportBillList.vue"
                      ),
                    hidden: false,
                    name: "ScICMOReportBillList",
                    path: "scICMOReportBillList",
                  },
                  // {
                  //   meta: {
                  //     icon: "build",
                  //     link: null,
                  //     noCache: false,
                  //     title: "生产入库单",
                  //   },
                  //   component: () => import("@/views/ProductInBill/Kf_ProductInBillEdit.vue"),
                  //   hidden: false,
                  //   name: "ProductInBillEdit",
                  //   path: "ProductInBillEdit",
                  // },
                ],
              },
            ],
@@ -904,9 +1211,9 @@
              icon: "build",
              link: null,
              noCache: false,
              title: "器具管理",
              title: "容器管理",
            },
            hidden: false,
            hidden: HIsHide,
            name: "ScMould",
            path: "/scMould",
            redirect: "noRedirect",
@@ -929,7 +1236,7 @@
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "器具领用出库单维护",
                      title: "容器领用出库单维护",
                    },
                    component: () =>
                      import(
@@ -944,7 +1251,7 @@
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "器具领用出库单",
                      title: "容器领用出库单",
                    },
                    component: () =>
                      import(
@@ -959,7 +1266,7 @@
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "器具领用退库单维护",
                      title: "容器入库单维护",
                    },
                    component: () =>
                      import(
@@ -974,7 +1281,7 @@
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "器具领用退库单",
                      title: "容器入库单",
                    },
                    component: () =>
                      import(
@@ -989,7 +1296,7 @@
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "器具直接调拨单维护",
                      title: "容器直接调拨单维护",
                    },
                    component: () =>
                      import(
@@ -1004,7 +1311,7 @@
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "器具直接调拨单",
                      title: "容器直接调拨单",
                    },
                    component: () =>
                      import(
@@ -1013,12 +1320,13 @@
                    hidden: false,
                    name: "Sc_MouldProdMoveBillEdit",
                    path: "Sc_MouldProdMoveBillEdit",
                  },{
                  },
                  {
                    meta: {
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "器具入库申请单维护",
                      title: "容器入库申请单维护",
                    },
                    component: () =>
                      import(
@@ -1033,7 +1341,7 @@
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "器具入库申请单",
                      title: "容器入库申请单",
                    },
                    component: () =>
                      import(
@@ -1042,12 +1350,13 @@
                    hidden: false,
                    name: "Sc_MouldInRequestBillEdit",
                    path: "Sc_MouldInRequestBillEdit",
                  },{
                  },
                  {
                    meta: {
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "器具领用申请单维护",
                      title: "容器领用申请单维护",
                    },
                    component: () =>
                      import(
@@ -1062,7 +1371,7 @@
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "器具领用申请单",
                      title: "容器领用申请单",
                    },
                    component: () =>
                      import(
@@ -1071,12 +1380,13 @@
                    hidden: false,
                    name: "Sc_MouldOutRequestBillEdit",
                    path: "Sc_MouldOutRequestBillEdit",
                  },{
                  },
                  {
                    meta: {
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "器具调拨申请单维护",
                      title: "容器调拨申请单维护",
                    },
                    component: () =>
                      import(
@@ -1091,7 +1401,7 @@
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "器具调拨申请单",
                      title: "容器调拨申请单",
                    },
                    component: () =>
                      import(
@@ -1121,7 +1431,7 @@
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "器具主档",
                      title: "容器主档",
                    },
                    component: () =>
                      import("@/views/scMould/basicModeling/Gy_MouldFile.vue"),
@@ -1134,7 +1444,7 @@
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "器具主档维护",
                      title: "容器主档维护",
                    },
                    component: () =>
                      import(
@@ -1172,7 +1482,7 @@
              noCache: false,
              title: "系统管理",
            },
            hidden: false,
            hidden: HIsHide,
            name: "System",
            path: "/system",
            redirect: "noRedirect",
@@ -1210,7 +1520,8 @@
                      noCache: false,
                      title: "角色列表",
                    },
                    component: () =>import("@/views/system/user/Xt_UserGroupList.vue"),
                    component: () =>
                      import("@/views/system/user/Xt_UserGroupList.vue"),
                    hidden: false,
                    name: "Xt_UserGroupList",
                    path: "Xt_UserGroupList",
@@ -1220,6 +1531,18 @@
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "驾驶员列表",
                    },
                    component: () => import("@/views/system/user/GyDriver.vue"),
                    hidden: false,
                    name: "gyDriver",
                    path: "GyDriver",
                  },
                  {
                    meta: {
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "权限查询",
                    },
                    component: () =>