From dead33a30f3023875220076eafb4e8151e818b82 Mon Sep 17 00:00:00 2001 From: pengm <674192343@qq.com> Date: Mon, 18 May 2026 15:43:51 +0800 Subject: [PATCH] 1.AJT-MES纸箱需要移除作业指导书 --- src/components/Common/CommonViewDragable/rglUtils.js | 2 +- src/mes/common/buttonComponent/index.js | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/components/Common/CommonViewDragable/rglUtils.js b/src/components/Common/CommonViewDragable/rglUtils.js index c369cc1..9124e53 100644 --- a/src/components/Common/CommonViewDragable/rglUtils.js +++ b/src/components/Common/CommonViewDragable/rglUtils.js @@ -12,7 +12,7 @@ export function getReactGridLayout(sParamType, selectedData = {}) { // 获取params数据 const recordDataAll = commonUtils.convertStrToObj( - sParams.replace(/[\n\r]/g, " "), + sParams?.replace(/[\n\r]/g, " "), [] ); const recordItem = diff --git a/src/mes/common/buttonComponent/index.js b/src/mes/common/buttonComponent/index.js index bfc6d8a..7596279 100644 --- a/src/mes/common/buttonComponent/index.js +++ b/src/mes/common/buttonComponent/index.js @@ -17,6 +17,19 @@ const ButtonComponent = props => { const { managementData, userinfo = {} } = app; const { iTeamType, sWorkshopId } = userinfo; + if(userinfo?.sBrandsId === '2222222222'){ + const scheduledTasks = managementData.find( + item => (item.sMenuName === "计划任务" || item.sMenuName?.trim() === "Scheduled Task") + ); + if (scheduledTasks && scheduledTasks.children) { + const iIndex = scheduledTasks?.children.findIndex( + child => (child.sMenuName === "工艺作业指导书" || child.sMenuName?.trim() === "Process Work Instructions") + ); + if (iIndex !== -1) { + scheduledTasks.children.splice(iIndex, 1); + } + } + } if ([3, 4, 5, 6].includes(iTeamType)) { const scheduledTasks = managementData.find( @@ -29,6 +42,15 @@ const ButtonComponent = props => { if (iIndex !== -1) { scheduledTasks.children.splice(iIndex, 1); } + console.log('aaa', props, userinfo?.sBrandsId); + if(userinfo?.sBrandsId === '2222222222'){ + const iIndex = scheduledTasks.children.findIndex( + child => (child.sMenuName === "工艺作业指导书" || child.sMenuName?.trim() === "Process Work Instructions") + ); + if (iIndex !== -1) { + scheduledTasks.children.splice(iIndex, 1); + } + } } const restArr = []; @@ -103,7 +125,7 @@ const ButtonComponent = props => { const [processReport, setProcessReport] = useState(false); const [dataList, setDataList] = useState([]); - + console.log('2managementData22', managementData); useEffect( () => { if (managementData.length) { -- libgit2 0.22.2