studentSignin.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <div class="m-container">
  3. <h2>
  4. <el-page-header @back="onCancel"
  5. content="学生点名总览"></el-page-header>
  6. <!-- <div class="term">第一学期</div>
  7. <div class="term active">第二学期</div> -->
  8. </h2>
  9. <div class='m-core'>
  10. <!-- <div class="searchBtn">导出</div> -->
  11. <!-- table -->
  12. <el-form :inline="true"
  13. :model="searchForm">
  14. <el-form-item label='开课时间'>
  15. <el-date-picker v-model="searchForm.times"
  16. type="daterange"
  17. value-format="yyyy-MM-dd"
  18. format="yyyy-MM-dd"
  19. range-separator="至"
  20. start-placeholder="开始日期"
  21. end-placeholder="结束日期">
  22. </el-date-picker>
  23. </el-form-item>
  24. <el-form-item label='班级名称'>
  25. <el-select v-model="searchForm.className">
  26. <el-option v-for='(item,index) in classList'
  27. :key='index'
  28. :label="item.name"
  29. :value="item.id"></el-option>
  30. </el-select>
  31. </el-form-item>
  32. <el-form-item label='学生名字'>
  33. <el-input v-model="searchForm.studentName"></el-input>
  34. </el-form-item>
  35. <el-form-item label='签到'>
  36. <el-select v-model="searchForm.sign"
  37. clearable>
  38. <el-option label="正常"
  39. value="NORMAL"></el-option>
  40. <el-option label="旷课"
  41. value="TRUANT"></el-option>
  42. <el-option label="请假"
  43. value="LEAVE"></el-option>
  44. </el-select>
  45. </el-form-item>
  46. <el-form-item>
  47. <el-button type="danger"
  48. @click="search">搜索</el-button>
  49. </el-form-item>
  50. <el-form-item>
  51. <el-button type="primary"
  52. @click="reset">重置</el-button>
  53. </el-form-item>
  54. </el-form>
  55. <div class="tableList">
  56. <el-table :data='tableList'>
  57. <el-table-column align='center'
  58. prop="signTime"
  59. label="时间">
  60. </el-table-column>
  61. <el-table-column align='center'
  62. prop="classGroupName"
  63. label="班级名称">
  64. </el-table-column>
  65. <el-table-column align='center'
  66. prop="name"
  67. label="学生名称">
  68. </el-table-column>
  69. <el-table-column align='center'
  70. prop="signStatus"
  71. label="签到">
  72. <template slot-scope="scope">
  73. <div>
  74. {{ scope.row.signStatus|studentSign}}
  75. </div>
  76. </template>
  77. </el-table-column>
  78. </el-table>
  79. <pagination :total="rules.total"
  80. :page.sync="rules.page"
  81. :limit.sync="rules.limit"
  82. :page-sizes="rules.page_size"
  83. @pagination="getList" />
  84. </div>
  85. </div>
  86. </div>
  87. </template>
  88. <script>
  89. import pagination from '@/components/Pagination/index'
  90. import { getStudentRecord } from '@/api/studentManager'
  91. import { getMusicGroupAllClass } from '@/api/buildTeam'
  92. export default {
  93. name: 'studentSignin',
  94. components: {
  95. pagination
  96. },
  97. data () {
  98. return {
  99. tableList: [], // table列表
  100. rules: {
  101. // 分页规则
  102. limit: 10, // 限制显示条数
  103. page: 1, // 当前页
  104. total: 0, // 总条数
  105. page_size: [10, 20, 40, 50] // 选择限制显示条数
  106. },
  107. searchForm: {
  108. times: [],
  109. courseName: '',
  110. studentName: '',
  111. sign: ''
  112. },
  113. teamid: ''
  114. }
  115. },
  116. created () {
  117. this.teamid = this.$route.query.id;
  118. // 判断是否带缓存参数
  119. if (this.$route.query.search) {
  120. this.Fsearch = this.$route.query.search;
  121. }
  122. if (this.$route.query.rules) {
  123. this.Frules = this.$route.query.rules
  124. }
  125. },
  126. mounted () {
  127. this.getList();
  128. // 获取乐团所有班级
  129. },
  130. methods: {
  131. search () {
  132. this.rules.page = 1;
  133. this.getList()
  134. },
  135. reset () {
  136. this.searchForm = {
  137. times: [],
  138. courseName: '',
  139. studentName: '',
  140. sign: ''
  141. }
  142. this.rules.page = 1;
  143. this.getList()
  144. },
  145. onCancel () {
  146. // history.go(-1)
  147. let params = this.$route.query
  148. this.$router.push({
  149. path: '/business/teamDetails',
  150. query: {
  151. id: params.id,
  152. status: params.status,
  153. name: params.name,
  154. checkIndex: "3",
  155. rules: this.Frules, search: this.Fsearch
  156. }
  157. })
  158. },
  159. getList () {
  160. if (!this.searchForm.times) {
  161. this.searchForm.times = []
  162. }
  163. let startTime = this.searchForm.times[0] || null
  164. if (startTime) startTime += ' 00:00:00'
  165. let endTime = this.searchForm.times[1] || null
  166. if (endTime) endTime += ' 23:59:59'
  167. let courseScheduleName = this.searchForm.courseName || null
  168. let userName = this.searchForm.studentName || null
  169. let signStatus = this.searchForm.sign || null
  170. let musicGroupId = this.teamid
  171. getStudentRecord({ musicGroupId, page: this.rules.page, rows: this.rules.limit, startTime, endTime, courseScheduleName, userName, signStatus }).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" scope>
  182. // .m-container {
  183. // h2 {
  184. // height: 48px;
  185. // line-height: 48px;
  186. // position: relative;
  187. // // padding-left: 30px;
  188. // margin-bottom: 30px;
  189. // display: flex;
  190. // flex-direction: row;
  191. // justify-content: flex-start;
  192. // align-items: center;
  193. // .term {
  194. // height: 32px;
  195. // line-height: 32px;
  196. // border-radius: 24px;
  197. // width: 100px;
  198. // color: #14928a;
  199. // border: 1px solid rgba(20, 146, 138, 1);
  200. // font-size: 14px;
  201. // text-align: center;
  202. // margin-right: 12px;
  203. // &:nth-child(1) {
  204. // margin-left: 47px;
  205. // }
  206. // }
  207. // .term.active {
  208. // color: #fff;
  209. // background-color: #14928a;
  210. // }
  211. // }
  212. // }
  213. </style>