|
|
@@ -49,8 +49,9 @@
|
|
|
</template>
|
|
|
|
|
|
<template slot="statusNameList" slot-scope="{ row }">
|
|
|
+ <!-- 文案直取后端中文 statusNameList;颜色按同序英文码 statusList 判断(2026-11-11 用户口径) -->
|
|
|
<div v-for="(name, index) in row.statusNameList" :key="index" class="status-tag-line">
|
|
|
- <el-tag size="mini" :type="attendanceStatusTagType(name)" class="punch-tag">
|
|
|
+ <el-tag size="mini" :type="attendanceStatusTagType(row.statusList[index])" class="punch-tag">
|
|
|
{{ name }}
|
|
|
</el-tag>
|
|
|
</div>
|
|
|
@@ -335,20 +336,35 @@ export default {
|
|
|
return { list: this.currentRows, count: data.count };
|
|
|
},
|
|
|
punchStatusTagType(item) {
|
|
|
- /* 文案与色值均按后端中文字段判断:statusName=有效/已作废/待审批,sourceType=移动端/考勤设备/补卡 */
|
|
|
- if (item.sourceType === '补卡' || item.statusText === '已作废') return 'danger';
|
|
|
- if (item.statusText === '有效') return 'success';
|
|
|
- if (item.statusText === '待审批') return 'warning';
|
|
|
- return 'info';
|
|
|
+ /* 打卡状态 tag 颜色按 punchRecords[].status 原始码判断(2026-11-11 用户口径):
|
|
|
+ VALID = 正常 → 绿色 success;其它码 = 异常 → 红色 danger。
|
|
|
+ status 未返回时没有判定依据 → 灰色 info,绝不把「字段缺失」当成异常;
|
|
|
+ 文案仍是后端中文 statusName 直取,未返回就留空,前端不兜底。 */
|
|
|
+ const code = String(item.status || '');
|
|
|
+ if (!code) return 'info';
|
|
|
+ return code === 'VALID' ? 'success' : 'danger';
|
|
|
},
|
|
|
- /* 出勤情况 tag 颜色:按后端状态中文字段判断(正常=绿,迟到/早退/缺卡类=橙,旷工=红,其他=灰) */
|
|
|
- attendanceStatusTagType(name) {
|
|
|
- const text = String(name || '');
|
|
|
- if (!text) return 'info';
|
|
|
- if (text.includes('正常')) return 'success';
|
|
|
- if (text.includes('旷工')) return 'danger';
|
|
|
- if (text.includes('迟到') || text.includes('早退') || text.includes('缺')) return 'warning';
|
|
|
- return 'info';
|
|
|
+ /* 出勤情况 tag 颜色:按行级 statusList 英文码判断(2026-11-11 用户口径:英文值判色、
|
|
|
+ 中文 statusNameList 显示)。两者同序,按 index 配对。
|
|
|
+ 码表 = 用户提供的 AttendanceConstants.DAILY_*(前 6 项,实际字符串按本页 STATUS_OPTIONS
|
|
|
+ 一直在用的 NORMAL/LATE/EARLY_LEAVE/MISSING_IN/MISSING_OUT/ABSENT)+ LEAVE/BUSINESS_TRIP/OUTING/OVERTIME。
|
|
|
+ 码未返回、两数组不同序或出现码表外的值 → 灰(没有配色依据),不把缺失/未知当成异常。 */
|
|
|
+ attendanceStatusTagType(code) {
|
|
|
+ const types = {
|
|
|
+ NORMAL: 'success',
|
|
|
+ LATE: 'warning',
|
|
|
+ EARLY_LEAVE: 'warning',
|
|
|
+ MISSING_IN: 'warning',
|
|
|
+ MISSING_OUT: 'warning',
|
|
|
+ ABSENT: 'danger',
|
|
|
+ LEAVE: 'info',
|
|
|
+ BUSINESS_TRIP: 'info',
|
|
|
+ OUTING: 'info',
|
|
|
+ OVERTIME: 'info',
|
|
|
+ };
|
|
|
+ const value = String(code || '');
|
|
|
+ if (!value) return 'info';
|
|
|
+ return types[value] || 'info';
|
|
|
},
|
|
|
minuteText(value) {
|
|
|
return value === null || value === undefined ? '' : String(value);
|