Browse Source

fix: [试验管理] [表单管理] 根据选择的学科显示列表

master
memorylkf 1 week ago
parent
commit
892eeae1fd
5 changed files with 62 additions and 12 deletions
  1. +10
    -2
      src/views/business/study/comp/suject.vue
  2. +24
    -4
      src/views/business/study/comp/tbbd.vue
  3. +2
    -1
      src/views/business/study/comp/tbbdList.vue
  4. +24
    -4
      src/views/business/study/comp/ytbd.vue
  5. +2
    -1
      src/views/business/study/comp/ytbdList.vue

+ 10
- 2
src/views/business/study/comp/suject.vue View File

@ -14,7 +14,7 @@
</div>
</div>
<div class="subject-content">
<div class="subject-item" v-for="(item,index) in subjectList" :key="index">
<div class="subject-item" :class="selectedSubjectId===item.id?'active':''" v-for="(item,index) in subjectList" :key="index" @click="changeSelectedSubject(item)">
<div class="subject-item-name">{{item.deptName}}({{item.leaderName}})</div>
<div class="subject-item-add">
<el-button type="primary" plain @click="yq(item)">{{$t('page.business.study.studyEnter.yq')}}</el-button>
@ -90,6 +90,7 @@ export default {
data() {
return {
subjectList:[],
selectedSubjectId:'',
infoDialog:{
title:this.$t('page.business.study.studyEnter.xzxk'),
visible:false,
@ -110,8 +111,14 @@ export default {
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)
})
},
changeSelectedSubject(item){
this.selectedSubjectId = item.id
this.$emit('change',this.selectedSubjectId)
},
editSubject(){
this.infoDialog.list = []
this.infoDialog.loading = true
@ -257,7 +264,8 @@ export default {
justify-content: space-between;
background: #f9fafc;
border-radius: 5px;
&:hover{
cursor: pointer;
&.active{
border: 1px solid #47a1ff;
}
.subject-item-name{

+ 24
- 4
src/views/business/study/comp/tbbd.vue View File

@ -1,10 +1,10 @@
<template>
<div class="study-tbbd">
<div class="tbbd-left" v-show="!showDetail">
<sbject :study="study" />
<sbject :study="study" @change="changeSubject" />
</div>
<div class="tbbd-right" >
<tbbdList :study="study" @showDetail="showDetailCallback"/>
<div class="tbbd-right" v-if="studyInfo.studySubjectId!=''">
<tbbdList :study="studyInfo" @showDetail="showDetailCallback"/>
</div>
</div>
</template>
@ -22,16 +22,36 @@ export default {
}
}
},
watch:{
study: {
immediate: true,
handler(v) {
this.studyInfo = {
studyId:v.id,
studyLeader:v.leader,
studySubjectId:''
}
}
},
},
components: {sbject,tbbdList},
computed: {},
filters: {},
data() {
return {
showDetail:false
showDetail:false,
studyInfo:{
studyId:this.study.id,
studyLeader:this.study.leader,
studySubjectId:''
}
}
},
created() {},
methods: {
changeSubject(val){
this.studyInfo.studySubjectId = val
},
showDetailCallback(val){
this.showDetail=val
this.$emit('showDetail',val)

+ 2
- 1
src/views/business/study/comp/tbbdList.vue View File

@ -129,7 +129,8 @@ export default {
watch: {
study: {
handler(newVal) {
this.searchForm.studyId = newVal.id
this.searchForm.studyId = newVal.studyId
this.searchForm.studySubjectId = newVal.studySubjectId
this.leader = newVal.leader
this.search()
},

+ 24
- 4
src/views/business/study/comp/ytbd.vue View File

@ -1,10 +1,10 @@
<template>
<div class="study-ytbd">
<div class="ytbd-left" v-show="!showDetail">
<sbject :study="study" />
<sbject :study="study" @change="changeSubject" />
</div>
<div class="ytbd-right" >
<ytbdList :study="study" @showDetail="showDetailCallback"/>
<div class="ytbd-right" v-if="studyInfo.studySubjectId!=''">
<ytbdList :study="studyInfo" @showDetail="showDetailCallback"/>
</div>
</div>
</template>
@ -22,16 +22,36 @@ export default {
}
}
},
watch:{
study: {
immediate: true,
handler(v) {
this.studyInfo = {
studyId:v.id,
studyLeader:v.leader,
studySubjectId:''
}
}
},
},
components: {sbject,ytbdList},
computed: {},
filters: {},
data() {
return {
showDetail:false
showDetail:false,
studyInfo:{
studyId:this.study.id,
studyLeader:this.study.leader,
studySubjectId:''
}
}
},
created() {},
methods: {
changeSubject(val){
this.studyInfo.studySubjectId = val
},
showDetailCallback(val){
this.showDetail=val
this.$emit('showDetail',val)

+ 2
- 1
src/views/business/study/comp/ytbdList.vue View File

@ -128,7 +128,8 @@ export default {
watch: {
study: {
handler(newVal) {
this.searchForm.studyId = newVal.id
this.searchForm.studyId = newVal.studyId
this.searchForm.studySubjectId = newVal.studySubjectId
this.leader = newVal.leader
this.search()
},

Loading…
Cancel
Save