index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <template>
  2. <div class="">
  3. <div class="m-10 bg-w p-20 br-10">
  4. <div class="f-sa-s">
  5. <div class="f-fs-c f-col">
  6. <div style="font-size: 16px;">总量</div>
  7. <div class="mt-4" style="font-weight: bold; font-size: 18px;">
  8. {{ statistics.all }}
  9. </div>
  10. </div>
  11. <div class="f-fs-c f-col">
  12. <div style="font-size: 16px;">月新增</div>
  13. <div class="mt-4" style="font-weight: bold; font-size: 18px;">
  14. {{ statistics.month }}
  15. </div>
  16. </div>
  17. <div class="f-fs-c f-col">
  18. <div style="font-size: 16px;">周新增</div>
  19. <div class="mt-4" style="font-weight: bold; font-size: 18px;">
  20. {{ statistics.week }}
  21. </div>
  22. </div>
  23. </div>
  24. </div>
  25. <toolbar @on-filter="filterData" @on-reset="filterData" />
  26. <base-table
  27. class="m-10 bg-w p-20 br-10"
  28. :columns="columns"
  29. :items="items"
  30. :pagination="pagination"
  31. :page-change="pageChange"
  32. />
  33. </div>
  34. </template>
  35. <script>
  36. import toolbar from './toolbar';
  37. import mxFilterList from '@/mixins/filterList';
  38. import { getPage, getCount } from '@/api/photoer';
  39. export default {
  40. name: 'PhotographerVerify',
  41. components: { toolbar },
  42. mixins: [
  43. mxFilterList({
  44. fetchList: getPage // 在下方data再声明一个 fetchList: iGetList 同等效果
  45. })
  46. ],
  47. data() {
  48. return {
  49. statistics: {},
  50. columns: [
  51. {
  52. key: 'nickname',
  53. name: '账号昵称',
  54. minWidth: this.$col.b
  55. },
  56. {
  57. key: 'phonenumber',
  58. name: '账号手机号码',
  59. width: this.$col.m
  60. },
  61. {
  62. key: 'realName',
  63. name: '申请者',
  64. width: this.$col.m
  65. },
  66. {
  67. key: 'idCardNumber',
  68. name: '身份证号',
  69. minWidth: this.$col.auto(240)
  70. },
  71. {
  72. key: 'applyPhonenumber',
  73. name: '申请手机号码',
  74. minWidth: this.$col.m
  75. },
  76. {
  77. key: 'logo',
  78. name: '有关图片',
  79. width: this.$col.b,
  80. render: (h, { row }) =>
  81. h('img', {
  82. style: {
  83. width: '120px',
  84. height: '90px'
  85. },
  86. class: 'pre-img',
  87. attrs: {
  88. src: row.bodyPhoto
  89. },
  90. on: {
  91. click: () =>
  92. this.$AdvanceViewImageModal({
  93. items: [
  94. { src: row.bodyPhoto },
  95. { src: row.idCardFront },
  96. { src: row.idCardBack }
  97. ]
  98. })
  99. }
  100. })
  101. },
  102. {
  103. key: 'createAt',
  104. name: '申请时间',
  105. width: this.$col.b
  106. },
  107. {
  108. key: 'auditStatus',
  109. name: '审核状态',
  110. minWidth: this.$col.s,
  111. type: 'tag',
  112. fetchTagType: val => {
  113. switch (val) {
  114. case 1:
  115. return 'success';
  116. case 0:
  117. return 'info';
  118. case -1:
  119. return 'danger';
  120. default:
  121. return 'info';
  122. }
  123. },
  124. tagName: row => {
  125. switch (row.auditStatus) {
  126. case 1:
  127. return '通过';
  128. case 0:
  129. return '待审核';
  130. case -1:
  131. return '拒绝';
  132. default:
  133. return '-';
  134. }
  135. }
  136. },
  137. {
  138. key: 'action',
  139. name: '操作',
  140. width: '120',
  141. render: (h, { row }) => {
  142. const action = [];
  143. action.push(
  144. h(
  145. 'el-button',
  146. {
  147. props: {
  148. type: 'text'
  149. },
  150. on: {
  151. click: () =>
  152. this.$PhotoerVerifyItemModal({
  153. id: row.id,
  154. auditStatus: row.auditStatus
  155. })
  156. }
  157. },
  158. '审核'
  159. )
  160. );
  161. return h('div', action);
  162. }
  163. }
  164. ]
  165. };
  166. },
  167. created() {
  168. this.$g_on('photoer_reload', this.reload);
  169. },
  170. beforeDestroy() {
  171. this.$g_off('photoer_reload', this.reload);
  172. },
  173. methods: {
  174. async pageChange(page) {
  175. this.pagination.page = page;
  176. const inParams = {
  177. ...this.filter,
  178. ...this.internalFilterObj,
  179. start: this.pagination.page,
  180. limit: this.pagination.pageSize
  181. };
  182. const { data, msg } = await this.apiList(inParams);
  183. const res2 = await getCount(inParams);
  184. this.statistics = res2.data;
  185. if ('data' in data) {
  186. const items = data.data;
  187. if (items.length === 0 && this.pagination.page > 1) {
  188. this.pageChange(1);
  189. } else {
  190. this.items = items;
  191. this.pagination.total = data.total;
  192. }
  193. this.loadCallBack(data);
  194. }
  195. }
  196. }
  197. };
  198. </script>
  199. <style type="scss" scoped></style>