diff --git a/src/pages/view/routine/xk/dm.vue b/src/pages/view/routine/xk/dm.vue
index f26a958..ba105e6 100644
--- a/src/pages/view/routine/xk/dm.vue
+++ b/src/pages/view/routine/xk/dm.vue
@@ -28,6 +28,10 @@
{{ dmInfo.qqRs }}
缺勤
+
+ {{ dmInfo.cdRs }}
+ 迟到
+
@@ -164,7 +168,8 @@ const dmInfo = ref({
zrs: 0,
sdRs: 0,
qjRs: 0,
- qqRs: 0
+ qqRs: 0,
+ cdRs: 0,
});
// 学生列表 - 匹配后端XkDmXs实体字段
const xsList = ref([]);
@@ -197,6 +202,9 @@ const getStatusClass = (status: string) => {
case "C":
case "缺勤":
return "status-absent";
+ case "F":
+ case "迟到":
+ return "status-overtime";
default:
return "status-normal";
}
@@ -211,6 +219,8 @@ const getStatusText = (status: string) => {
return "请假";
case "C":
return "缺勤";
+ case "F":
+ return "迟到";
default:
return status || "正常";
}
@@ -219,16 +229,23 @@ const getStatusText = (status: string) => {
// 获取学生状态选项
const loadStatusOptions = async () => {
try {
+ // 使用默认状态 - 匹配后端字段
+ statusOptions.value = [
+ {text: "正常", value: "A"},
+ {text: "请假", value: "B"},
+ {text: "缺勤", value: "C"},
+ {text: "迟到", value: "F"},
+ ];
// 假设字典表中考勤状态的pid为763939514,根据实际情况修改
- const res = await findByPid({pid: 763939514});
- if (res && res.result) {
- statusOptions.value = res.result.map((item: any) => {
- return {
- text: item.dictionaryValue,
- value: item.dictionaryCode
- };
- });
- }
+ // const res = await findByPid({pid: 763939514});
+ // if (res && res.result) {
+ // statusOptions.value = res.result.map((item: any) => {
+ // return {
+ // text: item.dictionaryValue,
+ // value: item.dictionaryCode
+ // };
+ // });
+ // }
} catch (error) {
console.error("获取状态选项失败", error);
// 使用默认状态 - 匹配后端字段
@@ -281,6 +298,7 @@ const rebuildNumInfo = () => {
let sd = 0;
let qj = 0;
let qq = 0;
+ let cd = 0;
// 循环统计状态对应的人数
for (let i = 0; i < xsList.value.length; i++) {
@@ -300,6 +318,10 @@ const rebuildNumInfo = () => {
case "缺勤":
qq++;
break;
+ case "F":
+ case "迟到":
+ cd++;
+ break;
default:
sd++; // 默认算作正常
break;
@@ -308,6 +330,7 @@ const rebuildNumInfo = () => {
dmInfo.value.sdRs = sd; // 实到人数
dmInfo.value.qjRs = qj; // 请假人数
dmInfo.value.qqRs = qq; // 缺勤人数
+ dmInfo.value.cdRs = cd; // 缺勤人数
};
// 打开状态选择器
diff --git a/src/pages/view/routine/xk/dmList.vue b/src/pages/view/routine/xk/dmList.vue
index 199c884..a466513 100644
--- a/src/pages/view/routine/xk/dmList.vue
+++ b/src/pages/view/routine/xk/dmList.vue
@@ -71,6 +71,10 @@
{{ data.qqRs || 0 }}
缺勤
+
+ {{ data.cdRs || 0 }}
+ 迟到
+
+
+ {{ safeDmRecord.cdRs || 0 }}
+ 迟到
+
@@ -180,6 +188,8 @@ const getStatusClass = (status: string) => {
case '请假': return 'status-leave';
case 'C':
case '缺勤': return 'status-absent';
+ case 'F':
+ case '迟到': return 'status-overtime';
default: return 'status-normal';
}
};
@@ -190,6 +200,7 @@ const getStatusText = (status: string) => {
case 'A': return '正常';
case 'B': return '请假';
case 'C': return '缺勤';
+ case 'F': return '迟到';
default: return status || '正常';
}
};
@@ -292,14 +303,14 @@ onMounted(() => {
.attendance-stats {
.stats-grid {
display: grid;
- grid-template-columns: repeat(4, 1fr);
- gap: 20rpx;
+ grid-template-columns: repeat(5, 1fr);
+ gap: 10rpx;
}
.stat-item {
background: white;
border-radius: 12px;
- padding: 20rpx 0;
+ padding-bottom: 20rpx;
text-align: center;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
cursor: pointer;