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

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

@ -1,10 +1,10 @@
<template> <template>
<div class="study-tbbd"> <div class="study-tbbd">
<div class="tbbd-left" v-show="!showDetail"> <div class="tbbd-left" v-show="!showDetail">
<sbject :study="study" />
<sbject :study="study" @change="changeSubject" />
</div> </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>
</div> </div>
</template> </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}, components: {sbject,tbbdList},
computed: {}, computed: {},
filters: {}, filters: {},
data() { data() {
return { return {
showDetail:false
showDetail:false,
studyInfo:{
studyId:this.study.id,
studyLeader:this.study.leader,
studySubjectId:''
}
} }
}, },
created() {}, created() {},
methods: { methods: {
changeSubject(val){
this.studyInfo.studySubjectId = val
},
showDetailCallback(val){ showDetailCallback(val){
this.showDetail=val this.showDetail=val
this.$emit('showDetail',val) this.$emit('showDetail',val)

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

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

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

@ -1,10 +1,10 @@
<template> <template>
<div class="study-ytbd"> <div class="study-ytbd">
<div class="ytbd-left" v-show="!showDetail"> <div class="ytbd-left" v-show="!showDetail">
<sbject :study="study" />
<sbject :study="study" @change="changeSubject" />
</div> </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>
</div> </div>
</template> </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}, components: {sbject,ytbdList},
computed: {}, computed: {},
filters: {}, filters: {},
data() { data() {
return { return {
showDetail:false
showDetail:false,
studyInfo:{
studyId:this.study.id,
studyLeader:this.study.leader,
studySubjectId:''
}
} }
}, },
created() {}, created() {},
methods: { methods: {
changeSubject(val){
this.studyInfo.studySubjectId = val
},
showDetailCallback(val){ showDetailCallback(val){
this.showDetail=val this.showDetail=val
this.$emit('showDetail',val) this.$emit('showDetail',val)

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

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

Loading…
Cancel
Save