|
@@ -3,7 +3,12 @@
|
|
|
<div class="m-container">
|
|
|
<h2>
|
|
|
<div class="squrt"></div>
|
|
|
- 老师考勤列表 <filter-search @reload="reloadSearch" :keys="['attendanceStatus', 'visitFlag']" :moreKeys="['start', 'end', 'organId']"/>
|
|
|
+ 老师考勤列表
|
|
|
+ <filter-search
|
|
|
+ @reload="reloadSearch"
|
|
|
+ :keys="['attendanceStatus', 'visitFlag']"
|
|
|
+ :moreKeys="['start', 'end', 'organId']"
|
|
|
+ />
|
|
|
</h2>
|
|
|
<div class="m-core">
|
|
|
<save-form
|
|
@@ -242,23 +247,34 @@
|
|
|
width="220px"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- v-if="scope.row.jobNature === 'PART_TIME' && scope.row.complaintsStatus ==2 "
|
|
|
- @click="unappeal(scope.row)"
|
|
|
- v-permission="'teacherAttendance/repealComplaints'"
|
|
|
- >撤销申诉</el-button>
|
|
|
- <el-button
|
|
|
- v-if="scope.row.jobNature === 'PART_TIME' && (scope.row.complaintsStatus == null || scope.row.complaintsStatus == 3)"
|
|
|
- type="text"
|
|
|
- @click="appeal(scope.row)"
|
|
|
- v-permission="'teacherAttendance/addComplaints'"
|
|
|
- >申诉</el-button>
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- v-permission="'teacherAttendance/update'"
|
|
|
- @click="hand(scope.row)"
|
|
|
- >处理意见</el-button>
|
|
|
+ <auth auths="teacherAttendance/repealComplaints">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ v-if="
|
|
|
+ scope.row.jobNature === 'PART_TIME' &&
|
|
|
+ scope.row.complaintsStatus == 2
|
|
|
+ "
|
|
|
+ @click="unappeal(scope.row)"
|
|
|
+ >撤销申诉</el-button
|
|
|
+ >
|
|
|
+ </auth>
|
|
|
+ <auth auths="teacherAttendance/addComplaints">
|
|
|
+ <el-button
|
|
|
+ v-if="
|
|
|
+ scope.row.jobNature === 'PART_TIME' &&
|
|
|
+ (scope.row.complaintsStatus == null ||
|
|
|
+ scope.row.complaintsStatus == 3)
|
|
|
+ "
|
|
|
+ type="text"
|
|
|
+ @click="appeal(scope.row)"
|
|
|
+ >申诉</el-button
|
|
|
+ >
|
|
|
+ </auth>
|
|
|
+ <auth auths="teacherAttendance/update">
|
|
|
+ <el-button type="text" @click="hand(scope.row)"
|
|
|
+ >处理意见</el-button
|
|
|
+ >
|
|
|
+ </auth>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -297,14 +313,14 @@ import { getToken } from "@/utils/auth";
|
|
|
import pagination from "@/components/Pagination/index";
|
|
|
import load from "@/utils/loading";
|
|
|
import qs from "qs";
|
|
|
-import cleanDeep from 'clean-deep'
|
|
|
+import cleanDeep from "clean-deep";
|
|
|
import { getTeacher, getEmployeeOrgan } from "@/api/buildTeam";
|
|
|
import { queryTeacherAttendances } from "@/api/recodeManager";
|
|
|
import { jobNature, courseType } from "@/utils/searchArray";
|
|
|
-import { repealComplaints } from './api'
|
|
|
-import appeal from './modals/appeal'
|
|
|
-import hand from './modals/hand'
|
|
|
-import { getTimes } from "@/utils";
|
|
|
+import { repealComplaints } from "./api";
|
|
|
+import appeal from "./modals/appeal";
|
|
|
+import hand from "./modals/hand";
|
|
|
+import { getTimes } from "@/utils";
|
|
|
let nowTime = new Date();
|
|
|
nowTime =
|
|
|
nowTime.getFullYear() +
|
|
@@ -322,13 +338,13 @@ export default {
|
|
|
signInStatus: null,
|
|
|
signOutStatus: null,
|
|
|
jobNature: null,
|
|
|
- courseTime: [],
|
|
|
+ courseTime: [],
|
|
|
},
|
|
|
detail: null,
|
|
|
appealVisible: false,
|
|
|
handVisible: false,
|
|
|
jobNature: jobNature, // 工作类型
|
|
|
-
|
|
|
+
|
|
|
courseType,
|
|
|
// teacherList: [],
|
|
|
tableList: [],
|
|
@@ -344,20 +360,23 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
isEmptyQuery() {
|
|
|
- return !Object.keys(cleanDeep({
|
|
|
- ...this.searchForm,
|
|
|
- // courseTime: this.courseTime,
|
|
|
- })).length && !this.teacherAttendanceId
|
|
|
+ return (
|
|
|
+ !Object.keys(
|
|
|
+ cleanDeep({
|
|
|
+ ...this.searchForm,
|
|
|
+ // courseTime: this.courseTime,
|
|
|
+ })
|
|
|
+ ).length && !this.teacherAttendanceId
|
|
|
+ );
|
|
|
},
|
|
|
teacherAttendanceId() {
|
|
|
- return this.$route.query.teacherAttendanceId
|
|
|
+ return this.$route.query.teacherAttendanceId;
|
|
|
},
|
|
|
},
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
created() {
|
|
|
-
|
|
|
- if(this.searchForm.courseTime.length <=0)
|
|
|
- this.searchForm.courseTime = [nowTime, nowTime]
|
|
|
+ if (this.searchForm.courseTime.length <= 0)
|
|
|
+ this.searchForm.courseTime = [nowTime, nowTime];
|
|
|
},
|
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted() {
|
|
@@ -372,15 +391,14 @@ export default {
|
|
|
// this.organList = res.data;
|
|
|
// }
|
|
|
// });
|
|
|
- const { query } = this.$route
|
|
|
+ const { query } = this.$route;
|
|
|
this.$store.dispatch("setBranchs");
|
|
|
if (query.organId) {
|
|
|
- this.searchForm.organId = query.organId
|
|
|
+ this.searchForm.organId = query.organId;
|
|
|
}
|
|
|
if (query.start || query.end) {
|
|
|
- this.searchForm.courseTime = [query.start, query.end]
|
|
|
+ this.searchForm.courseTime = [query.start, query.end];
|
|
|
} else {
|
|
|
-
|
|
|
}
|
|
|
this.init();
|
|
|
},
|
|
@@ -389,28 +407,28 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
getSearchValues() {
|
|
|
- const { courseTime, ...rest } = this.searchForm;
|
|
|
+ const { courseTime, ...rest } = this.searchForm;
|
|
|
let obj = {
|
|
|
...rest,
|
|
|
page: this.rules.page,
|
|
|
rows: this.rules.limit,
|
|
|
attendanceStatus: this.$route.query.attendanceStatus,
|
|
|
visitFlag: this.$route.query.visitFlag,
|
|
|
- ...getTimes(courseTime,['courseStartDate','courseEndDate'])
|
|
|
+ ...getTimes(courseTime, ["courseStartDate", "courseEndDate"]),
|
|
|
};
|
|
|
- return obj
|
|
|
+ return obj;
|
|
|
},
|
|
|
reloadSearch() {
|
|
|
if (this.isEmptyQuery) {
|
|
|
- this.courseTime = [nowTime, nowTime]
|
|
|
+ this.courseTime = [nowTime, nowTime];
|
|
|
}
|
|
|
- this.getList()
|
|
|
+ this.getList();
|
|
|
},
|
|
|
getList() {
|
|
|
- let obj = this.getSearchValues()
|
|
|
+ let obj = this.getSearchValues();
|
|
|
if (this.isEmptyQuery) {
|
|
|
this.$message.error("请至少选择一个条件");
|
|
|
- return
|
|
|
+ return;
|
|
|
}
|
|
|
queryTeacherAttendances(obj).then((res) => {
|
|
|
if (res.code == 200) {
|
|
@@ -424,38 +442,36 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
onReSet() {
|
|
|
-
|
|
|
-
|
|
|
this.$refs["searchForm"].resetFields();
|
|
|
- this.searchForm.courseTime = [nowTime, nowTime];
|
|
|
+ this.searchForm.courseTime = [nowTime, nowTime];
|
|
|
this.search();
|
|
|
},
|
|
|
hand(row) {
|
|
|
- this.handVisible = true
|
|
|
- this.detail = row
|
|
|
+ this.handVisible = true;
|
|
|
+ this.detail = row;
|
|
|
},
|
|
|
appeal(row) {
|
|
|
- this.appealVisible = true
|
|
|
- this.detail = row
|
|
|
+ this.appealVisible = true;
|
|
|
+ this.detail = row;
|
|
|
},
|
|
|
async unappeal(row) {
|
|
|
try {
|
|
|
- await this.$confirm('是否确认撤销申诉?', '提示', {
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ await this.$confirm("是否确认撤销申诉?", "提示", {
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
await repealComplaints({
|
|
|
courseScheduleId: row.courseScheduleId,
|
|
|
userId: row.teacherId,
|
|
|
- })
|
|
|
- this.$message.success('撤销成功')
|
|
|
- this.getList()
|
|
|
+ });
|
|
|
+ this.$message.success("撤销成功");
|
|
|
+ this.getList();
|
|
|
} catch (error) {}
|
|
|
},
|
|
|
onExport() {
|
|
|
- let obj = this.getSearchValues()
|
|
|
+ let obj = this.getSearchValues();
|
|
|
if (this.isEmptyQuery) {
|
|
|
this.$message.error("请至少选择一个条件");
|
|
|
- return
|
|
|
+ return;
|
|
|
}
|
|
|
let url = "/api-web/export/queryTeacherAttendances";
|
|
|
const options = {
|
|
@@ -491,7 +507,7 @@ export default {
|
|
|
} else {
|
|
|
let objectUrl = URL.createObjectURL(blob);
|
|
|
let link = document.createElement("a");
|
|
|
- let fname = "考勤列表" + new Date().getTime()+'.xls'; //下载文件的名字
|
|
|
+ let fname = "考勤列表" + new Date().getTime() + ".xls"; //下载文件的名字
|
|
|
link.href = objectUrl;
|
|
|
link.setAttribute("download", fname);
|
|
|
document.body.appendChild(link);
|