index.vue 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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 v-if="(courses.list||[]).length>0">
  12. <el-table
  13. :data="courses.list"
  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="LocationName"
  22. label="课程分类">
  23. </el-table-column>
  24. <el-table-column
  25. prop="CourseName"
  26. label="课程名称">
  27. </el-table-column>
  28. <el-table-column
  29. prop="DetailName"
  30. label="课时名称">
  31. </el-table-column>
  32. <el-table-column
  33. prop="StartDate"
  34. label="课程开始时间">
  35. <template slot-scope="scope">
  36. <span>{{toolClass.dateFormat(scope.row.StartDate)}}</span>
  37. </template>
  38. </el-table-column>
  39. <el-table-column
  40. prop="EndDate"
  41. label="课程结束时间">
  42. <template slot-scope="scope">
  43. <span>{{toolClass.dateFormat(scope.row.EndDate)}}</span>
  44. </template>
  45. </el-table-column>
  46. <el-table-column
  47. label="操作">
  48. <template slot-scope="scope">
  49. <el-button
  50. size="mini"
  51. type="success"
  52. v-if="scope.row.VerifyStatus!=='used'"
  53. @click="check(scope.row)">核销</el-button>
  54. <span v-else>已完成</span>
  55. </template>
  56. </el-table-column>
  57. </el-table>
  58. </div>
  59. <span class="noData" v-else>查不到当前信息,请核对二维码或详情</span>
  60. </div>
  61. </div>
  62. </div>
  63. </template>
  64. <script>
  65. import { createNamespacedHelpers } from 'vuex'
  66. const { mapState: mapVerifState, mapActions: mapVerifActions } = createNamespacedHelpers('verification')
  67. export default {
  68. name: '',
  69. data () {
  70. return {
  71. code: '',
  72. }
  73. },
  74. mounted () {
  75. const { code } = this.$route.query
  76. this.code = code
  77. this.$nextTick(function () {
  78. this.getList()
  79. })
  80. },
  81. computed: {
  82. ...mapVerifState({
  83. courses: x => x.courseVerifs
  84. })
  85. },
  86. methods: {
  87. ...mapVerifActions([
  88. 'GetCourseVerList',
  89. 'CourseVerifs',
  90. ]),
  91. check (item) { // 核销
  92. this.$confirm('确认核销此课程?', '提示', {
  93. confirmButtonText: '确定',
  94. cancelButtonText: '取消',
  95. type: 'warning'
  96. })
  97. .then(() => {
  98. this.CourseVerifs({id: item.CustomerDetailId, callback: this.afterCheck})
  99. })
  100. },
  101. getList () {
  102. this.GetCourseVerList({id: this.code})
  103. },
  104. afterCheck () {
  105. this.$message({
  106. type: 'success',
  107. message: '操作成功!'
  108. })
  109. this.getList()
  110. },
  111. reback () { // 返回
  112. this.$router.push({name: 'qrcodeVerification'})
  113. },
  114. }
  115. }
  116. </script>
  117. <!-- Add "scoped" attribute to limit CSS to this component only -->
  118. <style lang="scss" scoped>
  119. .subPage {
  120. .list {
  121. > div {
  122. margin: 0 20px;
  123. > div {
  124. width: 100%;
  125. position: relative;
  126. overflow: hidden;
  127. box-sizing: border-box;
  128. border: 1px solid #eee;
  129. border-bottom: none;
  130. margin-top: 20px;
  131. }
  132. }
  133. }
  134. .noData{
  135. width: 100%;
  136. display: block;
  137. line-height: 40px;
  138. font-size: 30px;
  139. color: #ccc;
  140. text-align: center;
  141. margin: 40px auto 0;
  142. }
  143. }
  144. </style>