440 lines
17 KiB
HTML
440 lines
17 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="ko">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>ChemiFactory 생산 계획 관리 (Gantt)</title>
|
|
<!-- Google Fonts Inter -->
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
|
<!-- 테마 적용 (base.css보다 먼저 로드해 FOWT 방지) -->
|
|
<script src="js/theme.js"></script>
|
|
<link rel="stylesheet" href="css/base.css">
|
|
<style>
|
|
.header-row {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 24px;
|
|
}
|
|
.form-control {
|
|
background-color: var(--overlay-hover);
|
|
border: 1px solid var(--border-color);
|
|
color: var(--text-primary);
|
|
padding: 8px 12px;
|
|
border-radius: 6px;
|
|
font-size: 13px;
|
|
width: 100%;
|
|
transition: all 0.2s ease;
|
|
}
|
|
.form-control:focus {
|
|
outline: none;
|
|
border-color: var(--border-focus);
|
|
background-color: var(--overlay-strong);
|
|
}
|
|
|
|
/* Gantt Layout */
|
|
.gantt-outer-container {
|
|
display: flex;
|
|
border: 1px solid var(--border-color);
|
|
border-radius: 12px;
|
|
background-color: var(--bg-card);
|
|
overflow: hidden;
|
|
height: calc(100vh - 240px);
|
|
min-height: 500px;
|
|
width: 100%;
|
|
max-width: 100%;
|
|
}
|
|
.gantt-left-panel {
|
|
width: 250px;
|
|
flex-shrink: 0;
|
|
border-right: 1px solid var(--border-color);
|
|
display: flex;
|
|
flex-direction: column;
|
|
overflow-x: hidden;
|
|
}
|
|
.gantt-right-timeline {
|
|
flex-grow: 1;
|
|
overflow-x: auto;
|
|
display: flex;
|
|
flex-direction: column;
|
|
max-width: calc(100% - 250px);
|
|
min-width: 0;
|
|
}
|
|
.gantt-right-timeline::-webkit-scrollbar {
|
|
height: 10px;
|
|
}
|
|
.gantt-right-timeline::-webkit-scrollbar-track {
|
|
background: var(--overlay-subtle);
|
|
}
|
|
.gantt-right-timeline::-webkit-scrollbar-thumb {
|
|
background: var(--overlay-border);
|
|
border-radius: 5px;
|
|
}
|
|
.gantt-right-timeline::-webkit-scrollbar-thumb:hover {
|
|
background: var(--overlay-border);
|
|
}
|
|
.gantt-header-row {
|
|
height: 70px;
|
|
border-bottom: 1px solid var(--border-color);
|
|
display: flex;
|
|
align-items: center;
|
|
background-color: var(--overlay-subtle);
|
|
flex-shrink: 0;
|
|
}
|
|
.gantt-left-header {
|
|
padding: 0 16px;
|
|
font-weight: 700;
|
|
font-size: 14px;
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
/* Gantt Grid Cells */
|
|
.gantt-day-header-cell {
|
|
width: 40px;
|
|
height: 100%;
|
|
border-right: 1px solid var(--border-color);
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
align-items: center;
|
|
font-size: 12px;
|
|
flex-shrink: 0;
|
|
}
|
|
.day-sat {
|
|
color: var(--accent-blue-soft);
|
|
background-color: rgba(96, 165, 250, 0.05);
|
|
}
|
|
.day-sun {
|
|
color: var(--accent-red-soft);
|
|
background-color: rgba(248, 113, 113, 0.05);
|
|
}
|
|
.day-today {
|
|
border: 2px solid var(--accent-red);
|
|
font-weight: 700;
|
|
}
|
|
|
|
.gantt-body {
|
|
flex-grow: 1;
|
|
overflow-y: auto;
|
|
overflow-x: hidden;
|
|
position: relative;
|
|
}
|
|
#gantt-right-body {
|
|
width: max-content;
|
|
min-width: 100%;
|
|
}
|
|
.gantt-row {
|
|
height: 60px;
|
|
display: flex;
|
|
align-items: center;
|
|
border-bottom: 1px solid var(--border-color);
|
|
position: relative;
|
|
}
|
|
.gantt-row:hover {
|
|
background-color: var(--overlay-subtle);
|
|
}
|
|
.gantt-left-item {
|
|
width: 250px;
|
|
padding: 0 16px;
|
|
font-size: 13px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
border-right: 1px solid var(--border-color);
|
|
height: 100%;
|
|
flex-shrink: 0;
|
|
cursor: pointer;
|
|
}
|
|
.gantt-left-item small {
|
|
color: var(--text-secondary);
|
|
margin-top: 2px;
|
|
}
|
|
.gantt-right-grid {
|
|
display: flex;
|
|
height: 100%;
|
|
position: relative;
|
|
}
|
|
.gantt-grid-cell {
|
|
width: 40px;
|
|
height: 100%;
|
|
border-right: 1px solid var(--border-color);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
/* Timeline bar */
|
|
.gantt-bar-container {
|
|
position: absolute;
|
|
height: 100%;
|
|
display: flex;
|
|
align-items: center;
|
|
pointer-events: none; /* 그리드 클릭이 방해되지 않도록 */
|
|
}
|
|
.gantt-bar-item {
|
|
height: 32px;
|
|
border-radius: 6px;
|
|
background: linear-gradient(135deg, rgba(59, 130, 246, 0.65), rgba(37, 99, 235, 0.65));
|
|
border: 1px solid var(--accent-blue);
|
|
color: var(--text-on-accent);
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 0 10px;
|
|
box-shadow: 0 4px 10px var(--card-shadow);
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
pointer-events: auto; /* 클릭 가능 */
|
|
cursor: pointer;
|
|
transition: transform 0.2s;
|
|
}
|
|
.gantt-bar-item:hover {
|
|
transform: scale(1.02);
|
|
box-shadow: 0 0 10px var(--accent-blue-glow);
|
|
}
|
|
|
|
/* 모달 스타일 */
|
|
.modal {
|
|
display: none;
|
|
position: fixed;
|
|
z-index: 1000;
|
|
left: 0;
|
|
top: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background-color: var(--modal-backdrop);
|
|
backdrop-filter: blur(4px);
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
.modal-content {
|
|
background-color: var(--bg-card);
|
|
border: 1px solid var(--border-color);
|
|
border-radius: 12px;
|
|
padding: 24px;
|
|
width: 95%;
|
|
max-width: 750px;
|
|
max-height: 90vh;
|
|
overflow-y: auto;
|
|
box-shadow: 0 10px 30px var(--card-shadow);
|
|
}
|
|
.close-btn {
|
|
font-size: 24px;
|
|
background: none;
|
|
border: none;
|
|
color: var(--text-secondary);
|
|
cursor: pointer;
|
|
}
|
|
.modal-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 20px;
|
|
border-bottom: 1px solid var(--border-color);
|
|
padding-bottom: 12px;
|
|
}
|
|
.modal-title {
|
|
font-size: 18px;
|
|
font-weight: 700;
|
|
}
|
|
.modal-body-grid {
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
gap: 20px;
|
|
}
|
|
@media (max-width: 768px) {
|
|
.modal-body-grid {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
}
|
|
.modal-actions {
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
gap: 12px;
|
|
margin-top: 24px;
|
|
border-top: 1px solid var(--border-color);
|
|
padding-top: 16px;
|
|
}
|
|
.btn-secondary {
|
|
background-color: var(--overlay-hover);
|
|
color: var(--text-primary);
|
|
border: 1px solid var(--border-color);
|
|
}
|
|
.btn-secondary:hover {
|
|
background-color: var(--overlay-strong);
|
|
}
|
|
|
|
.machine-checkbox-group {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 10px;
|
|
margin-top: 6px;
|
|
}
|
|
.machine-chip {
|
|
background-color: var(--overlay-subtle);
|
|
border: 1px solid var(--border-color);
|
|
border-radius: 6px;
|
|
padding: 6px 12px;
|
|
font-size: 12px;
|
|
cursor: pointer;
|
|
transition: all 0.2s;
|
|
}
|
|
.machine-chip.selected {
|
|
background-color: var(--nav-active-bg);
|
|
border-color: var(--accent-blue);
|
|
color: var(--accent-blue);
|
|
font-weight: 600;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="app-container">
|
|
<!-- 공통 사이드바 -->
|
|
<aside class="sidebar" id="sidebar"></aside>
|
|
|
|
<!-- 메인 콘텐츠 영역 -->
|
|
<main class="main-content">
|
|
<header class="content-header">
|
|
<div class="page-title">
|
|
<h1>생산 계획 관리 (간트차트)</h1>
|
|
<p>자재 시뮬레이션을 실행하여 필요 작업 기간을 연산하고, 기기 배정 일정을 수립합니다.</p>
|
|
</div>
|
|
<button class="btn btn-primary" id="btn-add-plan">+ 생산 계획 수립</button>
|
|
</header>
|
|
|
|
<!-- Gantt 차트 메인 판넬 -->
|
|
<div class="gantt-outer-container">
|
|
<!-- 좌측 정적 리스트 -->
|
|
<div class="gantt-left-panel">
|
|
<div class="gantt-header-row gantt-left-header">
|
|
생산 계획 / 배정 기기
|
|
</div>
|
|
<div class="gantt-body" id="gantt-left-body">
|
|
<!-- Left rows -->
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 우측 타임라인 스크롤 그리드 -->
|
|
<div class="gantt-right-timeline" id="gantt-timeline-container">
|
|
<div class="gantt-header-row" id="gantt-date-headers">
|
|
<!-- Date headers -->
|
|
</div>
|
|
<div class="gantt-body" id="gantt-right-body">
|
|
<!-- Grid rows & bars -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
|
|
<!-- 생산 계획 수립/수정 다이얼로그 모달 -->
|
|
<div id="plan-modal" class="modal">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h3 class="modal-title" id="plan-modal-title">생산 계획 및 시뮬레이션 수립</h3>
|
|
<button class="close-btn">×</button>
|
|
</div>
|
|
<form id="plan-form">
|
|
<input type="hidden" id="plan-id">
|
|
<div class="modal-body-grid">
|
|
<!-- 왼쪽: 거래처 및 소요 자재 입력 정보 -->
|
|
<div>
|
|
<h4 style="font-size: 14px; color: var(--accent-blue); margin-bottom: 12px;">1. 파트너사 및 자재 매핑</h4>
|
|
<div class="form-group">
|
|
<label for="plan-customer">거래처(고객사) 선택 *</label>
|
|
<select id="plan-customer" class="form-control" required></select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="plan-yarn">입고 원사 자재 *</label>
|
|
<select id="plan-yarn" class="form-control" required></select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="plan-bond">소요 본드 자재</label>
|
|
<select id="plan-bond" class="form-control"></select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="plan-qty">목표 생산량 (kg) *</label>
|
|
<input type="number" id="plan-qty" step="0.1" class="form-control" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="plan-start-date">생산 가동 예정일 *</label>
|
|
<input type="date" id="plan-start-date" class="form-control" required>
|
|
</div>
|
|
<div style="display: flex; gap: 20px; margin-top: 10px;">
|
|
<label style="display:flex; align-items:center; font-size:13px; cursor:pointer;">
|
|
<input type="checkbox" id="plan-sat" style="margin-right:6px;"> 토요일 가동
|
|
</label>
|
|
<label style="display:flex; align-items:center; font-size:13px; cursor:pointer;">
|
|
<input type="checkbox" id="plan-sun" style="margin-right:6px;"> 일요일 가동
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 오른쪽: 기계 가동 물성 및 시뮬레이션 계산 결과 -->
|
|
<div>
|
|
<h4 style="font-size: 14px; color: var(--accent-blue); margin-bottom: 12px;">2. 가동 변수 및 시뮬레이션 연산</h4>
|
|
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 10px;">
|
|
<div class="form-group">
|
|
<label for="plan-yarn-dia">선경 (Diameter, ㎛) *</label>
|
|
<input type="number" id="plan-yarn-dia" value="7.0" step="0.1" class="form-control" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="plan-yarn-k">K수 (K 번수) *</label>
|
|
<input type="number" id="plan-yarn-k" value="12" class="form-control" required>
|
|
</div>
|
|
</div>
|
|
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 10px;">
|
|
<div class="form-group">
|
|
<label for="plan-ports">포트 수 *</label>
|
|
<input type="number" id="plan-ports" value="40" class="form-control" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="plan-hz">사이클 타임 (Hz) *</label>
|
|
<input type="number" id="plan-hz" value="8.0" step="0.1" class="form-control" required>
|
|
</div>
|
|
</div>
|
|
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 10px;">
|
|
<div class="form-group">
|
|
<label for="plan-cut">커팅 길이 (mm) *</label>
|
|
<input type="number" id="plan-cut" value="6.0" step="0.1" class="form-control" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="plan-hours">일일 작업시간 (시간) *</label>
|
|
<input type="number" id="plan-hours" value="16" class="form-control" required>
|
|
</div>
|
|
</div>
|
|
|
|
<div style="margin: 14px 0; padding: 12px; background: var(--overlay-subtle); border: 1px dashed var(--border-color); border-radius: 8px;">
|
|
<button type="button" class="btn btn-secondary" id="btn-simulate" style="width: 100%; padding: 8px 0; font-size:12px; font-weight:700;">시뮬레이션 가동 계산 실행</button>
|
|
<div style="margin-top: 10px; font-size: 12px; display:flex; flex-direction:column; gap:4px;" id="sim-result-box">
|
|
<p style="color:var(--text-secondary);">소요 기간: <span id="sim-days" style="color:var(--text-primary); font-weight:700;">-</span> 일</p>
|
|
<p style="color:var(--text-secondary);">예상 매출: <span id="sim-sales" style="color:var(--text-primary); font-weight:700;">-</span> 원</p>
|
|
<p style="color:var(--text-secondary);">마진 (공장 이익): <span id="sim-margin" style="color:var(--accent-green); font-weight:700;">-</span> 원</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group" id="equip-assignment-box" style="display: none;">
|
|
<label>3. 가용 배정 설비 선택 *</label>
|
|
<div class="machine-checkbox-group" id="available-machines-container">
|
|
<!-- 가용 설비 칩 바인딩 -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal-actions">
|
|
<button type="button" class="btn btn-secondary close-modal-btn">취소</button>
|
|
<button type="submit" class="btn btn-primary" id="btn-save-plan" disabled>계획 최종 저장</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 스크립트 연결 -->
|
|
<script src="js/common.js"></script>
|
|
<script src="js/plan.js"></script>
|
|
</body>
|
|
</html>
|