- 공통 유틸리티 추출 (common/utils.js, common/base-state.js) - TBM 모바일 인라인 JS/CSS 외부 파일로 분리 (tbm-mobile.js, tbm-mobile.css) - 미사용 코드 삭제 (index.js, work-report-*.js 등 5개 파일) - TBM/작업보고 state.js, utils.js를 공통 모듈 기반으로 전환 - 작업보고서 SSO 인증 호환 수정 (token/user 함수) - tbmModel.js: incomplete-reports 쿼리에서 users→sso_users 조인 수정, leader_name 조인 추가 - docker-compose.yml: system1-web 볼륨 마운트 추가 - 모바일 인계(handover) 기능 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
345 lines
14 KiB
HTML
345 lines
14 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="ko">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>설비 상세 | (주)테크니컬코리아</title>
|
|
<link rel="stylesheet" href="/css/design-system.css">
|
|
<link rel="stylesheet" href="/css/admin-pages.css?v=8">
|
|
<link rel="stylesheet" href="/css/equipment-detail.css?v=1">
|
|
<link rel="icon" type="image/png" href="/img/favicon.png">
|
|
<script src="/js/api-base.js?v=2"></script>
|
|
<script src="/js/app-init.js?v=9" defer></script>
|
|
</head>
|
|
<body>
|
|
<!-- 네비게이션 바 -->
|
|
<div id="navbar-container"></div>
|
|
|
|
<!-- 메인 레이아웃 -->
|
|
<div class="page-container">
|
|
<!-- 메인 콘텐츠 -->
|
|
<main class="main-content">
|
|
<div class="dashboard-main">
|
|
<!-- 뒤로가기 & 제목 -->
|
|
<div class="page-header eq-detail-header">
|
|
<div class="page-title-section">
|
|
<button class="btn-back" onclick="goBack()">
|
|
<span class="back-arrow">←</span>
|
|
<span>뒤로</span>
|
|
</button>
|
|
<div class="eq-header-info">
|
|
<h1 class="page-title" id="equipmentTitle">설비 상세</h1>
|
|
<div class="eq-header-meta" id="equipmentMeta"></div>
|
|
</div>
|
|
</div>
|
|
<div class="eq-status-badge" id="equipmentStatus"></div>
|
|
</div>
|
|
|
|
<!-- 설비 기본 정보 카드 -->
|
|
<div class="eq-info-card" id="equipmentInfoCard">
|
|
<!-- JS에서 동적으로 렌더링 -->
|
|
</div>
|
|
|
|
<!-- 사진 섹션 -->
|
|
<div class="eq-section">
|
|
<div class="eq-section-header">
|
|
<h2 class="eq-section-title">설비 사진</h2>
|
|
<button class="btn btn-sm btn-outline" onclick="openPhotoModal()">+ 사진 추가</button>
|
|
</div>
|
|
<div class="eq-photo-grid" id="photoGrid">
|
|
<div class="eq-photo-empty">등록된 사진이 없습니다</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 위치 정보 섹션 -->
|
|
<div class="eq-section">
|
|
<div class="eq-section-header">
|
|
<h2 class="eq-section-title">위치 정보</h2>
|
|
</div>
|
|
<div class="eq-location-card" id="locationCard">
|
|
<div class="eq-location-info">
|
|
<div class="eq-location-row">
|
|
<span class="eq-location-label">원래 위치:</span>
|
|
<span class="eq-location-value" id="originalLocation">-</span>
|
|
</div>
|
|
<div class="eq-location-row" id="currentLocationRow" style="display: none;">
|
|
<span class="eq-location-label">현재 위치:</span>
|
|
<span class="eq-location-value eq-moved" id="currentLocation">-</span>
|
|
</div>
|
|
</div>
|
|
<div class="eq-map-preview" id="mapPreview">
|
|
<!-- 지도 미리보기 -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 액션 버튼들 -->
|
|
<div class="eq-action-buttons">
|
|
<button class="btn btn-action btn-move" onclick="openMoveModal()">
|
|
<span class="btn-icon">⇄</span>
|
|
<span>임시이동</span>
|
|
</button>
|
|
<button class="btn btn-action btn-repair" onclick="openRepairModal()">
|
|
<span class="btn-icon">🔧</span>
|
|
<span>수리신청</span>
|
|
</button>
|
|
<button class="btn btn-action btn-export" onclick="openExportModal()">
|
|
<span class="btn-icon">🚚</span>
|
|
<span>외부반출</span>
|
|
</button>
|
|
</div>
|
|
|
|
<!-- 수리 이력 섹션 -->
|
|
<div class="eq-section">
|
|
<div class="eq-section-header">
|
|
<h2 class="eq-section-title">수리 이력</h2>
|
|
</div>
|
|
<div class="eq-history-list" id="repairHistory">
|
|
<div class="eq-history-empty">수리 이력이 없습니다</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 외부반출 이력 섹션 -->
|
|
<div class="eq-section">
|
|
<div class="eq-section-header">
|
|
<h2 class="eq-section-title">외부반출 이력</h2>
|
|
</div>
|
|
<div class="eq-history-list" id="externalHistory">
|
|
<div class="eq-history-empty">외부반출 이력이 없습니다</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 이동 이력 섹션 -->
|
|
<div class="eq-section">
|
|
<div class="eq-section-header">
|
|
<h2 class="eq-section-title">이동 이력</h2>
|
|
</div>
|
|
<div class="eq-history-list" id="moveHistory">
|
|
<div class="eq-history-empty">이동 이력이 없습니다</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
|
|
<!-- 사진 추가 모달 -->
|
|
<div id="photoModal" class="modal-overlay" style="display: none;">
|
|
<div class="modal-container" style="max-width: 500px;">
|
|
<div class="modal-header">
|
|
<h2>사진 추가</h2>
|
|
<button class="btn-close" onclick="closePhotoModal()">×</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="form-group">
|
|
<label>사진 선택</label>
|
|
<input type="file" id="photoInput" accept="image/*" onchange="previewPhoto(event)">
|
|
</div>
|
|
<div class="photo-preview-container" id="photoPreviewContainer" style="display: none;">
|
|
<img id="photoPreview" class="photo-preview">
|
|
</div>
|
|
<div class="form-group">
|
|
<label>설명 (선택)</label>
|
|
<input type="text" id="photoDescription" class="form-control" placeholder="사진 설명을 입력하세요">
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" onclick="closePhotoModal()">취소</button>
|
|
<button type="button" class="btn btn-primary" onclick="uploadPhoto()">업로드</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 임시이동 모달 -->
|
|
<div id="moveModal" class="modal-overlay" style="display: none;">
|
|
<div class="modal-container" style="max-width: 600px;">
|
|
<div class="modal-header">
|
|
<h2>설비 임시 이동</h2>
|
|
<button class="btn-close" onclick="closeMoveModal()">×</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="move-step" id="moveStep1">
|
|
<div class="form-group">
|
|
<label>이동할 공장 선택</label>
|
|
<select id="moveFactorySelect" class="form-control" onchange="loadMoveWorkplaces()">
|
|
<option value="">공장을 선택하세요</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>이동할 작업장 선택</label>
|
|
<select id="moveWorkplaceSelect" class="form-control" onchange="loadMoveMap()">
|
|
<option value="">작업장을 선택하세요</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="move-step" id="moveStep2" style="display: none;">
|
|
<p class="move-instruction">지도에서 이동할 위치를 클릭하세요</p>
|
|
<div class="move-map-container" id="moveMapContainer">
|
|
<!-- 지도가 여기에 표시됨 -->
|
|
</div>
|
|
<div class="form-group">
|
|
<label>이동 사유 (선택)</label>
|
|
<input type="text" id="moveReason" class="form-control" placeholder="이동 사유를 입력하세요">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" onclick="closeMoveModal()">취소</button>
|
|
<button type="button" class="btn btn-primary" id="moveConfirmBtn" onclick="confirmMove()" disabled>이동 확인</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 수리신청 모달 -->
|
|
<div id="repairModal" class="modal-overlay" style="display: none;">
|
|
<div class="modal-container" style="max-width: 500px;">
|
|
<div class="modal-header">
|
|
<h2>수리 신청</h2>
|
|
<button class="btn-close" onclick="closeRepairModal()">×</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="form-group">
|
|
<label>수리 유형</label>
|
|
<select id="repairItemSelect" class="form-control">
|
|
<option value="">선택하세요</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>상세 내용</label>
|
|
<textarea id="repairDescription" class="form-control" rows="3" placeholder="수리가 필요한 내용을 상세히 적어주세요"></textarea>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>사진 첨부 (선택)</label>
|
|
<input type="file" id="repairPhotoInput" accept="image/*" multiple onchange="previewRepairPhotos(event)">
|
|
<div class="repair-photo-previews" id="repairPhotoPreviews"></div>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" onclick="closeRepairModal()">취소</button>
|
|
<button type="button" class="btn btn-primary" onclick="submitRepairRequest()">신청</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 외부반출 모달 -->
|
|
<div id="exportModal" class="modal-overlay" style="display: none;">
|
|
<div class="modal-container" style="max-width: 500px;">
|
|
<div class="modal-header">
|
|
<h2>외부 반출</h2>
|
|
<button class="btn-close" onclick="closeExportModal()">×</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="form-group">
|
|
<label class="checkbox-label">
|
|
<input type="checkbox" id="isRepairExport" onchange="toggleRepairFields()">
|
|
<span>수리 외주 (외부 수리)</span>
|
|
</label>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>반출일</label>
|
|
<input type="date" id="exportDate" class="form-control">
|
|
</div>
|
|
<div class="form-group">
|
|
<label>반입 예정일</label>
|
|
<input type="date" id="expectedReturnDate" class="form-control">
|
|
</div>
|
|
<div class="form-group">
|
|
<label>반출처 (업체명)</label>
|
|
<input type="text" id="exportDestination" class="form-control" placeholder="예: 삼성정비">
|
|
</div>
|
|
<div class="form-group">
|
|
<label>반출 사유</label>
|
|
<textarea id="exportReason" class="form-control" rows="2" placeholder="반출 사유를 입력하세요"></textarea>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>비고</label>
|
|
<textarea id="exportNotes" class="form-control" rows="2" placeholder="기타 메모사항"></textarea>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" onclick="closeExportModal()">취소</button>
|
|
<button type="button" class="btn btn-primary" onclick="submitExport()">반출 등록</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 반입 모달 -->
|
|
<div id="returnModal" class="modal-overlay" style="display: none;">
|
|
<div class="modal-container" style="max-width: 400px;">
|
|
<div class="modal-header">
|
|
<h2>설비 반입</h2>
|
|
<button class="btn-close" onclick="closeReturnModal()">×</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<input type="hidden" id="returnLogId">
|
|
<div class="form-group">
|
|
<label>반입일</label>
|
|
<input type="date" id="returnDate" class="form-control">
|
|
</div>
|
|
<div class="form-group">
|
|
<label>반입 후 상태</label>
|
|
<select id="returnStatus" class="form-control">
|
|
<option value="active">정상 가동</option>
|
|
<option value="maintenance">점검 필요</option>
|
|
<option value="repair_needed">추가 수리 필요</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>비고</label>
|
|
<textarea id="returnNotes" class="form-control" rows="2" placeholder="반입 관련 메모"></textarea>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" onclick="closeReturnModal()">취소</button>
|
|
<button type="button" class="btn btn-primary" onclick="submitReturn()">반입 처리</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 사진 확대 모달 -->
|
|
<div id="photoViewModal" class="modal-overlay" style="display: none;">
|
|
<div class="photo-view-container" onclick="closePhotoView()">
|
|
<button class="photo-view-close">×</button>
|
|
<img id="photoViewImage" class="photo-view-image">
|
|
</div>
|
|
</div>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
|
|
<script type="module">
|
|
import '/js/api-config.js?v=3';
|
|
</script>
|
|
<script>
|
|
(function() {
|
|
const checkApiConfig = setInterval(() => {
|
|
if (window.API_BASE_URL) {
|
|
clearInterval(checkApiConfig);
|
|
axios.defaults.baseURL = window.API_BASE_URL;
|
|
const token = localStorage.getItem('sso_token');
|
|
if (token) {
|
|
axios.defaults.headers.common['Authorization'] = `Bearer ${token}`;
|
|
}
|
|
axios.interceptors.request.use(
|
|
config => {
|
|
const token = localStorage.getItem('sso_token');
|
|
if (token) config.headers.Authorization = `Bearer ${token}`;
|
|
return config;
|
|
},
|
|
error => Promise.reject(error)
|
|
);
|
|
axios.interceptors.response.use(
|
|
response => response,
|
|
error => {
|
|
if (error.response?.status === 401) {
|
|
alert('세션이 만료되었습니다. 다시 로그인해주세요.');
|
|
window.location.href = '/pages/login.html';
|
|
}
|
|
return Promise.reject(error);
|
|
}
|
|
);
|
|
}
|
|
}, 50);
|
|
})();
|
|
</script>
|
|
<script src="/js/equipment-detail.js?v=1"></script>
|
|
</body>
|
|
</html>
|