diff --git a/src/components/project/AddApprover.vue b/src/components/project/AddApprover.vue index 6eeac476..dfeb493c 100644 --- a/src/components/project/AddApprover.vue +++ b/src/components/project/AddApprover.vue @@ -264,6 +264,13 @@ const deleteDepSelect = () => { //确定添加授权 const submitAuth = () => { + teaunm.value.map(item=>{ + props.arrayList.map(i=>{ + if(item.id === i.userId){ + item.affiliationUserId = i.affiliationUserId + } + }) + }) emit('update:arrayList',teaunm.value) emit('valueChange',teaunm.value,props.type) visiable.value = false; diff --git a/src/views/lecturer/Organization.vue b/src/views/lecturer/Organization.vue index bde3154a..20b7e222 100644 --- a/src/views/lecturer/Organization.vue +++ b/src/views/lecturer/Organization.vue @@ -217,14 +217,14 @@ - + @@ -344,7 +344,7 @@ export default{ leveTwoArray: [], leveThreeArray: [], code: null, - isContains: null, + isContains: '0', affiliationOrgList: [], }, }) @@ -632,10 +632,30 @@ const getTableDate = (obj) => { console.log(res,'resssss') state.editParams = false state.formParam = res.data.data - const actArray = res.data.data.affiliationUserList.filter(item=>item.type == 0) - const leveOneArray = res.data.data.affiliationUserList.filter(item=>item.type == 1) - const leveTwoArray = res.data.data.affiliationUserList.filter(item=>item.type == 2) - const leveThreeArray = res.data.data.affiliationUserList.filter(item=>item.type == 3) + const actArray = res.data.data.affiliationUserList.filter(item=>item.type == 0).reduce((accumulator, current) => { + if (!accumulator.some(item => item.userId === current.userId)) { + accumulator.push(current); + } + return accumulator; + }, []); + const leveOneArray = res.data.data.affiliationUserList.filter(item=>item.type == 1).reduce((accumulator, current) => { + if (!accumulator.some(item => item.userId === current.userId)) { + accumulator.push(current); + } + return accumulator; + }, []); + const leveTwoArray = res.data.data.affiliationUserList.filter(item=>item.type == 2).reduce((accumulator, current) => { + if (!accumulator.some(item => item.userId === current.userId)) { + accumulator.push(current); + } + return accumulator; + }, []); + const leveThreeArray = res.data.data.affiliationUserList.filter(item=>item.type == 3).reduce((accumulator, current) => { + if (!accumulator.some(item => item.userId === current.userId)) { + accumulator.push(current); + } + return accumulator; + }, []); state.formParam.actArray = actArray.map(item => { return { label: item.userName + item.userNo, @@ -682,6 +702,7 @@ const getTableDate = (obj) => { } }) }) + state.formParam.isContains = String(state.formParam.isContains) console.log(state.formParam.affiliationOrgList,'state.formParam.affiliationOrgList') state.teacherdialog = true; state.teacherdialogtitle = '编辑培训发生组织' @@ -710,7 +731,7 @@ const getTableDate = (obj) => { leveTwoArray: [], leveThreeArray: [], code: null, - isContains: null, + isContains: '0', affiliationOrgList: [], } }