| | |
| | | </up-grid> |
| | | </view> |
| | | </view> |
| | | <!-- 仓储物流模块 --> |
| | | <view class="common-module warehouse-logistics-module" |
| | | v-if="hasWarehouseLogisticsItems"> |
| | | <view class="module-header"> |
| | | <view class="module-title-container"> |
| | | <text class="module-title">仓储物流</text> |
| | | </view> |
| | | </view> |
| | | <view class="module-content"> |
| | | <up-grid :border="false" |
| | | col="4"> |
| | | <up-grid-item v-for="(item, index) in warehouseLogisticsItems" |
| | | :key="index" |
| | | @click="handleCommonItemClick(item)"> |
| | | <view class="icon-container" |
| | | :style="{ background: item.bgColor }"> |
| | | <up-icon :name="item.icon" |
| | | :size="58" |
| | | color="#ffffff"></up-icon> |
| | | </view> |
| | | <text class="item-label">{{item.label}}</text> |
| | | </up-grid-item> |
| | | </up-grid> |
| | | </view> |
| | | </view> |
| | | <!-- 耗材物料模块 --> |
| | | <view class="common-module material-module" |
| | | v-if="hasMaterialItems"> |
| | | <view class="module-header"> |
| | | <view class="module-title-container"> |
| | | <text class="module-title">耗材物料</text> |
| | | </view> |
| | | </view> |
| | | <view class="module-content"> |
| | | <up-grid :border="false" |
| | | col="4"> |
| | | <up-grid-item v-for="(item, index) in materialItems" |
| | | :key="index" |
| | | @click="handleCommonItemClick(item)"> |
| | | <view class="icon-container" |
| | | :style="{ background: item.bgColor }"> |
| | | <up-icon :name="item.icon" |
| | | :size="58" |
| | | color="#ffffff"></up-icon> |
| | | </view> |
| | | <text class="item-label">{{item.label}}</text> |
| | | </up-grid-item> |
| | | </up-grid> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | }, |
| | | { |
| | | icon: "/static/images/icon/xunjianshangchuan@2x.png", |
| | | label: "巡检管理", |
| | | label: "巡检任务", |
| | | }, |
| | | { |
| | | icon: "/static/images/icon/xunjianshangchuan@2x.png", |
| | | label: "巡检任务管理", |
| | | } |
| | | label: "巡检管理", |
| | | }, |
| | | ]); |
| | | |
| | | // 仓储物流功能数据 |
| | | const warehouseLogisticsItems = reactive([ |
| | | { |
| | | icon: "/static/images/icon/caigoutaizhang@2x.png", |
| | | label: "入库管理", |
| | | }, |
| | | { |
| | | icon: "/static/images/icon/caigoutaizhang@2x.png", |
| | | label: "出库台账", |
| | | }, |
| | | { |
| | | icon: "/static/images/icon/caigoutaizhang@2x.png", |
| | | label: "库存管理", |
| | | }, |
| | | { |
| | | icon: "/static/images/icon/caigoutaizhang@2x.png", |
| | | label: "库存报表", |
| | | }, |
| | | ]); |
| | | // 耗材物料功能数据 |
| | | const materialItems = reactive([ |
| | | { |
| | | icon: "/static/images/icon/caigoutaizhang@2x.png", |
| | | label: "入库管理", |
| | | module: "material", |
| | | }, |
| | | { |
| | | icon: "/static/images/icon/caigoutaizhang@2x.png", |
| | | label: "出库台账", |
| | | module: "material", |
| | | }, |
| | | { |
| | | icon: "/static/images/icon/caigoutaizhang@2x.png", |
| | | label: "库存管理", |
| | | module: "material", |
| | | }, |
| | | { |
| | | icon: "/static/images/icon/caigoutaizhang@2x.png", |
| | | label: "库存报表", |
| | | module: "material", |
| | | }, |
| | | ]); |
| | | |
| | | // 处理常用功能点击 |
| | |
| | | url: "/pages/equipmentManagement/repair/index", |
| | | }); |
| | | break; |
| | | case "设备保养任务": |
| | | uni.navigateTo({ |
| | | url: "/pages/equipmentManagement/upkeepTask/index", |
| | | }); |
| | | break; |
| | | case "设备保养": |
| | | uni.navigateTo({ |
| | | url: "/pages/equipmentManagement/upkeep/index", |
| | |
| | | url: "/pages/inspectionUpload/index", |
| | | }); |
| | | break; |
| | | case "巡检任务管理": |
| | | case "巡检任务": |
| | | uni.navigateTo({ |
| | | url: "/pages/inspectionManagement/index", |
| | | }); |
| | |
| | | case "合同管理": |
| | | uni.navigateTo({ |
| | | url: "/pages/humanResources/contractManagement/index", |
| | | }); |
| | | break; |
| | | case "入库管理": |
| | | uni.navigateTo({ |
| | | url: |
| | | item.module === "material" |
| | | ? "/pages/consumablesLogistics/receiptManagement/index" |
| | | : "/pages/inventoryManagement/receiptManagement/index", |
| | | }); |
| | | break; |
| | | case "出库台账": |
| | | uni.navigateTo({ |
| | | url: |
| | | item.module === "material" |
| | | ? "/pages/consumablesLogistics/dispatchLog/index" |
| | | : "/pages/inventoryManagement/dispatchLog/index", |
| | | }); |
| | | break; |
| | | case "库存管理": |
| | | uni.navigateTo({ |
| | | url: |
| | | item.module === "material" |
| | | ? "/pages/consumablesLogistics/stockManagement/index" |
| | | : "/pages/inventoryManagement/stockManagement/index", |
| | | }); |
| | | break; |
| | | case "库存报表": |
| | | uni.navigateTo({ |
| | | url: |
| | | item.module === "material" |
| | | ? "/pages/consumablesLogistics/stockReport/index" |
| | | : "/pages/inventoryManagement/stockReport/index", |
| | | }); |
| | | break; |
| | | default: |
| | |
| | | const originalEquipment = [ |
| | | { icon: "/static/images/icon/shbeibaoxiu@2x.png", label: "运行管理" }, |
| | | { icon: "/static/images/icon/shbeibaoxiu@2x.png", label: "设备报修" }, |
| | | { icon: "/static/images/icon/shbeibaoyang@2x.png", label: "设备保养任务" }, |
| | | { icon: "/static/images/icon/shbeibaoyang@2x.png", label: "设备保养" }, |
| | | { icon: "/static/images/icon/xunjianshangchuan@2x.png", label: "巡检任务" }, |
| | | { icon: "/static/images/icon/xunjianshangchuan@2x.png", label: "巡检管理" }, |
| | | { icon: "/static/images/icon/xunjianshangchuan@2x.png", label: "巡检任务管理" }, |
| | | ]; |
| | | const filteredEquipment = originalEquipment.filter(item => { |
| | | return allowedMenuTitles.has(item.label); |
| | | }); |
| | | if (filteredEquipment.some(i => i.label === "设备保养")) { |
| | | const upkeepTask = originalEquipment.find(i => i.label === "设备保养任务"); |
| | | if (upkeepTask && !filteredEquipment.some(i => i.label === "设备保养任务")) { |
| | | const upkeepIndex = filteredEquipment.findIndex(i => i.label === "设备保养"); |
| | | filteredEquipment.splice(upkeepIndex, 0, upkeepTask); |
| | | } |
| | | } |
| | | if (filteredEquipment.some(i => i.label === "巡检管理")) { |
| | | const task = originalEquipment.find(i => i.label === "巡检任务管理"); |
| | | if (task && !filteredEquipment.some(i => i.label === "巡检任务管理")) { |
| | | filteredEquipment.push(task); |
| | | const task = originalEquipment.find(i => i.label === "巡检任务"); |
| | | if (task && !filteredEquipment.some(i => i.label === "巡检任务")) { |
| | | const manageIndex = filteredEquipment.findIndex(i => i.label === "巡检管理"); |
| | | filteredEquipment.splice(manageIndex, 0, task); |
| | | } |
| | | } |
| | | equipmentItems.splice(0, equipmentItems.length, ...filteredEquipment); |
| | | |
| | | // 过滤仓储物流菜单 |
| | | const originalWarehouseLogistics = [ |
| | | { |
| | | icon: "/static/images/icon/caigoutaizhang@2x.png", |
| | | label: "入库管理", |
| | | module: "warehouse", |
| | | }, |
| | | { |
| | | icon: "/static/images/icon/caigoutaizhang@2x.png", |
| | | label: "出库台账", |
| | | module: "warehouse", |
| | | }, |
| | | { |
| | | icon: "/static/images/icon/caigoutaizhang@2x.png", |
| | | label: "库存管理", |
| | | module: "warehouse", |
| | | }, |
| | | { |
| | | icon: "/static/images/icon/caigoutaizhang@2x.png", |
| | | label: "库存报表", |
| | | module: "warehouse", |
| | | }, |
| | | ]; |
| | | const filteredWarehouseLogistics = originalWarehouseLogistics.filter( |
| | | item => allowedMenuTitles.has(item.label) |
| | | ); |
| | | warehouseLogisticsItems.splice( |
| | | 0, |
| | | warehouseLogisticsItems.length, |
| | | ...filteredWarehouseLogistics |
| | | ); |
| | | |
| | | // 过滤耗材物料菜单 |
| | | const materialCandidates = label => { |
| | | const list = [label, `耗材${label}`]; |
| | | if (label.endsWith("管理")) { |
| | | list.push(`耗材${label.replace("管理", "")}`); |
| | | } |
| | | return list; |
| | | }; |
| | | const originalMaterial = [ |
| | | { icon: "/static/images/icon/caigoutaizhang@2x.png", label: "入库管理", module: "material" }, |
| | | { icon: "/static/images/icon/caigoutaizhang@2x.png", label: "出库台账", module: "material" }, |
| | | { icon: "/static/images/icon/caigoutaizhang@2x.png", label: "库存管理", module: "material" }, |
| | | { icon: "/static/images/icon/caigoutaizhang@2x.png", label: "库存报表", module: "material" }, |
| | | ]; |
| | | const filteredMaterial = originalMaterial.filter(item => { |
| | | return materialCandidates(item.label).some(t => allowedMenuTitles.has(t)); |
| | | }); |
| | | materialItems.splice(0, materialItems.length, ...filteredMaterial); |
| | | }; |
| | | |
| | | // 检查模块是否有菜单项需要显示 |
| | |
| | | const hasHumanResourcesItems = computed(() => humanResourcesItems.length > 0); |
| | | const hasProductionItems = computed(() => productionItems.length > 0); |
| | | const hasEquipmentItems = computed(() => equipmentItems.length > 0); |
| | | const hasWarehouseLogisticsItems = computed( |
| | | () => warehouseLogisticsItems.length > 0 |
| | | ); |
| | | const hasMaterialItems = computed(() => materialItems.length > 0); |
| | | |
| | | onMounted(() => { |
| | | // 每次进入首页都强制刷新用户信息和路由权限,不做本地缓存判断 |