index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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. },
  55. {
  56. key: 'phonenumber',
  57. name: '账号手机号码',
  58. },
  59. {
  60. key: 'realName',
  61. name: '申请者',
  62. width: this.$col.m
  63. },
  64. {
  65. key: 'idCardNumber',
  66. name: '身份证号',
  67. minWidth: this.$col.auto(240)
  68. },
  69. {
  70. key: 'applyPhonenumber',
  71. name: '手机号',
  72. minWidth: this.$col.b
  73. },
  74. {
  75. key: 'logo',
  76. name: '有关图片',
  77. width: this.$col.b,
  78. render: (h, { row }) =>
  79. h('img', {
  80. style: {
  81. width: '120px',
  82. height: '90px'
  83. },
  84. class: 'pre-img',
  85. attrs: {
  86. src: row.bodyPhoto
  87. },
  88. on: {
  89. click: () =>
  90. this.$AdvanceViewImageModal({
  91. items: [
  92. { src: row.bodyPhoto },
  93. { src: row.idCardFront },
  94. { src: row.idCardBack }
  95. ]
  96. })
  97. }
  98. })
  99. },
  100. {
  101. key: 'auditStatus',
  102. name: '状态',
  103. minWidth: this.$col.s,
  104. type: 'tag',
  105. fetchTagType: val => {
  106. switch (val) {
  107. case 1:
  108. return 'success';
  109. case 0:
  110. return 'info';
  111. case -1:
  112. return 'danger';
  113. default:
  114. return 'info';
  115. }
  116. },
  117. tagName: row => {
  118. switch (row.auditStatus) {
  119. case 1:
  120. return '通过';
  121. case 0:
  122. return '待审核';
  123. case -1:
  124. return '拒绝';
  125. default:
  126. return '-';
  127. }
  128. }
  129. },
  130. {
  131. key: 'action',
  132. name: '操作',
  133. width: '120',
  134. render: (h, { row }) => {
  135. const action = [];
  136. action.push(
  137. h(
  138. 'el-button',
  139. {
  140. props: {
  141. type: 'text'
  142. },
  143. on: {
  144. click: () =>
  145. this.$PhotoerVerifyItemModal({
  146. id: row.id,
  147. auditStatus: row.auditStatus
  148. })
  149. }
  150. },
  151. '审核'
  152. )
  153. );
  154. return h('div', action);
  155. }
  156. }
  157. ]
  158. };
  159. },
  160. created() {
  161. this.$g_on('photoer_reload', this.reload);
  162. },
  163. beforeDestroy() {
  164. this.$g_off('photoer_reload', this.reload);
  165. },
  166. methods: {
  167. async pageChange(page) {
  168. this.pagination.page = page;
  169. const inParams = {
  170. ...this.filter,
  171. ...this.internalFilterObj,
  172. page: this.pagination.page,
  173. size: this.pagination.pageSize
  174. };
  175. const { data, msg } = await this.apiList(inParams, {
  176. limit: this.pagination.pageSize,
  177. start: this.pagination.page
  178. });
  179. const res2 = await getCount(inParams)
  180. this.statistics = res2.data
  181. if ('data' in data) {
  182. const items = data.data;
  183. if (items.length === 0 && this.pagination.page > 1) {
  184. this.pageChange(1);
  185. } else {
  186. this.items = items;
  187. this.pagination.total = data.total;
  188. }
  189. this.loadCallBack(data);
  190. }
  191. }
  192. }
  193. };
  194. </script>
  195. <style type="scss" scoped></style>