PaymentDetailPopup.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <!-- 门诊患者缴费明细弹框 -->
  2. <template>
  3. <view class="payment-popup" v-if="show">
  4. <!-- 遮罩层 -->
  5. <view class="mask" @click="handleClose"></view>
  6. <!-- 弹框内容 -->
  7. <view class="popup-content">
  8. <!-- 头部信息区域 -->
  9. <view class="popup-header">
  10. <view class="patient-name">{{ patientInfo.name || '未填写' }}</view>
  11. <view class="visit-info">
  12. <view class="info-item">就诊科室:{{ patientInfo.department || '未填写' }}</view>
  13. <view class="info-item">就诊医生:{{ patientInfo.doctor || '未填写' }}</view>
  14. <view class="info-item">就诊时间:{{ patientInfo.time || '未填写' }}</view>
  15. </view>
  16. </view>
  17. <!-- 分隔线 -->
  18. <view class="divider"></view>
  19. <!-- 缴费明细区域 -->
  20. <view class="detail-section">
  21. <view class="detail-title">缴费明细</view>
  22. <!-- 明细列表头部 -->
  23. <view class="detail-header">
  24. <view class="detail-col name-col">项目名称</view>
  25. <view class="detail-col price-col">金额</view>
  26. <view class="detail-col time-col">时间</view>
  27. <view class="detail-col status-col">状态</view>
  28. </view>
  29. <!-- 明细列表内容 -->
  30. <view class="detail-list">
  31. <view
  32. class="detail-item"
  33. v-for="(item, index) in paymentDetails"
  34. :key="index">
  35. <view class="detail-col name-col">{{ item.itemName }}</view>
  36. <view class="detail-col price-col">¥{{ item.price }}</view>
  37. <view class="detail-col time-col">{{ item.billDate+' '+ item.billTime}}</view>
  38. <view v-if="item.paidStatusDesc === '已结算'" class="detail-col status-col">{{ item.paidStatusDesc }}</view>
  39. <view v-if="item.paidStatusDesc !== '已结算'" class="detail-col time-col">{{ item.paidStatusDesc }}</view>
  40. </view>
  41. <!-- 空状态 -->
  42. <view class="empty-state" v-if="paymentDetails.length === 0">
  43. 暂无缴费明细
  44. </view>
  45. </view>
  46. </view>
  47. <!-- 底部操作区域 -->
  48. <view class="popup-footer">
  49. <button class="close-btn" @click="handleClose">关闭</button>
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. <script setup>
  55. import { defineProps } from 'vue'
  56. // 定义组件接收的参数
  57. const props = defineProps({
  58. // 是否显示弹框
  59. show: {
  60. type: Boolean,
  61. default: false
  62. },
  63. // 患者信息
  64. patientInfo: {
  65. type: Object,
  66. default: () => ({
  67. name: '', // 姓名
  68. department: '', // 就诊科室
  69. doctor: '', // 就诊医生
  70. time: '' // 就诊时间
  71. })
  72. },
  73. // 缴费明细数组
  74. paymentDetails: {
  75. type: Array,
  76. default: () => []
  77. }
  78. })
  79. // 定义 emits 事件
  80. const emit = defineEmits(['close'])
  81. // 关闭弹框
  82. const handleClose = () => {
  83. emit('close')
  84. }
  85. </script>
  86. <style scoped>
  87. .payment-popup {
  88. position: fixed;
  89. top: 0;
  90. left: 0;
  91. right: 0;
  92. bottom: 0;
  93. z-index: 999;
  94. }
  95. .mask {
  96. position: absolute;
  97. top: 0;
  98. left: 0;
  99. right: 0;
  100. bottom: 0;
  101. background-color: rgba(0, 0, 0, 0.5);
  102. }
  103. .popup-content {
  104. position: absolute;
  105. bottom: 0;
  106. left: 0;
  107. right: 0;
  108. background-color: #fff;
  109. border-radius: 16rpx 16rpx 0 0;
  110. max-height: 80vh;
  111. overflow-y: auto;
  112. }
  113. .popup-header {
  114. padding: 30rpx;
  115. }
  116. .patient-name {
  117. font-size: 36rpx;
  118. font-weight: bold;
  119. color: #333;
  120. margin-bottom: 20rpx;
  121. }
  122. .visit-info {
  123. display: flex;
  124. flex-wrap: wrap;
  125. gap: 20rpx 40rpx;
  126. }
  127. .info-item {
  128. font-size: 28rpx;
  129. color: #666;
  130. line-height: 1.5;
  131. }
  132. .divider {
  133. height: 1px;
  134. background-color: #f5f5f5;
  135. margin: 0 30rpx;
  136. }
  137. .detail-section {
  138. padding: 15rpx 30rpx;
  139. }
  140. .detail-title {
  141. font-size: 32rpx;
  142. font-weight: bold;
  143. color: #333;
  144. margin-bottom: 20rpx;
  145. }
  146. .detail-header, .detail-item {
  147. display: flex;
  148. align-items: center;
  149. padding: 20rpx 0;
  150. border-bottom: 1px solid #f5f5f5;
  151. }
  152. .detail-header {
  153. font-weight: bold;
  154. color: #666;
  155. }
  156. .detail-item:last-child {
  157. border-bottom: none;
  158. }
  159. .detail-col {
  160. font-size: 28rpx;
  161. text-align: center;
  162. }
  163. .name-col {
  164. flex: 3;
  165. text-align: left;
  166. }
  167. .price-col, .time-col {
  168. flex: 2;
  169. }
  170. .status-col {
  171. flex: 2;
  172. color: #f53f3f;
  173. }
  174. .empty-state {
  175. padding: 60rpx 0;
  176. text-align: center;
  177. color: #999;
  178. font-size: 28rpx;
  179. }
  180. .popup-footer {
  181. padding: 30rpx;
  182. border-top: 1px solid #f5f5f5;
  183. }
  184. .close-btn {
  185. width: 100%;
  186. height: 80rpx;
  187. line-height: 80rpx;
  188. background-color: #007aff;
  189. color: #fff;
  190. font-size: 32rpx;
  191. border-radius: 8rpx;
  192. }
  193. </style>