CfContent.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <view class="cf-content">
  3. <pub-loading-view :loaded="loaded" height="100%">
  4. <view class="cf-content-section" v-if="recipeContent">
  5. <view class="cf-content-title">{{recipeContent.hosName}}</view>
  6. <view class="cf-content-info">
  7. <view class="cf-content-info-left">
  8. <view>患者</view>
  9. <view>{{recipeContent.name}}</view>
  10. <view>{{recipeContent.sex}}</view>
  11. <view>{{recipeContent.age}}</view>
  12. </view>
  13. <view class="cf-content-info-right">
  14. <view>处方号</view>
  15. <view>{{recipeContent.cfNo}}</view>
  16. </view>
  17. </view>
  18. <view class="cf-content-list">
  19. <view class="cf-content-item" v-for="item in recipeContent.list" :key="item">
  20. <view>{{item.ypmc}}</view>
  21. <view>{{ item.jl+item.ypdw }}</view>
  22. </view>
  23. </view>
  24. <view class="cf-content-total">
  25. <view>{{recipeContent.ts}}</view>
  26. <view>{{recipeContent.fs}}</view>
  27. <view>{{recipeContent.kd}}</view>
  28. </view>
  29. <view class="cf-content-doctor">
  30. <view class="cf-content-doctor-left">
  31. <view>医生:</view>
  32. <view>{{recipeContent.doctor}}</view>
  33. </view>
  34. <view>{{recipeContent.date}}</view>
  35. </view>
  36. <view class="cf-content-note">{{recipeContent.note}}</view>
  37. </view>
  38. </pub-loading-view>
  39. </view>
  40. </template>
  41. <script lang="ts" setup>
  42. import { ref, PropType, onMounted } from 'vue'
  43. import rest from '@/stores/rest'
  44. import { RecipeContentVO } from '../../lib/type'
  45. import {
  46. getSexByCardNo,
  47. getAgeByCardNo,
  48. formatDate,
  49. DictLabelFYFSYF,
  50. DictLabelFYFSLX,
  51. maskName,
  52. } from '@/lib/util'
  53. defineProps({
  54. info: {
  55. type: Object as PropType<any>,
  56. default: () => ({}),
  57. },
  58. })
  59. const loaded = ref(false)
  60. const recipeContent = ref({
  61. hosName: '',
  62. name: '',
  63. sex: '',
  64. age: '',
  65. cfNo: '',
  66. list: [],
  67. ts: '',
  68. fs: '',
  69. kd: '',
  70. doctor: '',
  71. date: '',
  72. note: '根据卫生部《处方管理办法》规定,处方当日有效除药品质量原因外,药品一经发出,不得退换',
  73. })
  74. const getInfo = async () => {
  75. loaded.value = true
  76. try {
  77. const res = await rest.get('/app-api/bmfw/findCfYp', { ptwybh: '2024_1857595040975118338' }) as RecipeContentVO
  78. recipeContent.value = {
  79. hosName: res.yljgmc,
  80. name: res.patient.hzxm,
  81. sex: getSexByCardNo(res.patient.zjhm),
  82. age: `${getAgeByCardNo(res.patient.zjhm)}岁`,
  83. cfNo: `#${res.yncfbh}`,
  84. list: res.detail,
  85. ts: `${res.cfts}贴`,
  86. fs: DictLabelFYFSYF(res.fyfsyf),
  87. kd: DictLabelFYFSLX(res.fyfslx),
  88. doctor: maskName(res.doctor.nickname),
  89. date: formatDate(res.createTime, '{y}-{m}-{d} {h}:{i}'),
  90. note: '根据卫生部《处方管理办法》规定,处方当日有效除药品质量原因外,药品一经发出,不得退换'
  91. }
  92. } catch (e) {
  93. console.log(e)
  94. } finally {
  95. loaded.value = false
  96. }
  97. }
  98. onMounted(() => {
  99. getInfo()
  100. })
  101. </script>
  102. <style lang="scss" scoped>
  103. .cf-content {
  104. background: #fff;
  105. padding: $uni-spacing-col-s3 $page-row-spacing;
  106. height: 100%;
  107. box-sizing: border-box;
  108. overflow-y: auto;
  109. text-align: center;
  110. .cf-content-title {
  111. font-size: $uni-font-size-xl;
  112. line-height: $uni-line-height-xl;
  113. font-weight: 600;
  114. }
  115. .cf-content-info {
  116. @include flex-between;
  117. border-bottom: 1px dashed $uni-border-color;
  118. padding: 32rpx 24rpx;
  119. .cf-content-info-left,
  120. .cf-content-info-right {
  121. @include flex;
  122. >view {
  123. &+view {
  124. margin-left: 16rpx;
  125. }
  126. }
  127. }
  128. }
  129. .cf-content-list {
  130. display: flex;
  131. flex-wrap: wrap;
  132. padding: 20rpx 16rpx 20rpx;
  133. .cf-content-item {
  134. font-size: $uni-font-size-base;
  135. line-height: $uni-line-height-base;
  136. font-weight: 600;
  137. margin: 20rpx 8rpx;
  138. width: calc((100% - 48rpx)/3);
  139. text-align: left;
  140. display: flex;
  141. >view {
  142. &+view {
  143. margin-left: 8rpx;
  144. }
  145. }
  146. }
  147. }
  148. .cf-content-total {
  149. @include flex;
  150. padding: 0 24rpx 40rpx;
  151. border-bottom: 1px dashed $uni-border-color;
  152. color: $uni-text-color-grey;
  153. >view {
  154. &+view {
  155. margin-left: 32rpx;
  156. }
  157. }
  158. }
  159. .cf-content-doctor {
  160. // color: $uni-text-color-light;
  161. padding: 16rpx 24rpx 40rpx;
  162. @include flex-between;
  163. .cf-content-doctor-left {
  164. @include flex;
  165. }
  166. }
  167. .cf-content-note {
  168. color: $uni-text-color-light;
  169. padding: 0 24rpx 32rpx;
  170. text-align: left;
  171. font-size: $uni-font-size-sm;
  172. line-height: $uni-line-height-sm;
  173. }
  174. }
  175. </style>