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