index.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. <template>
  2. <div class="custom_page">
  3. <div class="content">
  4. <!-- 顶部搜索 -->
  5. <div class="toolbar">
  6. <!-- 顶部搜索 -->
  7. <el-form :inline="true" :model="formInline">
  8. <el-form-item label="用户名称">
  9. <el-input v-model="formInline.name" maxlength="20" placeholder="请输入" />
  10. </el-form-item>
  11. <el-form-item label="手机号">
  12. <el-input v-model="formInline.phone" maxlength="11" placeholder="请输入" />
  13. </el-form-item>
  14. <el-form-item label="提现状态">
  15. <el-select v-model="formInline.state" placeholder="请选择">
  16. <el-option label="全部" :value="null" />
  17. <el-option label="待审核" value="0" />
  18. <el-option label="打款中" value="1" />
  19. <el-option label="拒绝" value="2" />
  20. <el-option label="打款成功" value="3" />
  21. <el-option label="打款失败" value="4" />
  22. </el-select>
  23. </el-form-item>
  24. <el-form-item label-width="0">
  25. <el-button type="primary" plain @click="search">查询</el-button>
  26. <el-button plain @click="clear">重置</el-button>
  27. </el-form-item>
  28. </el-form>
  29. </div>
  30. <!-- 表格 -->
  31. <div class="content_table">
  32. <div class="table">
  33. <el-table :data="tableData" border :header-cell-style="{ background: '#EEF3FF', color: '#333333' }"
  34. style="width: 100%">
  35. >
  36. <el-table-column prop="orderSn" label="流水号"></el-table-column>
  37. <el-table-column prop="name" label="用户名称" />
  38. <el-table-column prop="phone" label="手机号码" />
  39. <el-table-column prop="withdrawalMoney" label="提现金额" />
  40. <el-table-column prop="cost" label="手续费"></el-table-column>
  41. <el-table-column label="处理状态">
  42. <template slot-scope="scope">
  43. <span v-if="scope.row.state == 0">审核中</span>
  44. <span v-if="scope.row.state == 1">打款中</span>
  45. <span v-if="scope.row.state == 2">拒绝</span>
  46. <span v-if="scope.row.state == 3">打款成功</span>
  47. <span v-if="scope.row.state == 4">打款失败</span>
  48. </template>
  49. </el-table-column>
  50. <el-table-column label="操作" show-overflow-tooltip>
  51. <template slot-scope="scope">
  52. <div class="btnList">
  53. <el-button v-if="scope.row.state !== 0" type="text" @click="seeMore(scope.row)">查看</el-button>
  54. <el-button v-else type="text" @click="del(scope.row)">处理</el-button>
  55. </div>
  56. </template>
  57. </el-table-column>
  58. </el-table>
  59. <div class="fenye">
  60. <el-pagination :current-page="currentPage" :page-sizes="[10, 20, 50, 100]" :page-size="10"
  61. layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handleSizeChange"
  62. @current-change="handleCurrentChange" />
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. <!-- *****************弹框开始***************** -->
  68. <!-- 详情弹框 -->
  69. <el-dialog :visible.sync="dioObj.show" :title="dioObj.title" width="40%" center :close-on-click-modal="false" @close="closeDialog">
  70. <div class="box">
  71. <div class="dioBox">
  72. <div v-for="(item, index) in infoList" :key="index" class="inner">{{ item.name }}:{{ item.value }}</div>
  73. </div>
  74. <div v-if="dioObj.type === 2" class="botTitle">*请确认您已转账成功,再点击确认</div>
  75. </div>
  76. <span slot="footer" class="dialog-footer">
  77. <el-button v-if="dioObj.type === 2" type="primary" @click="agreeEn(1)">{{ confirmInfo }}</el-button>
  78. <el-button v-if="dioObj.type === 2" type="danger" @click="agreeEn(2)">拒绝打款</el-button>
  79. <el-button v-if="dioObj.type === 1" @click="closeDialog">关 闭</el-button>
  80. </span>
  81. </el-dialog>
  82. </div>
  83. </template>
  84. <script>
  85. // import { getShopId } from '@/utils/auth'
  86. import { hidden } from '@/utils/index'
  87. import {
  88. applicationGetAll,
  89. applicationGetById,
  90. applicationHandle
  91. } from '@/api/application'
  92. export default {
  93. data() {
  94. return {
  95. formInline: {
  96. name: '', // 用户名称
  97. phone: '', // 手机号码
  98. state: null, // 提现状态 空-全部 0-待审核 1-通过 2-拒绝
  99. page: 1,
  100. pageSize: 10
  101. },
  102. total: 1,
  103. tableData: [],
  104. infoList: [
  105. { name: '手机号码', value: '', fields: 'phone' },
  106. { name: '银行名称', value: '', fields: 'bankName' },
  107. { name: '银行卡号', value: '', fields: 'bankCard' },
  108. { name: '收款人姓名', value: '', fields: 'name' },
  109. { name: '提现金额', value: '', fields: 'withdrawalMoney' },
  110. { name: "实际到账", value: '', fields: "actualReceipt" },
  111. { name: '申请时间', value: '', fields: 'applyTime' },
  112. { name: '处理时间', value: '', fields: 'handleTime' }
  113. ],
  114. currentPage: 1,
  115. multipleSelection: [],
  116. dioObj: {},
  117. // 拒绝打款理由
  118. rejectReason: "",
  119. // 控制确认信息和确认打款
  120. confirmInfo:"确认信息"
  121. }
  122. },
  123. created() {
  124. this.getAll(this.formInline)
  125. },
  126. methods: {
  127. handleSizeChange(val) {
  128. this.formInline.pageSize = val
  129. this.getAll(this.formInline)
  130. },
  131. handleCurrentChange(val) {
  132. this.formInline.page = val
  133. this.getAll(this.formInline)
  134. },
  135. handleSelectionChange(val) {
  136. this.multipleSelection = val
  137. },
  138. // 查询
  139. search() {
  140. this.total = 1
  141. this.formInline.page = 1
  142. this.getAll(this.formInline)
  143. },
  144. // 清除
  145. clear() {
  146. this.formInline = {
  147. name: '', // 用户名称
  148. phone: '', // 手机号码
  149. state: null, // 提现状态 空-全部 0-待审核 1-通过 2-拒绝
  150. page: 1,
  151. pageSize: 10
  152. }
  153. this.getAll(this.formInline)
  154. },
  155. getTopList(o) {
  156. this.infoList.map((item) => {
  157. item.value = o[item.fields]
  158. })
  159. },
  160. // 查看
  161. seeMore(row) {
  162. this.dioObj = {
  163. title: '查看',
  164. show: true,
  165. arr: row,
  166. type: 1
  167. }
  168. this.getDetails(row.withdrawalId)
  169. },
  170. // 处理
  171. del(row) {
  172. this.dioObj = {
  173. title: '处理',
  174. show: true,
  175. arr: row,
  176. type: 2
  177. }
  178. this.getDetails(row.withdrawalId)
  179. },
  180. // 确认
  181. async agreeEn(index) {
  182. if (index === 1 && this.confirmInfo == "确认信息") {
  183. const res = await applicationHandle({
  184. withdrawalId: this.dioObj.arr.withdrawalId,
  185. state: 1
  186. });
  187. this.$message.success('确认信息成功,请确认打款')
  188. this.confirmInfo = "确认打款";
  189. }else if(index === 1 && this.confirmInfo == "确认打款"){
  190. const res = await applicationHandle({
  191. withdrawalId: this.dioObj.arr.withdrawalId,
  192. state: 3
  193. });
  194. if (res.code === '') {
  195. this.$message.success('确认打款成功')
  196. this.dioObj.show = false
  197. this.getAll(this.formInline)
  198. }
  199. } else if (index === 2) {
  200. if (this.rejectReason == "") {
  201. this.$prompt('请输入拒绝打款理由', '提示', {
  202. confirmButtonText: '确定',
  203. cancelButtonText: '取消',
  204. inputPattern: /^\s*[\S]+\s*$/,
  205. inputErrorMessage: '输入的拒绝打款理由不能为空!!!'
  206. }).then(({ value }) => {
  207. this.rejectReason = value
  208. // console.log(value);
  209. this.infoList.push({ name: "拒绝打款理由", value: value, fields: 'rejectReason' })
  210. }).catch(() => {
  211. this.rejectReason = ""
  212. });
  213. return false
  214. }
  215. const res = await applicationHandle({
  216. withdrawalId: this.dioObj.arr.withdrawalId,
  217. state: 2,
  218. rejectReason: this.rejectReason
  219. })
  220. if (res.code === '') {
  221. this.$message.success('成功拒绝打款')
  222. this.dioObj.show = false
  223. this.getAll(this.formInline)
  224. }
  225. }
  226. },
  227. // 查询详情
  228. async getDetails(withdrawalId) {
  229. const res = await applicationGetById({ withdrawalId })
  230. if (res.code === '') {
  231. this.details = res.data
  232. this.getTopList(res.data)
  233. }
  234. // 判断是不是有拒绝打款理由
  235. if (res.data.rejectReason && res.data.state == 2) {
  236. this.infoList.push({ name: "拒绝打款理由", value: res.data.rejectReason, fields: 'rejectReason' })
  237. }
  238. },
  239. // 初始化查询所有数据
  240. async getAll(formInline) {
  241. const res = await applicationGetAll(formInline)
  242. this.tableData = res.data.list
  243. this.tableData.forEach((item) => {
  244. item.phone = hidden(item.phone, 3, 4)
  245. })
  246. this.total = res.data.total
  247. },
  248. // 关闭弹窗的回调
  249. closeDialog() {
  250. this.dioObj.show = false
  251. this.rejectReason = ""
  252. this.infoList = this.infoList.filter(item => item.fields != 'rejectReason');
  253. }
  254. }
  255. }
  256. </script>
  257. <style lang='scss' scoped>
  258. @import url("../../../styles/elDialog.scss");
  259. .custom_page {
  260. padding: 20px;
  261. }
  262. .box {
  263. .dioBox {
  264. display: flex;
  265. justify-content: flex-start;
  266. align-items: center;
  267. flex-wrap: wrap;
  268. .inner {
  269. width: 50%;
  270. padding: 20px;
  271. }
  272. }
  273. .botTitle {
  274. color: red;
  275. text-align: center;
  276. }
  277. }
  278. </style>