CampaignAuditList.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <div class="campaign-audit-list">
  3. <el-card>
  4. <el-tabs v-model="activeTab" @tab-click="loadData">
  5. <el-tab-pane label="待审核" name="pending"></el-tab-pane>
  6. <el-tab-pane label="审核通过" name="approved"></el-tab-pane>
  7. <el-tab-pane label="审核驳回" name="rejected"></el-tab-pane>
  8. </el-tabs>
  9. <div class="search-section">
  10. <div class="search-row">
  11. <el-form :model="searchForm" label-width="120px" inline>
  12. <el-form-item label="发放计划名称:">
  13. <el-input v-model="searchForm.bizName" placeholder="关键字" style="width: 200px" />
  14. </el-form-item>
  15. <div class="button-group" style="margin-left: 20px;">
  16. <el-button type="primary" @click="loadData">查询</el-button>
  17. <el-button @click="handleReset">重置</el-button>
  18. </div>
  19. </el-form>
  20. </div>
  21. </div>
  22. <el-table :data="tableData" stripe style="width: 100%">
  23. <el-table-column label="操作" min-width="100" fixed="left">
  24. <template #default="scope">
  25. <el-button
  26. v-if="activeTab === 'pending'"
  27. type="text"
  28. size="small"
  29. @click="goDetail(scope.row.id)"
  30. >审批</el-button>
  31. <el-button
  32. v-else
  33. type="text"
  34. size="small"
  35. @click="goDetail(scope.row.id)"
  36. >查看</el-button>
  37. </template>
  38. </el-table-column>
  39. <el-table-column prop="bizName" label="发放计划名称" min-width="160" show-overflow-tooltip />
  40. <el-table-column prop="bizId" label="发放计划 ID" width="160" align="center" />
  41. <el-table-column label="审核类型" width="120" align="center">
  42. <template #default="scope">
  43. <el-tag :type="auditTypeTag(scope.row.auditType)" size="small">
  44. {{ auditTypeLabel(scope.row.auditType) }}
  45. </el-tag>
  46. </template>
  47. </el-table-column>
  48. <el-table-column prop="submitterName" label="提交人" width="120" align="center" />
  49. <el-table-column prop="submitTime" label="提交时间" width="180" align="center" />
  50. <el-table-column prop="auditorName" label="审核人" width="120" align="center">
  51. <template #default="scope">
  52. <span>{{ scope.row.auditorName || '-' }}</span>
  53. </template>
  54. </el-table-column>
  55. <el-table-column prop="auditTime" label="审核时间" width="180" align="center">
  56. <template #default="scope">
  57. <span>{{ scope.row.auditTime || '-' }}</span>
  58. </template>
  59. </el-table-column>
  60. </el-table>
  61. <div class="pagination-section">
  62. <span>Total {{ tableData.length }}</span>
  63. <el-pagination
  64. layout="prev, pager, next, sizes, jumper"
  65. :page-size="10"
  66. :page-sizes="[10, 20, 50]"
  67. :total="tableData.length"
  68. />
  69. </div>
  70. </el-card>
  71. </div>
  72. </template>
  73. <script>
  74. import request from '@/utils/request'
  75. export default {
  76. name: 'CampaignAuditList',
  77. data() {
  78. return {
  79. activeTab: 'pending',
  80. searchForm: { bizName: '' },
  81. tableData: []
  82. }
  83. },
  84. created() {
  85. this.loadData()
  86. },
  87. activated() {
  88. this.loadData()
  89. },
  90. watch: {
  91. $route(to) {
  92. if (to.path === '/customization/hsbc/campaign-audit') {
  93. this.loadData()
  94. }
  95. }
  96. },
  97. methods: {
  98. loadData() {
  99. const params = new URLSearchParams()
  100. params.append('auditStatus', this.activeTab)
  101. if (this.searchForm.bizName) params.append('bizName', this.searchForm.bizName)
  102. request.get('/api/campaign-audit/list?' + params.toString()).then(res => {
  103. this.tableData = res.data || []
  104. }).catch(() => {})
  105. },
  106. handleReset() {
  107. this.searchForm = { bizName: '' }
  108. this.loadData()
  109. },
  110. auditTypeLabel(t) {
  111. return { new: '新增', end: '结束' }[t] || t
  112. },
  113. auditTypeTag(t) {
  114. return { new: 'success', end: 'warning' }[t] || ''
  115. },
  116. goDetail(id) {
  117. this.$router.push(`/customization/hsbc/campaign-audit/${id}`)
  118. }
  119. }
  120. }
  121. </script>
  122. <style scoped>
  123. .campaign-audit-list { padding: 0; }
  124. .search-section { display: flex; flex-direction: column; }
  125. .search-row { margin-bottom: 0; }
  126. .search-row .el-form { display: flex; flex-wrap: wrap; gap: 0; }
  127. .search-row .el-form-item { margin-right: 0; margin-bottom: 8px; }
  128. .button-group { display: flex; gap: 5px; }
  129. .pagination-section {
  130. display: flex;
  131. justify-content: flex-end;
  132. align-items: center;
  133. gap: 20px;
  134. margin-top: 20px;
  135. }
  136. </style>