outpatientRefund.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <view class="container">
  3. <view class="content" v-if="showCon">
  4. <userInfo :userInfo="currentUser" bgClass="bgLinGra"></userInfo>
  5. <view class="content_inner">
  6. <view class="public_info_list">
  7. <view class="public_info_item border_bottom displayFlexLeft">
  8. <view class="public_info_tit">可退金额</view>
  9. <view class="public_info_val colorRed">{{info.RefundableBalance/100}}元</view>
  10. <view class="public_info_remark">(通过微信公众号缴纳的预交金余额)</view>
  11. </view>
  12. <view class="public_info_item border_bottom displayFlexLeft">
  13. <view class="public_info_tit">就诊卡金额</view>
  14. <view class="public_info_val">{{info.Balance/100}}元</view>
  15. </view>
  16. <view class="public_info_item" @click="toDetails">
  17. <view class="public_info_tit">退款记录</view>
  18. <image class="public_right_img" :src="iconUrl.icon_right"></image>
  19. </view>
  20. </view>
  21. <view class="text_tip">
  22. <text>*温馨提示:</text>
  23. <text>1、退款金额将采用原路退还的方式,通过原缴费渠道(微信零钱包、银行卡),退还至您的初始支付账户(微信、银行账户),退款到账时间约为1-3个工作日</text>
  24. <text>2、可退金额:3个月内通过微信公众号缴纳的门诊预交金,经门诊结算后的剩余部分</text>
  25. <text>3、非通过微信公众号缴纳预交金的,请携带就诊卡本人有效身份证件、代办人有效身份证件及缴款凭据等资料前往门诊收费处办理退款手续。</text>
  26. <text>4、换卡、冻结、挂失卡不支持此渠道退款。</text>
  27. </view>
  28. </view>
  29. <view class="content_btn backgroundCustom" @click="refund">申请退款</view>
  30. </view>
  31. </view>
  32. </template>
  33. <script setup lang="ts">
  34. import { ref } from 'vue';
  35. import { onShow } from '@dcloudio/uni-app';
  36. import common from '@/utils/common';
  37. import icon from '@/utils/icon';
  38. import userInfo from '@/pagesPersonal/st1/components/userInfo/userInfo.vue';
  39. import { queryMemberRefundableMoney, applySelfServiceRefund } from '@/pagesPatient/service/outpatient/index';
  40. const app = getApp();
  41. const iconUrl = icon;
  42. const info = ref<any>({});
  43. const showCon = ref(false);
  44. const currentUser = ref<any>({});
  45. const startkey = ref<any>(undefined);
  46. onShow(() => {
  47. currentUser.value = app.globalData.currentUser;
  48. main();
  49. });
  50. const main = async () => {
  51. let user = currentUser.value;
  52. let queryData = {
  53. CardNo: user.cardNo,
  54. CardType: user.cardType,
  55. HisMemberId: user.hisMemberId,
  56. MemberId: user.memberId,
  57. Store: {
  58. cardEncryptionStore: user.encryptionStore || '',
  59. baseMemberEncryptionStore: user.baseMemberEncryptionStore
  60. }
  61. };
  62. let resp = await queryMemberRefundableMoney(queryData);
  63. let infoData: any = {};
  64. if (!common.isEmpty(resp)) {
  65. infoData = resp[0];
  66. }
  67. if (user.cardType == '1') {
  68. if (common.idCodeValid(user.cardNo).pass) {
  69. infoData.Balance = '0';
  70. infoData.RefundableBalance = '0';
  71. startkey.value = '0';
  72. }
  73. }
  74. info.value = infoData;
  75. showCon.value = true;
  76. };
  77. /**
  78. * 退费
  79. */
  80. const refund = () => {
  81. let infoData = info.value;
  82. let user = currentUser.value;
  83. if (infoData.RefundableBalance == 0) {
  84. common.showModal(`可退金额为0`);
  85. return;
  86. }
  87. common.showModal(`¥${infoData.RefundableBalance / 100}`, async () => {
  88. let queryData = {
  89. CardNo: user.cardNo,
  90. CardType: user.cardType,
  91. HisMemberId: user.hisMemberId,
  92. MemberId: user.memberId,
  93. RefundableBalance: infoData.RefundableBalance,
  94. Page: {
  95. PIndex: 0,
  96. PSize: 1
  97. }
  98. };
  99. let result = await applySelfServiceRefund(queryData);
  100. // Note: The original code destructured {resp, resData}, but handle.promistHandleNew typically returns just the response body or similar.
  101. // However, looking at handle.promistHandleNew implementation (based on knowledge/memories), it returns [err, res].
  102. // But the service layer wrapper I saw:
  103. // let resp = handle.promistHandleNew(...)
  104. // return handle.catchPromiseNew(resp, () => resp)
  105. // catchPromiseNew usually returns the data if success.
  106. // In original code: let {resp,resData} = await outpatient.applySelfServiceRefund(queryData)
  107. // This suggests the service might have returned an object with resp and resData, OR the original code was using a different service wrapper.
  108. // In the new service/outpatient/index.ts:
  109. // return handle.catchPromiseNew(resp, () => resp);
  110. // This typically returns the `data` part of the response.
  111. // If the API returns { RespCode: "10000", ... }, then `result` will be that object.
  112. // Let's assume result contains RespCode.
  113. // Wait, the original code: let {resp,resData} = await outpatient.applySelfServiceRefund(queryData)
  114. // This destructuring looks suspicious if the service returns a standard response.
  115. // If the service returns `handle.catchPromiseNew(...)`, it usually returns the data directly.
  116. // If `resData` is what we need, maybe the original service returned `{resp, resData}`.
  117. // But the new service I see just returns `resp`.
  118. // Let's assume `result` is the response data and check `result.RespCode`.
  119. if (result && result.RespCode == "10000") {
  120. common.goToUrl(`/pagesPatient/st1/business/pay/payState/payState?isSuccess=true&pageType=refund`);
  121. }
  122. }, {
  123. confirmText: '确认退款',
  124. cancelText: '取消',
  125. title: '温馨提示'
  126. });
  127. };
  128. const toDetails = () => {
  129. common.goToUrl(`/pagesPatient/st1/business/outpatient/outpatientRefundRecord/outpatientRefundRecord?startkey=${startkey.value}`);
  130. };
  131. </script>
  132. <style lang="scss" scoped>
  133. .public_info_list{
  134. background-color: #fff;
  135. margin: 32upx;
  136. border-radius: 24upx;
  137. padding: 0 24upx;
  138. }
  139. .public_info_item {
  140. position: relative;
  141. padding: 40upx 0;
  142. margin: 0;
  143. }
  144. .public_info_tit {
  145. font-size: 32upx;
  146. font-weight: 400;
  147. color: rgba(0, 0, 0, 1);
  148. width: 160upx;
  149. }
  150. .public_info_val {
  151. font-size: 32upx;
  152. font-weight: 400;
  153. color: rgba(85, 85, 85, 1);
  154. }
  155. .public_info_remark {
  156. font-size: 23upx;
  157. font-weight: 400;
  158. color: rgba(85, 85, 85, 1);
  159. line-height:44upx
  160. }
  161. .text_tip {
  162. margin: 55upx 30upx 30upx;
  163. font-size: 30upx;
  164. font-family: PingFang SC;
  165. color: rgba(153, 153, 153, 1);
  166. }
  167. .text_tip text {
  168. display: inline-block;
  169. line-height: 45upx;
  170. }
  171. .content_btn {
  172. width: 100%;
  173. height: 98upx;
  174. line-height: 98upx;
  175. text-align: center;
  176. font-size: 36upx;
  177. font-weight: 500;
  178. color: rgba(255, 255, 255, 1);
  179. position: fixed;
  180. bottom: 0;
  181. }
  182. </style>