|
|
@ -125,11 +125,24 @@ export default { |
|
|
checkPermi, |
|
|
checkPermi, |
|
|
checkRole, |
|
|
checkRole, |
|
|
getList(){ |
|
|
getList(){ |
|
|
studySubject_listByStudyId({studyId:this.study.id}).then(response => { |
|
|
|
|
|
this.subjectList = response.data; |
|
|
|
|
|
this.selectedSubjectId = this.subjectList.length>0?this.subjectList[0].id:'' |
|
|
|
|
|
this.$emit('change',this.selectedSubjectId) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
if(this.study.id){ |
|
|
|
|
|
this.selectedSubjectId = '' |
|
|
|
|
|
studySubject_listByStudyId({studyId:this.study.id}).then(response => { |
|
|
|
|
|
this.subjectList = response.data; |
|
|
|
|
|
for(let i=0;i<this.subjectList.length;i++){ |
|
|
|
|
|
let item = this.subjectList[i] |
|
|
|
|
|
if(item.leader==this.userId || (item.userIdList && item.userIdList.length>0 && item.userIdList.indexof(this.userId)>-1)){ |
|
|
|
|
|
this.selectedSubjectId = item.id |
|
|
|
|
|
break |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if(this.selectedSubjectId === ''){ |
|
|
|
|
|
this.selectedSubjectId = this.subjectList.length>0?this.subjectList[0].id:'' |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.$emit('change',this.selectedSubjectId) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
changeSelectedSubject(item){ |
|
|
changeSelectedSubject(item){ |
|
|
this.selectedSubjectId = item.id |
|
|
this.selectedSubjectId = item.id |
|
|
|