index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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. attrs: {
  44. src: row.logo
  45. },
  46. on: {
  47. click: () =>
  48. this.$AdvanceViewImageModal({
  49. items: [{ src: row.logo }]
  50. })
  51. }
  52. })
  53. },
  54. {
  55. key: 'region',
  56. name: '所在地区',
  57. minWidth: this.$col.auto(200),
  58. render: (h, { row }) =>
  59. h('span', `${row.province}/${row.city}/${row.area}`)
  60. },
  61. {
  62. key: 'type',
  63. name: '机构类型',
  64. width: this.$col.b
  65. },
  66. {
  67. key: 'realName',
  68. name: '申请人',
  69. width: this.$col.m
  70. },
  71. {
  72. key: 'personPhonenumber',
  73. name: '手机号码',
  74. width: this.$col.b
  75. },
  76. {
  77. key: 'auditStatus',
  78. name: '状态',
  79. width: this.$col.s,
  80. type: 'tag',
  81. fetchTagType: val => {
  82. switch (val) {
  83. case 1:
  84. return 'success';
  85. case 0:
  86. return 'info';
  87. case -1:
  88. return 'error';
  89. default:
  90. return 'info';
  91. }
  92. },
  93. tagName: row => {
  94. switch (row.auditStatus) {
  95. case 1:
  96. return '通过';
  97. case 0:
  98. return '待审核';
  99. case -1:
  100. return '拒绝';
  101. default:
  102. return '-';
  103. }
  104. }
  105. },
  106. {
  107. key: 'action',
  108. name: '操作',
  109. width: '120',
  110. render: (h, { row }) => {
  111. const action = [];
  112. action.push(
  113. h(
  114. 'el-button',
  115. {
  116. props: {
  117. type: 'text'
  118. },
  119. on: {
  120. click: () =>
  121. this.$SceneVerifyItemModal({
  122. id: row.id,
  123. auditStatus: row.auditStatus
  124. })
  125. }
  126. },
  127. '编辑'
  128. )
  129. );
  130. return h('div', action);
  131. }
  132. }
  133. ]
  134. };
  135. },
  136. created() {
  137. this.$g_on('scene_reload', this.reload);
  138. },
  139. beforeDestroy() {
  140. this.$g_off('scene_reload', this.reload);
  141. }
  142. };
  143. </script>
  144. <style type="scss" scoped></style>