|
@@ -186,6 +186,7 @@ export default {
|
|
kaWeek: 0,
|
|
kaWeek: 0,
|
|
recordList: [],
|
|
recordList: [],
|
|
userId: this.$store.state.user.userId,
|
|
userId: this.$store.state.user.userId,
|
|
|
|
+ // userId: 9,
|
|
deptId: this.$store.state.user.deptId,
|
|
deptId: this.$store.state.user.deptId,
|
|
// kaSort: 1, //打卡分类 1:上午上班 2:上午下班 3:下午上班 4:下午下班,
|
|
// kaSort: 1, //打卡分类 1:上午上班 2:上午下班 3:下午上班 4:下午下班,
|
|
kaType: 1, //打卡类别 1正常 2:迟到 3:外勤 4:早退
|
|
kaType: 1, //打卡类别 1正常 2:迟到 3:外勤 4:早退
|
|
@@ -224,6 +225,9 @@ export default {
|
|
yestkaWeek:'',
|
|
yestkaWeek:'',
|
|
recordYestList:[],
|
|
recordYestList:[],
|
|
guoflag:false,
|
|
guoflag:false,
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ reachflag: true,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -241,6 +245,12 @@ export default {
|
|
onUnload() {
|
|
onUnload() {
|
|
clearInterval(this.timefn)
|
|
clearInterval(this.timefn)
|
|
},
|
|
},
|
|
|
|
+ onReachBottom() {
|
|
|
|
+ if (this.reachflag) {
|
|
|
|
+ this.pageNum++
|
|
|
|
+ this.getRecordList()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
init() {
|
|
init() {
|
|
var that=this;
|
|
var that=this;
|
|
@@ -399,7 +409,10 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
getRuleFn() {
|
|
getRuleFn() {
|
|
- clocklist().then(res => {
|
|
|
|
|
|
+ var params={
|
|
|
|
+ isEquip:'N'
|
|
|
|
+ }
|
|
|
|
+ clocklist(params).then(res => {
|
|
if (res.rows) {
|
|
if (res.rows) {
|
|
this.ruleflag=true;
|
|
this.ruleflag=true;
|
|
this.rulelist=res.rows;
|
|
this.rulelist=res.rows;
|
|
@@ -416,15 +429,30 @@ export default {
|
|
var params = {
|
|
var params = {
|
|
// deptId: this.deptId,
|
|
// deptId: this.deptId,
|
|
userId: this.userId,
|
|
userId: this.userId,
|
|
- recordDate: this.kaTime
|
|
|
|
|
|
+ recordDate: this.kaTime,
|
|
|
|
+ pageSize: this.pageSize,
|
|
|
|
+ pageNum: this.pageNum,
|
|
};
|
|
};
|
|
var a=0;
|
|
var a=0;
|
|
getRecordList(params).then(res => {
|
|
getRecordList(params).then(res => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
- this.recordList = JSON.parse(JSON.stringify(res.rows));
|
|
|
|
|
|
+ if (res.rows.length < this.pageSize) {
|
|
|
|
+ this.reachflag = false
|
|
|
|
+ this.wtdt = '到底了~';
|
|
|
|
+ } else {
|
|
|
|
+ var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum -
|
|
|
|
+ 1)
|
|
|
|
+ if (num < res.total) {
|
|
|
|
+ this.reachflag = true
|
|
|
|
+ this.wtdt = '上拉加载更多'
|
|
|
|
+ } else {
|
|
|
|
+ this.reachflag = false
|
|
|
|
+ this.wtdt = '到底了~';
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ var newArr=JSON.parse(JSON.stringify(res.rows))
|
|
// 循环处理,获取上班时间,下班时间
|
|
// 循环处理,获取上班时间,下班时间
|
|
- var newArr=this.recordList;
|
|
|
|
- if(newArr&&newArr.length){
|
|
|
|
|
|
+ if(newArr&&newArr.length&&this.pageNum == 1){
|
|
Object.keys(newArr).some((key) => {
|
|
Object.keys(newArr).some((key) => {
|
|
// 去重
|
|
// 去重
|
|
var type=newArr[key].type||'';
|
|
var type=newArr[key].type||'';
|
|
@@ -438,10 +466,23 @@ export default {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (this.pageNum == 1) {
|
|
|
|
+ this.recordList = newArr;
|
|
|
|
+ } else {
|
|
|
|
+ this.recordList = this.recordList.concat(newArr)
|
|
|
|
+ }
|
|
this.loctiotimeup();
|
|
this.loctiotimeup();
|
|
} else {
|
|
} else {
|
|
- this.$toast(res.msg);
|
|
|
|
|
|
+ this.$toast(res.msg)
|
|
}
|
|
}
|
|
|
|
+ // if (res.code == 200) {
|
|
|
|
+ // this.recordList = JSON.parse(JSON.stringify(res.rows));
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // } else {
|
|
|
|
+ // this.$toast(res.msg);
|
|
|
|
+ // }
|
|
});
|
|
});
|
|
// this.$toast("登录中,请耐心等待...")
|
|
// this.$toast("登录中,请耐心等待...")
|
|
},
|
|
},
|
|
@@ -622,7 +663,6 @@ export default {
|
|
params.recordTime=this.gettime;
|
|
params.recordTime=this.gettime;
|
|
params.week=this.kaWeek;
|
|
params.week=this.kaWeek;
|
|
params.recordDt=this.kaTime+' '+this.gettime;
|
|
params.recordDt=this.kaTime+' '+this.gettime;
|
|
-
|
|
|
|
if(this.imgurl){
|
|
if(this.imgurl){
|
|
params.pictureUrl=this.imgurl;
|
|
params.pictureUrl=this.imgurl;
|
|
}
|
|
}
|
|
@@ -645,7 +685,7 @@ export default {
|
|
});
|
|
});
|
|
return
|
|
return
|
|
|
|
|
|
- // return
|
|
|
|
|
|
+ // return 打卡全走新增,不用覆盖
|
|
if (newArr.length) {
|
|
if (newArr.length) {
|
|
var len = newArr.length - 1;
|
|
var len = newArr.length - 1;
|
|
// params['recordId'] = newArr[0].recordId;
|
|
// params['recordId'] = newArr[0].recordId;
|