|
@@ -3,7 +3,7 @@
|
|
|
<div class="m-container">
|
|
|
<h2>
|
|
|
<div class="squrt"></div>
|
|
|
- 老师考勤列表
|
|
|
+ 老师考勤列表 <filter-search @reload="reloadSearch" searchKey="teacherAttendanceId"/>
|
|
|
</h2>
|
|
|
<div class="m-core">
|
|
|
<save-form
|
|
@@ -249,7 +249,7 @@ export default {
|
|
|
signInStatus: null,
|
|
|
signOutStatus: null,
|
|
|
},
|
|
|
- courseTime: [nowTime, nowTime],
|
|
|
+ courseTime: [],
|
|
|
courseType,
|
|
|
// teacherList: [],
|
|
|
tableList: [],
|
|
@@ -265,7 +265,13 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
isEmptyQuery() {
|
|
|
- return !Object.keys(cleanDeep({...this.searchForm})).length
|
|
|
+ return !Object.keys(cleanDeep({
|
|
|
+ ...this.searchForm,
|
|
|
+ courseTime: this.courseTime,
|
|
|
+ })).length && !this.teacherAttendanceId
|
|
|
+ },
|
|
|
+ teacherAttendanceId() {
|
|
|
+ return this.$route.query.teacherAttendanceId
|
|
|
}
|
|
|
},
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
@@ -283,8 +289,10 @@ export default {
|
|
|
// this.organList = res.data;
|
|
|
// }
|
|
|
// });
|
|
|
- this.$set(this.searchForm, 'search', this.$route.query.search)
|
|
|
this.$store.dispatch("setBranchs");
|
|
|
+ if (!this.teacherAttendanceId) {
|
|
|
+ this.courseTime = [nowTime, nowTime]
|
|
|
+ }
|
|
|
this.init();
|
|
|
},
|
|
|
activated() {
|
|
@@ -298,15 +306,22 @@ export default {
|
|
|
let obj = {
|
|
|
page: this.rules.page,
|
|
|
rows: this.rules.limit,
|
|
|
+ teacherAttendanceId: this.teacherAttendanceId,
|
|
|
};
|
|
|
Object.assign(obj, this.searchForm);
|
|
|
if (this.courseTime && this.courseTime.length > 0) {
|
|
|
obj.courseStartDate = this.courseTime[0];
|
|
|
obj.courseEndDate = this.courseTime[1];
|
|
|
}
|
|
|
- console.log(obj, this.$route.query.search)
|
|
|
+
|
|
|
return obj
|
|
|
},
|
|
|
+ reloadSearch() {
|
|
|
+ if (this.isEmptyQuery) {
|
|
|
+ this.courseTime = [nowTime, nowTime]
|
|
|
+ }
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
getList() {
|
|
|
let obj = this.getSearchValues()
|
|
|
if (this.isEmptyQuery) {
|