studentRecord.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <div>
  3. <!-- 搜索类型 -->
  4. <el-form :inline="true"
  5. class="searchForm"
  6. v-model="searchForm">
  7. <el-form-item>
  8. <el-select v-model="searchForm.classGroupType"
  9. placeholder="课程类型">
  10. <el-option v-for="(item, index) in courseArray"
  11. :key="index"
  12. :label="item.label"
  13. :value="item.value"></el-option>
  14. </el-select>
  15. </el-form-item>
  16. <el-form-item>
  17. <el-select v-model="searchForm.attendanceStatus"
  18. placeholder="考勤状态">
  19. <el-option v-for="(item, index) in att"
  20. :key="index"
  21. :label="item.label"
  22. :value="item.value"></el-option>
  23. </el-select>
  24. </el-form-item>
  25. <el-form-item>
  26. <el-input placeholder="班级名称"
  27. v-model="searchForm.classGroupName"></el-input>
  28. </el-form-item>
  29. <el-form-item>
  30. <el-input placeholder="老师姓名"
  31. v-model="searchForm.teacherName"></el-input>
  32. </el-form-item>
  33. <el-form-item>
  34. <el-button @click="search"
  35. type="danger">搜索</el-button>
  36. </el-form-item>
  37. <el-form-item>
  38. <el-button @click="onReSet"
  39. type="primary">重置</el-button>
  40. </el-form-item>
  41. </el-form>
  42. <!-- 查询列表 -->
  43. <!-- <div class="searchWrap">
  44. <p>查询条件:</p>
  45. <div class="searchItem"
  46. @click="closeSearch(item)"
  47. v-for="(item,index) in searchLsit">
  48. {{ item.key }}
  49. <i class="el-icon-close"></i>
  50. </div>
  51. </div> -->
  52. <!-- 列表 -->
  53. <div class="tableWrap">
  54. <el-table :data='tableList'
  55. :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  56. <el-table-column align='center'
  57. prop="courseDate"
  58. label="上课时间">
  59. </el-table-column>
  60. <el-table-column align='center'
  61. label="星期几">
  62. <template slot-scope="scope">
  63. {{ scope.row.courseDate | formatWeek }}
  64. </template>
  65. </el-table-column>
  66. <el-table-column align='center'
  67. label="课程类型">
  68. <template slot-scope="scope">
  69. {{ scope.row.classGroupType | coursesType }}
  70. </template>
  71. </el-table-column>
  72. <el-table-column align='center'
  73. prop="classGroupName"
  74. label="班级名称">
  75. </el-table-column>
  76. <el-table-column align='center'
  77. prop="currentCLassTimes"
  78. label="当前课次">
  79. <template slot-scope="scope">
  80. <div>
  81. {{ scope.row.currentCLassTimes + '/'+scope.row.totalClassTimes }}
  82. </div>
  83. </template>
  84. </el-table-column>
  85. <el-table-column align='center'
  86. prop="teacherName"
  87. label="课程老师">
  88. </el-table-column>
  89. <el-table-column align='center'
  90. prop="attendanceStatus"
  91. label="考勤状态">
  92. <template slot-scope="scope">
  93. {{ scope.row.attendanceStatus | clockingIn }}
  94. </template>
  95. </el-table-column>
  96. </el-table>
  97. <pagination :total="pageInfo.total"
  98. :page.sync="pageInfo.page"
  99. :limit.sync="pageInfo.limit"
  100. :page-sizes="pageInfo.page_size"
  101. @pagination="getList" />
  102. </div>
  103. </div>
  104. </template>
  105. <script>
  106. import pagination from '@/components/Pagination/index'
  107. import { findStudentAttendances } from '@/api/studentManager'
  108. export default {
  109. name: 'studentRecord',
  110. components: { pagination },
  111. data () {
  112. return {
  113. searchForm: {
  114. studentId: this.$route.query.userId,
  115. classGroupType: null,
  116. attendanceStatus: null,
  117. classGroupName: null,
  118. teacherName: null
  119. },
  120. searchLsit: [],
  121. tableList: [],
  122. courseArray: [
  123. { label: '单技课', value: 'NORMAL' },
  124. { label: '合奏课', value: 'MIX' },
  125. { label: '基础技能班', value: 'HIGH' },
  126. { label: 'VIP课', value: 'VIP' },
  127. { label: '试听课', value: 'DEMO' }
  128. ],
  129. att: [
  130. { value: "NORMAL", label: "正常" },
  131. { value: "TRUANT", label: "旷课" },
  132. { value: "LEAVE", label: "请假" },
  133. { value: "DROP_OUT", label: "休学" },
  134. ],
  135. pageInfo: {
  136. // 分页规则
  137. limit: 10, // 限制显示条数
  138. page: 1, // 当前页
  139. total: 0, // 总条数
  140. page_size: [10, 20, 40, 50] // 选择限制显示条数
  141. },
  142. }
  143. },
  144. mounted () {
  145. this.getList()
  146. },
  147. methods: {
  148. search () {
  149. this.pageInfo.page = 1;
  150. this.getList();
  151. },
  152. getList () {
  153. let params = this.searchForm
  154. params.rows = this.pageInfo.limit
  155. params.page = this.pageInfo.page
  156. findStudentAttendances(params).then(res => {
  157. if (res.code == 200) {
  158. this.tableList = res.data.rows
  159. this.pageInfo.total = res.data.total
  160. }
  161. })
  162. },
  163. onReSet () { // 重置搜索
  164. this.searchForm = {
  165. studentId: this.$route.query.userId,
  166. classGroupType: null,
  167. attendanceStatus: null,
  168. classGroupName: null,
  169. teacherName: null
  170. }
  171. this.getList()
  172. },
  173. }
  174. }
  175. </script>
  176. <style lang="scss">
  177. </style>