index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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: 'previewLogo',
  57. name: '预览Logo',
  58. width: this.$col.b,
  59. render: (h, { row }) =>
  60. h('img', {
  61. style: {
  62. width: '120px',
  63. height: '90px'
  64. },
  65. class: 'pre-img',
  66. attrs: {
  67. src: row.previewLogo
  68. },
  69. on: {
  70. click: () =>
  71. this.$AdvanceViewImageModal({
  72. items: [{ src: row.previewLogo }]
  73. })
  74. }
  75. })
  76. },
  77. {
  78. key: 'region',
  79. name: '所在地区',
  80. minWidth: this.$col.auto(200),
  81. render: (h, { row }) =>
  82. h('span', `${row.province}/${row.city}/${row.area}`)
  83. },
  84. {
  85. key: 'type',
  86. name: '机构类型',
  87. width: this.$col.b
  88. },
  89. {
  90. key: 'realName',
  91. name: '申请人',
  92. width: this.$col.m
  93. },
  94. {
  95. key: 'personPhonenumber',
  96. name: '手机号码',
  97. width: this.$col.b
  98. },
  99. {
  100. key: 'auditStatus',
  101. name: '状态',
  102. width: this.$col.s,
  103. type: 'tag',
  104. fetchTagType: val => {
  105. switch (val) {
  106. case 1:
  107. return 'success';
  108. case 0:
  109. return 'info';
  110. case -1:
  111. return 'error';
  112. default:
  113. return 'info';
  114. }
  115. },
  116. tagName: row => {
  117. switch (row.auditStatus) {
  118. case 1:
  119. return '通过';
  120. case 0:
  121. return '待审核';
  122. case -1:
  123. return '拒绝';
  124. default:
  125. return '-';
  126. }
  127. }
  128. },
  129. {
  130. key: 'action',
  131. name: '操作',
  132. width: '120',
  133. render: (h, { row }) => {
  134. const action = [];
  135. action.push(
  136. h(
  137. 'el-button',
  138. {
  139. props: {
  140. type: 'text'
  141. },
  142. on: {
  143. click: () =>
  144. this.$SceneVerifyItemModal({
  145. id: row.id,
  146. auditStatus: row.auditStatus
  147. })
  148. }
  149. },
  150. '审核'
  151. )
  152. );
  153. return h('div', action);
  154. }
  155. }
  156. ]
  157. };
  158. },
  159. created() {
  160. this.$g_on('scene_reload', this.reload);
  161. },
  162. beforeDestroy() {
  163. this.$g_off('scene_reload', this.reload);
  164. }
  165. };
  166. </script>
  167. <style type="scss" scoped></style>