From 402b0cd01fb6a6fb3963839530d30ead78a8ce51 Mon Sep 17 00:00:00 2001 From: "han\\hanst" Date: Thu, 27 Aug 2026 15:34:21 +0800 Subject: [PATCH] =?UTF-8?q?pjmList=E5=BA=94=E8=AF=A5=E4=BB=8Eaccess=5Frole?= =?UTF-8?q?=E8=A1=A8=E5=8F=96role=5Fno=E6=98=AFR002=E7=9A=84=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/eam/eamProjectInfoForUploads.vue | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src/views/modules/eam/eamProjectInfoForUploads.vue b/src/views/modules/eam/eamProjectInfoForUploads.vue index 945a883..915a98c 100644 --- a/src/views/modules/eam/eamProjectInfoForUploads.vue +++ b/src/views/modules/eam/eamProjectInfoForUploads.vue @@ -1887,6 +1887,22 @@ export default { list[i].projectLeader = this.resolveProjectLeaderByResponsibleDepartment(list[i]) } }, + buildPjmUserIdList (pjmUserList) { + if (!Array.isArray(pjmUserList) || pjmUserList.length === 0) { + return [] + } + // PjM 权限统一以后端 access_role(role_no='R002') 查询结果为准,避免从业务列表反推导致漏人。 + const pjmUserIdSet = new Set() + pjmUserList.forEach((item) => { + const userId = item && item.userId !== undefined && item.userId !== null + ? String(item.userId).trim() + : '' + if (userId !== '') { + pjmUserIdSet.add(userId) + } + }) + return Array.from(pjmUserIdSet) + }, // 获取用户的bu getSiteAndBuByUserName () { let tempData = { @@ -2088,14 +2104,8 @@ export default { requestPromise = searchAllProjectUploadsDocumentList(this.searchData).then(({data}) => { if (data.code === 0) { this.allDataList = data.list - let pjmList = [] - // 遍历data.page.list - data.list.forEach((item) => { - if (!pjmList.includes(item.projectOwner.split('-')[0])) { - pjmList.push(item.projectOwner.split('-')[0]) - } - }) - if (pjmList.includes(this.$store.state.user.name) || this.$store.state.user.name === 'admin') { + const pjmUserIdList = this.buildPjmUserIdList(data.pjmUserList) + if (pjmUserIdList.includes(String(this.$store.state.user.id)) || this.$store.state.user.name === 'admin') { this.warnFlag = true this.dataList = data.page.list this.allPersonnelInfoList = data.list @@ -2296,14 +2306,8 @@ export default { requestPromise = queryAllProjectUploadsDocumentList(params).then(({data}) => { if (data.code === 0) { this.allDataList = data.list - let pjmList = [] - // 遍历data.page.list - data.list.forEach((item) => { - if (!pjmList.includes(item.projectOwner.split('-')[0])) { - pjmList.push(item.projectOwner.split('-')[0]) - } - }) - if (pjmList.includes(this.$store.state.user.name)){ + const pjmUserIdList = this.buildPjmUserIdList(data.pjmUserList) + if (pjmUserIdList.includes(String(this.$store.state.user.id))){ this.warnFlag = true this.dataList = data.page.list this.allPersonnelInfoList = data.list