diff --git a/antis-ncc-admin/src/views/attendance-record/components/record-detail-dialog.vue b/antis-ncc-admin/src/views/attendance-record/components/record-detail-dialog.vue index 7d68631..cb47805 100644 --- a/antis-ncc-admin/src/views/attendance-record/components/record-detail-dialog.vue +++ b/antis-ncc-admin/src/views/attendance-record/components/record-detail-dialog.vue @@ -44,7 +44,7 @@
录入方式
-
{{ detail.isManual === 1 ? '含补卡/手工修正' : '真实打卡' }}
+
{{ isNoAttendanceRecord ? '无' : (detail.isManual === 1 ? '含补卡/手工修正' : '真实打卡') }}
@@ -54,7 +54,7 @@ 上班打卡
- {{ detail.punchIn ? detail.punchIn.typeText || '未打卡' : '未打卡' }} + {{ punchInTypeLabel }} 查看地图 @@ -63,7 +63,7 @@
- {{ detail.punchIn ? detail.punchIn.time || '未打卡' : '未打卡' }} + {{ punchInTimeLabel }}
@@ -89,7 +89,7 @@ 下班打卡
- {{ detail.punchOut ? detail.punchOut.typeText || '未打卡' : '未打卡' }} + {{ punchOutTypeLabel }} 查看地图 @@ -98,7 +98,7 @@
- {{ detail.punchOut ? detail.punchOut.time || '未打卡' : '未打卡' }} + {{ punchOutTimeLabel }}
@@ -120,7 +120,7 @@
- +
补卡信息 -
关联流程 @@ -176,6 +176,17 @@ 当前为{{ detail.statusText }}状态,暂无关联流程记录
+ + +
+ 记录备注 +
+
+
+ {{ detail.remark || '无' }} +
+
+
@@ -232,6 +243,7 @@ export default { case 2: return 'warning' case 3: + case 8: return 'info' default: return 'danger' @@ -240,12 +252,78 @@ export default { hasRelatedWorkflows() { return this.detail && Array.isArray(this.detail.relatedWorkflows) && this.detail.relatedWorkflows.length > 0 }, + /** 后端无考勤行时返回 hasAttendanceRecord: false(兼容旧接口:有 id 视为有记录) */ + hasAttendanceRecord() { + const d = this.detail + if (!d) return true + const h = d.hasAttendanceRecord + if (h === false || h === 0) return false + if (d.id) return true + return h !== false && h !== 0 + }, + isNoAttendanceRecord() { + return !!(this.detail && (this.detail.hasAttendanceRecord === false || this.detail.hasAttendanceRecord === 0)) + }, + /** 考勤日晚于今日、尚无打卡(后端 status=8 待考勤) */ + isPendingAttendanceDay() { + const d = this.detail + if (!d || !this.hasAttendanceRecord) return false + const s = d.status + return s === 8 || s === '8' + }, + /** 备注已记销假时不再视为「待销假」请假态,避免仍显示确认销假 */ isLeaveOrSickStatus() { - return this.detail && (this.detail.status === 4 || this.detail.status === 5) + if (!this.detail) return false + const r = this.detail.remark + if (r != null && String(r).indexOf('销假') >= 0) return false + return this.detail.status === 4 || this.detail.status === 5 + }, + /** 无补卡卡片时,若有考勤备注仍单独展示(原备注在补卡卡片内) */ + showRecordRemarkOnly() { + if (!this.detail || !this.hasAttendanceRecord) return false + const r = this.detail.remark + if (r == null || String(r).trim() === '') return false + return !this.hasSupplementInfo + }, + /** 无流程补卡数据时不展示补卡信息卡片(避免全是「无」仍占版面) */ + hasSupplementInfo() { + if (!this.detail || !this.hasAttendanceRecord) return false + const s = this.detail.supplement + if (!s) return false + const wf = s.workflowId != null && s.workflowId !== '' ? s.workflowId : s.WorkflowId + if (wf) return true + const r = s.remark != null && s.remark !== '' ? s.remark : s.Remark + if (r) return true + const op = s.operatorName != null && s.operatorName !== '' ? s.operatorName : s.OperatorName + if (op) return true + const t = s.operateTime != null && s.operateTime !== '' ? s.operateTime : s.OperateTime + return !!t + }, + punchInTypeLabel() { + if (this.isNoAttendanceRecord || this.isPendingAttendanceDay) return '暂无打卡' + const p = this.detail && this.detail.punchIn + return p ? (p.typeText || '未打卡') : '未打卡' + }, + punchInTimeLabel() { + if (this.isNoAttendanceRecord || this.isPendingAttendanceDay) return '暂无打卡' + const p = this.detail && this.detail.punchIn + return p ? (p.time || '未打卡') : '未打卡' + }, + punchOutTypeLabel() { + if (this.isNoAttendanceRecord || this.isPendingAttendanceDay) return '暂无打卡' + const p = this.detail && this.detail.punchOut + return p ? (p.typeText || '未打卡') : '未打卡' + }, + punchOutTimeLabel() { + if (this.isNoAttendanceRecord || this.isPendingAttendanceDay) return '暂无打卡' + const p = this.detail && this.detail.punchOut + return p ? (p.time || '未打卡') : '未打卡' }, /** 正常上下班均已打卡,或已有补卡/手工修正,或请假/病假:不显示后台补卡入口 */ showSupplementButton() { if (!this.detail) return false + if (!this.detail.id) return false + if (this.detail.status === 8 || this.detail.status === '8') return false if (this.detail.isManual === 1) return false if (this.detail.status === 4 || this.detail.status === 5) return false const hasIn = !!(this.detail.punchIn && this.detail.punchIn.time) @@ -311,6 +389,7 @@ export default { workflowTagType(type) { if (type === '请假') return 'danger' if (type === '补卡') return 'warning' + if (type === '销假') return 'success' return 'info' }, canOpenRelatedWorkflow(wf) { diff --git a/antis-ncc-admin/src/views/attendance-record/index.vue b/antis-ncc-admin/src/views/attendance-record/index.vue index 38aa4c0..20774cd 100644 --- a/antis-ncc-admin/src/views/attendance-record/index.vue +++ b/antis-ncc-admin/src/views/attendance-record/index.vue @@ -7,11 +7,11 @@
Attendance Record

考勤记录

- 按月查看员工每日考勤状态(含打卡、补卡及审批通过的请假/病假同步),可查看上下班时间、地点、照片与补卡信息;点击有记录的日期可查看详情并后台补卡。 + 按月查看员工每日考勤状态(列表含筛选范围内全部在职员工,无记录日期显示为无);含打卡、补卡及审批通过的请假/病假同步,可查看上下班时间、地点、照片与补卡信息;点击日期可查看详情并后台补卡。

- 导出月度明细 刷新
@@ -22,10 +22,21 @@ - + + + + + + + + + + +
员工人数
{{ summary.employeeCount }}
-
当前筛选条件下有考勤记录的员工数
+
当前筛选条件下的在职员工数(含当月无考勤记录)
正常出勤
@@ -68,7 +79,7 @@
- 月度考勤明细 + {{ viewMode === 'month' ? '月度考勤明细' : '周度考勤明细' }} {{ headerText }}
@@ -94,10 +105,10 @@ - +