218 lines
17 KiB
HTML
218 lines
17 KiB
HTML
{% extends "base_tailwind.html" %}
|
|
{% block title %}考级项目报名 - {{ brand_name }}{% endblock %}
|
|
{% block extra_css %}
|
|
<style>
|
|
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
|
|
.row-animate { animation: fadeSlideIn 0.3s ease both; }
|
|
@media (prefers-reduced-motion: reduce) { .row-animate, .list-item-enter { animation: none !important; opacity: 1 !important; } }
|
|
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
|
|
.table-wrap table { min-width: 1800px; }
|
|
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 9999px; font-size: 11px; font-weight: 500; }
|
|
.badge-green { background: #dcfce7; color: #166534; }
|
|
.badge-yellow { background: #fef9c3; color: #854d0e; }
|
|
.badge-gray { background: #f3f4f6; color: #4b5563; }
|
|
.badge-blue { background: #dbeafe; color: #1e40af; }
|
|
.dark .badge-green { background: #14532d; color: #bbf7d0; }
|
|
.dark .badge-yellow { background: #713f12; color: #fef08a; }
|
|
.dark .badge-gray { background: #374151; color: #d1d5db; }
|
|
.dark .badge-blue { background: #1e3a5f; color: #93c5fd; }
|
|
.modal-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; }
|
|
.modal-box { background: #fff; border-radius: 16px; max-width: 95vw; max-height: 85vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 25px 60px rgba(0,0,0,.3); }
|
|
.dark .modal-box { background: #1a1a1a; }
|
|
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid #e5e5e5; }
|
|
.dark .modal-header { border-color: #333; }
|
|
.modal-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
|
|
</style>
|
|
{% endblock %}
|
|
{% block content %}
|
|
<div>
|
|
<div class="flex flex-col md:flex-row justify-between items-start md:items-center gap-4 mb-6 list-item-enter" style="animation-delay:0ms;">
|
|
<div>
|
|
<h2 class="text-2xl font-bold flex items-center gap-2">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 6v6l4 2"/></svg>
|
|
考级项目报名
|
|
</h2>
|
|
<p class="text-sm text-gray-500 dark:text-gray-400 mt-1">等级考试报名信息查询</p>
|
|
</div>
|
|
<div class="flex items-center gap-2">
|
|
<span id="semesterLabel" class="text-sm font-medium text-gray-600 dark:text-gray-400"></span>
|
|
<button onclick="loadExpired()" class="px-3 py-1.5 rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-black/30 text-xs font-medium hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors">✉ 本学期过期项目报名信息</button>
|
|
<button onclick="loadData()" class="px-3 py-1.5 rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-black/30 text-xs font-medium hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors flex items-center gap-1"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/></svg>刷新</button>
|
|
</div>
|
|
</div>
|
|
<div id="loadingIndicator" class="text-center py-12 hidden"><div class="w-10 h-10 border-2 border-black dark:border-white border-t-transparent rounded-full animate-spin mx-auto mb-4"></div><p class="text-gray-500 dark:text-gray-400">加载中...</p></div>
|
|
<div id="errorMessage" class="glass rounded-2xl p-6 mb-4 text-center hidden"><p id="errorText" class="text-red-500"></p></div>
|
|
<div id="dataContainer" class="hidden list-item-enter" style="animation-delay:100ms;">
|
|
<div class="glass rounded-2xl overflow-hidden">
|
|
<div class="table-wrap">
|
|
<table class="w-full text-sm">
|
|
<thead>
|
|
<tr class="border-b border-gray-200 dark:border-gray-700 bg-gray-50/50 dark:bg-gray-800/50">
|
|
<th class="text-left py-3 px-3 font-semibold text-gray-700 dark:text-gray-300 whitespace-nowrap text-xs">流程跟踪</th>
|
|
<th class="text-left py-3 px-3 font-semibold text-gray-700 dark:text-gray-300 whitespace-nowrap text-xs">审核状态</th>
|
|
<th class="text-left py-3 px-3 font-semibold text-gray-700 dark:text-gray-300 whitespace-nowrap text-xs">缴费状态</th>
|
|
<th class="text-left py-3 px-3 font-semibold text-gray-700 dark:text-gray-300 whitespace-nowrap text-xs">报名学年</th>
|
|
<th class="text-left py-3 px-3 font-semibold text-gray-700 dark:text-gray-300 whitespace-nowrap text-xs">报名学期</th>
|
|
<th class="text-left py-3 px-3 font-semibold text-gray-700 dark:text-gray-300 whitespace-nowrap text-xs">报名批次</th>
|
|
<th class="text-left py-3 px-3 font-semibold text-gray-700 dark:text-gray-300 whitespace-nowrap text-xs">项目类别</th>
|
|
<th class="text-left py-3 px-3 font-semibold text-gray-700 dark:text-gray-300 whitespace-nowrap text-xs">项目名称</th>
|
|
<th class="text-left py-3 px-3 font-semibold text-gray-700 dark:text-gray-300 whitespace-nowrap text-xs">项目成绩</th>
|
|
<th class="text-left py-3 px-3 font-semibold text-gray-700 dark:text-gray-300 whitespace-nowrap text-xs">成绩明细</th>
|
|
<th class="text-right py-3 px-3 font-semibold text-gray-700 dark:text-gray-300 whitespace-nowrap text-xs">报名费用</th>
|
|
<th class="text-left py-3 px-3 font-semibold text-gray-700 dark:text-gray-300 whitespace-nowrap text-xs">证件类型</th>
|
|
<th class="text-left py-3 px-3 font-semibold text-gray-700 dark:text-gray-300 whitespace-nowrap text-xs">证件号码</th>
|
|
<th class="text-left py-3 px-3 font-semibold text-gray-700 dark:text-gray-300 whitespace-nowrap text-xs">准考证号</th>
|
|
<th class="text-left py-3 px-3 font-semibold text-gray-700 dark:text-gray-300 whitespace-nowrap text-xs">考试时间</th>
|
|
<th class="text-left py-3 px-3 font-semibold text-gray-700 dark:text-gray-300 whitespace-nowrap text-xs">考试地点</th>
|
|
<th class="text-left py-3 px-3 font-semibold text-gray-700 dark:text-gray-300 whitespace-nowrap text-xs">考场号</th>
|
|
<th class="text-left py-3 px-3 font-semibold text-gray-700 dark:text-gray-300 whitespace-nowrap text-xs">座位号</th>
|
|
<th class="text-left py-3 px-3 font-semibold text-gray-700 dark:text-gray-300 whitespace-nowrap text-xs">手机号码</th>
|
|
<th class="text-left py-3 px-3 font-semibold text-gray-700 dark:text-gray-300 whitespace-nowrap text-xs">校区</th>
|
|
<th class="text-left py-3 px-3 font-semibold text-gray-700 dark:text-gray-300 whitespace-nowrap text-xs">备注</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="tableBody"></tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="emptyState" class="glass rounded-2xl p-12 text-center hidden"><p class="text-gray-500 dark:text-gray-400 text-lg">暂无考级报名信息</p></div>
|
|
</div>
|
|
|
|
<!-- 过期项目弹窗 -->
|
|
<div id="expiredModal" class="modal-overlay hidden" onclick="if(event.target===this)closeExpiredModal()">
|
|
<div class="modal-box w-full max-w-4xl">
|
|
<div class="modal-header">
|
|
<h3 class="text-lg font-bold">查询过期项目</h3>
|
|
<button onclick="closeExpiredModal()" class="p-1 hover:bg-gray-100 dark:hover:bg-gray-800 rounded transition-colors text-xl leading-none">×</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div id="expiredLoading" class="text-center py-8"><div class="w-8 h-8 border-2 border-black dark:border-white border-t-transparent rounded-full animate-spin mx-auto mb-3"></div><p class="text-gray-500 text-sm">加载中...</p></div>
|
|
<div id="expiredError" class="text-center py-8 text-red-500 hidden"></div>
|
|
<div id="expiredContent" class="hidden">
|
|
<div class="overflow-x-auto">
|
|
<table class="w-full text-sm">
|
|
<thead>
|
|
<tr class="border-b border-gray-200 dark:border-gray-700 bg-gray-50/50 dark:bg-gray-800/50">
|
|
<th class="text-left py-2 px-3 font-semibold text-xs text-gray-700 dark:text-gray-300">报名学年</th>
|
|
<th class="text-left py-2 px-3 font-semibold text-xs text-gray-700 dark:text-gray-300">报名学期</th>
|
|
<th class="text-left py-2 px-3 font-semibold text-xs text-gray-700 dark:text-gray-300">项目类别</th>
|
|
<th class="text-left py-2 px-3 font-semibold text-xs text-gray-700 dark:text-gray-300">项目名称</th>
|
|
<th class="text-left py-2 px-3 font-semibold text-xs text-gray-700 dark:text-gray-300">报名批次</th>
|
|
<th class="text-right py-2 px-3 font-semibold text-xs text-gray-700 dark:text-gray-300">人数限制</th>
|
|
<th class="text-left py-2 px-3 font-semibold text-xs text-gray-700 dark:text-gray-300">开始时间</th>
|
|
<th class="text-left py-2 px-3 font-semibold text-xs text-gray-700 dark:text-gray-300">结束时间</th>
|
|
<th class="text-right py-2 px-3 font-semibold text-xs text-gray-700 dark:text-gray-300">费用</th>
|
|
<th class="text-center py-2 px-3 font-semibold text-xs text-gray-700 dark:text-gray-300">可退</th>
|
|
<th class="text-center py-2 px-3 font-semibold text-xs text-gray-700 dark:text-gray-300">可补考</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="expiredTableBody"></tbody>
|
|
</table>
|
|
</div>
|
|
<div id="expiredSummary" class="text-xs text-gray-500 text-right mt-3"></div>
|
|
</div>
|
|
</div>
|
|
<div class="flex justify-end px-5 py-3 border-t border-gray-100 dark:border-gray-800">
|
|
<button onclick="closeExpiredModal()" class="px-6 py-2 rounded-lg bg-black dark:bg-white text-white dark:text-black text-sm font-medium hover:opacity-85 transition-opacity">关 闭</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
{% block extra_js %}
|
|
<script>
|
|
function v(item, keys) {
|
|
for (const k of keys) { const val = item[k]; if (val != null && val !== '') return val; }
|
|
return '--';
|
|
}
|
|
|
|
async function loadData() {
|
|
showLoading();
|
|
try {
|
|
const res = await fetch('/api/jwxt/exam-registration');
|
|
const data = await res.json();
|
|
hideLoading();
|
|
if (!data.success) { showError(data.message); return; }
|
|
const items = data.items || [];
|
|
if (!items.length) { showEmpty('暂无考级报名信息'); return; }
|
|
renderTable(items);
|
|
} catch(e) { hideLoading(); showError('网络错误: '+e.message); }
|
|
}
|
|
|
|
function renderTable(items) {
|
|
const tbody = document.getElementById('tableBody');
|
|
tbody.innerHTML = items.map((item, i) => {
|
|
const shzt = v(item, ['shztmc', 'shzt', '审核状态']);
|
|
const jfzt = v(item, ['jfzt', 'jfztmc', '缴费状态']);
|
|
const shBadge = shzt.includes('通过') ? 'badge-green' : shzt.includes('待审') ? 'badge-yellow' : shzt.includes('缴费') ? 'badge-blue' : 'badge-gray';
|
|
const jfBadge = jfzt.includes('已缴') ? 'badge-green' : jfzt.includes('未缴') ? 'badge-yellow' : 'badge-gray';
|
|
return `<tr class="border-b border-gray-100 dark:border-gray-800 hover:bg-gray-50/50 dark:hover:bg-gray-800/30 transition-colors row-animate" style="animation-delay:${i*30}ms;">
|
|
<td class="py-2.5 px-3 text-xs">${escHtml(v(item,['lczz','流程跟踪']))}</td>
|
|
<td class="py-2.5 px-3"><span class="badge ${shBadge}">${escHtml(shzt)}</span></td>
|
|
<td class="py-2.5 px-3"><span class="badge ${jfBadge}">${escHtml(jfzt)}</span></td>
|
|
<td class="py-2.5 px-3 text-xs text-gray-500">${escHtml(v(item,['bmdxnm','xnm','报名学年']))}</td>
|
|
<td class="py-2.5 px-3 text-xs text-gray-500">${escHtml(v(item,['bmdxqm','xqm','报名学期']))}</td>
|
|
<td class="py-2.5 px-3 text-xs text-gray-500">${escHtml(v(item,['bmpc','bmpcmc','报名批次']))}</td>
|
|
<td class="py-2.5 px-3 text-xs">${escHtml(v(item,['xmlbmc','xmlb','项目类别']))}</td>
|
|
<td class="py-2.5 px-3 font-medium">${escHtml(v(item,['xmmc','项目名称']))}</td>
|
|
<td class="py-2.5 px-3 text-xs">${escHtml(v(item,['xmcj','项目成绩']))}</td>
|
|
<td class="py-2.5 px-3 text-xs text-blue-500">${escHtml(v(item,['cjmx','成绩明细']))}</td>
|
|
<td class="py-2.5 px-3 text-right text-xs font-medium">${escHtml(v(item,['bmfy','报名费用(元)','fy','费用']))}</td>
|
|
<td class="py-2.5 px-3 text-xs text-gray-500">${escHtml(v(item,['zjlxmc','zjlx','证件类型']))}</td>
|
|
<td class="py-2.5 px-3 text-xs">${escHtml(v(item,['zjhm','证件号码']))}</td>
|
|
<td class="py-2.5 px-3 text-xs">${escHtml(v(item,['zkzh','准考证号']))}</td>
|
|
<td class="py-2.5 px-3 text-xs text-gray-500">${escHtml(v(item,['kssj','考试时间']))}</td>
|
|
<td class="py-2.5 px-3 text-xs">${escHtml(v(item,['ksdd','kscd','考试地点']))}</td>
|
|
<td class="py-2.5 px-3 text-xs text-gray-500">${escHtml(v(item,['kch','考场号']))}</td>
|
|
<td class="py-2.5 px-3 text-xs text-gray-500">${escHtml(v(item,['zwh','座位号']))}</td>
|
|
<td class="py-2.5 px-3 text-xs">${escHtml(v(item,['sjhm','手机号码']))}</td>
|
|
<td class="py-2.5 px-3 text-xs text-gray-500">${escHtml(v(item,['xqmc','校区']))}</td>
|
|
<td class="py-2.5 px-3 text-xs text-gray-400 max-w-[120px] truncate">${escHtml(v(item,['bz','备注']))}</td>
|
|
</tr>`;
|
|
}).join('');
|
|
document.getElementById('dataContainer').classList.remove('hidden');
|
|
document.getElementById('emptyState').classList.add('hidden');
|
|
}
|
|
|
|
async function loadExpired() {
|
|
document.getElementById('expiredModal').classList.remove('hidden');
|
|
document.getElementById('expiredLoading').classList.remove('hidden');
|
|
document.getElementById('expiredError').classList.add('hidden');
|
|
document.getElementById('expiredContent').classList.add('hidden');
|
|
try {
|
|
const res = await fetch('/api/jwxt/exam-registration/expired');
|
|
const data = await res.json();
|
|
document.getElementById('expiredLoading').classList.add('hidden');
|
|
if (!data.success) { document.getElementById('expiredError').textContent = data.message; document.getElementById('expiredError').classList.remove('hidden'); return; }
|
|
const items = data.items || [];
|
|
if (!items.length) { document.getElementById('expiredError').textContent = '暂无过期报名信息'; document.getElementById('expiredError').classList.remove('hidden'); return; }
|
|
const tbody = document.getElementById('expiredTableBody');
|
|
tbody.innerHTML = items.map((item, i) => `
|
|
<tr class="border-b border-gray-100 dark:border-gray-800 row-animate" style="animation-delay:${i*30}ms;">
|
|
<td class="py-2 px-3 text-xs">${escHtml(item.xnmc||'--')}</td>
|
|
<td class="py-2 px-3 text-xs">${escHtml(item.xqmmc||'--')}</td>
|
|
<td class="py-2 px-3 text-xs">${escHtml(item.xmlbmc||'--')}</td>
|
|
<td class="py-2 px-3 text-xs font-medium">${escHtml(item.xmmc||'--')}</td>
|
|
<td class="py-2 px-3 text-xs">${escHtml(item.bmpc||'--')}</td>
|
|
<td class="py-2 px-3 text-xs text-right">${escHtml(item.rszgxz||'--')}</td>
|
|
<td class="py-2 px-3 text-xs text-gray-500">${escHtml(item.kssj||'--')}</td>
|
|
<td class="py-2 px-3 text-xs text-gray-500">${escHtml(item.jssj||'--')}</td>
|
|
<td class="py-2 px-3 text-xs text-right font-medium">${escHtml(item.bmfy||'--')}</td>
|
|
<td class="py-2 px-3 text-xs text-center">${item.sfkt==='1'?'✅':'❌'}</td>
|
|
<td class="py-2 px-3 text-xs text-center">${item.sfkbk==='1'?'✅':'❌'}</td>
|
|
</tr>
|
|
`).join('');
|
|
document.getElementById('expiredSummary').textContent = `共 ${items.length} 条记录`;
|
|
document.getElementById('expiredContent').classList.remove('hidden');
|
|
} catch(e) { document.getElementById('expiredLoading').classList.add('hidden'); document.getElementById('expiredError').textContent = '加载失败: '+e.message; document.getElementById('expiredError').classList.remove('hidden'); }
|
|
}
|
|
|
|
function closeExpiredModal() { document.getElementById('expiredModal').classList.add('hidden'); }
|
|
function showLoading() { document.getElementById('loadingIndicator').classList.remove('hidden'); document.getElementById('errorMessage').classList.add('hidden'); document.getElementById('dataContainer').classList.add('hidden'); document.getElementById('emptyState').classList.add('hidden'); }
|
|
function hideLoading() { document.getElementById('loadingIndicator').classList.add('hidden'); }
|
|
function showError(msg) { document.getElementById('errorText').textContent = msg; document.getElementById('errorMessage').classList.remove('hidden'); }
|
|
function showEmpty(msg) { document.getElementById('emptyState').classList.remove('hidden'); document.getElementById('emptyState').querySelector('p').textContent = msg; }
|
|
function escHtml(s) { if(s==null) return ''; return String(s).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"'); }
|
|
document.addEventListener('DOMContentLoaded', () => loadData());
|
|
</script>
|
|
{% endblock %} |