index.vue 5.6 KB

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