调整选课点名,修复状态问题,增加迟到状态计数

This commit is contained in:
ywyonui 2025-09-27 11:09:39 +08:00
parent d69bf5e937
commit d256372289
3 changed files with 52 additions and 14 deletions

View File

@ -28,6 +28,10 @@
<text class="font-18 font-bold cor-danger">{{ dmInfo.qqRs }}</text>
<text class="font-12 cor-666 mt-3">缺勤</text>
</view>
<view class="stat-item flex-col items-center">
<text class="font-18 font-bold cor-danger">{{ dmInfo.cdRs }}</text>
<text class="font-12 cor-666 mt-3">迟到</text>
</view>
</view>
</view>
@ -164,7 +168,8 @@ const dmInfo = ref<any>({
zrs: 0,
sdRs: 0,
qjRs: 0,
qqRs: 0
qqRs: 0,
cdRs: 0,
});
// - XkDmXs
const xsList = ref<any[]>([]);
@ -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"},
];
// pid763939514
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; //
};
//

View File

@ -71,6 +71,10 @@
<text class="stat-number">{{ data.qqRs || 0 }}</text>
<text class="stat-label">缺勤</text>
</view>
<view class="stat-item overtime">
<text class="stat-number">{{ data.cdRs || 0 }}</text>
<text class="stat-label">迟到</text>
</view>
</view>
<view class="record-footer">
@ -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;

View File

@ -50,6 +50,14 @@
<view class="stat-number">{{ safeDmRecord.qqRs || 0 }}</view>
<view class="stat-label">缺勤</view>
</view>
<view
class="stat-item absent"
:class="{ active: currentFilter === 'F' }"
@click="setFilter('F')"
>
<view class="stat-number">{{ safeDmRecord.cdRs || 0 }}</view>
<view class="stat-label">迟到</view>
</view>
</view>
</view>
</view>
@ -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;