feat(quality): 新增质量管理模块页面和首页入口
- 在 pages.json 中注册原材料检验、过程检验、出厂检验等13个质量管理相关页面
- 在首页添加质量管理模块入口,支持权限过滤显示
- 实现质量管理各菜单项的点击导航功能
| | |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/qualityManagement/materialInspection/index", |
| | | "style": { |
| | | "navigationBarTitleText": "原材料检验", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/qualityManagement/materialInspection/add", |
| | | "style": { |
| | | "navigationBarTitleText": "原材料检验添加", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/qualityManagement/materialInspection/detail", |
| | | "style": { |
| | | "navigationBarTitleText": "原材料检验详情", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/qualityManagement/materialInspection/fileList", |
| | | "style": { |
| | | "navigationBarTitleText": "原材料检验附件", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/qualityManagement/processInspection/index", |
| | | "style": { |
| | | "navigationBarTitleText": "过程检验", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/qualityManagement/processInspection/add", |
| | | "style": { |
| | | "navigationBarTitleText": "过程检验添加", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/qualityManagement/processInspection/detail", |
| | | "style": { |
| | | "navigationBarTitleText": "过程检验详情", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/qualityManagement/processInspection/fileList", |
| | | "style": { |
| | | "navigationBarTitleText": "过程检验附件", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/qualityManagement/finalInspection/index", |
| | | "style": { |
| | | "navigationBarTitleText": "出厂检验", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/qualityManagement/finalInspection/add", |
| | | "style": { |
| | | "navigationBarTitleText": "出厂检验添加", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/qualityManagement/finalInspection/detail", |
| | | "style": { |
| | | "navigationBarTitleText": "出厂检验详情", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/qualityManagement/finalInspection/fileList", |
| | | "style": { |
| | | "navigationBarTitleText": "出厂检验附件", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/qualityManagement/InspectItem/index", |
| | | "style": { |
| | | "navigationBarTitleText": "检测项维护", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/qualityManagement/metricBinding/index", |
| | | "style": { |
| | | "navigationBarTitleText": "指标绑定", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/qualityManagement/metricBinding/detail", |
| | | "style": { |
| | | "navigationBarTitleText": "绑定关系", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/qualityManagement/metricMaintenance/index", |
| | | "style": { |
| | | "navigationBarTitleText": "指标维护", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/qualityManagement/metricMaintenance/detail", |
| | | "style": { |
| | | "navigationBarTitleText": "标准参数", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/qualityManagement/nearExpiryReturn/index", |
| | | "style": { |
| | | "navigationBarTitleText": "近效期退货", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/qualityManagement/nonconformingManagement/index", |
| | | "style": { |
| | | "navigationBarTitleText": "不合格品管理", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/qualityManagement/rawMaterial/index", |
| | | "style": { |
| | | "navigationBarTitleText": "原材料", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/qualityManagement/visualization/qualityDashboard", |
| | | "style": { |
| | | "navigationBarTitleText": "质量看板", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/humanResources/attendance/checkin", |
| | | "style": { |
| | | "navigationBarTitleText": "打卡签到", |
| | |
| | | </up-grid> |
| | | </view> |
| | | </view> |
| | | <!-- 质量管理模块 --> |
| | | <view class="common-module collaboration-module" |
| | | v-if="hasQualityItems"> |
| | | <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 qualityItems" |
| | | :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/guzhangfenxi@2x.png", |
| | | // label: "安全培训考核", |
| | | // }, |
| | | ]); |
| | | |
| | | // 质量管理 |
| | | const qualityItems = 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: "出厂检验", |
| | | }, |
| | | ]); |
| | | // 协同办公功能数据 |
| | | const collaborationItems = reactive([ |
| | |
| | | : "/pages/inventoryManagement/stockReport/index", |
| | | }); |
| | | break; |
| | | case "原材料检验": |
| | | uni.navigateTo({ |
| | | url: "/pages/qualityManagement/materialInspection/index", |
| | | }); |
| | | break; |
| | | case "过程检验": |
| | | uni.navigateTo({ |
| | | url: "/pages/qualityManagement/processInspection/index", |
| | | }); |
| | | break; |
| | | case "出厂检验": |
| | | uni.navigateTo({ |
| | | url: "/pages/qualityManagement/finalInspection/index", |
| | | }); |
| | | break; |
| | | case "检测项维护": |
| | | uni.navigateTo({ |
| | | url: "/pages/qualityManagement/InspectItem/index", |
| | | }); |
| | | break; |
| | | case "指标维护": |
| | | uni.navigateTo({ |
| | | url: "/pages/qualityManagement/metricMaintenance/index", |
| | | }); |
| | | break; |
| | | case "指标绑定": |
| | | uni.navigateTo({ |
| | | url: "/pages/qualityManagement/metricBinding/index", |
| | | }); |
| | | break; |
| | | case "不合格品管理": |
| | | uni.navigateTo({ |
| | | url: "/pages/qualityManagement/nonconformingManagement/index", |
| | | }); |
| | | break; |
| | | case "原材料": |
| | | uni.navigateTo({ |
| | | url: "/pages/qualityManagement/rawMaterial/index", |
| | | }); |
| | | break; |
| | | case "近效期退货": |
| | | uni.navigateTo({ |
| | | url: "/pages/qualityManagement/nearExpiryReturn/index", |
| | | }); |
| | | break; |
| | | case "质量看板": |
| | | uni.navigateTo({ |
| | | url: "/pages/qualityManagement/visualization/qualityDashboard", |
| | | }); |
| | | break; |
| | | default: |
| | | uni.showToast({ |
| | | title: `点击了${item.label}`, |
| | |
| | | }); |
| | | purchaseItems.splice(0, purchaseItems.length, ...filteredPurchase); |
| | | |
| | | // 过滤质量管理菜单 |
| | | const originalQuality = [ |
| | | { 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: "指标维护" }, |
| | | { 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: "质量看板" }, |
| | | ]; |
| | | const hasAllowedTitleLike = label => { |
| | | if (allowedMenuTitles.has(label)) return true; |
| | | return Array.from(allowedMenuTitles).some( |
| | | title => |
| | | typeof title === "string" && |
| | | (title.includes(label) || label.includes(title)) |
| | | ); |
| | | }; |
| | | const filteredQuality = originalQuality.filter(item => { |
| | | return hasAllowedTitleLike(item.label); |
| | | }); |
| | | const hasQualityModulePermission = Array.from(allowedMenuTitles).some( |
| | | title => |
| | | typeof title === "string" && |
| | | (title.includes("质量") || title.includes("检验")) |
| | | ); |
| | | const finalQualityItems = filteredQuality.length |
| | | ? filteredQuality |
| | | : hasQualityModulePermission |
| | | ? originalQuality |
| | | : []; |
| | | qualityItems.splice(0, qualityItems.length, ...finalQualityItems); |
| | | |
| | | // 过滤安全生产菜单 |
| | | const originalSafety = [ |
| | | { icon: "/static/images/icon/caigoutaizhang@2x.png", label: "规程与资质" }, |
| | |
| | | const hasPurchaseItems = computed(() => purchaseItems.length > 0); |
| | | const hasCollaborationItems = computed(() => collaborationItems.length > 0); |
| | | const hasSafetyItems = computed(() => safetyItems.length > 0); |
| | | const hasQualityItems = computed(() => qualityItems.length > 0); |
| | | const hasHumanResourcesItems = computed(() => humanResourcesItems.length > 0); |
| | | const hasProductionItems = computed(() => productionItems.length > 0); |
| | | const hasEquipmentItems = computed(() => equipmentItems.length > 0); |