withdrawApply.vue 11 KB

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