courseList.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <div class='cl-container'>
  3. <!-- 搜索类型 -->
  4. <el-form :inline="true"
  5. class="searchForm"
  6. v-model.trim="searchForm">
  7. <el-form-item label="课程类型">
  8. <el-select v-model.trim="searchForm.courseStatus"
  9. clearable
  10. filterable
  11. placeholder="课程类型">
  12. <el-option label="基础技能课"
  13. value="HIGH"></el-option>
  14. <el-option label="综合课"
  15. value="COMPREHENSIVE"></el-option>
  16. <el-option label="课堂课"
  17. value="CLASSROOM"></el-option>
  18. <el-option label="合奏课"
  19. value="MIX"></el-option>
  20. <el-option label="集训合奏课"
  21. value="TRAINING_MIX"></el-option>
  22. <el-option label="集训声部课"
  23. value="TRAINING_SINGLE"></el-option>
  24. <el-option label="声部课"
  25. value="SINGLE"></el-option>
  26. <el-option label="线上基础技能课"
  27. value="HIGH_ONLINE"></el-option>
  28. </el-select>
  29. </el-form-item>
  30. <el-form-item label="班级名称">
  31. <!-- getMusicGroupAllClass -->
  32. <el-select v-model.trim="searchForm.class"
  33. filterable
  34. clearable>
  35. <el-option v-for='(item,index) in classList'
  36. :key="index"
  37. :value="item.id"
  38. :label="item.name"></el-option>
  39. </el-select>
  40. </el-form-item>
  41. <el-form-item label="选择日期">
  42. <el-date-picker v-model.trim="searchForm.timer"
  43. style="width:420px;"
  44. type="daterange"
  45. value-format="yyyy-MM-dd"
  46. range-separator="至"
  47. start-placeholder="开始日期"
  48. end-placeholder="结束日期"
  49. :picker-options="{
  50. firstDayOfWeek: 1
  51. }">
  52. </el-date-picker>
  53. </el-form-item>
  54. <el-form-item>
  55. <div class='searchBtn'
  56. @click="search">搜索</div>
  57. </el-form-item>
  58. </el-form>
  59. <div class="btnWraps">
  60. </div>
  61. <!-- 列表 -->
  62. <div class="tableWrap">
  63. <el-table :data='tableList'
  64. :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  65. <el-table-column align='center'
  66. label="时间">
  67. <template slot-scope="scope">
  68. {{ scope.row.classDate }} {{ scope.row.startClassTime ? scope.row.startClassTime.substr(0, 5) : '' }}-{{ scope.row.endClassTime ? scope.row.endClassTime.substr(0, 5) : '' }}
  69. </template>
  70. </el-table-column>
  71. <el-table-column align='center'
  72. prop="classGroupName"
  73. label="班级名称">
  74. </el-table-column>
  75. <el-table-column align='center'
  76. prop="courseScheduleType"
  77. label="课程类型">
  78. <template slot-scope="scope">
  79. <div>
  80. {{ scope.row.courseScheduleType | coursesType}}
  81. </div>
  82. </template>
  83. </el-table-column>
  84. <el-table-column align='center'
  85. prop="masterTeacherName"
  86. label="指导老师">
  87. </el-table-column>
  88. </el-table>
  89. <pagination :total="rules.total"
  90. :page.sync="rules.page"
  91. :limit.sync="rules.limit"
  92. :page-sizes="rules.page_size"
  93. @pagination="getList" />
  94. </div>
  95. </div>
  96. </template>
  97. <script>
  98. import pagination from '@/components/Pagination/index'
  99. import { getTeacher, getMusicGroupAllClass, getCourseSchedule } from '@/api/buildTeam'
  100. export default {
  101. name: 'tcourseList',
  102. props: {
  103. teamid: {
  104. type: String,
  105. required: true
  106. },
  107. },
  108. data () {
  109. return {
  110. timerVisible: false,
  111. courseVisible: false,
  112. searchForm: {
  113. courseStatus: '', // 课程类型
  114. classStatus: '', // 课程状态
  115. timer: [], // 时间
  116. class: ''
  117. },
  118. tableList: [],
  119. searchLsit: [],
  120. rules: {
  121. // 分页规则
  122. limit: 10, // 限制显示条数
  123. page: 1, // 当前页
  124. total: 0, // 总条数
  125. page_size: [10, 20, 40, 50] // 选择限制显示条数
  126. },
  127. teacherList: [],
  128. classList: []
  129. }
  130. },
  131. components: {
  132. pagination
  133. },
  134. activated () {
  135. this.init()
  136. },
  137. mounted () {
  138. this.init()
  139. },
  140. methods: {
  141. /**
  142. * courseStatus: '', // 课程类型
  143. classStatus: '', // 课程状态
  144. timer:[] // 时间
  145. *
  146. */
  147. init () {
  148. this.getList();
  149. // 获取所有老师
  150. getTeacher().then(res => {
  151. if (res.code == 200) {
  152. this.teacherList = res.data;
  153. }
  154. })
  155. // 获取班级列表
  156. getMusicGroupAllClass({ musicGroupId: this.teamid }).then(res => {
  157. if (res.code == 200) {
  158. this.classList = res.data;
  159. }
  160. })
  161. },
  162. search () {
  163. this.rules.page = 1;
  164. this.getList();
  165. },
  166. getList () {
  167. if (!this.searchForm.timer) {
  168. this.searchForm.timer = []
  169. }
  170. let obj = {
  171. classScheduleStatus: this.searchForm.classStatus || null,
  172. classScheduleType: this.searchForm.courseStatus || null,
  173. musicGroupId: this.teamid,
  174. startTime: this.searchForm.timer[0] || null,
  175. endTime: this.searchForm.timer[1] || null,
  176. page: this.rules.page, rows: this.rules.limit,
  177. classGroupId: this.searchForm.class || null
  178. }
  179. getCourseSchedule(obj).then(res => {
  180. if (res.code == 200) {
  181. this.tableList = res.data.rows;
  182. this.rules.total = res.data.total;
  183. }
  184. })
  185. }
  186. }
  187. }
  188. </script>
  189. <style lang="scss" scope>
  190. .cl-container {
  191. .topFrom {
  192. margin: 20px 30px 0;
  193. .classlist {
  194. display: flex;
  195. flex-direction: row;
  196. justify-content: flex-start;
  197. align-items: center;
  198. ul {
  199. li {
  200. list-style: none;
  201. }
  202. }
  203. }
  204. }
  205. .searchForm {
  206. margin: 0 30px;
  207. }
  208. }
  209. .btnWraps {
  210. display: flex;
  211. flex-direction: row;
  212. justify-content: flex-start;
  213. div {
  214. margin-right: 20px;
  215. }
  216. }
  217. </style>