| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262 |
- <template>
- <div class="tr-cotainer">
- <!-- 搜索标题 -->
- <save-form
- :inline="true"
- save-key="teacherDetail-record"
- class="searchForm"
- :model="searchForm"
- @submit="search"
- @reset="onReSet"
- >
- <el-form-item>
- <el-date-picker
- style="width: 400px"
- v-model.trim="searchForm.courseDate"
- type="daterange"
- value-format="yyyy-MM-dd"
- range-separator="至"
- start-placeholder="课程开始日期"
- end-placeholder="课程结束日期"
- :picker-options="{
- firstDayOfWeek: 1,
- }"
- ></el-date-picker>
- </el-form-item>
- <el-form-item>
- <el-select
- v-model.trim="searchForm.courseScheduleType"
- clearable
- filterable
- placeholder="课程类型"
- >
- <el-option
- v-for="(item, index) in courseType"
- :key="index"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-input
- placeholder="课程名称"
- @keyup.enter.native="search"
- v-model.trim="searchForm.classGroupName"
- clearable
- ></el-input>
- </el-form-item>
- <el-form-item>
- <el-select
- v-model.trim="searchForm.signInStatus"
- filterable
- clearable
- placeholder="签到状态"
- >
- <el-option :value="1" label="正常签到"></el-option>
- <el-option :value="0" label="异常签到"></el-option>
- <el-option :value="3" label="未签到"></el-option>
- <!-- <el-option
- v-for="(item, index) in attendance"
- :key="index"
- :label="item.label"
- :value="item.value"
- ></el-option> -->
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-select
- v-model.trim="searchForm.signOutStatus"
- filterable
- clearable
- placeholder="签退状态"
- >
- <!-- <el-option
- v-for="(item, index) in attendance"
- :key="index"
- :label="item.label"
- :value="item.value"
- ></el-option> -->
- <el-option :value="1" label="正常签退"></el-option>
- <el-option :value="0" label="异常签退"></el-option>
- <el-option :value="3" label="未签退"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button native-type="search" type="danger">搜索</el-button>
- <el-button native-type="reset" type="primary">重置</el-button>
- </el-form-item>
- </save-form>
- <!-- 列表 -->
- <div class="tableWrap">
- <div class="tableWrap">
- <el-table
- :data="tableList"
- :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
- >
- <el-table-column
- align="center"
- prop="courseScheduleId"
- label="课程编号"
- >
- <template slot-scope="scope">
- <copy-text>
- {{ scope.row.courseScheduleId }}
- </copy-text>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="name" label="课程名称">
- <template slot-scope="scope">
- <copy-text>
- {{ scope.row.name }}
- </copy-text>
- </template>
- </el-table-column>
- <el-table-column align="center" label="上课时间" width="150">
- <template slot-scope="scope"
- >{{ scope.row.classDate }}
- {{ scope.row.startClassTime.substring(0, 5) }}</template
- >
- </el-table-column>
- <el-table-column align="center" label="下课时间" width="150">
- <template slot-scope="scope"
- >{{ scope.row.classDate }}
- {{ scope.row.endClassTime.substring(0, 5) }}</template
- >
- </el-table-column>
- <el-table-column align="center" label="课程类型">
- <template slot-scope="scope">{{
- scope.row.type | coursesType
- }}</template>
- </el-table-column>
- <el-table-column align="center" label="签到状态">
- <template slot-scope="scope">
- <div v-if="scope.row.courseStatus != 'NOT_START'">{{
- scope.row.signInStatus | attendanceType
- }}</div>
- </template>
- </el-table-column>
- <el-table-column align="center" label="签退状态">
- <template slot-scope="scope">
- <div v-if="scope.row.courseStatus != 'NOT_START'">{{
- scope.row.signOutStatus | attendanceOutType
- }}</div>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="remark"
- label="备注"
- ></el-table-column>
- </el-table>
- <pagination
- save-key="teacherDetail-record"
- sync
- :total.sync="pageInfo.total"
- :page.sync="pageInfo.page"
- :limit.sync="pageInfo.limit"
- :page-sizes="pageInfo.page_size"
- @pagination="getList"
- />
- </div>
- </div>
- </div>
- </template>
- <script>
- import { getTeacherPersonalAttendances } from "@/api/teacherManager";
- import pagination from "@/components/Pagination/index";
- import store from "@/store";
- import { courseType, attendance } from "@/utils/searchArray";
- import { getTimes } from "@/utils";
- export default {
- name: "teacherRecord",
- components: {
- pagination,
- },
- data() {
- return {
- courseType: courseType, // 课程类型
- attendance: attendance, // 考勤状态
- searchForm: {
- courseStartDate: null,
- courseEndDate: null,
- classGroupName: null,
- courseScheduleType: null,
- signInStatus: null,
- signOutStatus: null,
- courseDate:[]
- },
- tableList: [],
- organId: null,
- teacherId: this.$route.query.teacherId,
- pageInfo: {
- // 分页规则
- limit: 10, // 限制显示条数
- page: 1, // 当前页
- total: 1, // 总条数
- page_size: [10, 20, 40, 50], // 选择限制显示条数
- },
- };
- },
- mounted() {
- this.getList();
- },
- activated() {
- this.getList();
- },
- methods: {
- search() {
- this.pageInfo.page = 1;
- this.getList();
- },
- getList() {
- const { courseDate, ...rest } = this.searchForm;
- let params = {
- ...rest,
- ...getTimes(courseDate, ["courseStartDate", "courseEndDate"]),
- page: this.pageInfo.page,
- rows: this.pageInfo.limit,
- teacherId: this.teacherId
- };
- // let params = this.searchForm;
- // params.rows = this.pageInfo.limit;
- // (params.page = this.pageInfo.page), (params.teacherId = this.teacherId);
- getTeacherPersonalAttendances(params).then((res) => {
- if (res.code == 200) {
- this.tableList = res.data.rows;
- this.pageInfo.total = res.data.total;
- }
- });
- },
- searchCourseDate(value) {
- if (value) {
- this.searchForm.courseStartDate = value[0];
- this.searchForm.courseEndDate = value[1];
- } else {
- this.searchForm.courseStartDate = null;
- this.searchForm.courseEndDate = null;
- }
- },
- onReSet() {
- this.courseDate = null;
- this.searchForm = {
- courseStartDate: null,
- courseEndDate: null,
- classGroupName: null,
- courseScheduleType: null,
- signInStatus: null,
- signOutStatus: null
- };
- this.getList()
- },
- },
- };
- </script>
- <style lang="scss" scope>
- .tr-cotainer {
- // margin-top: 20px;
- }
- </style>
|