index.vue 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <template>
  2. <div class="subPage">
  3. <div class="list flex-h">
  4. <div class="flex-item">
  5. <div style="text-align:right;margin: 20px 0 0;border:none;">
  6. <el-button
  7. size="mini"
  8. type="warning"
  9. @click="reback">返回</el-button>
  10. </div>
  11. <div>
  12. <el-table
  13. :data="info"
  14. stripe
  15. style="width: 100%">
  16. <el-table-column
  17. prop="CaseName"
  18. label="所在案场">
  19. </el-table-column>
  20. <el-table-column
  21. prop="PrizeName"
  22. label="奖品名称">
  23. </el-table-column>
  24. <el-table-column
  25. prop="Name"
  26. label="姓名">
  27. </el-table-column>
  28. <el-table-column
  29. prop="CustomerName"
  30. label="微信昵称">
  31. </el-table-column>
  32. <el-table-column
  33. prop="Phone"
  34. label="手机号">
  35. </el-table-column>
  36. <el-table-column
  37. prop="ActivitName"
  38. label="活动名称">
  39. </el-table-column>
  40. <el-table-column
  41. prop="CreateDate"
  42. label="获取时间"
  43. width="140px">
  44. <template slot-scope="scope">
  45. {{scope.row.CreateDate === '0001-01-01T00:00:00Z' ? '-' : toolClass.dateFormat(scope.row.CreateDate)}}
  46. </template>
  47. </el-table-column>
  48. <el-table-column
  49. prop="Status"
  50. label="状态">
  51. <template slot-scope="scope">
  52. {{scope.row.Status === 0 ? '未核销' : '已核销'}}
  53. </template>
  54. </el-table-column>
  55. <el-table-column
  56. label="操作">
  57. <template slot-scope="scope">
  58. <el-button
  59. size="mini"
  60. type="success"
  61. v-if="scope.row.Status === 0"
  62. @click="check(scope.row)">核销</el-button>
  63. <span v-else>已核销</span>
  64. </template>
  65. </el-table-column>
  66. </el-table>
  67. </div>
  68. <span class="noData" v-if="!info.length && ajaxOff">查不到当前信息,请核对二维码或详情</span>
  69. </div>
  70. </div>
  71. </div>
  72. </template>
  73. <script>
  74. import { createNamespacedHelpers } from 'vuex'
  75. const { mapActions: mapVerifActions } = createNamespacedHelpers('verification')
  76. export default {
  77. name: '',
  78. data () {
  79. return {
  80. ajaxOff: false,
  81. info: [],
  82. }
  83. },
  84. mounted () {
  85. this.$nextTick(function () {
  86. this.drawVerifyList({
  87. id: this.$route.query.code
  88. }).then((res) => {
  89. // console.log(JSON.stringify(res))
  90. if (res !== null) {
  91. this.info.push(res)
  92. }
  93. this.ajaxOff = true
  94. })
  95. })
  96. },
  97. computed: {
  98. },
  99. methods: {
  100. ...mapVerifActions([
  101. 'drawVerify',
  102. 'drawVerifyList',
  103. ]),
  104. check (item) { // 核销
  105. this.$confirm('确认核销此卡?', '提示', {
  106. confirmButtonText: '确定',
  107. cancelButtonText: '取消',
  108. type: 'warning'
  109. }).then(() => {
  110. this.drawVerify({
  111. id: this.$route.query.code
  112. }).then((res) => {
  113. this.$message({
  114. type: 'success',
  115. message: '操作成功!'
  116. })
  117. this.$router.push({ name: 'drawVerification' })
  118. })
  119. })
  120. },
  121. getList () {
  122. // 1
  123. },
  124. afterCheck () {
  125. this.$message({
  126. type: 'success',
  127. message: '操作成功!'
  128. })
  129. this.getList()
  130. },
  131. reback () { // 返回
  132. this.$router.push({ name: 'drawVerification' })
  133. },
  134. }
  135. }
  136. </script>
  137. <!-- Add "scoped" attribute to limit CSS to this component only -->
  138. <style lang="scss" scoped>
  139. .subPage {
  140. .list {
  141. > div {
  142. margin: 0 20px;
  143. > div {
  144. width: 100%;
  145. position: relative;
  146. overflow: hidden;
  147. box-sizing: border-box;
  148. border: 1px solid #eee;
  149. border-bottom: none;
  150. margin-top: 20px;
  151. }
  152. }
  153. }
  154. .noData {
  155. width: 100%;
  156. display: block;
  157. line-height: 40px;
  158. font-size: 30px;
  159. color: #ccc;
  160. text-align: center;
  161. margin: 40px auto 0;
  162. }
  163. }
  164. </style>