teamTeacherRecord.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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. :picker-options="{
  36. firstDayOfWeek: 1
  37. }">
  38. </el-date-picker>
  39. </el-form-item>
  40. <el-form-item>
  41. <el-input v-model.trim="searchForm.teacher"
  42. @keyup.enter.native='search'
  43. placeholder="请输入老师姓名"></el-input>
  44. </el-form-item>
  45. <el-form-item>
  46. <div class="searchBtn"
  47. @click="search">搜索</div>
  48. </el-form-item>
  49. </el-form>
  50. <div class="tableList">
  51. <el-table :data='tableList'>
  52. <el-table-column align='center'
  53. prop="classDate"
  54. label="时间">
  55. <template slot-scope="scope">
  56. {{ scope.row.classDate }} {{ scope.row.startClassTime ? scope.row.startClassTime.substr(0, 5) : '' }}
  57. </template>
  58. </el-table-column>
  59. <el-table-column align='center'
  60. prop="courseScheduleName"
  61. label="课程名称">
  62. </el-table-column>
  63. <el-table-column align='center'
  64. prop="realName"
  65. label="老师名称">
  66. </el-table-column>
  67. <el-table-column align='center'
  68. prop="signInStatus"
  69. label="签到">
  70. <template slot-scope="scope">
  71. <div>
  72. {{ scope.row.signInStatus|attendanceType}}
  73. </div>
  74. </template>
  75. </el-table-column>
  76. <el-table-column align='center'
  77. prop="signOutStatus"
  78. label="签退">
  79. <template slot-scope="scope">
  80. <div>
  81. {{ scope.row.signOutStatus|attendanceOutType}}
  82. </div>
  83. </template>
  84. </el-table-column>
  85. </el-table>
  86. <pagination :total="rules.total"
  87. :page.sync="rules.page"
  88. :limit.sync="rules.limit"
  89. :page-sizes="rules.page_size"
  90. @pagination="getList" />
  91. </div>
  92. </div>
  93. </template>
  94. <script>
  95. import { findMusicGroupClassTeacher, getTeacheerRecord } from '@/api/buildTeam'
  96. import pagination from '@/components/Pagination/index'
  97. export default {
  98. components: {
  99. pagination
  100. },
  101. data () {
  102. const query = this.$route.query
  103. return {
  104. name: query.name,
  105. searchForm: {
  106. teacher: '',
  107. timer: []
  108. },
  109. teamId: '',
  110. teacherList: [],
  111. tableList: [],
  112. rules: {
  113. // 分页规则
  114. limit: 10, // 限制显示条数
  115. page: 1, // 当前页
  116. total: 0, // 总条数
  117. page_size: [10, 20, 30, 40] // 选择限制显示条数
  118. },
  119. }
  120. },
  121. // created () {
  122. // this.teamId = this.$route.query.id;
  123. // },
  124. mounted () {
  125. // this.name = localStorage.getItem('teamName');
  126. // findMusicGroupClassTeacher({ musicGroupId: this.teamId }).then(res => {
  127. // if (res.code == 200) {
  128. // this.teacherList = res.data;
  129. // }
  130. // })
  131. this.teamId = this.$route.query.id;
  132. this.getList()
  133. },
  134. activated () {
  135. this.getList()
  136. },
  137. methods: {
  138. onCancel () {
  139. // window.history.back()
  140. let params = this.$route.query
  141. this.$router.push({
  142. path: '/business/teamDetails',
  143. query: {
  144. id: params.id,
  145. status: params.status,
  146. name: params.name,
  147. checkIndex: "2"
  148. }
  149. })
  150. },
  151. search () {
  152. this.rules.page = 1;
  153. this.getList();
  154. },
  155. reset () {
  156. this.rules.page = 1
  157. this.rules.limit = 10
  158. this.searchForm = {
  159. teacher: '',
  160. timer: []
  161. }
  162. this.getList()
  163. },
  164. getList () {
  165. //musicGroupId: this.teamId
  166. this.searchForm.timer = this.searchForm.timer || [];
  167. let obj = {
  168. page: this.rules.page,
  169. rows: this.rules.limit,
  170. musicGroupId: this.teamId,
  171. teacherName: this.searchForm.teacher || null,
  172. startTime: this.searchForm.timer[0] || null,
  173. endTime: this.searchForm.timer[1] || null,
  174. }
  175. getTeacheerRecord(obj).then(res => {
  176. if (res.code == 200) {
  177. this.tableList = res.data.rows;
  178. this.rules.total = res.data.total
  179. }
  180. })
  181. }
  182. },
  183. }
  184. </script>
  185. <style lang="scss">
  186. </style>