index.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <!-- -->
  2. <template>
  3. <div class="app-container">
  4. <!-- 查询和其他操作 -->
  5. <div class="filter-container">
  6. <el-input v-model="listQuery.shopName" clearable size="mini" class="filter-item" style="width: 200px" placeholder="请输入店铺名称" />
  7. <el-input v-model="listQuery.shopCode" clearable size="mini" class="filter-item" style="width: 200px; margin-left: 10px" placeholder="请输入店铺编码" />
  8. <el-date-picker v-model="listQuery.startTime" type="date" value-format="yyyy-MM-dd" placeholder="选择日期" size="mini" class="filter-item" style="width: 200px; margin-left: 10px" />
  9. <el-select v-model="listQuery.state" clearable size="mini" class="filter-item" style="width: 200px; margin-left: 10px" placeholder="请选择处理状态">
  10. <el-option label="待处理" value="0" />
  11. <el-option label="已处理" value="1" />
  12. <el-option label="通过" value="2" />
  13. <el-option label="拒绝" value="3" />
  14. <el-option label="待确认" value="4" />
  15. </el-select>
  16. <el-button size="mini" class="filter-item" type="primary" icon="el-icon-search" style="margin-left: 10px" @click="handleSearch">查找</el-button>
  17. <el-button size="mini" type="info" class="filter-item" @click="handleReset">重置</el-button>
  18. </div>
  19. <!-- 查询结果 -->
  20. <div v-tableHeight>
  21. <el-table v-loading="listLoading" height="100%" element-loading-text="正在查询中。。。" :data="list" v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }">
  22. <el-table-column align="center" width="150" label="店铺名称" prop="shopName" show-overflow-tooltip />
  23. <el-table-column align="center" min-width="150" label="店铺编码" prop="shopCode" show-overflow-tooltip />
  24. <el-table-column align="center" min-width="150" label="提现类型" prop="withdrawalType">
  25. <template slot-scope="{ row }">
  26. <el-tag v-if="row.withdrawalType === 1" effect="plain" type="info">普通订单</el-tag>
  27. <el-tag v-else-if="row.withdrawalType === 2" effect="plain" type="success">交易金</el-tag>
  28. <el-tag v-else-if="row.withdrawalType === 3" effect="plain" type="success">代金券</el-tag>
  29. <el-tag v-else-if="row.withdrawalType === 4" effect="plain" type="success">余额支付</el-tag>
  30. <el-tag v-else-if="row.withdrawalType === 5" effect="plain" type="success"></el-tag>
  31. <el-tag v-else-if="row.withdrawalType === 31" effect="plain" type="warning">充值代金券</el-tag>
  32. <el-tag v-else-if="row.withdrawalType === 32" effect="plain" type="danger">兑换代金券(非兑换专区)</el-tag>
  33. <el-tag v-else-if="row.withdrawalType === 50" effect="plain" type="danger">联盟卡支付</el-tag>
  34. </template>
  35. </el-table-column>
  36. <el-table-column align="center" width="120" label="提现金额" prop="withdrawalMoney" show-overflow-tooltip />
  37. <el-table-column align="center" label="处理状态" prop="state">
  38. <template slot-scope="{ row }">
  39. <el-tag v-if="row.state === 0" effect="plain" type="info">待处理</el-tag>
  40. <el-tag v-else-if="row.state === 1" effect="plain" type="success">已处理</el-tag>
  41. <el-tag v-else-if="row.state === 2" effect="plain">通过</el-tag>
  42. <el-tag v-else-if="row.state === 3" effect="plain" type="warning">拒绝</el-tag>
  43. <el-tag v-else-if="row.state === 4" effect="plain" type="danger">待确认</el-tag>
  44. <span v-else>--</span>
  45. </template>
  46. </el-table-column>
  47. <el-table-column align="center" width="150" label="备注" prop="cause" show-overflow-tooltip />
  48. <el-table-column label="操作" width="180" fixed="right" class-name="small-padding fixed-width">
  49. <template slot-scope="{ row }">
  50. <el-button type="warning" size="mini" @click="handleDetail(row)">详情</el-button>
  51. <el-button v-if="row.state == 0 || row.state == 2" size="mini" @click="handleResolve(row)">处理</el-button>
  52. <el-button v-if="row.state == 4" type="text" @click="handleConfirmTong(row)">通联确认</el-button>
  53. </template>
  54. </el-table-column>
  55. </el-table>
  56. </div>
  57. <div>
  58. <el-pagination
  59. :current-page="listQuery.page"
  60. :page-sizes="[10, 20, 50, 100]"
  61. :page-size="listQuery.pageSize"
  62. layout="total, sizes, prev, pager, next, jumper"
  63. :total="total"
  64. @size-change="(val) => (listQuery.pageSize = val) && getList()"
  65. @current-change="(val) => (listQuery.page = val) && getList()"
  66. />
  67. </div>
  68. <!-- 提现处理 -->
  69. <WithdrawalProcessing ref="WithdrawalProcessing" @success="getList" />
  70. <!-- 查看详情 -->
  71. <DetailModal ref="DetailModal" />
  72. </div>
  73. </template>
  74. <script>
  75. import WithdrawalProcessing from './components/WithdrawalProcessing'
  76. import DetailModal from './components/DetailModal'
  77. import { withdrawalGetAll, updateWithdrawalByAllinpay } from '@/api/withdrawal'
  78. export default {
  79. name: 'Withdrawal',
  80. components: {
  81. WithdrawalProcessing,
  82. DetailModal
  83. },
  84. data() {
  85. return {
  86. listQuery: {
  87. shopName: '', // 店铺名称
  88. shopCode: '', // 店铺编号
  89. startTime: '', // 申请时间数组
  90. state: '', // 处理状态 1-已处理 0-未处理
  91. page: 1,
  92. pageSize: 10
  93. },
  94. list: [],
  95. total: 0,
  96. listLoading: true
  97. }
  98. },
  99. mounted() {
  100. this.getList()
  101. },
  102. methods: {
  103. async getList() {
  104. this.listLoading = true
  105. try {
  106. const res = await withdrawalGetAll(this.listQuery)
  107. this.list = res.data.list
  108. this.total = res.data.total
  109. } finally {
  110. this.listLoading = false
  111. }
  112. },
  113. handleSearch() {
  114. this.listQuery.page = 1
  115. this.getList()
  116. },
  117. handleReset() {
  118. this.listQuery = { shopName: '', shopCode: '', dates: [], state: '', page: 1, pageSize: 10 }
  119. this.getList()
  120. },
  121. handleDetail(row) {
  122. this.$refs.DetailModal && this.$refs.DetailModal.handleOpen(row)
  123. },
  124. handleResolve(row) {
  125. this.$refs.WithdrawalProcessing && this.$refs.WithdrawalProcessing.handleOpen(row)
  126. },
  127. handleConfirmTong(row) {
  128. this.$confirm('确定此项通联确认?')
  129. .then(async () => {
  130. await updateWithdrawalByAllinpay({ handleSn: row.handleSn, withdrawalId: row.withdrawalId })
  131. this.$message({ message: '操作成功!', type: 'success' })
  132. this.handleSearch()
  133. })
  134. .catch(() => {})
  135. }
  136. }
  137. }
  138. </script>
  139. <style lang="scss" scoped>
  140. .app-container {
  141. padding: 20px;
  142. display: flex;
  143. flex-direction: column;
  144. .filter-container {
  145. .filter-item {
  146. display: inline-block;
  147. vertical-align: middle;
  148. margin-bottom: 10px;
  149. }
  150. }
  151. .small-padding {
  152. .cell {
  153. padding-left: 5px;
  154. padding-right: 5px;
  155. }
  156. }
  157. .fixed-width {
  158. .el-button--mini {
  159. padding: 7px 10px;
  160. }
  161. }
  162. }
  163. </style>