withdrawApply.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. <template>
  2. <div class="search">
  3. <Row>
  4. <Col>
  5. <Card>
  6. <Row @keydown.enter.native="handleSearch">
  7. <Form
  8. ref="searchForm"
  9. :model="searchForm"
  10. inline
  11. :label-width="70"
  12. class="search-form"
  13. >
  14. <Form-item label="会员名称" prop="memberName">
  15. <Input
  16. type="text"
  17. v-model="searchForm.memberName"
  18. placeholder="请输入会员名称"
  19. clearable
  20. style="width: 200px"
  21. />
  22. </Form-item>
  23. <Form-item label="审核状态" prop="applyStatus">
  24. <Select
  25. v-model="searchForm.memberName"
  26. clearable
  27. style="width: 200px"
  28. >
  29. <Option value="APPLY">申请中</Option>
  30. <Option value="VIA_AUDITING">审核通过(提现成功)</Option>
  31. <Option value="FAIL_AUDITING">审核拒绝</Option>
  32. </Select>
  33. </Form-item>
  34. <Form-item label="申请时间">
  35. <DatePicker
  36. v-model="selectDate"
  37. type="datetimerange"
  38. format="yyyy-MM-dd HH:mm:ss"
  39. clearable
  40. @on-change="selectDateRange"
  41. placeholder="选择起始时间"
  42. style="width: 200px"
  43. ></DatePicker>
  44. </Form-item>
  45. <Form-item style="margin-left: -35px" class="br">
  46. <Button @click="handleSearch" type="primary" icon="ios-search"
  47. >搜索
  48. </Button
  49. >
  50. </Form-item>
  51. </Form>
  52. </Row>
  53. <Row class="padding-row">
  54. <Table
  55. :loading="loading"
  56. border
  57. :columns="columns"
  58. :data="data"
  59. ref="table"
  60. sortable="custom"
  61. @on-sort-change="changeSort"
  62. @on-selection-change="changeSelect"
  63. ></Table>
  64. </Row>
  65. <Row type="flex" justify="end" class="page">
  66. <Page
  67. :current="searchForm.pageNumber"
  68. :total="total"
  69. :page-size="searchForm.pageSize"
  70. @on-change="changePage"
  71. @on-page-size-change="changePageSize"
  72. :page-size-opts="[10, 20, 50]"
  73. size="small"
  74. show-total
  75. show-elevator
  76. show-sizer
  77. ></Page>
  78. </Row>
  79. </Card>
  80. </Col>
  81. </Row>
  82. <Modal
  83. :title="modalTitle"
  84. v-model="roleModalVisible"
  85. :mask-closable="false"
  86. :width="500"
  87. >
  88. <Form
  89. :label-width="80"
  90. >
  91. <FormItem label="申请编号">
  92. <span>{{showList.sn}}</span>
  93. </FormItem>
  94. <FormItem label="用户名称">
  95. <span>{{showList.memberName}}</span>
  96. </FormItem>
  97. <FormItem label="申请金额">
  98. <span>{{showList.applyMoney}}</span>
  99. </FormItem>
  100. <FormItem label="提现状态">
  101. <span>{{showList.applyStatus | paramTypeFilter}}</span>
  102. </FormItem>
  103. <FormItem label="申请时间">
  104. <span>{{showList.createTime}}</span>
  105. </FormItem>
  106. <FormItem label="审核备注">
  107. <Input v-model="audit"/>
  108. </FormItem>
  109. </Form>
  110. <div slot="footer" v-if="showList.applyStatus == 'APPLY'">
  111. <Button type="text" @click="submitRole(false)">拒绝</Button>
  112. <Button type="primary" :loading="submitLoading" @click="submitRole(true)"
  113. >通过
  114. </Button
  115. >
  116. </div>
  117. </Modal>
  118. <Modal
  119. :title="modalTitle"
  120. v-model="queryModalVisible"
  121. :mask-closable="false"
  122. :width="500"
  123. >
  124. <Form
  125. :label-width="80"
  126. >
  127. <FormItem label="申请编号">
  128. <span>{{showList.sn}}</span>
  129. </FormItem>
  130. <FormItem label="用户名称">
  131. <span>{{showList.memberName}}</span>
  132. </FormItem>
  133. <FormItem label="申请金额">
  134. <span>{{showList.applyMoney}}</span>
  135. </FormItem>
  136. <FormItem label="提现状态">
  137. <span>{{showList.applyStatus | paramTypeFilter}}</span>
  138. </FormItem>
  139. <FormItem label="申请时间">
  140. <span>{{showList.createTime}}</span>
  141. </FormItem>
  142. <FormItem label="审核时间">
  143. <span>{{showList.inspectTime}}</span>
  144. </FormItem>
  145. </Form>
  146. <div slot="footer" v-if="showList.applyStatus == 'APPLY'">
  147. <Button type="text" @click="submitRole(false)">拒绝</Button>
  148. <Button type="primary" :loading="submitLoading" @click="submitRole(true)"
  149. >通过
  150. </Button
  151. >
  152. </div>
  153. <div slot="footer" v-else>
  154. <Button type="text" @click="queryModalVisible = false">取消</Button>
  155. </div>
  156. </Modal>
  157. </div>
  158. </template>
  159. <script>
  160. import {
  161. getUserWithdrawApply,
  162. withdrawApply
  163. } from "@/api/member";
  164. export default {
  165. name: "withdrawApply",
  166. components: {},
  167. data() {
  168. return {
  169. modalTitle: "", //弹出框标题
  170. openSearch: true, // 显示搜索
  171. openTip: true, // 显示提示
  172. loading: true, // 表单加载状态
  173. audit: '', // 审核备注
  174. roleModalVisible: false, // 审核模态框
  175. queryModalVisible: false, // 审核模态框
  176. searchForm: {
  177. // 搜索框初始化对象
  178. pageNumber: 1, // 当前页数
  179. pageSize: 10, // 页面大小
  180. sort: "createTime", // 默认排序字段
  181. order: "desc", // 默认排序方式
  182. startDate: "", // 起始时间
  183. endDate: "", // 终止时间
  184. memberName: "",
  185. applyStatus: ""
  186. },
  187. selectDate: null, // 选择时间段
  188. submitLoading: false, // 添加或编辑提交状态
  189. selectList: [], // 多选数据
  190. selectCount: 0, // 多选计数
  191. showList: {}, // 可操作选项
  192. columns: [
  193. {
  194. title: "申请编号",
  195. key: "sn",
  196. align: "left",
  197. tooltip: true
  198. },
  199. {
  200. title: "用户名称",
  201. key: "memberName",
  202. align: "left",
  203. tooltip: true
  204. },
  205. {
  206. title: "申请金额",
  207. key: "applyMoney",
  208. align: "left",
  209. width: 120,
  210. },
  211. {
  212. title: "提现状态",
  213. align: "left",
  214. key: "applyStatus",
  215. width: 120,
  216. render: (h, params) => {
  217. if (params.row.applyStatus == "APPLY") {
  218. return h('div', [
  219. h('span', {}, '申请中'),
  220. ]);
  221. } else if (params.row.applyStatus == "VIA_AUDITING") {
  222. return h('div', [
  223. h('span', {}, '审核通过'),
  224. ]);
  225. } else if (params.row.applyStatus == "SUCCESS") {
  226. return h('div', [
  227. h('span', {}, '提现成功'),
  228. ]);
  229. } else {
  230. return h('div', [
  231. h('span', {}, '审核拒绝'),
  232. ]);
  233. }
  234. },
  235. },
  236. {
  237. title: "申请时间",
  238. key: "createTime",
  239. align: "left",
  240. width: 170
  241. },
  242. {
  243. title: "审核时间",
  244. key: "inspectTime",
  245. align: "left",
  246. width: 170
  247. }, {
  248. title: "操作",
  249. key: "action",
  250. width: 120,
  251. align: "center",
  252. fixed: "right",
  253. render: (h, params) => {
  254. if (params.row.applyStatus == 'APPLY') {
  255. return h(
  256. "Button",
  257. {
  258. props: {
  259. type: "success",
  260. size: "small"
  261. },
  262. style: {
  263. marginRight: "5px"
  264. },
  265. on: {
  266. click: () => {
  267. this.showList = {}
  268. this.roleModalVisible = true;
  269. this.showList = params.row
  270. }
  271. }
  272. },
  273. "审核"
  274. );
  275. } else {
  276. return h(
  277. "Button",
  278. {
  279. props: {
  280. type: "primary",
  281. size: "small"
  282. },
  283. style: {
  284. marginRight: "5px",
  285. },
  286. on: {
  287. click: () => {
  288. this.showList = {}
  289. this.queryModalVisible = true;
  290. this.showList = params.row
  291. this.modalTitle = "查看"
  292. }
  293. }
  294. },
  295. "查看"
  296. );
  297. }
  298. }
  299. }
  300. ],
  301. data: [], // 表单数据
  302. total: 0, // 表单数据总数
  303. };
  304. },
  305. filters: {
  306. paramTypeFilter(val) {
  307. if (val === 'APPLY') {
  308. return '申请中'
  309. } else if (val === 'VIA_AUDITING') {
  310. return '审核通过(提现成功)'
  311. } else if (val === 'FAIL_AUDITING') {
  312. return '审核拒绝'
  313. } else {
  314. return '未知状态'
  315. }
  316. }
  317. },
  318. methods: {
  319. submitRole(res) {
  320. const params = {}
  321. params.apply_id = this.showList.id
  322. params.result = res
  323. params.remark = this.audit
  324. if (res === false && params.remark === '') {
  325. this.$Message.error("审核备注不能为空");
  326. return
  327. }
  328. withdrawApply(params).then((res) => {
  329. this.loading = false;
  330. if (res == true) {
  331. this.$Message.success("操作成功");
  332. this.roleModalVisible = false;
  333. this.getDataList();
  334. }
  335. });
  336. },
  337. init() {
  338. this.getDataList();
  339. },
  340. changePage(v) {
  341. this.searchForm.pageNumber = v;
  342. this.getDataList();
  343. this.clearSelectAll();
  344. },
  345. changePageSize(v) {
  346. this.searchForm.pageSize = v;
  347. this.getDataList();
  348. },
  349. handleSearch() {
  350. this.searchForm.pageNumber = 1;
  351. this.searchForm.pageSize = 10;
  352. this.getDataList();
  353. },
  354. handleReset() {
  355. this.$refs.searchForm.resetFields();
  356. this.searchForm.pageNumber = 1;
  357. this.searchForm.pageSize = 10;
  358. this.selectDate = null;
  359. this.searchForm.startDate = "";
  360. this.searchForm.endDate = "";
  361. this.searchForm.memberName = "";
  362. // 重新加载数据
  363. this.getDataList();
  364. },
  365. changeSort(e) {
  366. this.searchForm.sort = e.key;
  367. this.searchForm.order = e.order;
  368. if (e.order === "normal") {
  369. this.searchForm.order = "";
  370. }
  371. this.getDataList();
  372. },
  373. clearSelectAll() {
  374. this.$refs.table.selectAll(false);
  375. },
  376. changeSelect(e) {
  377. this.selectList = e;
  378. this.selectCount = e.length;
  379. },
  380. selectDateRange(v) {
  381. if (v) {
  382. this.searchForm.startDate = v[0];
  383. this.searchForm.endDate = v[1];
  384. }
  385. },
  386. getDataList() {
  387. this.loading = true;
  388. // 带多条件搜索参数获取表单数据 请自行修改接口
  389. getUserWithdrawApply(this.searchForm).then((res) => {
  390. this.loading = false;
  391. if (res.success) {
  392. this.data = res.result.records;
  393. this.total = res.result.total;
  394. }
  395. });
  396. this.total = this.data.length;
  397. this.loading = false;
  398. },
  399. },
  400. mounted() {
  401. this.init();
  402. },
  403. };
  404. </script>
  405. <style lang="scss" scoped>
  406. // 建议引入通用样式 可删除下面样式代码
  407. @import "@/styles/table-common.scss";
  408. </style>