index.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <ContentWrap>
  3. <!-- 搜索工作栏 -->
  4. <el-form
  5. class="-mb-15px"
  6. :model="queryParams"
  7. ref="queryFormRef"
  8. :inline="true"
  9. label-width="100px"
  10. >
  11. <el-form-item label="支付订单编号" prop="payOrderId">
  12. <el-input
  13. v-model="queryParams.payOrderId"
  14. placeholder="请输入支付订单编号"
  15. clearable
  16. @keyup.enter="handleQuery"
  17. class="!w-240px"
  18. />
  19. </el-form-item>
  20. <el-form-item label="支付退款编号" prop="payRefundId">
  21. <el-input
  22. v-model="queryParams.payRefundId"
  23. placeholder="请输入支付退款编号"
  24. clearable
  25. @keyup.enter="handleQuery"
  26. class="!w-240px"
  27. />
  28. </el-form-item>
  29. <el-form-item label="是否已支付" prop="payStatus">
  30. <el-select
  31. v-model="queryParams.payStatus"
  32. placeholder="请选择是否已支付"
  33. clearable
  34. class="!w-240px"
  35. >
  36. <el-option
  37. v-for="(val, i) in payStatus"
  38. :key="i"
  39. :label="val.label"
  40. :value="val.value"
  41. />
  42. </el-select>
  43. </el-form-item>
  44. <el-form-item label="支付时间" prop="payTime">
  45. <el-date-picker
  46. v-model="queryParams.payTime"
  47. value-format="YYYY-MM-DD HH:mm:ss"
  48. type="daterange"
  49. start-placeholder="开始日期"
  50. end-placeholder="结束日期"
  51. :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
  52. class="!w-240px"
  53. />
  54. </el-form-item>
  55. <el-form-item>
  56. <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
  57. <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
  58. </el-form-item>
  59. </el-form>
  60. </ContentWrap>
  61. <ContentWrap>
  62. <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
  63. <el-table-column label="编号" align="center" prop="id" />
  64. <el-table-column label="用户实际到余额" align="center" prop="totalPrice">
  65. <template #default="scope">
  66. {{ fenToYuan(scope.row.totalPrice) }}
  67. </template>
  68. </el-table-column>
  69. <el-table-column label="实际支付金额" align="center" prop="payPrice">
  70. <template #default="scope">
  71. {{ fenToYuan(scope.row.payPrice) }}
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="钱包赠送金额" align="center" prop="bonusPrice">
  75. <template #default="scope">
  76. {{ fenToYuan(scope.row.bonusPrice) }}
  77. </template>
  78. </el-table-column>
  79. <el-table-column label="是否已支付" align="center" prop="payStatus">
  80. <template #default="scope">
  81. {{ scope.row.payStatus ? '已支付': '未支付' }}
  82. </template>
  83. </el-table-column>
  84. <el-table-column label="支付成功的支付渠道" align="center" prop="payChannelCode">
  85. <template #default="scope">
  86. <dict-tag :type="DICT_TYPE.PAY_CHANNEL_CODE" :value="scope.row.payChannelCode" />
  87. </template>
  88. </el-table-column>
  89. <el-table-column label="支付成功的外部订单号" align="center" prop="payOrderChannelOrderNo" />
  90. <el-table-column label="退款状态" align="center" prop="refundStatus">
  91. <template #default="scope">
  92. <dict-tag v-if="scope.row.payStatus && scope.row.refundStatus !== 0" :type="DICT_TYPE.PAY_REFUND_STATUS" :value="scope.row.refundStatus" />
  93. <span v-else></span>
  94. </template>
  95. </el-table-column>
  96. <el-table-column
  97. label="订单支付时间"
  98. align="center"
  99. prop="payTime"
  100. :formatter="dateFormatter"
  101. width="180px"
  102. />
  103. <el-table-column label="操作" align="center">
  104. <template #default="scope">
  105. <el-button v-if="scope.row.payStatus" link type="danger" @click="handleRefund(scope.row)">发起退款</el-button>
  106. </template>
  107. </el-table-column>
  108. </el-table>
  109. <!-- 分页 -->
  110. <Pagination
  111. :total="total"
  112. v-model:page="queryParams.pageNo"
  113. v-model:limit="queryParams.pageSize"
  114. @pagination="getList"
  115. />
  116. </ContentWrap>
  117. </template>
  118. <script lang="ts" setup>
  119. import { dateFormatter } from '@/utils/formatTime'
  120. import { DICT_TYPE } from '@/utils/dict'
  121. import { fenToYuan } from '@/utils'
  122. import { getWalletRechargePage, refundWalletRechargeOrder } from '@/api/pay/wallet/rechargeRecord'
  123. defineOptions({ name: 'CurrencyRechargeList' })
  124. const message = useMessage() // 消息弹窗
  125. const loading = ref(true) // 列表的加载中
  126. const total = ref(0) // 列表的总页数
  127. const queryParams = reactive({
  128. pageNo: 1,
  129. pageSize: 10,
  130. payTime: null,
  131. payStatus: null,
  132. payRefundId: null,
  133. payOrderId: null,
  134. packageId: null,
  135. currencyId: null,
  136. payChannelCode: null
  137. })
  138. const payStatus = ref([
  139. { label: '已支付', value: true },
  140. { label: '未支付', value: false }
  141. ])
  142. const queryFormRef = ref()
  143. const list = ref([]) // 列表的数据
  144. /** 查询列表 */
  145. const getList = async () => {
  146. loading.value = true
  147. try {
  148. const data = await getWalletRechargePage(queryParams)
  149. list.value = data.list
  150. total.value = data.total
  151. } finally {
  152. loading.value = false
  153. }
  154. }
  155. /** 退款按钮操作 */
  156. const handleRefund = async (row: any) => {
  157. const id = row.id
  158. try {
  159. await message.confirm('是否确认退款编号为"' + id + '"的订单?')
  160. await refundWalletRechargeOrder(id)
  161. await getList()
  162. message.success('发起退款成功!')
  163. } catch {}
  164. }
  165. /** 搜索按钮操作 */
  166. const handleQuery = () => {
  167. queryParams.pageNo = 1
  168. getList()
  169. }
  170. /** 重置按钮操作 */
  171. const resetQuery = () => {
  172. queryFormRef.value.resetFields()
  173. handleQuery()
  174. }
  175. /** 初始化 **/
  176. onMounted(() => {
  177. getList()
  178. })
  179. </script>