|
@@ -1,98 +1,139 @@
|
|
|
<template>
|
|
|
<div class="tr-cotainer">
|
|
|
<!-- 搜索标题 -->
|
|
|
- <el-form :inline="true"
|
|
|
- class="searchForm"
|
|
|
- v-model.trim="searchForm">
|
|
|
+ <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="courseDate"
|
|
|
- type="daterange"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- @change="searchCourseDate"
|
|
|
- range-separator="至"
|
|
|
- start-placeholder="课程开始日期"
|
|
|
- end-placeholder="课程结束日期"
|
|
|
- :picker-options="{
|
|
|
- firstDayOfWeek: 1
|
|
|
- }"></el-date-picker>
|
|
|
+ <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
|
|
|
+ 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"></el-input>
|
|
|
+ <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 v-for="(item, index) in attendance"
|
|
|
- :key="index"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"></el-option>
|
|
|
+ <el-select
|
|
|
+ v-model.trim="searchForm.signInStatus"
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ placeholder="考勤状态"
|
|
|
+ >
|
|
|
+ <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-button @click="search"
|
|
|
- type="danger">搜索</el-button>
|
|
|
- <el-button @click="onReSet"
|
|
|
- type="primary">重置</el-button>
|
|
|
+ <el-button native-type="search" type="danger">搜索</el-button>
|
|
|
+ <el-button native-type="reset" type="primary">重置</el-button>
|
|
|
</el-form-item>
|
|
|
- </el-form>
|
|
|
+ </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="课程编号"></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
|
|
|
+ :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"
|
|
|
- label="下课时间"
|
|
|
- width="150">
|
|
|
- <template slot-scope="scope">{{ scope.row.classDate }} {{ scope.row.endClassTime.substring(0,5) }}</template>
|
|
|
+ <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="课程类型">
|
|
|
- <template slot-scope="scope">{{ scope.row.type | coursesType }}</template>
|
|
|
+ <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"
|
|
|
- prop="name"
|
|
|
- label="课程名称"></el-table-column>
|
|
|
- <el-table-column align="center"
|
|
|
- label="签到">
|
|
|
- <template slot-scope="scope">{{ scope.row.signInStatus | attendanceType }}</template>
|
|
|
+ <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.signOutStatus | attendanceOutType }}</template>
|
|
|
+ <el-table-column align="center" label="课程类型">
|
|
|
+ <template slot-scope="scope">{{
|
|
|
+ scope.row.type | coursesType
|
|
|
+ }}</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center"
|
|
|
- prop="remark"
|
|
|
- label="备注"></el-table-column>
|
|
|
+
|
|
|
+ <el-table-column align="center" label="签到">
|
|
|
+ <template slot-scope="scope">{{
|
|
|
+ scope.row.signInStatus | attendanceType
|
|
|
+ }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="签退">
|
|
|
+ <template slot-scope="scope">{{
|
|
|
+ scope.row.signOutStatus | attendanceOutType
|
|
|
+ }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ prop="remark"
|
|
|
+ label="备注"
|
|
|
+ ></el-table-column>
|
|
|
</el-table>
|
|
|
- <pagination :total="pageInfo.total"
|
|
|
- :page.sync="pageInfo.page"
|
|
|
- :limit.sync="pageInfo.limit"
|
|
|
- :page-sizes="pageInfo.page_size"
|
|
|
- @pagination="getList" />
|
|
|
+ <pagination
|
|
|
+ sync
|
|
|
+ :total.sync="pageInfo.total"
|
|
|
+ :page.sync="pageInfo.page"
|
|
|
+ :limit.sync="pageInfo.limit"
|
|
|
+ :page-sizes="pageInfo.page_size"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -102,22 +143,24 @@ 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
|
|
|
+ pagination,
|
|
|
},
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
return {
|
|
|
courseType: courseType, // 课程类型
|
|
|
attendance: attendance, // 考勤状态
|
|
|
- courseDate: null, // 上课时间
|
|
|
+
|
|
|
searchForm: {
|
|
|
courseStartDate: null,
|
|
|
courseEndDate: null,
|
|
|
classGroupName: null,
|
|
|
courseScheduleType: null,
|
|
|
- signInStatus: null
|
|
|
+ signInStatus: null,
|
|
|
+ courseDate:[]
|
|
|
},
|
|
|
tableList: [],
|
|
|
organId: null,
|
|
@@ -127,33 +170,41 @@ export default {
|
|
|
limit: 10, // 限制显示条数
|
|
|
page: 1, // 当前页
|
|
|
total: 1, // 总条数
|
|
|
- page_size: [10, 20, 40, 50] // 选择限制显示条数
|
|
|
- }
|
|
|
+ page_size: [10, 20, 40, 50], // 选择限制显示条数
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
- mounted () {
|
|
|
+ mounted() {
|
|
|
this.getList();
|
|
|
},
|
|
|
- activated () {
|
|
|
+ activated() {
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
- search () {
|
|
|
+ search() {
|
|
|
this.pageInfo.page = 1;
|
|
|
this.getList();
|
|
|
},
|
|
|
- getList () {
|
|
|
- let params = this.searchForm;
|
|
|
- params.rows = this.pageInfo.limit;
|
|
|
- (params.page = this.pageInfo.page), (params.teacherId = this.teacherId);
|
|
|
- getTeacherPersonalAttendances(params).then(res => {
|
|
|
+ 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) {
|
|
|
+ searchCourseDate(value) {
|
|
|
if (value) {
|
|
|
this.searchForm.courseStartDate = value[0];
|
|
|
this.searchForm.courseEndDate = value[1];
|
|
@@ -162,21 +213,21 @@ export default {
|
|
|
this.searchForm.courseEndDate = null;
|
|
|
}
|
|
|
},
|
|
|
- onReSet () {
|
|
|
+ onReSet() {
|
|
|
this.courseDate = null;
|
|
|
this.searchForm = {
|
|
|
courseStartDate: null,
|
|
|
courseEndDate: null,
|
|
|
classGroupName: null,
|
|
|
courseScheduleType: null,
|
|
|
- signInStatus: null
|
|
|
+ signInStatus: null,
|
|
|
};
|
|
|
- }
|
|
|
- }
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scope>
|
|
|
.tr-cotainer {
|
|
|
margin-top: 20px;
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|