index.vue 4.9 KB

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