From d28cdef861fc5dd11e5a020870b47641509f2732 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Fri, 11 Jul 2025 12:03:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/applet_attendance.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/yuthon_hr_attendance/controllers/applet_attendance.py b/yuthon_hr_attendance/controllers/applet_attendance.py index 9364b783e..d5ee5318b 100644 --- a/yuthon_hr_attendance/controllers/applet_attendance.py +++ b/yuthon_hr_attendance/controllers/applet_attendance.py @@ -346,8 +346,19 @@ class AppletAttendance(Controller): is_late_card = att.is_late_card check_in_status = '缺卡' if not check_in else ('迟到' if is_late_card else '正常') check_out_status = '缺卡' if not check_out else ('早退' if is_early_card else '正常') - check_in_str = (check_in + timedelta(hours=8)).strftime('%H:%M:%S') if check_in else '缺卡' - check_out_str = (check_out + timedelta(hours=8)).strftime('%H:%M:%S') if check_out else '缺卡' + if check_in: + check_in_str = (check_in + timedelta(hours=8)).strftime('%H:%M:%S') + if check_in_status in ['迟到', '早退', '缺卡']: + check_in_str += f" ({check_in_status})" + else: + check_in_str = '缺卡' + if check_out: + check_out_str = (check_out + timedelta(hours=8)).strftime('%H:%M:%S') + if check_out_status in ['迟到', '早退', '缺卡']: + check_out_str += f" ({check_out_status})" + else: + check_out_str = '缺卡' + if not check_in_status and not check_out_status: color_select = 3 else: