auth.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <div class="app-container">
  3. <search-form
  4. :list-loading="listLoading"
  5. @change="searchHandle"
  6. />
  7. <table-list
  8. :list-loading="listLoading"
  9. :data="tableData2"
  10. :columns="listConfig"
  11. :current-page="currentPage"
  12. :page-size="pageSize"
  13. :total-records="totalRecords"
  14. @currentChange="pageHandle"
  15. @sizeChange="sizeChange"
  16. />
  17. <!-- :isAdd="true"
  18. @add="openPopup" -->
  19. <popup-edit
  20. :isShow="isDtlShow"
  21. :curObj="curObj"
  22. @close="closePopup"
  23. />
  24. </div>
  25. </template>
  26. <script>
  27. import { arrToObj } from '@/utils'
  28. import SearchForm from './components/searchForm/Auth'
  29. import PopupEdit from './components/popup/AuthEdit'
  30. import baseTable from '_m/baseTable.js'
  31. export default {
  32. name: 'index',
  33. components: {
  34. SearchForm,
  35. PopupEdit,
  36. },
  37. provide() {
  38. return {
  39. parentData: this
  40. }
  41. },
  42. mixins: [baseTable],
  43. data() {
  44. return {
  45. apiStr: 'user.admuserauthlist',
  46. searchForm: null,
  47. isDtlShow: false,
  48. curObj: {},
  49. }
  50. },
  51. computed: {
  52. tableData2() {
  53. const arr = [...this.tableData]
  54. arr.map(item => {
  55. if (item.auth_state === '1') item.authstateIs1 = true
  56. })
  57. return arr
  58. }
  59. },
  60. created() {},
  61. mounted() {
  62. this.listConfig = {
  63. rows: [
  64. { label: '推荐人', prop: 'referrer' },
  65. { label: '认证渠道', prop: 'group_type', type: 'flag', flags: arrToObj(this.$dictData.group_type) },
  66. { label: '昵称', prop: 'nickname' },
  67. { label: '手机号', prop: 'phone' },
  68. { label: '身份认证', prop: 'auth_state', type: 'tag', tags: arrToObj(this.$dictData.auth_state), tagTypeObj: {'1': 'success', '2': 'warning', '3': 'danger', '4': 'info'} },
  69. { label: '绑定微信', prop: 'bind_wechat', type: 'tag', tags: arrToObj(this.$dictData.sys_yesno), tagTypeObj: {'1': 'success', '2': 'danger'} },
  70. { label: '身份证号', prop: 'id_number', fullShow: true, minWidth: 90 },
  71. { label: 'ID正面', prop: 'id_card_front', type: 'img' },
  72. { label: 'ID反面', prop: 'id_card_revers', type: 'img' },
  73. { label: '银行卡号', prop: 'bank_number', fullShow: true },
  74. { label: '银行卡正面', prop: 'bank_card', type: 'img' },
  75. { label: '营业执照', prop: 'busines_licens', type: 'img' },
  76. { label: '更新时间', prop: 'update_at' },
  77. { label: '操作', width: 70, type: 'handle2', operations:
  78. [
  79. { label: '审核', func: this.openPopup, btnType: 'primary', hide: 'authstateIs1' },
  80. ]
  81. }
  82. ]
  83. }
  84. },
  85. methods: {
  86. openPopup(row) {
  87. if (row && row.id) {
  88. this.curObj = row
  89. } else {
  90. this.curObj = {}
  91. }
  92. this.isDtlShow = true
  93. },
  94. closePopup(obj) {
  95. if (obj) {
  96. const params = obj
  97. let apiStr = 'admuserauthedit'
  98. if (this.curObj.group_type == 1) apiStr = 'admdeptauthedit'
  99. this.$api.user[apiStr]({
  100. ...params
  101. }).then(data => {
  102. this.$msgs('操作成功')
  103. this.fetchData()
  104. this.isDtlShow = false
  105. })
  106. } else {
  107. this.isDtlShow = false
  108. }
  109. }
  110. }
  111. }
  112. </script>