gaoluyang
2026-04-28 2082dea4977d47618c8d7ad4dd9bb847f5cf1b17
src/pages/works.vue
@@ -264,6 +264,8 @@
        </up-grid>
      </view>
    </view>
    <DownloadProgressMask />
  </view>
</template>
@@ -271,6 +273,7 @@
  import { ref, onMounted, nextTick, reactive, computed } from "vue";
  import { userLoginFacotryList } from "@/api/login";
  import { getProductWorkOrderById } from "@/api/productionManagement/productionReporting";
  import DownloadProgressMask from "@/components/DownloadProgressMask.vue";
  import modal from "@/plugins/modal";
  import useUserStore from "@/store/modules/user";
@@ -331,6 +334,10 @@
      icon: "/static/images/icon/caigouguanli.svg",
      label: "采购退货",
    },
    {
      icon: "/static/images/icon/gongyingshangdangan.svg",
      label: "供应商档案",
    },
  ]);
  // 财务管理功能数据
@@ -385,9 +392,13 @@
  const archiveManagementItems = reactive([
    {
      icon: "/static/images/icon/gongyingshangdangan.svg",
      label: "供应商档案",
      label: "借阅登记",
    },
  ]);
    {
      icon: "/static/images/icon/hetongguanli.svg",
      label: "归还登记",
    }
  ])
  // 售后服务功能数据
  const afterSalesServiceItems = reactive([
@@ -917,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}`,
@@ -1105,7 +1126,7 @@
    // 定义菜单配置映射
    const menuMapping = {
      collaboration: { target: collaborationItems, specialMapping: { "规章制度": "规章制度管理" } },
      archiveManagement: { target: archiveManagementItems, specialMapping: { "供应商档案": "供应商管理" } },
      purchase: { specialMapping: { "供应商档案": "供应商管理" } },
    };
    console.log(allowedMenuTitles)
    // 通用过滤函数
@@ -1122,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);
@@ -1132,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);
@@ -1147,6 +1167,7 @@
  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(() => {
    // 每次进入首页都强制刷新用户信息和路由权限,不做本地缓存判断