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

152 lines
4.7 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" @changeTab="changeTab" />
  12. <tbbd v-if="active === 'tbbd'" :study="study" @showDetail="showDetailCallback" @changeTab="changeTab"/>
  13. <syxx v-if="active === 'syxx'" :study="study" @showDetail="showDetailCallback" @changeTab="changeTab"/>
  14. <syff v-if="active === 'syff'" :study="study" @showDetail="showDetailCallback" @changeTab="changeTab"/>
  15. <wzlb v-if="active === 'wzlb'" :study="study" @showDetail="showDetailCallback" @changeTab="changeTab"/>
  16. <syj v-if="active === 'syj'" :study="study" @showDetail="showDetailCallback" @changeTab="changeTab"/>
  17. </div>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. import { checkPermi } from "@/utils/permission";
  23. import { study_info} from "@/api/business/study/study";
  24. import ytbd from './ytbd.vue'
  25. import tbbd from './tbbd.vue'
  26. import syxx from './syxx.vue'
  27. import syff from './syff.vue'
  28. import wzlb from './wzlb.vue'
  29. import syj from './syj.vue'
  30. export default {
  31. name: 'StudyEnter',
  32. props: {},
  33. components: { ytbd, tbbd ,syxx,syff,wzlb, syj},
  34. computed: {},
  35. filters: {},
  36. data() {
  37. return {
  38. showDetail: false,
  39. tabList: [],
  40. active: '',
  41. study: {},
  42. }
  43. },
  44. created() {
  45. // let x = this.$route.params
  46. // let y = this.$route.query
  47. // debugger
  48. this.initTab()
  49. this.getInfo()
  50. },
  51. methods: {
  52. checkPermi,
  53. initTab(){
  54. this.tabList = []
  55. if(this.checkPermi(['business:studyFormPreTab'])){
  56. this.tabList.push({ key: 'ytbd', name: 'page.business.study.studyEnter.ytbdlb' })
  57. }
  58. if(this.checkPermi(['business:studyFormFillTab'])){
  59. this.tabList.push({ key: 'tbbd', name: 'page.business.study.studyEnter.tbbdlb' })
  60. }
  61. if(this.checkPermi(['business:studyFormPlanTab'])){
  62. this.tabList.push({ key: 'syxx', name: 'page.business.study.studyEnter.syxx' })
  63. }
  64. if(this.checkPermi(['business:studyWzlbTab'])){
  65. this.tabList.push({ key: 'wzlb', name: 'page.business.study.studyEnter.wzlb' })
  66. }
  67. if(this.checkPermi(['business:studyMethodTab'])){
  68. this.tabList.push({ key: 'syff', name: 'page.business.study.studyEnter.syfflb' })
  69. }
  70. if(this.checkPermi(['business:studyRoomTab'])){
  71. this.tabList.push({ key: 'syj', name: 'page.business.study.studyEnter.syjsygl' })
  72. }
  73. this.active = this.$route.params.tab && _.findIndex(this.tabList,(o)=>{return o.key===this.$route.params.tab})>-1 ? this.$route.params.tab: this.tabList.length>0 ? this.tabList[0].key :''
  74. if(this.active){
  75. let name = this.tabList[_.findIndex(this.tabList,(o)=>{return o.key===this.active})].name
  76. if(name){
  77. this.saveSimpleLog({name:this.$t(name,'zh_CN'),nameEn:this.$t(name,'en_US'),jcmc:this.$t('system.enterPage','zh_CN'),jcmcEn:this.$t('system.enterPage','en_US')})
  78. }
  79. }
  80. },
  81. getInfo(){
  82. this.$modal.loading()
  83. study_info({id:this.$route.params.studyId}).then(({data}) => {
  84. this.study = data
  85. const obj = Object.assign({}, this.$route, { title: this.study.name+'('+this.study.sn+')' })
  86. this.$tab.updatePage(obj);
  87. }).finally(() => {
  88. this.$modal.closeLoading()
  89. })
  90. },
  91. show(row) {
  92. this.study = row
  93. },
  94. showDetailCallback(val) {
  95. this.showDetail = val
  96. },
  97. changeTab(item) {
  98. if (this.active !== item.key) {
  99. this.saveSimpleLog({name:this.$t(item.name,'zh_CN'),nameEn:this.$t(item.name,'en_US'),jcmc:this.$t('system.enterPage','zh_CN'),jcmcEn:this.$t('system.enterPage','en_US')})
  100. this.active = item.key
  101. }
  102. }
  103. }
  104. }
  105. </script>
  106. <style lang="scss" scoped>
  107. .study-enter {
  108. margin: 10px 10px;
  109. .search-box {
  110. background: #fff;
  111. padding: 0;
  112. border-radius: 3px;
  113. margin-bottom: 10px;
  114. display: flex;
  115. flex-direction: row;
  116. align-items: center;
  117. .search-item {
  118. padding: 10px 20px;
  119. font-size: 14px;
  120. cursor: pointer;
  121. &.active {
  122. background: #1890ff;
  123. color: #fff;
  124. }
  125. &:hover {
  126. background: #46a6ff;
  127. color: #fff;
  128. }
  129. &:first-child {
  130. border-top-left-radius: 3px;
  131. border-bottom-left-radius: 3px;
  132. }
  133. &:last-child {
  134. border-top-right-radius: 3px;
  135. border-bottom-right-radius: 3px;
  136. }
  137. }
  138. }
  139. .content-box {}
  140. }
  141. </style>