teamTeacherRecord.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <div class="m-container">
  3. <h2>
  4. <!-- <div class='squrt'></div>
  5. {{name}} -->
  6. <el-page-header @back="onCancel"
  7. :content="name"></el-page-header>
  8. </h2>
  9. <p style="margin-bottom:20px;">老师上课记录</p>
  10. <!-- 搜索类型 -->
  11. <el-form :inline="true"
  12. class="searchForm"
  13. v-model.trim="searchForm">
  14. <!-- <el-form-item>
  15. <el-select v-model.trim="searchForm.teacher">
  16. <el-option v-for='(item,index) in teacherList'
  17. :key="index"
  18. :value="item.id"
  19. :label="item.name"></el-option>
  20. </el-select>
  21. </el-form-item> -->
  22. <el-form-item>
  23. <el-input v-model="searchForm.teacher"
  24. @keyup.enter.native='search'
  25. placeholder="请输入老师姓名"></el-input>
  26. </el-form-item>
  27. <el-form-item>
  28. <el-date-picker v-model.trim="searchForm.timer"
  29. style="width:420px;"
  30. type="daterange"
  31. value-format="yyyy-MM-dd"
  32. range-separator="至"
  33. start-placeholder="开始日期"
  34. end-placeholder="结束日期">
  35. </el-date-picker>
  36. </el-form-item>
  37. <el-form-item>
  38. <el-input v-model.trim="searchForm.teacher"
  39. @keyup.enter.native='search'
  40. placeholder="请输入老师姓名"></el-input>
  41. </el-form-item>
  42. <el-form-item>
  43. <div class="searchBtn"
  44. @click="search">搜索</div>
  45. </el-form-item>
  46. </el-form>
  47. <div class="tableList">
  48. <el-table :data='tableList'>
  49. <el-table-column align='center'
  50. prop="classDate"
  51. label="时间">
  52. <template slot-scope="scope">
  53. {{ scope.row.classDate }} {{ scope.row.startClassTime ? scope.row.startClassTime.substr(0, 5) : '' }}
  54. </template>
  55. </el-table-column>
  56. <el-table-column align='center'
  57. prop="courseScheduleName"
  58. label="课程名称">
  59. </el-table-column>
  60. <el-table-column align='center'
  61. prop="realName"
  62. label="老师名称">
  63. </el-table-column>
  64. <el-table-column align='center'
  65. prop="signInStatus"
  66. label="签到">
  67. <template slot-scope="scope">
  68. <div>
  69. {{ scope.row.signInStatus|attendanceType}}
  70. </div>
  71. </template>
  72. </el-table-column>
  73. <el-table-column align='center'
  74. prop="signOutStatus"
  75. label="签退">
  76. <template slot-scope="scope">
  77. <div>
  78. {{ scope.row.signOutStatus|attendanceOutType}}
  79. </div>
  80. </template>
  81. </el-table-column>
  82. </el-table>
  83. <pagination :total="rules.total"
  84. :page.sync="rules.page"
  85. :limit.sync="rules.limit"
  86. :page-sizes="rules.page_size"
  87. @pagination="getList" />
  88. </div>
  89. </div>
  90. </template>
  91. <script>
  92. import { findMusicGroupClassTeacher, getTeacheerRecord } from '@/api/buildTeam'
  93. import pagination from '@/components/Pagination/index'
  94. export default {
  95. components: {
  96. pagination
  97. },
  98. data () {
  99. return {
  100. name: '',
  101. searchForm: {
  102. teacher: '',
  103. timer: []
  104. },
  105. teamId: '',
  106. teacherList: [],
  107. tableList: [],
  108. rules: {
  109. // 分页规则
  110. limit: 10, // 限制显示条数
  111. page: 1, // 当前页
  112. total: 0, // 总条数
  113. page_size: [10, 20, 30, 40] // 选择限制显示条数
  114. },
  115. }
  116. },
  117. created () {
  118. this.teamId = this.$route.query.id;
  119. },
  120. mounted () {
  121. this.name = localStorage.getItem('teamName');
  122. // findMusicGroupClassTeacher({ musicGroupId: this.teamId }).then(res => {
  123. // if (res.code == 200) {
  124. // this.teacherList = res.data;
  125. // }
  126. // })
  127. this.getList()
  128. },
  129. activated () {
  130. this.teamId = this.$route.query.id;
  131. this.getList()
  132. },
  133. methods: {
  134. onCancel () {
  135. // window.history.back()
  136. let params = this.$route.query
  137. this.$router.push({
  138. path: '/business/teamDetails',
  139. query: {
  140. id: params.id,
  141. status: params.status,
  142. name: params.name,
  143. checkIndex: "2"
  144. }
  145. })
  146. },
  147. search () {
  148. this.rules.page = 1;
  149. this.getList();
  150. },
  151. reset() {
  152. this.rules.page = 1
  153. this.rules.limit = 10
  154. this.searchForm = {
  155. teacher: '',
  156. timer: []
  157. }
  158. this.getList()
  159. },
  160. getList () {
  161. //musicGroupId: this.teamId
  162. this.searchForm.timer = this.searchForm.timer || [];
  163. let obj = {
  164. page: this.rules.page,
  165. rows: this.rules.limit,
  166. musicGroupId: this.teamId,
  167. teacherName: this.searchForm.teacher || null,
  168. startTime: this.searchForm.timer[0] || null,
  169. endTime: this.searchForm.timer[1] || null,
  170. }
  171. getTeacheerRecord(obj).then(res => {
  172. if (res.code == 200) {
  173. this.tableList = res.data.rows;
  174. this.rules.total = res.data.total
  175. }
  176. })
  177. }
  178. },
  179. }
  180. </script>
  181. <style lang="scss">
  182. </style>