index.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <div id="card-1">
  3. <el-row>
  4. <el-col
  5. :span="24"
  6. class="main animate__animated animate__backInRight"
  7. v-loading="loadings"
  8. element-loading-text="拼命加载中"
  9. element-loading-spinner="el-icon-loading"
  10. >
  11. <el-col :span="24" class="one"> <span>提现审核</span> </el-col>
  12. <el-col :span="24" class="two">
  13. <search-1 :form="searchForm" :statusList="statusList" @onSubmit="search" @toReset="toClos"> </search-1>
  14. </el-col>
  15. <el-col :span="24" class="four">
  16. <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @exam="toExam"> </data-table>
  17. </el-col>
  18. </el-col>
  19. </el-row>
  20. <e-dialog :dialog="dialog" @toClose="toClose">
  21. <template v-slot:info>
  22. <data-form :span="24" :fields="fieldsForm" :rules="fieldRules" v-model="fieldform" labelWidth="150px" @save="onSubmit">
  23. <template #status>
  24. <el-option v-for="i in statusList" :key="i.model" :label="i.label" :value="i.value"></el-option>
  25. </template>
  26. </data-form>
  27. </template>
  28. </e-dialog>
  29. </div>
  30. </template>
  31. <script>
  32. const _ = require('lodash');
  33. const moment = require('moment');
  34. import { mapState, createNamespacedHelpers } from 'vuex';
  35. const { mapActions } = createNamespacedHelpers('cashOut');
  36. const { mapActions: dictData } = createNamespacedHelpers('dictData');
  37. export default {
  38. name: 'card-1',
  39. props: {},
  40. components: { search1: () => import('./parts/search-1.vue') },
  41. data: function () {
  42. const that = this;
  43. return {
  44. loadings: true,
  45. searchForm: {},
  46. list: [],
  47. total: 0,
  48. opera: [{ label: '审核', method: 'exam' }],
  49. fields: [
  50. { label: '申请人姓名', model: 'customer.name' },
  51. { label: '提现金额', model: 'money' },
  52. { label: '申请时间', model: 'apply_time' },
  53. {
  54. label: '审核状态',
  55. model: 'status',
  56. format: (i) => {
  57. let data = this.statusList.find((f) => f.value == i);
  58. if (data) return data.label;
  59. else return '暂无';
  60. },
  61. },
  62. { label: '审核处理人', model: 'deal_person.name' },
  63. { label: '审核时间', model: 'exam_time' },
  64. ],
  65. statusList: [],
  66. // 弹框
  67. dialog: { title: '信息管理', show: false, type: '1' },
  68. fieldform: {},
  69. fieldsForm: [
  70. { label: '申请理由', model: 'apply_reason', readonly: true },
  71. { label: '是否通过', model: 'status', type: 'select' },
  72. { label: '审核理由', model: 'exam_reason', type: 'textarea' },
  73. ],
  74. fieldRules: {
  75. status: [{ required: true, message: '请选择是否通过', trigger: 'change' }],
  76. exam_reason: [{ required: true, message: '请输入审核理由', trigger: 'blur' }],
  77. },
  78. };
  79. },
  80. async created() {
  81. await this.search();
  82. await this.searchOther();
  83. },
  84. methods: {
  85. ...dictData({ dictQuery: 'query' }),
  86. ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
  87. // 查询
  88. async search({ skip = 0, limit = this.$limit, ...info } = {}) {
  89. let condition = _.cloneDeep(this.searchForm);
  90. let res = await this.query({ skip, limit, ...condition, ...info });
  91. if (this.$checkRes(res)) {
  92. this.$set(this, 'list', res.data);
  93. this.$set(this, 'total', res.total);
  94. }
  95. this.loadings = false;
  96. },
  97. toExam({ data }) {
  98. this.$set(this, 'fieldform', data);
  99. this.dialog = { title: '信息管理', show: true, type: '1' };
  100. },
  101. // 保存
  102. async onSubmit({ data }) {
  103. data.exam_time = moment().format('YYYY-MM-DD HH:mm:ss');
  104. let res;
  105. if (data.id) res = await this.update(data);
  106. else res = await this.create(data);
  107. if (this.$checkRes(res)) {
  108. this.$message({ type: `success`, message: `维护信息成功` });
  109. this.toClose();
  110. }
  111. },
  112. // 关闭
  113. toClose() {
  114. this.fieldform = {};
  115. this.dialog = { title: '信息管理', show: false, type: '1' };
  116. this.search();
  117. },
  118. toClos() {
  119. this.searchForm = {};
  120. this.search();
  121. },
  122. // 查询其他信息
  123. async searchOther() {
  124. let res;
  125. // 提现审核状态
  126. res = await this.dictQuery({ code: 'withdrawal_exam_status' });
  127. if (this.$checkRes(res)) {
  128. this.$set(this, `statusList`, res.data);
  129. }
  130. },
  131. },
  132. computed: {
  133. ...mapState(['user']),
  134. },
  135. metaInfo() {
  136. return { title: this.$route.meta.title };
  137. },
  138. watch: {
  139. test: {
  140. deep: true,
  141. immediate: true,
  142. handler(val) {},
  143. },
  144. },
  145. };
  146. </script>
  147. <style lang="less" scoped>
  148. .one {
  149. margin: 0 0 10px 0;
  150. }
  151. .two {
  152. margin: 0 0 10px 0;
  153. }
  154. </style>