123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- <template>
- <div>
- <el-form :inline="true" ref="searchForm" :model="searchForm">
- <el-form-item prop="dates">
- <el-date-picker
- v-model="searchForm.dates"
- type="daterange"
- style="width: 405px"
- range-separator="至"
- start-placeholder="课程开始日期"
- end-placeholder="课程结束日期"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item prop="groupType">
- <el-select
- v-model.trim="searchForm.groupType"
- placeholder="请选择课程组类型"
- >
- <el-option
- v-for="(item, index) in courseListType"
- :key="index"
- :value="item.value"
- :label="item.label"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="status">
- <el-select
- v-model.trim="searchForm.status"
- placeholder="请选择考勤状态"
- clearable
- >
- <el-option
- v-for="(item, index) in attendanceStatus"
- :key="index"
- :value="item.value"
- :label="item.label"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button @click="search" type="danger">搜索</el-button>
- <el-button @click="onReSet" type="primary">重置</el-button>
- </el-form-item>
- </el-form>
- <el-table
- style="width: 100%"
- :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
- :data="tableList"
- >
- <el-table-column align="center" prop="courseScheduleId" label="课程编号">
- <template slot-scope="scope">
- <div>
- <copy-text>{{ scope.row.courseScheduleId }}</copy-text>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="courseSchedule.name"
- label="课程名称"
- ></el-table-column>
- <el-table-column
- width="180px"
- align="center"
- prop="startClassTime"
- label="上课时间"
- >
- <template slot-scope="scope">
- <div>
- {{ scope.row.courseSchedule.classDate | dayjsFormat }}
- {{ scope.row.courseSchedule.startClassTime | dayjsFormatMinute }}-{{
- scope.row.courseSchedule.endClassTime | dayjsFormatMinute
- }}
- </div>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="startClassTime" label="课程组类型">
- <template slot-scope="scope">
- <div>
- {{ scope.row.groupType | coursesType }}
- </div>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="startClassTime" label="课程类型">
- <template slot-scope="scope">
- <div>
- {{ scope.row.courseSchedule.type | coursesType }}
- </div>
- </template>
- </el-table-column>
- <el-table-column align="center" label="考勤状态">
- <template slot-scope="scope">
- <div>
- {{ scope.row.status | clockingIn }}
- </div>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- :total.sync="rules.total"
- :page.sync="rules.page"
- :limit.sync="rules.limit"
- :page-sizes="rules.page_size"
- @pagination="getList"
- />
- </div>
- </template>
- <script>
- import { courseListType, stuAttendance } from "@/utils/searchArray";
- import pagination from "@/components/Pagination/index";
- import { findStudentAttendance } from "@/api/buildTeam";
- import { getTimes } from "@/utils";
- export default {
- components: { pagination },
- props:['studentId'],
- data() {
- return {
- searchForm: {
- studentID: "",
- groupType: "",
- status: "",
- dates: [],
- },
- courseListType,
- attendanceStatus: stuAttendance,
- rules: {
- // 分页规则
- limit: 10, // 限制显示条数
- page: 1, // 当前页
- total: 0, // 总条数
- page_size: [10, 20, 40, 50], // 选择限制显示条数
- },
- tableList: [],
- };
- },
- mounted() {
- this.searchForm.studentID = this.studentId
- if (this.searchForm.dates?.length < 1) {
- this.searchForm.dates = [new Date().setDate(1), new Date()];
- }
- this.init();
- },
- methods: {
- init(){
- this.getList()
- },
- search() {
- this.rules.page =1;
- this.getList()
- },
- onReSet() {
- this.$refs["searchForm"].resetFields();
- this.search();
- },
- getList() {
- const { dates, ...rest } = this.searchForm;
- let obj = {
- ...rest,
- page: this.rules.page,
- rows: this.rules.limit,
- ...getTimes(dates, ["startDateOfCourse", "endDateOfCourse"], "YYYY-MM-DD"),
- }
- findStudentAttendance(obj).then((res) => {
- if (res.code == 200) {
- this.tableList = res.data.rows;
- this.rules.total = res.data.total;
- }
- });
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- </style>
|