v0.8.5测试

This commit is contained in:
2026-04-16 10:36:34 +08:00
parent 4cbf294cd9
commit 112dc94f7c
12 changed files with 297 additions and 90 deletions

View File

@@ -38,6 +38,14 @@ include __DIR__ . '/../includes/header.php';
<label>日期</label>
<input type="date" id="attendanceDate" value="<?php echo date('Y-m-d'); ?>">
</div>
<div class="form-group" style="margin:0">
<label>时段</label>
<select id="attendanceSlot">
<option value="morning">早 8:15</option>
<option value="afternoon">下午 14:00</option>
<option value="evening">晚 19:30</option>
</select>
</div>
<div class="status-group">
<button class="status-btn active" data-status="absent" onclick="selectStatus(this)" data-default-deduction="3">缺勤</button>
<button class="status-btn" data-status="late" onclick="selectStatus(this)" data-default-deduction="1">迟到</button>
@@ -166,20 +174,7 @@ async function submitAttendance() {
const customDeduction = document.getElementById('customDeduction').value;
const customDeductionValue = customDeduction ? parseInt(customDeduction) : null;
// 检查是否有已存在记录的学生
const hasRecordStudents = [];
selectedCells.forEach(cell => {
if (cell.classList.contains('has-record')) {
hasRecordStudents.push(cell.dataset.name);
}
});
if (hasRecordStudents.length > 0) {
const confirmed = confirm(`以下学生已有考勤记录:${hasRecordStudents.join('、')},是否继续提交?`);
if (!confirmed) return;
}
// 批量提交
// 批量提交(不再检查已有记录,允许同一学生同一天多次考勤)
const promises = [];
selectedCells.forEach(cell => {
const studentId = parseInt(cell.dataset.id);