81 lines
3.6 KiB
HTML
81 lines
3.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="ko">
|
|
<head>
|
|
<meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
|
<title>신고 목록</title>
|
|
<link rel="stylesheet" href="/css/style.css">
|
|
</head>
|
|
<body>
|
|
<nav class="nav"><span class="nav-brand">⚡ EV AS 관리 — 관리자</span><div id="navUser"></div></nav>
|
|
<div class="layout">
|
|
<div class="sidebar">
|
|
<div class="sidebar-section">AS 관리</div>
|
|
<a href="/pages/admin/dashboard.html">📊 대시보드</a>
|
|
<a href="/pages/admin/reports.html" class="active">📋 신고 목록</a>
|
|
<a href="/pages/admin/costs.html">💰 출장비 관리</a>
|
|
<div class="sidebar-section">시스템</div>
|
|
<a href="/pages/admin/improvements.html">🔧 개선항목</a>
|
|
<a href="/pages/admin/chargers.html">⚡ 충전기 관리</a>
|
|
<a href="/pages/admin/charger-types.html">🏷 충전기 종류</a>
|
|
<a href="/pages/admin/qr.html">📷 QR 생성</a>
|
|
<a href="/pages/admin/accounts.html">👥 계정 관리</a>
|
|
<a href="/pages/admin/settings.html">⚙️ 설정</a>
|
|
</div>
|
|
<div class="main">
|
|
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:18px;flex-wrap:wrap;gap:10px;">
|
|
<h2 style="font-size:18px;font-weight:700;color:var(--navy)">AS 신고 목록</h2>
|
|
<button class="btn btn-success btn-sm" onclick="API.download('/export/reports','AS신고목록.xlsx')">📥 엑셀 다운로드</button>
|
|
</div>
|
|
<div class="card">
|
|
<div style="display:flex;gap:10px;margin-bottom:14px;flex-wrap:wrap;">
|
|
<select id="fStatus" style="width:auto">
|
|
<option value="">전체 상태</option>
|
|
<option value="pending_approval">승인대기</option>
|
|
<option value="pending">접수</option>
|
|
<option value="in_progress">처리중</option>
|
|
<option value="done">완료</option>
|
|
<option value="waiting">부품대기</option>
|
|
<option value="revisit">재방문</option>
|
|
</select>
|
|
<input type="text" id="fCharger" placeholder="충전기 ID" style="width:150px">
|
|
<button class="btn btn-outline btn-sm" onclick="load()">🔍 검색</button>
|
|
</div>
|
|
<div class="tbl-wrap">
|
|
<table>
|
|
<thead><tr><th>#</th><th>충전기ID</th><th>충전소</th><th>종류</th><th>문제유형</th><th>신고일시</th><th>상태</th><th>정비사</th></tr></thead>
|
|
<tbody id="tbody"></tbody>
|
|
</table>
|
|
</div>
|
|
<div id="empty" class="alert alert-info" style="display:none">조회된 신고가 없습니다.</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script src="/js/api.js"></script><script src="/js/auth.js"></script>
|
|
<script>
|
|
Auth.require(['admin']); Auth.renderNav(document.getElementById('navUser'));
|
|
async function load() {
|
|
let url = '/reports?';
|
|
const s = document.getElementById('fStatus').value;
|
|
const c = document.getElementById('fCharger').value.trim();
|
|
if (s) url += 'status='+s+'&';
|
|
if (c) url += 'charger_id='+c+'&';
|
|
const rows = await API.get(url);
|
|
const tbody = document.getElementById('tbody');
|
|
document.getElementById('empty').style.display = rows.length ? 'none' : 'block';
|
|
tbody.innerHTML = rows.map(r => `
|
|
<tr onclick="location.href='/pages/admin/report-detail.html?id=${r.id}'">
|
|
<td>#${r.id}</td>
|
|
<td><strong>${r.charger_id}</strong></td>
|
|
<td>${r.station_name||'-'}</td>
|
|
<td>${r.charger_type||'-'}</td>
|
|
<td style="max-width:200px">${(r.issue_types||[]).join(', ')}</td>
|
|
<td>${Auth.fmtDt(r.reported_at)}</td>
|
|
<td>${Auth.statusBadge(r.status)}</td>
|
|
<td>${r.repair?.mechanic_name||'-'}</td>
|
|
</tr>`).join('');
|
|
}
|
|
load();
|
|
</script>
|
|
</body>
|
|
</html>
|