JoinShop.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <div class="join-shop-list-container">
  3. <div class="search-container" style="display: flex; align-items: center; margin-bottom: 10px">
  4. <!-- <el-radio-group v-model="listQuery.state" size="mini" @change="handleSearch">
  5. <el-radio-button label="-1">全部</el-radio-button>
  6. <el-radio-button label="1">已报名</el-radio-button>
  7. <el-radio-button label="2">已通过</el-radio-button>
  8. <el-radio-button label="3">未通过</el-radio-button>
  9. </el-radio-group> -->
  10. </div>
  11. <!-- 查询结果 -->
  12. <el-table v-loading="listLoading" element-loading-text="正在查询中..." :data="list" v-bind="{ stripe: true, size: 'small', border: true, highlightCurrentRow: true }">
  13. <el-table-column prop="allianceCardId" label="联盟卡ID" width="90" align="center" />
  14. <el-table-column prop="shopId" label="参与商家ID" width="90" align="center" />
  15. <el-table-column prop="shopName" label="商家名称" width="120" align="center" />
  16. <el-table-column prop="shopLogo" label="商家Logo" width="120" align="center">
  17. <template slot-scope="scope">
  18. <el-image :preview-src-list="[scope.row.shopLogo]" v-if="scope.row.shopLogo" :src="scope.row.shopLogo" fit="fill" style="width: 127px; height: 73px"></el-image>
  19. <span v-else>--</span>
  20. </template>
  21. </el-table-column>
  22. <el-table-column prop="state" label="参与状态" width="120" align="center">
  23. <template slot-scope="scope">
  24. <el-tag v-if="scope.row.state === 1" size="mini" type="info">已报名</el-tag>
  25. <el-tag v-if="scope.row.state === 2" size="mini" type="success">已通过</el-tag>
  26. <el-tag v-if="scope.row.state === 3" size="mini" type="danger">不通过</el-tag>
  27. </template>
  28. </el-table-column>
  29. <el-table-column prop="settlementRatio" label="结算比例" width="120" align="center">
  30. <template slot-scope="scope">
  31. <el-tag>{{ scope.row.settlementRatio * 100 }}%</el-tag>
  32. </template>
  33. </el-table-column>
  34. <el-table-column prop="createTime" label="报名时间" align="center" />
  35. </el-table>
  36. <div style="margin-top: 10px">
  37. <el-pagination
  38. :current-page="listQuery.page"
  39. :page-sizes="[10, 20, 50, 100]"
  40. :page-size="listQuery.pageSize"
  41. layout="total, sizes, prev, pager, next, -> ,jumper"
  42. :total="total"
  43. @size-change="(val) => (listQuery.pageSize = val) && getList()"
  44. @current-change="(val) => (listQuery.page = val) && getList()"
  45. />
  46. </div>
  47. </div>
  48. </template>
  49. <script>
  50. import { getRegistrationShopsByIdApi } from '@/api/business'
  51. export default {
  52. props: {
  53. cardId: { type: [Number, String], required: true }
  54. },
  55. data() {
  56. return {
  57. list: [],
  58. total: 0,
  59. listLoading: false,
  60. listQuery: {
  61. allianceCardId: undefined,
  62. page: 1,
  63. pageSize: 20,
  64. }
  65. }
  66. },
  67. watch: {
  68. cardId: {
  69. handler(value) {
  70. this.listQuery.allianceCardId = value
  71. value && this.getList()
  72. },
  73. immediate: true
  74. }
  75. },
  76. methods: {
  77. // 获取商家列表
  78. async getList() {
  79. try {
  80. this.listLoading = true
  81. const res = await getRegistrationShopsByIdApi({ ...this.listQuery, state: this.listQuery.state == '-1' ? undefined : this.listQuery.state * 1 })
  82. this.list = res.data.list
  83. this.total = res.data.total
  84. this.listLoading = false
  85. } catch (error) {
  86. this.listLoading = false
  87. }
  88. },
  89. handleSearch() {
  90. this.listQuery.page = 1
  91. this.getList()
  92. }
  93. }
  94. }
  95. </script>
  96. <style lang="scss" scoped>
  97. .join-shop-list-container {
  98. }
  99. </style>