考勤记录扣分列显示实际扣分数
1. 新增/更新考勤扣分时记录关联的扣分记录ID(deduction_record_id) 2. 考勤记录查询关联扣分记录,返回扣分数与撤销状态;旧记录按考勤记录ID回查兜底 3. 前端扣分列显示"扣X分 / 扣X分(已撤销)",无扣分显示"-"
This commit is contained in:
1 parent
0ac933a3a5
commit
a7304d151e
4 files changed
+38
-9
No files matched your search
@@ -165,13 +165,22 @@ async function loadAttendanceRecords() {
|
||||
let html = '';
|
||||
const records = res.data.records || [];
|
||||
records.forEach(record => {
|
||||
let deductionText = '-';
|
||||
if (record.deduction_points) {
|
||||
deductionText = '扣' + Math.abs(record.deduction_points) + '分';
|
||||
if (record.deduction_revoked) {
|
||||
deductionText += '(已撤销)';
|
||||
}
|
||||
} else if (record.deduction_applied) {
|
||||
deductionText = '已扣分';
|
||||
}
|
||||
html += `<tr>
|
||||
<td>${escapeHtml(record.student_no)}</td>
|
||||
<td>${escapeHtml(record.student_name)}</td>
|
||||
<td>${getStatusBadge(record.status, 'attendance')}</td>
|
||||
<td>${escapeHtml(record.reason || '-')}</td>
|
||||
<td>${escapeHtml(record.recorder_name || '-')}</td>
|
||||
<td>${record.deduction_applied ? '已扣分' : '-'}</td>
|
||||
<td>${deductionText}</td>
|
||||
</tr>`;
|
||||
});
|
||||
if (records.length === 0) {
|
||||
|
||||
Reference in new issue
Block a user