medication.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <view class="mb-5">
  3. <view class="position-relative bghead">
  4. <image style="opacity: 0;" src="@/static/img/other/med.png" mode="widthFix" class="w-100"></image>
  5. <view class="position-absolute text-white px-3 mx-3 positionY-50" style="">
  6. <view class="centerY">
  7. <view class="bw_line"></view>
  8. <view class="ml-1 fs-18 font-bold">
  9. 随访用药
  10. </view>
  11. </view>
  12. <view class="mt-2 fs-14">
  13. 患者每次随访的用药记录
  14. </view>
  15. </view>
  16. </view>
  17. <view class="px-3 pb-3 mt-n2" v-if="dataArray.length>0">
  18. <view class="bg-white px-2 py-3 mt-3" style="border-radius: 16rpx;" v-for="(item,index) in dataArray">
  19. <view class="centerY mb-2 text-gry">
  20. <view class="bule_line"></view>
  21. <view class="ml-2 fs-14 text-dark font-bold">
  22. {{item.type=="tnb"?'糖尿病随访':item.type=="gxy"?'高血压随访':'未知类型'}}
  23. </view>
  24. <text class="ml-auto iconfont Clock fs-16"></text>
  25. <view class="ml-1 fs-12">
  26. {{item.date}}
  27. </view>
  28. </view>
  29. <view class="">
  30. <view class="mtable-title centerY bg-primary text-white fs-12">
  31. <view class="text-left" style="width: 23%;">
  32. 药名
  33. </view>
  34. <view class=" text-center" style="width: 15%;">
  35. 剂量
  36. </view>
  37. <view class="w-10 text-center">
  38. 用法
  39. </view>
  40. <view class="text-center" style="width: 17%;">
  41. 用药频次
  42. </view>
  43. <view class="text-center" style="width: 17%;">
  44. 不良反应
  45. </view>
  46. <view class=" text-center" style="width: 17%;">
  47. 用药类型
  48. </view>
  49. </view>
  50. <view v-if="item.medicinals.length==0">
  51. <Empty title="此次随访没有用药" />
  52. </view>
  53. <view class="mtable-body-item centerY fs-12" v-for="(item2,index2) in item.medicinals"
  54. style="color: #868687;">
  55. <uni-tooltip :content="item2.name" style="color: #818181;width: 23%;">
  56. <view class="text-left text-view2">
  57. {{item2.name }}
  58. </view>
  59. </uni-tooltip>
  60. <view class=" text-center" style="width: 15%;">
  61. {{item2.unit + item2.medicinalUnit}}
  62. </view>
  63. <view class="w-10 text-center">
  64. {{item2.medicinalUse||'未知'}}
  65. </view>
  66. <view class="text-center" style="width: 17%;">
  67. {{item2.medicinalInterval||'未知'}}
  68. </view>
  69. <view class="text-center" style="width: 17%;">
  70. {{item2.untowardReaction||'无'}}
  71. </view>
  72. <view class="text-center" style="width: 17%;">
  73. {{item2.type=="Tnb"?'糖尿病':item2.type=="Gxy"?'高血压':'未知类型'}}
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. <view v-if="dataArray.length>0">
  80. <uni-load-more iconType="circle" :status="status" class="fs-12"></uni-load-more>
  81. </view>
  82. <view class="px-3 pb-3 mt-n2" v-if="dataArray.length==0">
  83. <Empty title="没有随访用药" class="py-5" />
  84. </view>
  85. </view>
  86. </template>
  87. <script>
  88. import Empty from '@/component/empty/empty.vue'
  89. export default {
  90. components: {
  91. Empty
  92. },
  93. data() {
  94. return {
  95. dataArray: [],
  96. status: 'loading',
  97. filter: {
  98. size: 10,
  99. current: 1
  100. }
  101. };
  102. },
  103. onLoad() {
  104. this.get_medicinal()
  105. },
  106. onReachBottom(a) {
  107. if (this.status !== "no-more") {
  108. this.status = 'loading';
  109. let page = JSON.parse(this.filter.page) + 1
  110. this.get_medicinal(page)
  111. }
  112. },
  113. methods: {
  114. async get_medicinal(page) {
  115. page = page || 1
  116. this.filter = {
  117. ...this.filter,
  118. page
  119. }
  120. uni.showLoading({
  121. title: '加载中'
  122. });
  123. let idCard = uni.getStorageSync('idCard')
  124. let {
  125. data,
  126. code,
  127. count
  128. } = await this.$api.find_medicinal_page({
  129. idCard,
  130. ...this.filter
  131. })
  132. if (code == 0) {
  133. this.dataArray=[...this.dataArray,...data||[]]
  134. uni.hideLoading();
  135. console.log(count / this.filter.size > this.filter.current)
  136. if (count / this.filter.size > this.filter.current) {
  137. this.status = 'more';
  138. } else {
  139. this.status = 'no-more';
  140. }
  141. uni.stopPullDownRefresh()
  142. } else {
  143. this.status = 'more';
  144. uni.hideLoading();
  145. uni.stopPullDownRefresh()
  146. }
  147. console.log(this.dataArray)
  148. }
  149. },
  150. onPullDownRefresh() {
  151. this.dataArray=[]
  152. this.get_medicinal(1)
  153. }
  154. }
  155. </script>
  156. <style lang="scss">
  157. page {
  158. background: #F5F9FF;
  159. }
  160. .bw_line {
  161. width: 10rpx;
  162. height: 30rpx;
  163. background-color: #fff;
  164. border-radius: 6rpx;
  165. }
  166. .bghead {
  167. background-image: url('@/static/img/other/med.png');
  168. background-size: 100% 100%;
  169. background-repeat: no-repeat;
  170. background-position: center;
  171. }
  172. .mtable {
  173. &-title {
  174. border-radius: 50rpx;
  175. padding: 20rpx 0 20rpx 20rpx;
  176. box-shadow: 0px 2px 7px 1px rgba(45, 142, 255, 0.5);
  177. }
  178. &-body {
  179. &-item {
  180. margin-top: 20rpx;
  181. border-radius: 50rpx;
  182. padding: 14rpx 0 14rpx 20rpx;
  183. background-color: #F6F9FE;
  184. color: #868687;
  185. }
  186. }
  187. }
  188. </style>