wangyi
2026-04-02 74feb99b1b4e2eb3706bbb503d07fb087ca39d4a
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 = [
@@ -74,19 +83,36 @@
                    name: "WL_YayBill",
                    path: "WL_YayBill",
                  },
                  // {
                  //   meta: {
                  //     icon: "build",
                  //     link: null,
                  //     noCache: false,
                  //     title: "运单编辑",
                  //   },
                  //   component: () =>
                  //     import("@/views/logistics/transportGPS/Add_Edit_WL_YayBill.vue"),
                  //   hidden: false,
                  //   name: "Add_Edit_WL_YayBill",
                  //   path: "Add_Edit_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",
                  },
                ],
              },
            ],
@@ -100,7 +126,7 @@
              noCache: false,
              title: "销售管理",
            },
            hidden: false,
            hidden: HIsHide,
            name: "Sell",
            path: "/sell",
            redirect: "noRedirect",
@@ -327,7 +353,7 @@
              noCache: false,
              title: "仓库管理",
            },
            hidden: false,
            hidden: HIsHide,
            name: "Warehouse",
            path: "/warehouse",
            redirect: "noRedirect",
@@ -457,6 +483,51 @@
                  icon: "build",
                  link: null,
                  noCache: false,
                  title: "报表统计",
                },
                hidden: false,
                name: "barCodeReport",
                path: "BarCodeReport",
                redirect: "noRedirect",
                component: "Layout",
                children: [
                   {
                    meta: {
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "条码出入库报表",
                    },
                    component: () =>
                      import(
                        "@/views/warehouse/BarCodeReport/Kf_BarCodeOutInReport.vue"
                      ),
                    hidden: false,
                    name: "Kf_BarCodeOutInReport",
                    path: "Kf_BarCodeOutInReport",
                  },
                   {
                    meta: {
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "条码库存报表",
                    },
                    component: () =>
                      import(
                        "@/views/warehouse/BarCodeReport/Kf_ICInventory_BarCode.vue"
                      ),
                    hidden: false,
                    name: "Kf_ICInventory_BarCode",
                    path: "Kf_ICInventory_BarCode",
                  },
                ],
              },
              {
                meta: {
                  icon: "build",
                  link: null,
                  noCache: false,
                  title: "条码主档",
                },
                hidden: false,
@@ -535,7 +606,7 @@
                  noCache: false,
                  title: "生产资料",
                },
                hidden: false,
                hidden: HIsHide,
                name: "Production",
                path: "production",
                redirect: "noRedirect",
@@ -563,7 +634,7 @@
                  noCache: false,
                  title: "物流基础资料",
                },
                hidden: false,
                hidden: HIsHide,
                name: "Transport",
                path: "transport",
                redirect: "noRedirect",
@@ -608,7 +679,7 @@
                    },
                    component: () =>
                      import("@/views/basic/gyWarehouse/gyWarehouse.vue"),
                    hidden: false,
                    hidden: HIsHide,
                    name: "GyWarehouse",
                    path: "gyWarehouse",
                  },
@@ -621,7 +692,7 @@
                    },
                    component: () =>
                      import("@/views/basic/gyStockPlace/gyStockPlace.vue"),
                    hidden: false,
                    hidden: HIsHide,
                    name: "GyStockPlace",
                    path: "gyStockPlace",
                  },
@@ -634,7 +705,7 @@
                    },
                    component: () =>
                      import("@/views/basic/gyCartypelist/gyCartypelist.vue"),
                    hidden: false,
                    hidden: HIsHide,
                    name: "GyCartypelist",
                    path: "gyCartypelist",
                  },
@@ -647,7 +718,7 @@
                    },
                    component: () =>
                      import("@/views/basic/gyItemMoney/gyItemMoney.vue"),
                    hidden: false,
                    hidden: HIsHide,
                    name: "GyItemMoney",
                    path: "gyItemMoney",
                  },
@@ -669,11 +740,23 @@
                      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: () =>
                      import("@/views/basic/gyEmployee/gyEmployee.vue"),
                    hidden: false,
                    hidden: HIsHide,
                    name: "GyEmployee",
                    path: "gyEmployee",
                  },
@@ -686,7 +769,7 @@
                    },
                    component: () =>
                      import("@/views/basic/gy/gyDepartment.vue"),
                    hidden: false,
                    hidden: HIsHide,
                    name: "GyDepartment",
                    path: "gyDepartment",
                  },
@@ -699,24 +782,22 @@
                    },
                    component: () =>
                      import("@/views/basic/gyCurrency/gyCurrency.vue"),
                    hidden: false,
                    hidden: HIsHide,
                    name: "GyCurrency",
                    path: "gyCurrency",
                  },
                  {
                    meta: {
                      icon: "build",
                      link: null,
                      noCache: false,
                      noCache: HIsHide,
                      title: "计量单位列表",
                    },
                    component: () => import("@/views/basic/gyUnit/gyUnit.vue"),
                    hidden: false,
                    hidden: HIsHide,
                    name: "GyUnit",
                    path: "gyUnit",
                  },
                  {
                    meta: {
                      icon: "build",
@@ -725,7 +806,7 @@
                      title: "供应商列表",
                    },
                    component: () => import("@/views/basic/gy/gySupplier.vue"),
                    hidden: false,
                    hidden: HIsHide,
                    name: "GySupplier",
                    path: "gySupplier",
                  },
@@ -738,7 +819,7 @@
                    },
                    component: () =>
                      import("@/views/gyMaterial/GyMaterial.vue"),
                    hidden: false,
                    hidden: HIsHide,
                    name: "GyMaterial",
                    path: "GyMaterial",
                  },
@@ -750,7 +831,7 @@
                      title: "客户列表",
                    },
                    component: () => import("@/views/GyCustomer/index.vue"),
                    hidden: false,
                    hidden: HIsHide,
                    name: "GyCustomer",
                    path: "GyCustomer",
                  },
@@ -763,7 +844,7 @@
                    },
                    component: () =>
                      import("@/views/basic/gyProperty/gyPropertyList.vue"),
                    hidden: false,
                    hidden: HIsHide,
                    name: "GyProperty",
                    path: "gyProperty",
                  },
@@ -780,7 +861,7 @@
              noCache: false,
              title: "采购管理",
            },
            hidden: false,
            hidden: HIsHide,
            name: "Purchase",
            path: "/purchase",
            redirect: "noRedirect",
@@ -1051,7 +1132,7 @@
              noCache: false,
              title: "生产管理",
            },
            hidden: false,
            hidden: HIsHide,
            name: "ICMO",
            path: "/icmo",
            redirect: "noRedirect",
@@ -1189,7 +1270,7 @@
              noCache: false,
              title: "容器管理",
            },
            hidden: false,
            hidden: HIsHide,
            name: "ScMould",
            path: "/scMould",
            redirect: "noRedirect",
@@ -1458,7 +1539,7 @@
              noCache: false,
              title: "系统管理",
            },
            hidden: false,
            hidden: HIsHide,
            name: "System",
            path: "/system",
            redirect: "noRedirect",