courseInfo1.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <div class='courseInfo'>
  3. <save-form :inline="true"
  4. @submit='search'
  5. :model="searchList">
  6. <el-form-item>
  7. <el-input placeholder="vip编号、名称"
  8. clearable
  9. @keyup.enter.native='search'
  10. v-model.trim="searchList.search"></el-input>
  11. </el-form-item>
  12. <el-form-item label="课程状态">
  13. <el-select v-model.trim="searchList.status"
  14. clearable>
  15. <el-option v-for="(item,index) in vipGroupStatus"
  16. :key="index"
  17. :value='item.value'
  18. :label='item.text'></el-option>
  19. </el-select>
  20. </el-form-item>
  21. <el-form-item>
  22. <el-button type="danger"
  23. native-type="search">搜索</el-button>
  24. </el-form-item>
  25. </save-form>
  26. <div class="tableWrap tableMargin">
  27. <el-table :data='teamList'
  28. :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  29. <el-table-column label="VIP编号"
  30. prop="id">
  31. </el-table-column>
  32. <el-table-column label="VIP课名称"
  33. prop="name">
  34. </el-table-column>
  35. <el-table-column label="VIP课状态">
  36. <template slot-scope="scope">
  37. {{ scope.row.status | formatterStatus}}
  38. </template>
  39. </el-table-column>
  40. <el-table-column label="班级人数"
  41. prop="studentNum">
  42. </el-table-column>
  43. <el-table-column label="课程单价">
  44. <template slot-scope="scope">
  45. 线上:{{ scope.row.onlineClassesUnitPrice }} <br />
  46. 线下:{{ scope.row.offlineClassesUnitPrice }}
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="活动方案"
  50. prop="vipGroupActivityName">
  51. </el-table-column>
  52. <el-table-column label="当前课次">
  53. <template slot-scope="scope">
  54. <p>{{scope.row.currentClassTimes + '/' + scope.row.totalClassTimes}}</p>
  55. </template>
  56. </el-table-column>
  57. <el-table-column label="月均消耗">
  58. <template slot-scope="scope">
  59. {{ scope.row.monthConsumeRate }}%
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="开课时间">
  63. <template slot-scope="scope">
  64. {{scope.row.courseStartDate | formatterTime}}
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="截止时间">
  68. <template slot-scope="scope">
  69. {{ scope.row.coursesExpireDate | formatTimer }}
  70. </template>
  71. </el-table-column>
  72. <el-table-column label="申请时间">
  73. <template slot-scope="scope">
  74. {{scope.row.createTime | formatterTime}}
  75. </template>
  76. </el-table-column>
  77. </el-table>
  78. <pagination :total="pageInfo.total"
  79. :page.sync="pageInfo.page"
  80. :limit.sync="pageInfo.limit"
  81. :page-sizes="pageInfo.page_size"
  82. @pagination="getList" />
  83. </div>
  84. </div>
  85. </template>
  86. <script>
  87. // import { getTeacherVipClass } from '@/api/teacherManager'
  88. import { getVipList } from '@/api/vipSeting'
  89. import pagination from '@/components/Pagination/index'
  90. import { vipGroupStatus } from '@/utils/searchArray'
  91. import store from '@/store'
  92. export default {
  93. name: 'courseInfo1',
  94. components: {
  95. pagination
  96. },
  97. data () {
  98. return {
  99. searchList: {
  100. status: '',
  101. search: ''
  102. },
  103. teamList: [],
  104. organId: null,
  105. vipGroupStatus: null,
  106. teacherId: this.$route.query.teacherId,
  107. pageInfo: {
  108. // 分页规则
  109. limit: 10, // 限制显示条数
  110. page: 1, // 当前页
  111. total: 1, // 总条数
  112. page_size: [10, 20, 40, 50] // 选择限制显示条数
  113. }
  114. }
  115. },
  116. activated () {
  117. this.teacherId = this.$route.query.teacherId
  118. this.vipGroupStatus = vipGroupStatus;
  119. this.getList()
  120. },
  121. mounted () {
  122. this.teacherId = this.$route.query.teacherId
  123. this.vipGroupStatus = vipGroupStatus;
  124. this.getList()
  125. },
  126. methods: {
  127. getList () {
  128. getVipList({
  129. rows: this.pageInfo.limit,
  130. page: this.pageInfo.page,
  131. teacherId: this.teacherId,
  132. status: this.searchList.status || null,
  133. search: this.searchList.search || null
  134. }).then(res => {
  135. if (res.code == 200) {
  136. this.teamList = res.data.rows
  137. this.pageInfo.total = res.data.total
  138. }
  139. })
  140. },
  141. search () {
  142. this.pageInfo.page = 1;
  143. this.getList();
  144. }
  145. },
  146. filters: {
  147. formatterTime (val) {
  148. let result
  149. if (val) {
  150. result = val.split(' ')[0];
  151. } else {
  152. result = ''
  153. }
  154. return result
  155. },
  156. formatterStatus (val) {
  157. let arr = ["未开始", "报名中", "进行中", '取消', '已结束', '报名结束', '暂停']
  158. return arr[val];
  159. }
  160. }
  161. }
  162. </script>
  163. <style lang="scss" scope>
  164. .courseInfo {
  165. h4 {
  166. margin-bottom: 20px;
  167. }
  168. .tableMargin {
  169. margin-top: 20px;
  170. }
  171. }
  172. </style>