기능 추가 — 재조치 요청 (조치 기록 유지 재출동)

정비사 조치 완료 후 동일 문제 재발 시 관리자가 기존 기록을 보존한 채
재조치를 요청할 수 있는 기능 추가.

- DB: repairs.re_dispatch_requested/at, reports.re_dispatch_count 컬럼 추가
- 재조치 요청 엔드포인트 (POST /repairs/{id}/re-dispatch): 기존 repair에 플래그,
  연결 신고를 pending으로 복원, re_dispatch_count 증가
- pending 상태 신고는 새 조치 생성으로 분기 (in_progress만 기존 수정 모드)
- report-detail: 조치승인·취소 사이에 "🔁 재조치 요청" 버튼, 이전 조치 이력 카드
- 정비사 대시보드: 재조치 건에 🔁 뱃지 및 강조 버튼색 표시
- 엑셀 export: 재조치횟수 컬럼 추가

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

View File

@@ -88,13 +88,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,
18,24,16,14]
18,24,16,14,10]
for i, w in enumerate(col_widths, 1):
ws.column_dimensions[ws.cell(1, i).column_letter].width = w
@@ -148,6 +149,7 @@ def export_reports(db: Session = Depends(get_db), _=Depends(require_admin)):
r.closure_note or "",
fmt_dt(r.closed_at),
r.closer.name if r.closer else "",
r.re_dispatch_count or 0,
]
for col, val in enumerate(row_data, 1):
ws.cell(row=row_num, column=col, value=val)