studentRecord.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <template>
  2. <div>
  3. <!-- 搜索类型 -->
  4. <save-form
  5. :inline="true"
  6. ref="searchForm"
  7. :model="searchForm"
  8. @submit="search"
  9. @reset="onReSet"
  10. save-key='studentDetail-studentRecord'
  11. >
  12. <el-form-item prop="teacherId">
  13. <remote-search :commit='"setTeachers"' v-model='searchForm.teacherId' />
  14. </el-form-item>
  15. <el-form-item prop="musicGroupId">
  16. <el-input
  17. v-model.trim="searchForm.musicGroupId"
  18. clearable
  19. @keyup.enter.native="search"
  20. placeholder="乐团编号"
  21. ></el-input>
  22. </el-form-item>
  23. <el-form-item prop="courseScheduleId">
  24. <el-input
  25. v-model.trim="searchForm.courseScheduleId"
  26. clearable
  27. @keyup.enter.native="search"
  28. placeholder="课程编号"
  29. ></el-input>
  30. </el-form-item>
  31. <el-form-item prop="groupType">
  32. <el-select
  33. v-model.trim="searchForm.groupType"
  34. placeholder="请选择课程组类型"
  35. >
  36. <el-option
  37. v-for="(item, index) in courseListType"
  38. :key="index"
  39. :value="item.value"
  40. :label="item.label"
  41. ></el-option>
  42. </el-select>
  43. </el-form-item>
  44. <el-form-item prop="courseScheduleType">
  45. <el-select
  46. v-model.trim="searchForm.courseScheduleType"
  47. clearable
  48. placeholder="请选择课程类型"
  49. >
  50. <el-option
  51. v-for="(item, index) in courseType"
  52. :key="index"
  53. :value="item.value"
  54. :label="item.label"
  55. ></el-option>
  56. </el-select>
  57. </el-form-item>
  58. <el-form-item prop="status">
  59. <el-select
  60. v-model.trim="searchForm.status"
  61. placeholder="请选择考勤状态"
  62. >
  63. <el-option
  64. v-for="(item, index) in attendanceStatus"
  65. :key="index"
  66. :value="item.value"
  67. :label="item.label"
  68. ></el-option>
  69. </el-select>
  70. </el-form-item>
  71. <el-form-item prop="dates" >
  72. <el-date-picker
  73. v-model="dates"
  74. type="daterange"
  75. style="width: 405px;"
  76. range-separator="至"
  77. start-placeholder="课程开始日期"
  78. end-placeholder="课程结束日期">
  79. </el-date-picker>
  80. </el-form-item>
  81. <el-form-item>
  82. <el-button native-type="submit" type="danger">搜索</el-button>
  83. <el-button native-type="reset" type="primary">重置</el-button>
  84. </el-form-item>
  85. </save-form>
  86. <div class="tableWrap">
  87. <div class="tableWrap">
  88. <el-table
  89. style="width: 100%"
  90. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  91. :data="tableList"
  92. >
  93. <el-table-column
  94. align="center"
  95. prop="courseSchedule.organization.name"
  96. label="分部"
  97. ></el-table-column>
  98. <el-table-column align="center" prop="username" label="学生姓名">
  99. <template slot-scope="scope">
  100. <div>
  101. {{ scope.row.username }}
  102. <p style="color: #f56c6c">
  103. (<copy-text>{{ scope.row.userId }}</copy-text
  104. >)
  105. </p>
  106. </div>
  107. </template>
  108. </el-table-column>
  109. <el-table-column
  110. align="center"
  111. prop="courseSchedule.teacherName"
  112. label="老师姓名"
  113. >
  114. <template slot-scope="scope">
  115. {{ scope.row.courseSchedule.teacherName }}
  116. <p style="color: #f56c6c">
  117. (<copy-text>{{ scope.row.teacherId }}</copy-text
  118. >)
  119. </p>
  120. </template>
  121. </el-table-column>
  122. <el-table-column
  123. align="center"
  124. prop="musicGroupId"
  125. label="乐团编号"
  126. >
  127. <template slot-scope="scope">
  128. <div>
  129. <copy-text>{{ scope.row.musicGroupId }}</copy-text>
  130. </div>
  131. </template>
  132. </el-table-column>
  133. <el-table-column
  134. align="center"
  135. prop="courseScheduleId"
  136. label="课程编号"
  137. >
  138. <template slot-scope="scope">
  139. <div>
  140. <copy-text>{{ scope.row.courseScheduleId }}</copy-text>
  141. </div>
  142. </template>
  143. </el-table-column>
  144. <el-table-column
  145. align="center"
  146. prop="courseSchedule.name"
  147. label="课程名称"
  148. ></el-table-column>
  149. <el-table-column
  150. align="center"
  151. prop="courseSchedule.classDate"
  152. label="上课日期"
  153. >
  154. <template slot-scope="scope">
  155. <div>
  156. {{ scope.row.courseSchedule.classDate | dayjsFormat }}
  157. </div>
  158. </template>
  159. </el-table-column>
  160. <el-table-column
  161. align="center"
  162. prop="startClassTime"
  163. label="上课时间"
  164. >
  165. <template slot-scope="scope">
  166. <div>
  167. {{
  168. scope.row.courseSchedule.startClassTime | dayjsFormatMinute
  169. }}-{{
  170. scope.row.courseSchedule.endClassTime | dayjsFormatMinute
  171. }}
  172. </div>
  173. </template>
  174. </el-table-column>
  175. <el-table-column
  176. align="center"
  177. prop="startClassTime"
  178. label="课程组类型"
  179. >
  180. <template slot-scope="scope">
  181. <div>
  182. {{ scope.row.groupType | coursesType }}
  183. </div>
  184. </template>
  185. </el-table-column>
  186. <el-table-column
  187. align="center"
  188. prop="startClassTime"
  189. label="课程类型"
  190. >
  191. <template slot-scope="scope">
  192. <div>
  193. {{ scope.row.courseSchedule.type | coursesType }}
  194. </div>
  195. </template>
  196. </el-table-column>
  197. <el-table-column align="center" label="是否被合并">
  198. <template slot-scope="scope">
  199. <div>
  200. {{ scope.row.courseSchedule.newCourseId > 0 ? '是' : '否' }}
  201. </div>
  202. </template>
  203. </el-table-column>
  204. <el-table-column align="center" label="签到时间" width="180px">
  205. <template slot-scope="scope">
  206. <div>
  207. {{ scope.row.signInTime }}
  208. </div>
  209. </template>
  210. </el-table-column>
  211. <el-table-column
  212. align="center"
  213. prop="startClassTime"
  214. width="180px"
  215. label="签退时间"
  216. >
  217. <template slot-scope="scope">
  218. <div>
  219. {{ scope.row.signOutTime }}
  220. </div>
  221. </template>
  222. </el-table-column>
  223. <el-table-column align="center" label="考勤状态">
  224. <template slot-scope="scope">
  225. <div>
  226. {{ scope.row.status | clockingIn }}
  227. </div>
  228. </template>
  229. </el-table-column>
  230. <el-table-column align="center" label="教学模式">
  231. <template slot-scope="scope">
  232. <div>
  233. {{ scope.row.courseSchedule.teachMode | teachMode }}
  234. </div>
  235. </template>
  236. </el-table-column>
  237. </el-table>
  238. <pagination
  239. sync
  240. save-key='studentDetail-studentRecord'
  241. :total.sync="pageInfo.total"
  242. :page.sync="pageInfo.page"
  243. :limit.sync="pageInfo.limit"
  244. :page-sizes="pageInfo.page_size"
  245. @pagination="getList"
  246. />
  247. </div>
  248. </div>
  249. </div>
  250. </template>
  251. <script>
  252. import pagination from "@/components/Pagination/index";
  253. import { findStudentAttendance } from "@/api/buildTeam";
  254. import { getTimes } from "@/utils";
  255. import {
  256. courseType,
  257. courseListType,
  258. attendanceStatus,
  259. } from "@/utils/searchArray";
  260. export default {
  261. name: "studentRecord",
  262. components: { pagination },
  263. data () {
  264. return {
  265. searchForm: {
  266. studentID: "",
  267. groupType: "MUSIC",
  268. musicGroupId: "",
  269. courseScheduleId: "",
  270. status: "",
  271. teacherId:'',
  272. courseScheduleType:''
  273. },
  274. dates:[],
  275. searchLsit: [],
  276. tableList: [],
  277. courseType,
  278. courseListType,
  279. attendanceStatus,
  280. pageInfo: {
  281. // 分页规则
  282. limit: 10, // 限制显示条数
  283. page: 1, // 当前页
  284. total: 0, // 总条数
  285. page_size: [10, 20, 40, 50] // 选择限制显示条数
  286. }
  287. };
  288. },
  289. mounted () {
  290. this.searchForm.studentID = this.$route.query.userId;
  291. this.getList();
  292. },
  293. activated () {
  294. this.searchForm.studentID = this.$route.query.userId;
  295. this.getList();
  296. },
  297. methods: {
  298. search () {
  299. this.pageInfo.page = 1;
  300. this.getList();
  301. },
  302. getList () {
  303. let obj = {
  304. page: this.pageInfo.page,
  305. rows: this.pageInfo.limit,
  306. ...this.searchForm,
  307. ...getTimes(this.dates, ["startDateOfCourse", "endDateOfCourse"],'YYYY-MM-DD'),
  308. };
  309. findStudentAttendance(obj).then(res => {
  310. if (res.code == 200) {
  311. this.tableList = res.data.rows;
  312. this.pageInfo.total = res.data.total;
  313. }
  314. });
  315. },
  316. onReSet () {
  317. // 重置搜索
  318. this.$refs.searchForm.resetFields();
  319. this.searchForm.studentId = this.$route.query.userId;
  320. this.getList();
  321. }
  322. }
  323. };
  324. </script>
  325. <style lang="scss">
  326. </style>