trainingPlan.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <div class="app-container" style="padding: 0 0 0 0">
  3. <el-tabs type="border-card" v-model="activeName" @tab-click="handleClick">
  4. <el-tab-pane label="装置级培训" name="first">
  5. <firstplan-bccnew :newId="newId" item="1" typename="firstplan" v-if="isFirst"></firstplan-bccnew>
  6. </el-tab-pane>
  7. <el-tab-pane label="导师带徒(裂解)" name="second" v-if="planType == 1">
  8. <score :newId="newId" :planType="1" v-if="isSecond"/>
  9. </el-tab-pane>
  10. <el-tab-pane label="导师带徒(压缩)" name="third" v-if="planType == 2">
  11. <score :newId="newId" :planType="2" v-if="isThird"/>
  12. </el-tab-pane>
  13. <el-tab-pane label="导师带徒(分离)" name="fourth" v-if="planType == 3">
  14. <score :newId="newId" :planType="3" v-if="isFourth"/>
  15. </el-tab-pane>
  16. <el-tab-pane label="导师带徒(芳烃)" name="fifth" v-if="planType == 4">
  17. <score :newId="newId" :planType="4" v-if="isFifth"/>
  18. </el-tab-pane>
  19. </el-tabs>
  20. </div>
  21. </template>
  22. <script>
  23. import List from "@/views/training/newstaff/firstplan/index.vue";
  24. import Score from "@/views/training/bccnew/tsnew/score.vue";
  25. import {listLjplandsdt} from "@/api/training/bccnew/ljplandsdt";
  26. import {listYsplandsdt} from "@/api/training/bccnew/ysplandsdt";
  27. import {listFlplandsdt} from "@/api/training/bccnew/flplandsdt";
  28. import {listFtplandsdt} from "@/api/training/bccnew/ftplandsdt";
  29. import {getTsnew} from "@/api/training/bccnew/tsnew";
  30. import Firstplan from "@/views/training/newstaff/firstplan/index.vue";
  31. import FirstplanBccnew from "@/views/training/bccnew/firstplan/index.vue";
  32. export default {
  33. name: "trainingPlan",
  34. components: {FirstplanBccnew, Firstplan, Score, List},
  35. data() {
  36. return {
  37. dsdtList: [],
  38. clientHeight: 300,
  39. // 默认第一个Tab
  40. activeName: 'first',
  41. isFirst: true,
  42. isSecond: false,
  43. isThird: false,
  44. isFourth: false,
  45. isFifth: false,
  46. isSixth: false,
  47. planType: 1,
  48. newId: ''
  49. }
  50. },
  51. created() {
  52. //设置表格高度对应屏幕高度
  53. this.newId = this.$route.params && this.$route.params.newId;
  54. getTsnew(this.newId).then(response => {
  55. this.planType = response.data.planType;
  56. });
  57. },
  58. methods: {
  59. handleClick(tab) {
  60. console.log(tab.name)
  61. this.dsdtList = [];
  62. if (tab.name === 'first') {
  63. this.isFirst = true
  64. this.isSecond = false
  65. this.isThird = false
  66. this.isFourth = false
  67. this.isFifth = false
  68. this.isSix1th = false
  69. } else if (tab.name === 'second') {
  70. this.isFirst = false
  71. this.isSecond = true
  72. this.isThird = false
  73. this.isFourth = false
  74. this.isFifth = false
  75. this.isSixth = false
  76. } else if (tab.name === 'third') {
  77. this.isFirst = false
  78. this.isSecond = false
  79. this.isThird = true
  80. this.isFourth = false
  81. this.isFifth = false
  82. this.isSixth = false
  83. } else if (tab.name === 'fourth') {
  84. this.isFirst = false
  85. this.isSecond = false
  86. this.isThird = false
  87. this.isFourth = true
  88. this.isFifth = false
  89. this.isSixth = false
  90. } else if (tab.name === 'fifth') {
  91. listLjplandsdt({newId: this.newId}).then(res => {
  92. this.dsdtList = res.data;
  93. })
  94. this.isFirst = false
  95. this.isSecond = false
  96. this.isThird = false
  97. this.isFourth = false
  98. this.isFifth = true
  99. this.isSixth = false
  100. } else if (tab.name === 'sixth') {
  101. listLjplandsdt({newId: this.newId}).then(res => {
  102. this.dsdtList = res.data;
  103. })
  104. this.isFirst = false
  105. this.isSecond = false
  106. this.isThird = false
  107. this.isFourth = false
  108. this.isFifth = false
  109. this.isSixth = true
  110. }
  111. }
  112. }
  113. };
  114. </script>
  115. <style scoped>
  116. </style>