message-custom.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <view class="custom">
  3. <template v-if="isCustom === 'order'">
  4. <!-- <div>
  5. <h1></h1>
  6. {{extension.title}}
  7. </div> -->
  8. <view class="order-item">
  9. <view class="title">问诊订单 </view>
  10. <view class="text">患者:{{extension.patientName}} {{extension.sex}} {{extension.mobile}} </view>
  11. <view class="text">患病时间:{{extension.duration}} </view>
  12. <view class="text">就诊情况:{{extension.isVisit}} </view>
  13. <view class="text">病情描述:{{extension.title}} </view>
  14. </view>
  15. </template>
  16. <template v-else-if="isCustom === 'prescribe'">
  17. <view class="prescribe-item">
  18. <view class="title">电子处方单 </view>
  19. <view class="text">诊断:{{extension.diagnose}} </view>
  20. <view class="btns">
  21. <view class="btn">查看处方</view>
  22. </view>
  23. </view>
  24. </template>
  25. <template v-else-if="isCustom === 'report'">
  26. <view class="report-item">
  27. <view class="title">问诊报告单 </view>
  28. <view class="btns">
  29. <view class="btn">查看报告单</view>
  30. </view>
  31. </view>
  32. </template>
  33. <template v-else-if="isCustom === 'follow'">
  34. <view class="prescribe-item">
  35. <view class="title">随访单 </view>
  36. <view class="btns">
  37. <view class="btn">查看随访</view>
  38. </view>
  39. </view>
  40. </template>
  41. <template v-else-if="isCustom === 'drugReport'">
  42. <view class="report-item">
  43. <view class="title">用药报告单 </view>
  44. <view class="btns">
  45. <view class="btn">查看报告单</view>
  46. </view>
  47. </view>
  48. </template>
  49. <template v-else-if="isCustom === 'startInquiry'">
  50. <span :class="['content content-' + message.flow]">{{extension.title}}</span>
  51. </template>
  52. <template v-else-if="isCustom === 'finishInquiry'">
  53. <span :class="['content content-' + message.flow]">{{extension.title}}</span>
  54. </template>
  55. <template v-else>
  56. <span :class="['content content-' + message.flow]">{{data.custom}}</span>
  57. </template>
  58. </view>
  59. </template>
  60. <script lang="ts">
  61. import store from "@/store";
  62. import { defineComponent, watchEffect, reactive, toRefs } from 'vue';
  63. const MessageCustom = defineComponent({
  64. props: {
  65. data: {
  66. type: Object,
  67. default: () => {
  68. return {};
  69. }
  70. },
  71. messageData: {
  72. type: Object,
  73. default: () => {
  74. return {};
  75. }
  76. }
  77. },
  78. setup(props:any, ctx:any) {
  79. const data = reactive({
  80. data: {},
  81. extension: {},
  82. isCustom: '',
  83. payload: {},
  84. message: {},
  85. });
  86. watchEffect(()=>{
  87. data.data = props.data;
  88. data.message = props.messageData;
  89. data.isCustom = props.data.message.payload.data;
  90. data.payload = props.data.message.payload;
  91. data.extension = JSON.parse(props.data.message.payload.extension);
  92. });
  93. return {
  94. ...toRefs(data),
  95. };
  96. }
  97. });
  98. export default MessageCustom
  99. </script>
  100. <style lang="scss" scoped>
  101. a {
  102. color: #679CE1;
  103. }
  104. .custom {
  105. padding: 12px 0;
  106. border-radius: 10px 0px 10px 10px;
  107. .order-item{
  108. width: 400rpx;
  109. padding: 15rpx;
  110. padding: 15rpx;
  111. border: 1rpx solid #54ab9f;
  112. box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  113. background-color: #f6fffe;
  114. border-radius: 15rpx;
  115. display: flex;
  116. flex-direction: column;
  117. align-items: flex-start;
  118. justify-content: flex-start;
  119. .title{
  120. font-size: 32upx;
  121. font-family: PingFang SC;
  122. font-weight: bold;
  123. color: #111111;
  124. }
  125. .text{
  126. font-size: 24upx;
  127. font-family: PingFang SC;
  128. color: #9a9a9c;
  129. }
  130. }
  131. .prescribe-item{
  132. width: 400rpx;
  133. padding: 15rpx;
  134. border: 1rpx solid #54ab9f;
  135. box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  136. background-color: #f6fffe;
  137. border-radius: 15rpx;
  138. display: flex;
  139. flex-direction: column;
  140. align-items: flex-start;
  141. justify-content: flex-start;
  142. .title{
  143. font-size: 32upx;
  144. font-family: PingFang SC;
  145. font-weight: bold;
  146. color: #111111;
  147. }
  148. .text{
  149. margin-top: 10rpx;
  150. font-size: 24upx;
  151. font-family: PingFang SC;
  152. color: #9a9a9c;
  153. }
  154. .btns{
  155. padding: 15rpx;
  156. display: flex;
  157. align-items: center;
  158. justify-content: center;
  159. width:100%;
  160. .btn{
  161. border-radius: 30rpx;
  162. padding:15rpx 30rpx;
  163. border: 1rpx solid #54ab9f;
  164. font-family: PingFang SC;
  165. color: #3bb697;
  166. }
  167. }
  168. }
  169. .report-item{
  170. width: 400rpx;
  171. padding: 15rpx;
  172. border: 1rpx solid #54ab9f;
  173. box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  174. background-color: #f6fffe;
  175. border-radius: 15rpx;
  176. display: flex;
  177. flex-direction: column;
  178. align-items: flex-start;
  179. justify-content: flex-start;
  180. .title{
  181. font-size: 32upx;
  182. font-family: PingFang SC;
  183. font-weight: bold;
  184. color: #111111;
  185. }
  186. .text{
  187. margin-top: 10rpx;
  188. font-size: 24upx;
  189. font-family: PingFang SC;
  190. color: #9a9a9c;
  191. }
  192. .btns{
  193. padding: 15rpx;
  194. display: flex;
  195. align-items: center;
  196. justify-content: center;
  197. width:100%;
  198. .btn{
  199. border-radius: 30rpx;
  200. padding:15rpx 30rpx;
  201. border: 1rpx solid #54ab9f;
  202. font-family: PingFang SC;
  203. color: #3bb697;
  204. }
  205. }
  206. }
  207. }
  208. .content {
  209. padding: 10px;
  210. &-in {
  211. background: #e1e1e1;
  212. border-radius: 0px 10px 10px 10px;
  213. }
  214. &-out {
  215. background: #DCEAFD;
  216. border-radius: 10px 0px 10px 10px;
  217. }
  218. }
  219. </style>