TransferDetail.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <el-drawer
  3. :model-value="modelValue"
  4. title="转账记录详情"
  5. direction="rtl"
  6. size="500px"
  7. @close="handleClose"
  8. >
  9. <div v-loading="loading" class="transfer-detail">
  10. <el-descriptions :column="1" border>
  11. <el-descriptions-item label="商家订单号">
  12. {{ detailData.out_biz_no || '-' }}
  13. </el-descriptions-item>
  14. <el-descriptions-item label="支付宝转账单号">
  15. {{ detailData.order_no || '-' }}
  16. </el-descriptions-item>
  17. <el-descriptions-item label="企业ID">
  18. {{ detailData.enterprise_id || '-' }}
  19. </el-descriptions-item>
  20. <el-descriptions-item label="资金账户">
  21. {{ detailData.account_book_id || '-' }}
  22. </el-descriptions-item>
  23. <el-descriptions-item label="转账金额">
  24. <span class="amount">¥{{ detailData.amount || '0.00' }}</span>
  25. </el-descriptions-item>
  26. <el-descriptions-item label="转账标题">
  27. {{ detailData.order_title || '-' }}
  28. </el-descriptions-item>
  29. <el-descriptions-item label="状态">
  30. <el-tag :type="getStatusType(detailData.status)">
  31. {{ getStatusLabel(detailData.status) }}
  32. </el-tag>
  33. </el-descriptions-item>
  34. <el-descriptions-item label="创建时间">
  35. {{ detailData.created_time || '-' }}
  36. </el-descriptions-item>
  37. <el-descriptions-item label="更新时间">
  38. {{ detailData.updated_time || '-' }}
  39. </el-descriptions-item>
  40. </el-descriptions>
  41. <el-divider content-position="left">收款方信息</el-divider>
  42. <el-descriptions :column="1" border>
  43. <el-descriptions-item label="收款方类型">
  44. {{ getPayeeTypeLabel(detailData.payee_info?.identity_type) }}
  45. </el-descriptions-item>
  46. <el-descriptions-item label="收款方姓名">
  47. {{ detailData.payee_info?.name || '-' }}
  48. </el-descriptions-item>
  49. <el-descriptions-item label="收款方账号">
  50. {{ detailData.payee_info?.identity || '-' }}
  51. </el-descriptions-item>
  52. <template v-if="detailData.payee_info?.bankcard_ext_info">
  53. <el-descriptions-item label="账户类型">
  54. {{ detailData.payee_info.bankcard_ext_info.account_type === '1' ? '对公' : '对私' }}
  55. </el-descriptions-item>
  56. <el-descriptions-item label="银行名称">
  57. {{ detailData.payee_info.bankcard_ext_info.inst_name || '-' }}
  58. </el-descriptions-item>
  59. <el-descriptions-item label="开户省份">
  60. {{ detailData.payee_info.bankcard_ext_info.inst_province || '-' }}
  61. </el-descriptions-item>
  62. <el-descriptions-item label="开户城市">
  63. {{ detailData.payee_info.bankcard_ext_info.inst_city || '-' }}
  64. </el-descriptions-item>
  65. <el-descriptions-item label="支行名称">
  66. {{ detailData.payee_info.bankcard_ext_info.inst_branch_name || '-' }}
  67. </el-descriptions-item>
  68. <el-descriptions-item label="联行号">
  69. {{ detailData.payee_info.bankcard_ext_info.bank_code || '-' }}
  70. </el-descriptions-item>
  71. </template>
  72. </el-descriptions>
  73. </div>
  74. <template #footer>
  75. <div class="drawer-footer">
  76. <el-button @click="handleClose">关闭</el-button>
  77. <el-button type="primary" @click="handleRefresh">刷新</el-button>
  78. </div>
  79. </template>
  80. </el-drawer>
  81. </template>
  82. <script setup lang="ts">
  83. import AccountAPI from "@/api/module_payment/account";
  84. import { ref, watch } from "vue";
  85. const props = defineProps<{
  86. modelValue: boolean;
  87. outBizNo: string;
  88. }>();
  89. const emit = defineEmits<{
  90. (e: "update:modelValue", value: boolean): void;
  91. (e: "refresh"): void;
  92. }>();
  93. const loading = ref(false);
  94. const detailData = ref<any>({});
  95. watch(
  96. () => [props.modelValue, props.outBizNo],
  97. async ([val, outBizNo]) => {
  98. if (val && outBizNo) {
  99. await fetchDetail();
  100. }
  101. },
  102. { immediate: true }
  103. );
  104. async function fetchDetail() {
  105. if (!props.outBizNo) return;
  106. loading.value = true;
  107. try {
  108. const res = await AccountAPI.transferDetail(props.outBizNo);
  109. console.log(res);
  110. detailData.value = res.data.data || {};
  111. } catch (error) {
  112. console.error("获取转账详情失败:", error);
  113. } finally {
  114. loading.value = false;
  115. }
  116. }
  117. function getStatusType(status: string) {
  118. const map: Record<string, any> = {
  119. DEALING: "warning",
  120. SUCCESS: "success",
  121. FAIL: "danger",
  122. REFUND: "warning",
  123. };
  124. return map[status] || "info";
  125. }
  126. function getStatusLabel(status: string) {
  127. const map: Record<string, string> = {
  128. DEALING: "处理中",
  129. SUCCESS: "成功",
  130. FAIL: "失败",
  131. REFUND: "退票",
  132. };
  133. return map[status] || status;
  134. }
  135. function getPayeeTypeLabel(type: string) {
  136. const map: Record<string, string> = {
  137. ALIPAY_ACCOUNT: "支付宝账户",
  138. BANK_CARD: "银行卡",
  139. BOOK: "资金专户",
  140. };
  141. return map[type] || type;
  142. }
  143. function handleClose() {
  144. emit("update:modelValue", false);
  145. }
  146. function handleRefresh() {
  147. fetchDetail();
  148. emit("refresh");
  149. }
  150. </script>
  151. <style lang="scss" scoped>
  152. .transfer-detail {
  153. padding: 16px;
  154. .amount {
  155. font-size: 18px;
  156. font-weight: 600;
  157. color: #67c23a;
  158. }
  159. }
  160. .drawer-footer {
  161. display: flex;
  162. justify-content: flex-end;
  163. gap: 12px;
  164. }
  165. </style>