Răsfoiți Sursa

考勤记录状态显示修复

zhonghuizhen 1 zi în urmă
părinte
comite
eb1c3fcd18
1 a modificat fișierele cu 6 adăugiri și 5 ștergeri
  1. 6 5
      src/views/system/dashboard/components/util.js

+ 6 - 5
src/views/system/dashboard/components/util.js

@@ -1122,10 +1122,11 @@ export function buildComponent(name, column, preview, vm) {
               
                 const hasStart = !!rawStart
                 const hasEnd = !!rawEnd
-              
+
+                
                 // 迟到判断(仅当有上班打卡时)
                 let isLate = false
-                if (hasStart) {
+                if (hasStart && (ext.zhuangTai1 !== '正常')) {
                   const startDateTime = new Date(rawStart)
                   const banStart = new Date(ext.banCiKaiShi)
                   isLate = startDateTime > banStart
@@ -1133,14 +1134,14 @@ export function buildComponent(name, column, preview, vm) {
               
                 // 早退判断(仅当有下班打卡时)
                 let isEarlyLeave = false
-                if (hasEnd) {
+                if (hasEnd && (ext.zhuangTai2 !== '正常')) {
                   const endDateTime = new Date(rawEnd)
                   const banEnd = new Date(ext.banCiJieShu)
                   isEarlyLeave = endDateTime < banEnd
                 }
               
-                // 最终是否完全正常:有两次打卡 && 不迟到 && 不早退
-                const isAllNormal = hasStart && hasEnd && !isLate && !isEarlyLeave
+                // 最终是否完全正常:有两次打卡 && 不迟到 && 不早退 && 两次打卡状态都为正常
+                const isAllNormal = hasStart && hasEnd && !isLate && !isEarlyLeave && ext.zhuangTai1 == '正常' && ext.zhuangTai2 == '正常'
               
                 // 小方块颜色与状态图标
                 const dotColor = isAllNormal ? '#67C23A' : '#F56C6C'