华西海圻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

  1. <template>
  2. <div class="study-enter">
  3. <div class="content-list">
  4. <div class="search-box" v-show="!showDetail">
  5. <div class="search-item" :class="active === item.key ? 'active' : ''" v-for="(item, index) in tabList"
  6. :key="index" @click="changeTab(item)">
  7. {{ $t(item.name) }}
  8. </div>
  9. </div>
  10. <div class="content-box" v-if="study.id!='' && study.id!=undefined">
  11. <ytbd v-if="active === 'ytbd'" :study="study" @showDetail="showDetailCallback" />
  12. <tbbd v-if="active === 'tbbd'" :study="study" @showDetail="showDetailCallback"/>
  13. <syxx v-if="active === 'syxx'" :study="study" @showDetail="showDetailCallback"/>
  14. <syff v-if="active === 'syff'" :study="study" @showDetail="showDetailCallback"/>
  15. <wzlb v-if="active === 'wzlb'" :study="study" @showDetail="showDetailCallback"/>
  16. <syj v-if="active === 'syj'" :study="study" @showDetail="showDetailCallback"/>
  17. </div>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. import { study_info} from "@/api/business/study/study";
  23. import ytbd from './ytbd.vue'
  24. import tbbd from './tbbd.vue'
  25. import syxx from './syxx.vue'
  26. import syff from './syff.vue'
  27. import wzlb from './wzlb.vue'
  28. import syj from './syj.vue'
  29. export default {
  30. name: 'StudyEnter',
  31. props: {},
  32. components: { ytbd, tbbd ,syxx,syff,wzlb, syj},
  33. computed: {},
  34. filters: {},
  35. data() {
  36. return {
  37. showDetail: false,
  38. tabList: [
  39. { key: 'ytbd', name: 'page.business.study.studyEnter.ytbdlb' },
  40. { key: 'tbbd', name: 'page.business.study.studyEnter.tbbdlb' },
  41. { key: 'syxx', name: 'page.business.study.studyEnter.syxx' },
  42. { key: 'wzlb', name: 'page.business.study.studyEnter.wzlb' },
  43. { key: 'syff', name: 'page.business.study.studyEnter.syfflb' },
  44. { key: 'syj', name: 'page.business.study.studyEnter.syjsygl' }
  45. ],
  46. active: this.$route.params.tab || 'ytbd',
  47. study: {},
  48. }
  49. },
  50. created() {
  51. // let x = this.$route.params
  52. // let y = this.$route.query
  53. // debugger
  54. this.getInfo()
  55. },
  56. methods: {
  57. getInfo(){
  58. this.$modal.loading()
  59. study_info({id:this.$route.params.studyId}).then(({data}) => {
  60. this.study = data
  61. const obj = Object.assign({}, this.$route, { title: '试验管理:'+this.study.sn })
  62. this.$tab.updatePage(obj);
  63. }).finally(() => {
  64. this.$modal.closeLoading()
  65. })
  66. },
  67. show(row) {
  68. this.study = row
  69. },
  70. showDetailCallback(val) {
  71. this.showDetail = val
  72. },
  73. changeTab(item) {
  74. if (this.active !== item.key) {
  75. this.active = item.key
  76. }
  77. }
  78. }
  79. }
  80. </script>
  81. <style lang="scss" scoped>
  82. .study-enter {
  83. margin: 10px 10px;
  84. .search-box {
  85. background: #fff;
  86. padding: 0;
  87. border-radius: 3px;
  88. margin-bottom: 10px;
  89. display: flex;
  90. flex-direction: row;
  91. align-items: center;
  92. .search-item {
  93. padding: 10px 20px;
  94. font-size: 14px;
  95. cursor: pointer;
  96. &.active {
  97. background: #1890ff;
  98. color: #fff;
  99. }
  100. &:hover {
  101. background: #46a6ff;
  102. color: #fff;
  103. }
  104. &:first-child {
  105. border-top-left-radius: 3px;
  106. border-bottom-left-radius: 3px;
  107. }
  108. &:last-child {
  109. border-top-right-radius: 3px;
  110. border-bottom-right-radius: 3px;
  111. }
  112. }
  113. }
  114. .content-box {}
  115. }
  116. </style>