index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <div class="">
  3. <toolbar @on-filter="filterData" @on-reset="filterData" />
  4. <base-table
  5. class="m-10 bg-w p-20 br-10"
  6. :columns="columns"
  7. :items="items"
  8. :pagination="pagination"
  9. :page-change="pageChange"
  10. />
  11. </div>
  12. </template>
  13. <script>
  14. import toolbar from './toolbar';
  15. import mxFilterList from '@/mixins/filterList';
  16. import { getPage } from '@/api/scene';
  17. export default {
  18. name: 'SceneVerify',
  19. components: { toolbar },
  20. mixins: [
  21. mxFilterList({
  22. fetchList: getPage // 在下方data再声明一个 fetchList: iGetList 同等效果
  23. })
  24. ],
  25. data() {
  26. return {
  27. columns: [
  28. {
  29. key: 'name',
  30. name: '机构名称',
  31. width: this.$col.b
  32. },
  33. {
  34. key: 'logo',
  35. name: 'Logo',
  36. width: this.$col.b,
  37. render: (h, { row }) =>
  38. h('img', {
  39. style: {
  40. width: '120px',
  41. height: '90px'
  42. },
  43. class: 'pre-img',
  44. attrs: {
  45. src: row.logo
  46. },
  47. on: {
  48. click: () =>
  49. this.$AdvanceViewImageModal({
  50. items: [{ src: row.logo }]
  51. })
  52. }
  53. })
  54. },
  55. {
  56. key: 'region',
  57. name: '所在地区',
  58. minWidth: this.$col.auto(200),
  59. render: (h, { row }) =>
  60. h('span', `${row.province}/${row.city}/${row.area}`)
  61. },
  62. {
  63. key: 'type',
  64. name: '机构类型',
  65. width: this.$col.b
  66. },
  67. {
  68. key: 'realName',
  69. name: '申请人',
  70. width: this.$col.m
  71. },
  72. {
  73. key: 'personPhonenumber',
  74. name: '手机号码',
  75. width: this.$col.b
  76. },
  77. {
  78. key: 'auditStatus',
  79. name: '状态',
  80. width: this.$col.s,
  81. type: 'tag',
  82. fetchTagType: val => {
  83. switch (val) {
  84. case 1:
  85. return 'success';
  86. case 0:
  87. return 'info';
  88. case -1:
  89. return 'error';
  90. default:
  91. return 'info';
  92. }
  93. },
  94. tagName: row => {
  95. switch (row.auditStatus) {
  96. case 1:
  97. return '通过';
  98. case 0:
  99. return '待审核';
  100. case -1:
  101. return '拒绝';
  102. default:
  103. return '-';
  104. }
  105. }
  106. },
  107. {
  108. key: 'action',
  109. name: '操作',
  110. width: '120',
  111. render: (h, { row }) => {
  112. const action = [];
  113. action.push(
  114. h(
  115. 'el-button',
  116. {
  117. props: {
  118. type: 'text'
  119. },
  120. on: {
  121. click: () =>
  122. this.$SceneVerifyItemModal({
  123. id: row.id,
  124. auditStatus: row.auditStatus
  125. })
  126. }
  127. },
  128. '审核'
  129. )
  130. );
  131. return h('div', action);
  132. }
  133. }
  134. ]
  135. };
  136. },
  137. created() {
  138. this.$g_on('scene_reload', this.reload);
  139. },
  140. beforeDestroy() {
  141. this.$g_off('scene_reload', this.reload);
  142. }
  143. };
  144. </script>
  145. <style type="scss" scoped></style>