血透系统pad前端

CheckTab.vue 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <div class="fixedTop">
  3. <div class="nav">
  4. <!-- <ul style="width: 90%">
  5. <li
  6. v-for="(item,i) in inspectionDate"
  7. :key="i"
  8. :class="index == i? 'active':'' "
  9. @click="ClickTab(i,item)"
  10. >{{item.project_name}}</li>
  11. </ul>-->
  12. <van-tabs v-model="active" @change="onClick">
  13. <van-tab v-for="(item, i) in inspectionDate" :key="i" :title="item.project_name"></van-tab>
  14. </van-tabs>
  15. <!-- <van-tabs v-model="active" ref="one">
  16. <van-tab title="标签 1">内容 1</van-tab>
  17. <van-tab title="标签 2">内容 2</van-tab>
  18. <van-tab title="标签 3">内容 3</van-tab>
  19. <van-tab title="标签 4">内容 4</van-tab>
  20. </van-tabs>-->
  21. </div>
  22. <div class="tab-content">
  23. <inspection-item-table ref="item"></inspection-item-table>
  24. </div>
  25. </div>
  26. </template>
  27. <script>
  28. import { GetInspection } from "@/api/check";
  29. import InspectionItemTable from "./InspectionItemTable";
  30. import $ from "jquery";
  31. export default {
  32. name: "CheckTab",
  33. created() {
  34. this.patient = this.$route.query.patient_id;
  35. this.GetList();
  36. this.$nextTick(() => {
  37. if (this.active === 0) {
  38. console.log();
  39. $(".van-tabs__line").addClass("intro");
  40. }
  41. });
  42. },
  43. data() {
  44. return {
  45. index: 0,
  46. inspectionDate: [],
  47. patient: 0,
  48. active: 0
  49. };
  50. },
  51. components: {
  52. InspectionItemTable
  53. },
  54. methods: {
  55. ClickTab: function(tabIndex, row) {
  56. this.index = tabIndex;
  57. this.$refs.item.GetList(row.project_id, row);
  58. },
  59. GetList: function() {
  60. let params = {
  61. patient: this.patient
  62. };
  63. GetInspection(params).then(response => {
  64. this.inspectionDate = [];
  65. if (response.data.state == 1) {
  66. // console.log(this.$refs.item);
  67. this.inspectionDate = response.data.data.reference;
  68. this.$refs.item.GetList(1, this.inspectionDate[0]);
  69. }
  70. });
  71. },
  72. onClick(num, title) {
  73. // console.log(this.inspectionDate);
  74. // console.log(num);
  75. // console.log(this.$refs.item);
  76. if ($(".van-tabs__line").is(".intro")) {
  77. $(".van-tabs__line").removeClass("intro");
  78. }
  79. this.inspectionDate.map((items, i) => {
  80. if (num == i) {
  81. this.index = i;
  82. this.$refs.item.GetList(items.project_id, items);
  83. }
  84. });
  85. }
  86. }
  87. };
  88. </script>
  89. <style style="stylesheet/scss" lang="scss" scoped>
  90. .nav {
  91. border-bottom: 1px #e5e5e5 solid;
  92. background: #fff;
  93. position: fixed;
  94. top: 76px;
  95. // @media only screen and (min-width: 376px) and (max-width: 668px) {
  96. // top: 84px !important;
  97. // }
  98. // @media only screen and (min-width: 415px) and (max-width: 736px) {
  99. // top: 88px !important;
  100. // }
  101. // @media only screen and (max-width: 767px) {
  102. // top: 76px !important;
  103. // }
  104. @media only screen and (min-width: 768px) {
  105. top: 116px !important;
  106. }
  107. // @media only screen and (min-width: 813px) and (max-width: 1024px) {
  108. // top: 117px !important;
  109. // }
  110. // @media only screen and (min-width: 1024px) {
  111. // top: 117px !important;
  112. // }
  113. right: 0;
  114. z-index: 55;
  115. left: 0;
  116. background: #fff;
  117. ul {
  118. width: 60%;
  119. margin: 0 auto;
  120. @include box-sizing;
  121. @include display-flex;
  122. @include align-items-center;
  123. @include text-align;
  124. @include justify-content-between;
  125. li {
  126. font-size: 0.32rem;
  127. float: left;
  128. color: $pgh-color;
  129. padding: 0.3rem 0;
  130. cursor: pointer;
  131. }
  132. .active {
  133. position: relative;
  134. &::before {
  135. width: 100%;
  136. height: 2px;
  137. color: $main-color;
  138. position: absolute;
  139. bottom: 0;
  140. left: 0;
  141. content: "";
  142. background: $main-color;
  143. }
  144. }
  145. }
  146. }
  147. </style>
  148. <style lang="scss">
  149. .intro {
  150. width: 41px !important;
  151. transform: translateX(20.5px) !important;
  152. @media only screen and (min-width: 415px) and (max-width: 668px) {
  153. width: 73px !important;
  154. transform: translateX(36.5px) !important;
  155. }
  156. @media only screen and (min-width: 376px) and (max-width: 415px) {
  157. width: 45.5px !important;
  158. transform: translateX(22.75px) !important;
  159. }
  160. @media only screen and (min-width: 668px) and (max-width: 735px) {
  161. width: 45.5px !important;
  162. transform: translateX(22.75px) !important;
  163. }
  164. @media only screen and (min-width: 668px) and (max-width: 736px) {
  165. width: 81px !important;
  166. transform: translateX(40.5px) !important;
  167. }
  168. @media only screen and (min-width: 737px) and (max-width: 812px) {
  169. width: 89px !important;
  170. transform: translateX(44.5px) !important;
  171. }
  172. @media only screen and (min-width: 813px) and (max-width: 1024px) {
  173. width: 113px !important;
  174. transform: translateX(56.5px) !important;
  175. }
  176. @media only screen and (min-width: 1025px) {
  177. width: 150.5px !important;
  178. transform: translateX(75.25px) !important;
  179. }
  180. }
  181. .van-tabs {
  182. height: 1rem;
  183. }
  184. .van-tabs--line .van-tabs__wrap {
  185. height: 1rem;
  186. }
  187. .van-tabs--line {
  188. padding-top: 1rem;
  189. }
  190. .van-tab {
  191. line-height: 1rem;
  192. }
  193. </style>