完成报到确认页完善:

增加勾选、全选本页、批量设置状态和统一备注;应用后点击“暂存当前页”保存。
修复 Excel 文件选择事件被错误放在键盘监听中的问题。
导入后显示读取行数、实际更新人数、未变化人数及状态变化明细;重复导入会明确提示“没有产生变化”。
“拍摄二维码”改为调用 getUserMedia 实时相机,图片选择仅作为备用方式。
扫码后先展示考生确认页,默认选择“确认报到”,点击“暂存”后才修改数据。
后端新增扫码预览接口,预览过程不会提前修改报到状态。
This commit is contained in:
2026-07-22 10:59:33 +08:00 Unverified
parent 3e1bced990
commit 411cf6892c
6 changed files with 237 additions and 34 deletions
+12 -4
View File
@@ -698,15 +698,23 @@ try {
finalizedInspector.close();
const finalizedPlacement = { id: finalizedPlacementRow.id, kind: finalizedPlacementRow.kind, examId: finalizedPlacementRow.exam_id, userId: finalizedPlacementRow.user_id, schoolId: finalizedPlacementRow.school_id, status: finalizedPlacementRow.status, payload: JSON.parse(finalizedPlacementRow.payload_json), createdAt: finalizedPlacementRow.created_at, updatedAt: finalizedPlacementRow.updated_at };
const noticeCode = admissionNoticeCode('development-document-verification-secret', finalizedPlacement, exam);
const scannedReporting = await admissionSchoolClient.request('/api/admission/reporting/scan', { method: 'POST', body: { code: `http://127.0.0.1/#verify/${noticeCode}` } });
assert.equal(scannedReporting.response.status, 200, '招生学校应能扫描通知书防伪二维码并暂存报到');
assert.equal(scannedReporting.data.row.status, 'reported', '扫码核验通过后应暂存为已报到而不是直接提交');
const reportingPreview = await admissionSchoolClient.request('/api/admission/reporting/scan-preview', { method: 'POST', body: { examId: exam.id, code: `http://127.0.0.1/#verify/${noticeCode}` } });
assert.equal(reportingPreview.response.status, 200, '扫描通知书二维码后应先返回考生确认信息');
assert.equal(reportingPreview.data.row.status, 'pending', '扫码预览不得提前修改报到状态');
const scannedReporting = await admissionSchoolClient.request('/api/admission/reporting/scan', { method: 'POST', body: { examId: exam.id, code: `http://127.0.0.1/#verify/${noticeCode}`, status: 'reported' } });
assert.equal(scannedReporting.response.status, 200, '确认页点击暂存后应能保存扫码报到结果');
assert.equal(scannedReporting.data.row.status, 'reported', '确认页默认选择应能暂存为已报到而不是直接提交');
const secondRow = reportingBatch.rows[1];
const importReportingFile = Buffer.from(await buildWorkbook('admission_reporting', [{ noticeNumber: secondRow.noticeNumber, candidateNumber: secondRow.candidateNumber, name: secondRow.name, examCode: exam.code, schoolCode: admissionOnlySchool.data.school.code, categoryName: secondRow.categoryName, reportingStatusCode: 'N', reportingNote: '逾期未报到' }]));
const importedReporting = await admissionSchoolClient.request(`/api/admission/reporting/import?examId=${exam.id}`, { method: 'POST', headers: { 'Content-Type': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }, body: importReportingFile });
assert.equal(importedReporting.response.status, 200, '招生学校应能导入修改后的报到 Excel 并暂存');
assert.equal(importedReporting.data.count, 1, 'Excel 导入应返回实际暂存人数');
assert.equal(importedReporting.data.count, 1, 'Excel 导入应返回读取行数');
assert.equal(importedReporting.data.changedCount, 1, 'Excel 导入应明确返回实际变化人数');
assert.equal(importedReporting.data.changes[0].toCode, 'N', 'Excel 导入变化摘要应说明修改后的状态码');
const unchangedReporting = await admissionSchoolClient.request(`/api/admission/reporting/import?examId=${exam.id}`, { method: 'POST', headers: { 'Content-Type': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }, body: importReportingFile });
assert.equal(unchangedReporting.data.changedCount, 0, '重复导入相同 Excel 时应明确提示没有变化');
assert.equal(unchangedReporting.data.unchangedCount, 1, '重复导入相同 Excel 时应返回未变化行数');
assert.equal((await admissionSchoolClient.request('/api/admission/reporting/submit', { method: 'POST', body: { examId: exam.id } })).response.status, 200, '全部状态确认后招生学校应能提交报到情况');
assert.equal((await admissionSchoolClient.request('/api/admission/reporting/decision', { method: 'POST', body: { examId: exam.id, supplement: true, decisionNote: '一名考生未报到,申请补录缺额' } })).response.status, 200, '招生学校应能根据实时完成率提交补录决定');
const reportingApprovalLedger = await admin.request('/api/admin/admissions');