|
|
|
@ -131,26 +131,29 @@ export default { |
|
|
|
getList(){ |
|
|
|
if(this.study.id){ |
|
|
|
this.selectedSubjectId = '' |
|
|
|
let selectedDeptId = '' |
|
|
|
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 |
|
|
|
selectedDeptId = item.deptId |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
if(this.selectedSubjectId === ''){ |
|
|
|
this.selectedSubjectId = this.subjectList.length>0?this.subjectList[0].id:'' |
|
|
|
selectedDeptId = this.subjectList.length>0?this.subjectList[0].deptId:'' |
|
|
|
} |
|
|
|
|
|
|
|
this.$emit('change',this.selectedSubjectId) |
|
|
|
this.$emit('change',this.selectedSubjectId,selectedDeptId) |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
changeSelectedSubject(item){ |
|
|
|
this.selectedSubjectId = item.id |
|
|
|
this.$emit('change',this.selectedSubjectId) |
|
|
|
this.$emit('change',this.selectedSubjectId,item.deptId) |
|
|
|
}, |
|
|
|
editSubject(){ |
|
|
|
this.infoDialog.list = [] |
|
|
|
|