gaoluyang
2026-04-28 2082dea4977d47618c8d7ad4dd9bb847f5cf1b17
src/pages/works.vue
@@ -271,16 +271,13 @@
<script setup>
  import { ref, onMounted, nextTick, reactive, computed } from "vue";
  import { onShow } from "@dcloudio/uni-app";
  import { userLoginFacotryList } from "@/api/login";
  import { getProductWorkOrderById } from "@/api/productionManagement/productionReporting";
  import { createVersionUpgradeChecker } from "@/utils/versionUpgrade";
  import DownloadProgressMask from "@/components/DownloadProgressMask.vue";
  import modal from "@/plugins/modal";
  import useUserStore from "@/store/modules/user";
  const userStore = useUserStore();
  const { triggerVersionCheck } = createVersionUpgradeChecker({ logPrefix: "[version-works]" });
  const show = ref(false);
  const factoryList = ref([]);
  const factoryListTem = ref([]);
@@ -337,6 +334,10 @@
      icon: "/static/images/icon/caigouguanli.svg",
      label: "采购退货",
    },
    {
      icon: "/static/images/icon/gongyingshangdangan.svg",
      label: "供应商档案",
    },
  ]);
  // 财务管理功能数据
@@ -391,9 +392,13 @@
  const archiveManagementItems = reactive([
    {
      icon: "/static/images/icon/gongyingshangdangan.svg",
      label: "供应商档案",
      label: "借阅登记",
    },
  ]);
    {
      icon: "/static/images/icon/hetongguanli.svg",
      label: "归还登记",
    }
  ])
  // 售后服务功能数据
  const afterSalesServiceItems = reactive([
@@ -923,6 +928,16 @@
          url: "/pages/customerService/afterSalesHandling/index",
        });
        break;
      case "借阅登记":
        uni.navigateTo({
          url: "/pages/fileManagement/borrow/index",
        });
        break;
      case "归还登记":
        uni.navigateTo({
          url: "/pages/fileManagement/return/index",
        });
        break;
      default:
        uni.showToast({
          title: `点击了${item.label}`,
@@ -1111,7 +1126,7 @@
    // 定义菜单配置映射
    const menuMapping = {
      collaboration: { target: collaborationItems, specialMapping: { "规章制度": "规章制度管理" } },
      archiveManagement: { target: archiveManagementItems, specialMapping: { "供应商档案": "供应商管理" } },
      purchase: { specialMapping: { "供应商档案": "供应商管理" } },
    };
    console.log(allowedMenuTitles)
    // 通用过滤函数
@@ -1128,9 +1143,8 @@
    // 过滤各个模块
    filterArray(marketingItems);
    filterArray(purchaseItems);
    filterArray(purchaseItems, menuMapping.purchase.specialMapping);
    filterArray(financeManagementItems);
    filterArray(archiveManagementItems, menuMapping.archiveManagement.specialMapping);
    filterArray(collaborationItems, menuMapping.collaboration.specialMapping);
    filterArray(safetyItems);
    filterArray(humanResourcesItems);
@@ -1138,13 +1152,13 @@
    filterArray(qualityItems);
    filterArray(productionItems);
    filterArray(equipmentItems);
    filterArray(archiveManagementItems);
  };
  // 检查模块是否有菜单项需要显示
  const hasMarketingItems = computed(() => marketingItems.length > 0);
  const hasPurchaseItems = computed(() => purchaseItems.length > 0);
  const hasFinanceManagementItems = computed(() => financeManagementItems.length > 0);
  const hasArchiveManagementItems = computed(() => archiveManagementItems.length > 0);
  const hasAfterSalesServiceItems = computed(() => afterSalesServiceItems.length > 0);
  const hasCollaborationItems = computed(() => collaborationItems.length > 0);
  const hasSafetyItems = computed(() => safetyItems.length > 0);
@@ -1153,9 +1167,9 @@
  const hasWarehouseLogisticsItems = computed(() => warehouseLogisticsItems.length > 0);
  const hasProductionItems = computed(() => productionItems.length > 0);
  const hasEquipmentItems = computed(() => equipmentItems.length > 0);
  const hasArchiveManagementItems = computed(() => archiveManagementItems.length > 0);
  onMounted(() => {
    triggerVersionCheck("onMounted");
    // 每次进入首页都强制刷新用户信息和路由权限,不做本地缓存判断
    userStore.getInfo().then(() => {
      userStore
@@ -1170,10 +1184,6 @@
    getUserLoginFacotryList();
    // 启动通知状态定时器
    startStatusTimer();
  });
  onShow(() => {
    triggerVersionCheck("onShow");
  });
</script>