|
@@ -73,7 +73,7 @@
|
|
|
banci &&
|
|
banci &&
|
|
|
banci.attendance &&
|
|
banci.attendance &&
|
|
|
banci.attendance.zhuang_tai_1_ != '正常' &&
|
|
banci.attendance.zhuang_tai_1_ != '正常' &&
|
|
|
- compareTime() &&
|
|
|
|
|
|
|
+ compareTime('in') &&
|
|
|
validExist(banci.attendance, 'in')
|
|
validExist(banci.attendance, 'in')
|
|
|
"
|
|
"
|
|
|
class="clock-btn"
|
|
class="clock-btn"
|
|
@@ -90,7 +90,7 @@
|
|
|
banci &&
|
|
banci &&
|
|
|
banci.attendance &&
|
|
banci.attendance &&
|
|
|
banci.attendance.zhuang_tai_2_ != '正常' &&
|
|
banci.attendance.zhuang_tai_2_ != '正常' &&
|
|
|
- compareTime() &&
|
|
|
|
|
|
|
+ compareTime('out') &&
|
|
|
validExist(banci.attendance, 'out')
|
|
validExist(banci.attendance, 'out')
|
|
|
"
|
|
"
|
|
|
class="clock-btn"
|
|
class="clock-btn"
|
|
@@ -151,21 +151,31 @@ export default {
|
|
|
if (!data?.[time[type]]) {
|
|
if (!data?.[time[type]]) {
|
|
|
return '未打卡'
|
|
return '未打卡'
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ let showtime = data[time[type]].substring(0, 16); //显示年月日时分
|
|
|
return data[status[type]] === '正常'
|
|
return data[status[type]] === '正常'
|
|
|
- ? `${data[time[type]]} 正常`
|
|
|
|
|
- : `${data[time[type]]} <span style="color: red;">${data[status[type]] === '异常' ? '迟到' : data[status[type]]}${data[duration[type]]}分钟</span>`
|
|
|
|
|
|
|
+ ? `${showtime} 正常`
|
|
|
|
|
+ : `${showtime} <span style="color: red;">${data[status[type]] === '异常' ? '迟到' : data[status[type]]}${data[duration[type]]}分钟</span>`
|
|
|
},
|
|
},
|
|
|
- compareTime() {
|
|
|
|
|
- // 比较班次时间和当前时间,过去日期的才显示,返回true。
|
|
|
|
|
|
|
+ compareTime(flag) {
|
|
|
|
|
+ // 比较班次打卡时间和当前时间,过去日期的才显示,返回true。
|
|
|
const today = this.$common.getDateNow()
|
|
const today = this.$common.getDateNow()
|
|
|
- if (this.banciInfo.jieShuShiJian < today) {
|
|
|
|
|
- return true
|
|
|
|
|
|
|
+ if(flag === 'in') { //比较上班时间
|
|
|
|
|
+ if (this.banciInfo.kaishishijian < today) {
|
|
|
|
|
+ return true
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
- return false
|
|
|
|
|
|
|
+ if (this.banciInfo.jieShuShiJian < today) {
|
|
|
|
|
+ return true
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
async validExist(attendance, type) {
|
|
async validExist(attendance, type) {
|
|
|
|
|
+
|
|
|
// 判断该班次是否申请过
|
|
// 判断该班次是否申请过
|
|
|
const str = type === 'in' ? '上班' : '下班'
|
|
const str = type === 'in' ? '上班' : '下班'
|
|
|
const banci = attendance.ban_ci_bie_ming_ + '-' + str
|
|
const banci = attendance.ban_ci_bie_ming_ + '-' + str
|
|
@@ -194,12 +204,12 @@ export default {
|
|
|
const str = type === 'in' ? '上班' : '下班'
|
|
const str = type === 'in' ? '上班' : '下班'
|
|
|
const buKaShiJian =
|
|
const buKaShiJian =
|
|
|
type === 'in'
|
|
type === 'in'
|
|
|
- ? attendanceInfo.ban_ci_kai_shi_.split(' ')[1] + ':00'
|
|
|
|
|
- : attendanceInfo.ban_ci_jie_shu_.split(' ')[1] + ':00'
|
|
|
|
|
|
|
+ ? attendanceInfo.ban_ci_kai_shi_
|
|
|
|
|
+ : attendanceInfo.ban_ci_jie_shu_
|
|
|
params = {
|
|
params = {
|
|
|
bu_ka_ri_qi_: attendanceInfo.ri_qi_,
|
|
bu_ka_ri_qi_: attendanceInfo.ri_qi_,
|
|
|
bu_ka_ban_ci_: attendanceInfo.ban_ci_bie_ming_ + '-' + str,
|
|
bu_ka_ban_ci_: attendanceInfo.ban_ci_bie_ming_ + '-' + str,
|
|
|
- bu_ka_shi_jian_: buKaShiJian,
|
|
|
|
|
|
|
+ bu_ka_shi_jian_: buKaShiJian.substring(0, 16),
|
|
|
pai_ban_id_: attendanceInfo.pai_ban_id_,
|
|
pai_ban_id_: attendanceInfo.pai_ban_id_,
|
|
|
pai_ban_ji_lu_id_: attendanceInfo.pai_ban_ji_lu_id_,
|
|
pai_ban_ji_lu_id_: attendanceInfo.pai_ban_ji_lu_id_,
|
|
|
kao_qin_id_:attendanceInfo.id_
|
|
kao_qin_id_:attendanceInfo.id_
|