| | |
| | | </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/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", |
| | | }, |
| | | ]); |
| | | |
| | |
| | | break; |
| | | case "入库管理": |
| | | uni.navigateTo({ |
| | | url: "/pages/inventoryManagement/receiptManagement/index", |
| | | url: |
| | | item.module === "material" |
| | | ? "/pages/consumablesLogistics/receiptManagement/index" |
| | | : "/pages/inventoryManagement/receiptManagement/index", |
| | | }); |
| | | break; |
| | | case "出库台账": |
| | | uni.navigateTo({ |
| | | url: "/pages/inventoryManagement/dispatchLog/index", |
| | | url: |
| | | item.module === "material" |
| | | ? "/pages/consumablesLogistics/dispatchLog/index" |
| | | : "/pages/inventoryManagement/dispatchLog/index", |
| | | }); |
| | | break; |
| | | case "库存管理": |
| | | uni.navigateTo({ |
| | | url: "/pages/inventoryManagement/stockManagement/index", |
| | | url: |
| | | item.module === "material" |
| | | ? "/pages/consumablesLogistics/stockManagement/index" |
| | | : "/pages/inventoryManagement/stockManagement/index", |
| | | }); |
| | | break; |
| | | case "库存报表": |
| | | uni.navigateTo({ |
| | | url: "/pages/inventoryManagement/stockReport/index", |
| | | url: |
| | | item.module === "material" |
| | | ? "/pages/consumablesLogistics/stockReport/index" |
| | | : "/pages/inventoryManagement/stockReport/index", |
| | | }); |
| | | break; |
| | | default: |
| | |
| | | |
| | | // 过滤仓储物流菜单 |
| | | const originalWarehouseLogistics = [ |
| | | { 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: "库存报表" }, |
| | | { |
| | | 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.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 hasWarehouseLogisticsItems = computed( |
| | | () => warehouseLogisticsItems.length > 0 |
| | | ); |
| | | const hasMaterialItems = computed(() => materialItems.length > 0); |
| | | |
| | | onMounted(() => { |
| | | // 每次进入首页都强制刷新用户信息和路由权限,不做本地缓存判断 |