index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <ele-page flex-table>
  3. <page-search @search="reload" />
  4. <common-table
  5. ref="pageRef"
  6. :pageConfig="pageConfig"
  7. :columns="columns"
  8. :tools="false"
  9. >
  10. <template #toolbar>
  11. <el-button
  12. type="danger"
  13. plain
  14. :icon="DeleteOutlined"
  15. v-permission="'optimization:fallback:batchDelete'"
  16. @click="handleBatchDelete()"
  17. >
  18. 批量删除
  19. </el-button>
  20. <el-button
  21. type="success"
  22. plain
  23. v-permission="'optimization:fallback:export'"
  24. @click="handleExportExcel"
  25. :icon="DownloadOutlined"
  26. >
  27. 导出EXCEL
  28. </el-button>
  29. </template>
  30. <template #action="{ row }">
  31. <div>
  32. <el-button
  33. type="primary"
  34. link
  35. v-permission="'optimization:fallback:detail'"
  36. @click="handleUpdate(row, 'detail')"
  37. >
  38. [详情]
  39. </el-button>
  40. <el-button
  41. type="primary"
  42. link
  43. v-permission="'optimization:fallback:deal'"
  44. @click="handleUpdate(row)"
  45. >
  46. 去处理
  47. </el-button>
  48. </div>
  49. </template>
  50. </common-table>
  51. <deal-fallback ref="dealFallbackRef" @done="reload()" />
  52. </ele-page>
  53. </template>
  54. <script setup>
  55. import { ref, reactive } from 'vue';
  56. import CommonTable from '@/components/CommonPage/CommonTable.vue';
  57. import dealFallback from '@/views/optimization/fallback/components/deal-fallback.vue';
  58. import pageSearch from '@/views/optimization/fallback/components/page-search.vue';
  59. import { useDictData } from '@/utils/use-dict-data';
  60. defineOptions({ name: 'fallbackList' });
  61. const [useStatusDicts] = useDictData(['sys_normal_disable']);
  62. /** 表格列配置 */
  63. const columns = ref([
  64. {
  65. type: 'selection',
  66. columnKey: 'selection',
  67. width: 50,
  68. align: 'center',
  69. fixed: 'left'
  70. },
  71. { type: 'index', label: '序号', width: 60, align: 'center' },
  72. {
  73. label: '状态',
  74. prop: 'useStatus',
  75. align: 'center',
  76. formatter: (row) =>
  77. useStatusDicts.value.find((d) => d.dictValue == row.useStatus)
  78. ?.dictLabel
  79. },
  80. { label: '用户UID', prop: 'uid', align: 'center' },
  81. { label: '联系方式', prop: 'mobile', align: 'center' },
  82. { label: '意见类型', prop: 'type', align: 'center' },
  83. { label: '反馈时间', prop: 'createTime', align: 'center', width: 180 },
  84. {
  85. label: '意见描述',
  86. prop: 'paymentCode',
  87. align: 'center',
  88. minWidth: 200
  89. },
  90. {
  91. columnKey: 'action',
  92. label: '操作',
  93. width: 160,
  94. align: 'center',
  95. slot: 'action'
  96. }
  97. ]);
  98. /** 页面组件实例 */
  99. const pageRef = ref(null);
  100. const pageConfig = reactive({
  101. pageUrl: '/baseinfo/godown/pagelist',
  102. exportUrl: '/baseinfo/godown/export',
  103. fileName: '意见反馈',
  104. cacheKey: 'fallbackTable'
  105. });
  106. //刷新表格
  107. function reload(where) {
  108. pageRef.value?.reload(where);
  109. }
  110. //批量删除
  111. function handleBatchDelete(row) {
  112. let selections = row ? [row] : pageRef.value?.getSelections();
  113. let ids = selections.map((item) => item.id).join(',');
  114. let url = `/baseinfo/schoolInfo/removeById/${ids}`;
  115. pageRef.value?.operatBatch({
  116. title: '确认删除?',
  117. method: 'post',
  118. url,
  119. row
  120. });
  121. }
  122. //导出excel
  123. function handleExportExcel() {
  124. pageRef.value?.exportData('意见反馈');
  125. }
  126. //去处理
  127. const dealFallbackRef = ref(null);
  128. function handleUpdate(row, type) {
  129. dealFallbackRef.value?.handleOpen(row, type);
  130. }
  131. </script>