기능 추가 — 신고 상황종료 처리

- DB: reports 테이블에 closure_type, closure_note, closed_at, closed_by 컬럼 추가
- 백엔드: PATCH /reports/{id}/close 엔드포인트 (사유 4종: natural/remote_reset/false_alarm/other)
- 신고상세: 승인대기 상태에서 [상황종료] 버튼 추가, 인라인 패널에서 사유 선택
- 상황종료 후 상세 화면에 사유·메모·처리자·일시 표시
- 엑셀 AS신고목록에 상황종료 4개 컬럼 추가
- 신고목록 필터·지도 상태 목록에 closed 추가, CSS 뱃지 추가

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
byun
2026-06-01 09:39:50 +09:00
parent b59569ca11
commit af7e47529c
7 changed files with 108 additions and 6 deletions

View File

@@ -74,6 +74,12 @@ def export_reports(db: Session = Depends(get_db), _=Depends(require_admin)):
ws.title = "AS신고목록"
ws.freeze_panes = "A2"
CLOSURE_LABEL = {
"natural": "증상자연소거",
"remote_reset": "원격리셋후증상소거",
"false_alarm": "인지오류",
"other": "기타",
}
headers = [
"접수번호","충전기ID","충전기종류","충전기명","충전소명","CPO명","설치일",
"신고위치(위도)","신고위치(경도)","문제유형","에러코드","상세설명",
@@ -81,12 +87,14 @@ def export_reports(db: Session = Depends(get_db), _=Depends(require_admin)):
"담당정비사","정비사소속","조치유형","조치내용",
"조치시작","조치완료","작업소요시간","신고→완료소요시간",
"문제원인(관리자)","비고","출장비부담주체","출장비금액(원)","출장비상태",
"처리담당자","처리일시","연결개선항목번호"
"처리담당자","처리일시","연결개선항목번호",
"상황종료사유","상황종료메모","상황종료일시","상황종료처리자"
]
style_header(ws, headers)
col_widths = [10,14,14,14,18,14,12,12,12,22,12,24,14,16,16,10,16,12,
12,14,16,24,16,16,12,18,24,24,16,12,12,12,16,18]
12,14,16,24,16,16,12,18,24,24,16,12,12,12,16,18,
18,24,16,14]
for i, w in enumerate(col_widths, 1):
ws.column_dimensions[ws.cell(1, i).column_letter].width = w
@@ -136,6 +144,10 @@ def export_reports(db: Session = Depends(get_db), _=Depends(require_admin)):
cost.reviewer.name if cost and cost.reviewer else "",
fmt_dt(cost.reviewed_at) if cost else "",
", ".join(str(i) for i in imp_ids) if imp_ids else "",
CLOSURE_LABEL.get(r.closure_type, "") if r.closure_type else "",
r.closure_note or "",
fmt_dt(r.closed_at),
r.closer.name if r.closer else "",
]
for col, val in enumerate(row_data, 1):
ws.cell(row=row_num, column=col, value=val)