studentRecord.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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. </el-table-column>
  80. <el-table-column align='center'
  81. prop="teacherName"
  82. label="课程老师">
  83. </el-table-column>
  84. <el-table-column align='center'
  85. prop="attendanceStatus"
  86. label="考勤状态">
  87. <template slot-scope="scope">
  88. {{ scope.row.attendanceStatus | clockingIn }}
  89. </template>
  90. </el-table-column>
  91. </el-table>
  92. <pagination :total="pageInfo.total"
  93. :page.sync="pageInfo.page"
  94. :limit.sync="pageInfo.limit"
  95. :page-sizes="pageInfo.page_size"
  96. @pagination="getList" />
  97. </div>
  98. </div>
  99. </template>
  100. <script>
  101. import pagination from '@/components/Pagination/index'
  102. import { findStudentAttendances } from '@/api/studentManager'
  103. export default {
  104. name: 'studentRecord',
  105. components: { pagination },
  106. data () {
  107. return {
  108. searchForm: {
  109. studentId: this.$route.query.userId,
  110. classGroupType: null,
  111. attendanceStatus: null,
  112. classGroupName: null,
  113. teacherName: null
  114. },
  115. searchLsit: [],
  116. tableList: [],
  117. courseArray: [
  118. { label: '单技课', value: 'NORMAL' },
  119. { label: '合奏课', value: 'MIX' },
  120. { label: '基础技能班', value: 'HIGH' },
  121. { label: 'VIP课', value: 'VIP' },
  122. { label: '试听课', value: 'DEMO' }
  123. ],
  124. att: [
  125. { value: "NORMAL", label: "正常" },
  126. { value: "TRUANT", label: "旷课" },
  127. { value: "LEAVE", label: "请假" },
  128. { value: "DROP_OUT", label: "休学" },
  129. ],
  130. pageInfo: {
  131. // 分页规则
  132. limit: 10, // 限制显示条数
  133. page: 1, // 当前页
  134. total: 0, // 总条数
  135. page_size: [10, 20, 40, 50] // 选择限制显示条数
  136. },
  137. }
  138. },
  139. mounted () {
  140. this.getList()
  141. },
  142. methods: {
  143. search () {
  144. this.pageInfo.page = 1;
  145. this.getList();
  146. },
  147. getList () {
  148. let params = this.searchForm
  149. params.rows = this.pageInfo.limit
  150. params.page = this.pageInfo.page
  151. findStudentAttendances(params).then(res => {
  152. if (res.code == 200) {
  153. this.tableList = res.data.rows
  154. this.pageInfo.total = res.data.total
  155. }
  156. })
  157. },
  158. onReSet () { // 重置搜索
  159. this.searchForm = {
  160. studentId: this.$route.query.userId,
  161. classGroupType: null,
  162. attendanceStatus: null,
  163. classGroupName: null,
  164. teacherName: null
  165. }
  166. this.getList()
  167. },
  168. }
  169. }
  170. </script>
  171. <style lang="scss">
  172. </style>