Files
tk-factory-services/system3-nonconformance/web/m/management.html
Hyungi Ahn 178155df6b fix(tkqc): 사진 silent data loss 차단 + 관리함 사진 보충 기능
근본 원인: 2026-04-01 보안 패치(f09c86e)에서 system3-api Dockerfile에
USER appuser 추가했으나, named volume(tkqc-package_uploads)이 root 소유로
남아있어 appuser(999)가 /app/uploads 에 쓰기 실패. 하지만 file_service.py
가 except → return None 으로 silent failure 처리해서 system2는 200 OK 로
인식. 결과: 4/1 이후 qc_issues.id=185~191 사진이 전부 photo_path=NULL.

조치:
1. system3 Dockerfile: entrypoint.sh 추가 → 시작 시 chown 후 gosu appuser 강등
   (named volume 이 restart 후에도 root로 돌아가는 문제 영구 해결)
2. file_service.py: save_base64_image 실패 시 RuntimeError raise (silent 금지)
3. system2 workIssueController: sendToMProject 실패/예외 시 system 알림 발송
4. 관리함 (desktop + mobile): 이슈 상세/편집 모달에 원본 사진 보충 UI 추가
   - 빈 슬롯(photo_path{N}=NULL)에만 자동 채움, 기존 사진 유지
   - ManagementUpdateRequest 스키마에 photo/photo2~5 필드 추가
   - update_issue_management 엔드포인트에 사진 저장 루프 추가

런타임 chown 으로 immediate data loss 는 이미 차단됨 (09:28 KST).
이 커밋은 재발 방지 + 데이터 복구 UI 제공.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 13:28:24 +09:00

194 lines
10 KiB
HTML

<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>관리함</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link rel="stylesheet" href="/static/css/m-common.css?v=2026031401">
</head>
<body>
<!-- 로딩 -->
<div id="loadingOverlay" class="m-loading-overlay">
<div class="m-spinner"></div>
<p>관리함을 불러오는 중...</p>
</div>
<!-- 고정 상단 헤더 -->
<header class="m-header">
<div class="m-header-title">
<i class="fas fa-tasks" style="color:#3b82f6"></i>
관리함
</div>
<div class="m-header-actions">
<button class="m-header-btn" id="additionalInfoBtn" onclick="openAdditionalInfoSheet()" style="display:none"><i class="fas fa-info-circle"></i></button>
<button class="m-header-btn" onclick="location.reload()"><i class="fas fa-sync-alt"></i></button>
</div>
</header>
<!-- 탭 바 -->
<div class="m-tab-bar" style="margin-top:48px;position:sticky;top:48px;z-index:50;background:#fff">
<button class="m-tab active" id="tabInProgress" onclick="switchTab('in_progress')">진행 중</button>
<button class="m-tab" id="tabCompleted" onclick="switchTab('completed')">완료됨</button>
</div>
<!-- 통계 바 -->
<div class="m-stats-bar" id="statsBar">
<div class="m-stat-pill blue"><span>전체</span><span class="m-stat-value" id="totalCount">0</span></div>
<div class="m-stat-pill amber"><span>진행 중</span><span class="m-stat-value" id="inProgressCount">0</span></div>
<div class="m-stat-pill purple"><span>완료 대기</span><span class="m-stat-value" id="pendingCompletionCount">0</span></div>
<div class="m-stat-pill green"><span>완료됨</span><span class="m-stat-value" id="completedCount">0</span></div>
</div>
<!-- 프로젝트 필터 -->
<div class="m-filter-bar">
<select class="m-filter-select" id="projectFilter" onchange="filterIssues()">
<option value="">전체 프로젝트</option>
</select>
</div>
<!-- 이슈 카드 리스트 -->
<div id="issuesList"></div>
<!-- 빈 상태 -->
<div id="emptyState" class="m-empty hidden">
<i class="fas fa-tasks"></i>
<p>해당하는 부적합이 없습니다</p>
</div>
<!-- ===== 바텀시트: 편집 (관리 필드) ===== -->
<div id="editMgmtOverlay" class="m-sheet-overlay" onclick="closeSheet('editMgmt')"></div>
<div id="editMgmtSheet" class="m-sheet">
<div class="m-sheet-handle"></div>
<div class="m-sheet-header">
<span class="m-sheet-title"><i class="fas fa-edit" style="color:#3b82f6;margin-right:6px"></i>관리 정보 편집</span>
<button class="m-sheet-close" onclick="closeSheet('editMgmt')"><i class="fas fa-times"></i></button>
</div>
<div class="m-sheet-body">
<div class="m-form-group">
<label class="m-label"><i class="fas fa-folder" style="color:#8b5cf6;margin-right:4px"></i>프로젝트</label>
<select id="editProject" class="m-select"><option value="">선택하세요</option></select>
</div>
<div class="m-form-group">
<label class="m-label"><i class="fas fa-lightbulb" style="color:#eab308;margin-right:4px"></i>해결방안 (확정)</label>
<textarea id="editManagementComment" class="m-textarea" rows="3" placeholder="확정된 해결 방안을 입력하세요..."></textarea>
</div>
<div class="m-form-group">
<label class="m-label"><i class="fas fa-building" style="color:#3b82f6;margin-right:4px"></i>담당부서</label>
<select id="editResponsibleDept" class="m-select">
<option value="">선택하세요</option>
<option value="production">생산</option>
<option value="quality">품질</option>
<option value="purchasing">구매</option>
<option value="design">설계</option>
<option value="sales">영업</option>
</select>
</div>
<div class="m-form-group">
<label class="m-label"><i class="fas fa-user" style="color:#8b5cf6;margin-right:4px"></i>담당자</label>
<input type="text" id="editResponsiblePerson" class="m-input" placeholder="담당자 이름">
</div>
<div class="m-form-group">
<label class="m-label"><i class="fas fa-calendar-alt" style="color:#ef4444;margin-right:4px"></i>조치 예상일</label>
<input type="date" id="editExpectedDate" class="m-input">
</div>
<!-- 원본 사진 보충 (빈 슬롯에만 채움) -->
<div class="m-form-group" id="editPhotoGroup">
<label class="m-label"><i class="fas fa-camera" style="color:#10b981;margin-right:4px"></i>사진 보충 <span id="editPhotoSlotInfo" style="font-size:11px;color:#6b7280"></span></label>
<div id="editExistingPhotos" style="display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px"></div>
<input type="file" id="editPhotoInput" accept="image/*" capture="environment" multiple
class="m-input" style="padding:8px;font-size:12px" onchange="previewEditPhotos(event)">
<div id="editPhotoPreview" style="display:flex;flex-wrap:wrap;gap:6px;margin-top:6px"></div>
<p style="font-size:11px;color:#9ca3af;margin-top:4px">※ 비어있는 슬롯에만 자동 채움. 기존 사진은 유지됩니다.</p>
</div>
</div>
<div class="m-sheet-footer">
<button class="m-submit-btn" onclick="saveManagementEdit()">
<i class="fas fa-save"></i>저장
</button>
</div>
</div>
<!-- ===== 바텀시트: 추가 정보 ===== -->
<div id="additionalOverlay" class="m-sheet-overlay" onclick="closeSheet('additional')"></div>
<div id="additionalSheet" class="m-sheet">
<div class="m-sheet-handle"></div>
<div class="m-sheet-header">
<span class="m-sheet-title"><i class="fas fa-info-circle" style="color:#f59e0b;margin-right:6px"></i>추가 정보 입력</span>
<button class="m-sheet-close" onclick="closeSheet('additional')"><i class="fas fa-times"></i></button>
</div>
<div class="m-sheet-body">
<div class="m-form-group">
<label class="m-label">대상 이슈 선택</label>
<select id="additionalIssueSelect" class="m-select" onchange="loadAdditionalInfo()"></select>
</div>
<div class="m-form-group">
<label class="m-label">원인부서</label>
<select id="additionalCauseDept" class="m-select">
<option value="">선택하세요</option>
<option value="production">생산</option>
<option value="quality">품질</option>
<option value="purchasing">구매</option>
<option value="design">설계</option>
<option value="sales">영업</option>
</select>
</div>
<div class="m-form-group">
<label class="m-label">해당자</label>
<input type="text" id="additionalCausePerson" class="m-input" placeholder="해당자 이름">
</div>
<div class="m-form-group">
<label class="m-label">원인 상세</label>
<textarea id="additionalCauseDetail" class="m-textarea" rows="3" placeholder="원인을 상세히 기술하세요..."></textarea>
</div>
</div>
<div class="m-sheet-footer">
<button class="m-submit-btn" onclick="saveAdditionalInfo()">
<i class="fas fa-save"></i>저장
</button>
</div>
</div>
<!-- ===== 바텀시트: 완료됨 상세보기 ===== -->
<div id="detailOverlay" class="m-sheet-overlay" onclick="closeSheet('detail')"></div>
<div id="detailSheet" class="m-sheet">
<div class="m-sheet-handle"></div>
<div class="m-sheet-header">
<span class="m-sheet-title" id="detailSheetTitle">상세 정보</span>
<button class="m-sheet-close" onclick="closeSheet('detail')"><i class="fas fa-times"></i></button>
</div>
<div class="m-sheet-body" id="detailSheetBody"></div>
</div>
<!-- ===== 바텀시트: 반려 ===== -->
<div id="rejectOverlay" class="m-sheet-overlay" onclick="closeSheet('reject')"></div>
<div id="rejectSheet" class="m-sheet">
<div class="m-sheet-handle"></div>
<div class="m-sheet-header">
<span class="m-sheet-title"><i class="fas fa-times-circle" style="color:#ef4444;margin-right:6px"></i>완료 반려</span>
<button class="m-sheet-close" onclick="closeSheet('reject')"><i class="fas fa-times"></i></button>
</div>
<div class="m-sheet-body">
<div class="m-form-group">
<label class="m-label">반려 사유</label>
<textarea id="rejectReason" class="m-textarea" rows="4" placeholder="반려 사유를 입력하세요..."></textarea>
</div>
</div>
<div class="m-sheet-footer">
<button class="m-submit-btn red" onclick="submitReject()">
<i class="fas fa-times-circle"></i>반려하기
</button>
</div>
</div>
<!-- 스크립트 -->
<script src="/static/js/api.js?v=2026031401"></script>
<script src="/static/js/sso-relay.js?v=20260401"></script>
<script src="/static/js/core/auth-manager.js?v=2026031401"></script>
<script src="/static/js/core/permissions.js?v=2026031401"></script>
<script src="/static/js/utils/issue-helpers.js?v=2026031401"></script>
<script src="/static/js/m/m-common.js?v=2026031401"></script>
<script src="/static/js/m/m-management.js?v=2026040901"></script>
</body>
</html>