ActivityTable.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <div>
  3. <el-dialog
  4. :title="this.ids.title"
  5. width="1000px"
  6. :visible.sync="dialogVisible"
  7. :before-close="close"
  8. >
  9. <div class="dialog-search">
  10. <div>参与用户数量:{{this.ids.realNum}}</div>
  11. <div class="ge"></div>
  12. <div>抽奖码数量:{{marketingTotal}}</div>
  13. </div>
  14. <el-table
  15. v-loading="loading"
  16. :data="marketingList"
  17. @selection-change="handleSelectionCoupon"
  18. class="el-table"
  19. >
  20. <el-table-column label="用户编号" prop="userId" min-width="80" />
  21. <el-table-column label="用户昵称" prop="nickName" min-width="80" />
  22. <el-table-column label="抽奖码" prop="code" min-width="80" />
  23. <el-table-column label="抽奖码获取时间" prop="createdTime" min-width="85">
  24. <template slot-scope="scope">
  25. <div>{{ parseTime(scope.row.createdTime) }}</div>
  26. </template>
  27. </el-table-column>
  28. <el-table-column label="奖级" prop="awardsName" min-width="50" >
  29. <template slot-scope="scope">
  30. <div v-if="scope.row.prizeName != ''">{{ scope.row.awardsName }}</div>
  31. <div v-else> -- </div>
  32. </template>
  33. </el-table-column>
  34. <el-table-column label="奖品名称" prop="prizeName" min-width="85" >
  35. <template slot-scope="scope">
  36. <div v-if="scope.row.prizeName != ''">{{ scope.row.prizeName }}</div>
  37. <div v-else> -- </div>
  38. </template>
  39. </el-table-column>
  40. </el-table>
  41. <pagination
  42. v-show="marketingTotal > 0"
  43. :total="marketingTotal"
  44. :page.sync="pageParams.pageNum"
  45. :limit.sync="pageParams.pageSize"
  46. @pagination="getMarketingData"
  47. />
  48. <div class="dialog-btn">
  49. <el-button size="small" @click="close"> 关 闭 </el-button>
  50. </div>
  51. </el-dialog>
  52. </div>
  53. </template>
  54. <script>
  55. import { publicFileGetUrl } from "@/api/common";
  56. import { getMarketingData } from '@/api/business/marketing'
  57. export default {
  58. name: "CouponAdd",
  59. props: {
  60. dialogVisible: {
  61. type: Boolean,
  62. default: false,
  63. },
  64. ids: {
  65. type: Object,
  66. default: () => []
  67. }
  68. },
  69. data() {
  70. return {
  71. loading: false,
  72. marketingTitle: "", // 券名称
  73. marketingList: [], // 卡券列表
  74. marketingTotal: 0, // 卡券总数
  75. selectCouponList: [], // 选中卡券
  76. pageParams: {
  77. pageNum: 1,
  78. pageSize: 10,
  79. },
  80. };
  81. },
  82. created() {
  83. this.getMarketingData();
  84. },
  85. methods: {
  86. // 卡券列表
  87. getMarketingData() {
  88. this.loading = true;
  89. getMarketingData(this.ids.id ).then((res) => {
  90. this.marketingList = res.rows
  91. this.marketingTotal = res.total;
  92. this.loading = false;
  93. });
  94. },
  95. // 选中卡券
  96. handleSelectionCoupon(e) {
  97. this.selectCouponList = e.map((item) => {
  98. return {
  99. couponNum: 1,
  100. couponId: item.couponId,
  101. title: item.title,
  102. createdTime: item.createdTime,
  103. updatedTime: item.updatedTime,
  104. type: item.type,
  105. discount: item.discount,
  106. dueDays: item.dueDays
  107. };
  108. });
  109. },
  110. // 确认选中卡券
  111. confirmCoupon() {
  112. this.$emit("confirmCoupon", this.selectCouponList);
  113. this.close()
  114. },
  115. close() {
  116. this.$emit("close");
  117. },
  118. },
  119. };
  120. </script>
  121. <style lang="scss" scoped>
  122. .dialog-search {
  123. display: flex;
  124. line-height: 32px;
  125. margin-bottom: 20px;
  126. .ge {
  127. width: 40px;
  128. }
  129. }
  130. .dialog-btn {
  131. display: flex;
  132. align-content: center;
  133. justify-content: flex-end;
  134. padding: 40px 0 0;
  135. .ge {
  136. width: 40px;
  137. }
  138. }
  139. </style>