|
|
@@ -57,7 +57,7 @@
|
|
|
import config from '@/config.js';
|
|
|
import { createAttendance, tranAddress, checkAttendance, getAttendanceRule, getAttendanceSegment } from '@/api/mine.js'
|
|
|
const userStore = useUserStore();
|
|
|
- const configStore=useConfigStore();
|
|
|
+ const configStore = useConfigStore();
|
|
|
const thisUser = userStore.user;
|
|
|
const intervalId = ref(null); // 定时器ID
|
|
|
onBeforeUnmount(() => {
|
|
|
@@ -96,6 +96,9 @@
|
|
|
const dayOfWeek = nowDate.getDay(); // 获取当前星期
|
|
|
currentDay.value = weekArr[dayOfWeek]; // 设置当前星期
|
|
|
getTodayAtt();
|
|
|
+ // if (nowTime.value > '12:00') {
|
|
|
+ // signName.value = '下班签退'
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -122,7 +125,7 @@
|
|
|
const time1 = attList.find(item => item.att_type_id === '1');
|
|
|
//拿到所有签退数据后,用pop取最后一个
|
|
|
const time2 = attList.filter(item => item.att_type_id === '2').pop();
|
|
|
- console.log('time2', time2);
|
|
|
+ console.log('time1', time1);
|
|
|
if (time1 !== undefined) {
|
|
|
// console.log('getTime1',time1);
|
|
|
signInTime.value = time1.att_time.split(' ')[1];
|
|
|
@@ -134,7 +137,9 @@
|
|
|
signInStatusName.value = '旷工';
|
|
|
isSignInStatusDisabled.value = false;
|
|
|
}
|
|
|
- } else {
|
|
|
+ }else if (new Date().getHours()>=12) {
|
|
|
+ signName.value = '下班签退'
|
|
|
+ } else {
|
|
|
signName.value = '上班签到';
|
|
|
}
|
|
|
if (time2 !== undefined) {
|
|
|
@@ -404,44 +409,48 @@
|
|
|
|
|
|
//是否补卡、请假判断
|
|
|
function isToFillClock(attType, time) {
|
|
|
+ // console.log('isToFillClock',attType,time);
|
|
|
//早上迟到跳补卡
|
|
|
let status = '';
|
|
|
if (attType == 1) {
|
|
|
- if (isTimeInRange(time, ...configStore.lateTimeRange)){
|
|
|
+ if (isTimeInRange(time, ...configStore.lateTimeRange)) {
|
|
|
status = '迟到'
|
|
|
} else if (isTimeInRange(time, configStore.lateTimeRange[1], '23:59:59')) {
|
|
|
status = '旷工'
|
|
|
- } else{
|
|
|
+ } else {
|
|
|
+ $modal.msgSuccess('打卡成功')
|
|
|
+ setTimeout(() => {
|
|
|
+ $tab.navigateTo('/pages/mine/checkIn/checkIn')
|
|
|
+ }, 1000)
|
|
|
return
|
|
|
}
|
|
|
$modal.confirm('当前状态为' + status + '!\n是否跳转补卡页面').then(() => {
|
|
|
$tab.reLaunch('/pages/work/index')
|
|
|
})
|
|
|
- .catch(() => {
|
|
|
+ .catch(() => {
|
|
|
$tab.navigateTo('/pages/mine/checkIn/checkIn')
|
|
|
})
|
|
|
} else if (attType == 2) {
|
|
|
//早退请假提示
|
|
|
- if(isTimeInRange(time, '00:00:00',configStore.earlyTimeRange[0])){
|
|
|
+ if (isTimeInRange(time, '00:00:00', configStore.earlyTimeRange[0])) {
|
|
|
status = '旷工'
|
|
|
- }else if (isTimeInRange(time, ...configStore.earlyTimeRange)) {
|
|
|
+ } else if (isTimeInRange(time, ...configStore.earlyTimeRange)) {
|
|
|
status = '早退'
|
|
|
- } else{
|
|
|
+ } else {
|
|
|
+ $modal.msgSuccess('打卡成功')
|
|
|
+ setTimeout(() => {
|
|
|
+ $tab.navigateTo('/pages/mine/checkIn/checkIn')
|
|
|
+ }, 1000)
|
|
|
return
|
|
|
}
|
|
|
$modal.confirm('当前状态为' + status + '!\n是否跳转请假页面').then(() => {
|
|
|
$tab.reLaunch('/pages/work/index')
|
|
|
})
|
|
|
- .catch(() => {
|
|
|
+ .catch(() => {
|
|
|
$tab.navigateTo('/pages/mine/checkIn/checkIn')
|
|
|
})
|
|
|
}
|
|
|
- else {
|
|
|
- $modal.msgSuccess('打卡成功')
|
|
|
- setTimeout(() => {
|
|
|
- $tab.navigateTo('/pages/mine/checkIn/checkIn')
|
|
|
- }, 1000)
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//判断是否已经打卡
|