华西海圻ELN前端工程
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

127 lines
3.3 KiB

<template>
<div class="study-enter">
<div class="content-list">
<div class="search-box" v-show="!showDetail">
<div class="search-item" :class="active === item.key ? 'active' : ''" v-for="(item, index) in tabList"
:key="index" @click="changeTab(item)">
{{ $t(item.name) }}
</div>
</div>
<div class="content-box" v-if="study.id!='' && study.id!=undefined">
<ytbd v-if="active === 'ytbd'" :study="study" @showDetail="showDetailCallback" />
<tbbd v-if="active === 'tbbd'" :study="study" @showDetail="showDetailCallback"/>
<syxx v-if="active === 'syxx'" :study="study" @showDetail="showDetailCallback"/>
<syff v-if="active === 'syff'" :study="study" @showDetail="showDetailCallback"/>
<wzlb v-if="active === 'wzlb'" :study="study" @showDetail="showDetailCallback"/>
<syj v-if="active === 'syj'" :study="study" @showDetail="showDetailCallback"/>
</div>
</div>
</div>
</template>
<script>
import { study_info} from "@/api/business/study/study";
import ytbd from './ytbd.vue'
import tbbd from './tbbd.vue'
import syxx from './syxx.vue'
import syff from './syff.vue'
import wzlb from './wzlb.vue'
import syj from './syj.vue'
export default {
name: 'StudyEnter',
props: {},
components: { ytbd, tbbd ,syxx,syff,wzlb, syj},
computed: {},
filters: {},
data() {
return {
showDetail: false,
tabList: [
{ key: 'ytbd', name: 'page.business.study.studyEnter.ytbdlb' },
{ key: 'tbbd', name: 'page.business.study.studyEnter.tbbdlb' },
{ key: 'syxx', name: 'page.business.study.studyEnter.syxx' },
{ key: 'wzlb', name: 'page.business.study.studyEnter.wzlb' },
{ key: 'syff', name: 'page.business.study.studyEnter.syfflb' },
{ key: 'syj', name: 'page.business.study.studyEnter.syjsygl' }
],
active: this.$route.params.tab || 'ytbd',
study: {},
}
},
created() {
// let x = this.$route.params
// let y = this.$route.query
// debugger
this.getInfo()
},
methods: {
getInfo(){
this.$modal.loading()
study_info({id:this.$route.params.studyId}).then(({data}) => {
this.study = data
const obj = Object.assign({}, this.$route, { title: '试验管理:'+this.study.sn })
this.$tab.updatePage(obj);
}).finally(() => {
this.$modal.closeLoading()
})
},
show(row) {
this.study = row
},
showDetailCallback(val) {
this.showDetail = val
},
changeTab(item) {
if (this.active !== item.key) {
this.active = item.key
}
}
}
}
</script>
<style lang="scss" scoped>
.study-enter {
margin: 10px 10px;
.search-box {
background: #fff;
padding: 0;
border-radius: 3px;
margin-bottom: 10px;
display: flex;
flex-direction: row;
align-items: center;
.search-item {
padding: 10px 20px;
font-size: 14px;
cursor: pointer;
&.active {
background: #1890ff;
color: #fff;
}
&:hover {
background: #46a6ff;
color: #fff;
}
&:first-child {
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
}
&:last-child {
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}
}
}
.content-box {}
}
</style>