From d256372289f26df354e3ade060ffc3cb41647169 Mon Sep 17 00:00:00 2001 From: ywyonui Date: Sat, 27 Sep 2025 11:09:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=80=89=E8=AF=BE=E7=82=B9?= =?UTF-8?q?=E5=90=8D=EF=BC=8C=E4=BF=AE=E5=A4=8D=E7=8A=B6=E6=80=81=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E5=A2=9E=E5=8A=A0=E8=BF=9F=E5=88=B0=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E8=AE=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/view/routine/xk/dm.vue | 43 ++++++++++++++++++++------ src/pages/view/routine/xk/dmList.vue | 6 +++- src/pages/view/routine/xk/dmXsList.vue | 17 ++++++++-- 3 files changed, 52 insertions(+), 14 deletions(-) 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 }} + 迟到 + @@ -447,7 +451,7 @@ onMounted(() => { .record-stats { display: grid; - grid-template-columns: repeat(4, 1fr); + grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 15px; diff --git a/src/pages/view/routine/xk/dmXsList.vue b/src/pages/view/routine/xk/dmXsList.vue index ed3358b..2e153f5 100644 --- a/src/pages/view/routine/xk/dmXsList.vue +++ b/src/pages/view/routine/xk/dmXsList.vue @@ -50,6 +50,14 @@ {{ safeDmRecord.qqRs || 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;