outpatientRefundRecord.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <view class="container">
  3. <view class="content">
  4. <userInfo :userInfo="currentUser" bgClass="bgLinGra"></userInfo>
  5. <block v-if="list.length > 0">
  6. <view class="record_box" v-for="(item, ind) in list" :key="ind" @click="itemClick(item)">
  7. <view class="header_time border_bottom">
  8. <text>门诊预交金退款</text>
  9. <text class="mr10 colorCustom" :class="{
  10. 'colorCustom': item.State == '2' || item.State == '3',
  11. 'colorRed': item.State == '4'
  12. }">{{ item.State == '1' ? '退款中' : item.State == '2' ? '全额到账' : item.State == '3' ? '部分到账' : item.State == '4' ? '退款失败' : '' }}</text>
  13. </view>
  14. <view class="main_centent">
  15. <view class="record_info">
  16. <text>退款申请</text>
  17. <text>¥{{ item.RefundableBalance / 100 }} 共{{ item.RefundableCount }}笔</text>
  18. </view>
  19. <view class="record_info">
  20. <text>实际到账</text>
  21. <text class="colorRed">¥{{ item.RefundAmount / 100 }} 共{{ item.RefundCount }}笔</text>
  22. </view>
  23. <view class="record_info">
  24. <text>到账时间</text>
  25. <text>{{ item.UpdateTime }}</text>
  26. </view>
  27. </view>
  28. </view>
  29. </block>
  30. <view v-else class="noData">
  31. <noData :value="noDataValue"></noData>
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script setup lang="ts">
  37. import { ref } from 'vue';
  38. import { onLoad, onShow } from '@dcloudio/uni-app';
  39. import { querySelfRefundRecordList } from '@/pagesPatient/service/outpatient/index';
  40. import common from '@/utils/common';
  41. import userInfo from '@/pagesPersonal/st1/components/userInfo/userInfo.vue';
  42. import noData from '@/pages/st1/components/noData/noData.vue';
  43. const app = getApp();
  44. const currentUser = ref<any>({});
  45. const list = ref<any[]>([]);
  46. const noDataValue = ref("暂无门诊退款记录");
  47. const startkey = ref("");
  48. onLoad((options: any) => {
  49. startkey.value = options.startkey || "";
  50. currentUser.value = app.globalData.currentUser || {};
  51. });
  52. onShow(() => {
  53. main();
  54. });
  55. const main = async () => {
  56. const user = app.globalData.currentUser || {};
  57. currentUser.value = user;
  58. const queryData = {
  59. CardNo: user.cardNo,
  60. CardType: user.cardType,
  61. HisMemberId: user.hisMemberId,
  62. MemberId: user.memberId,
  63. Store: {
  64. cardEncryptionStore: user.encryptionStore || '',
  65. baseMemberEncryptionStore: user.baseMemberEncryptionStore
  66. }
  67. };
  68. try {
  69. const resp = await querySelfRefundRecordList(queryData);
  70. // 处理可能的返回结构,原逻辑是直接使用 resp
  71. // 假设 service 返回的是数据本身或包含数据的对象
  72. // 如果 resp 是 [err, res] 形式(取决于 handle 的具体实现),这里可能需要调整
  73. // 但根据 service 代码:return handle.catchPromiseNew(resp, () => resp);
  74. // 以及原 JS 代码:list: resp || []
  75. // 我们暂时保持一致
  76. // 观察 handle.catchPromiseNew 的常见行为,如果 resp 是 [null, data],回调返回 [null, data],那么最终返回 [null, data]
  77. // 但如果 service 层已经解构了,或者 handle 做了特殊处理。
  78. // 为了保险,我们可以打印一下,或者做一个简单的判断
  79. // 如果 resp 是数组,直接用;如果是对象且有 list 字段,用 list;否则用 resp
  80. if (Array.isArray(resp)) {
  81. list.value = resp;
  82. } else if (resp && Array.isArray(resp.list)) {
  83. list.value = resp.list;
  84. } else if (resp && Array.isArray(resp.List)) {
  85. list.value = resp.List;
  86. } else {
  87. list.value = resp || [];
  88. }
  89. } catch (e) {
  90. console.error(e);
  91. list.value = [];
  92. }
  93. };
  94. const itemClick = (item: any) => {
  95. const queryBean = JSON.stringify(item);
  96. common.goToUrl(`/pagesPatient/st1/business/outpatient/outpatientRefundDetail/outpatientRefundDetail?queryBean=${queryBean}`);
  97. };
  98. </script>
  99. <style scoped lang="scss">
  100. .container {
  101. height: 100vh;
  102. background-color: #f5f5f5;
  103. overflow-y: auto;
  104. }
  105. .record_box {
  106. background: white;
  107. margin: 30upx;
  108. border-radius: 24upx;
  109. }
  110. .header_time {
  111. height: 106upx;
  112. padding: 30upx;
  113. box-sizing: border-box;
  114. display: flex;
  115. flex-direction: row;
  116. justify-content: space-between;
  117. align-items: center;
  118. }
  119. .header_time text {
  120. font-size: 32upx;
  121. }
  122. .header_time text:nth-child(1) {
  123. color: #333;
  124. font-weight: bold;
  125. }
  126. .main_centent {
  127. padding: 30upx;
  128. box-sizing: border-box;
  129. }
  130. .record_info {
  131. margin-bottom: 30upx;
  132. display: flex;
  133. flex-direction: row;
  134. justify-content: space-between;
  135. align-items: center;
  136. }
  137. .record_info:last-child {
  138. margin-bottom: 0 !important;
  139. }
  140. .record_info text:nth-child(1) {
  141. width: 26%;
  142. display: inline-block;
  143. font-size: 30upx;
  144. color: #666;
  145. }
  146. .record_info text:nth-child(2) {
  147. width: 74%;
  148. display: inline-block;
  149. font-size: 30upx;
  150. color: #666;
  151. }
  152. .colorCustom {
  153. color: #007aff; // 假设 colorCustom 是蓝色,原代码没有定义 css 类,可能是全局样式。这里用蓝色代替,或者保留类名等待全局样式生效。
  154. // 原 wxss 中使用了 .colorCustom 但没有定义它?
  155. // 检查 wxss 文件:
  156. // .mr10 colorCustom ...
  157. // WXSS 文件中没有 .colorCustom 的定义!
  158. // 说明它是全局样式。
  159. // 在 scoped style 中,如果依赖全局样式,可能不生效,除非是 global.
  160. // 但 UniApp 的 App.vue 里的样式是全局的。
  161. // 这里保留类名即可。
  162. }
  163. .colorRed {
  164. color: red;
  165. }
  166. .mr10 {
  167. margin-right: 10upx;
  168. }
  169. .border_bottom {
  170. border-bottom: 1upx solid #eee;
  171. }
  172. </style>