📝 프로젝트 등록 페이지 간소화 및 개선

핵심 변경사항:
 간단한 프로젝트 등록 요청 시스템으로 변경
- 복잡한 2단계 시스템 → 간단한 요청 폼으로 단순화
- 필수 입력 항목만 4개로 축소

📋 새로운 입력 항목 (4개만)
1. 프로젝트명 *
2. 고객사 정보 (엔드유저 * + EPC/실제고객사)
3. 납기일 *
4. 납품방식 * (현장납품/공장인도/부분납품)

🎯 Job No. 자동 생성 시스템
- TK-년도-순번 규칙 (예: TK-2024-156)
- 실시간 미리보기 기능
- 등록 승인 후 자동 부여

🎨 UI/UX 개선
- 좌측: 간단한 등록 폼
- 우측: 최근 등록 요청 현황 리스트
- 상태별 색상 구분 (승인완료/검토중/추가정보필요)
- 반응형 디자인 (모바일 지원)

 인터랙티브 기능
- 실시간 Job No. 미리보기
- 폼 검증 및 제출 처리
- 새 요청 자동 리스트 추가
- 애니메이션 효과 (fade-in, slide-in)
- 초기화 버튼 기능

💾 하드코딩 데이터
- 기존 요청 3개 (승인완료/검토중/보류)
- 실제 업무 시나리오 반영
- 다양한 고객사 유형 (엔드유저 vs EPC)

시연 준비: 간단하고 직관적인 프로젝트 등록 시스템 완성
This commit is contained in:
Hyungi Ahn
2025-09-15 11:43:43 +09:00
parent d1d52e4f50
commit b83654ba25
4 changed files with 425 additions and 88 deletions

View File

@@ -355,15 +355,147 @@ function initializePage(pageId) {
function initializeProjectRegistration() {
console.log('프로젝트 등록 페이지 초기화');
// 자동 생성된 Job No. 애니메이션
const jobNoValue = document.querySelector('.generated-item .value');
if (jobNoValue) {
setTimeout(() => {
jobNoValue.style.transform = 'scale(1.1)';
setTimeout(() => {
jobNoValue.style.transform = 'scale(1)';
}, 200);
}, 500);
// 폼 이벤트 리스너 설정
setupProjectForm();
// Job No. 미리보기 업데이트
updateJobNoPreview();
// 요청 리스트 애니메이션
animateElements('.request-item');
}
// 프로젝트 폼 설정
function setupProjectForm() {
const form = document.querySelector('.project-form');
if (!form) return;
// 폼 제출 이벤트
form.addEventListener('submit', function(e) {
e.preventDefault();
handleProjectSubmission();
});
// 입력 필드 변경시 Job No. 미리보기 업데이트
const inputs = form.querySelectorAll('input, select');
inputs.forEach(input => {
input.addEventListener('input', updateJobNoPreview);
});
}
// 프로젝트 제출 처리
function handleProjectSubmission() {
const form = document.querySelector('.project-form');
const formData = new FormData(form);
// 입력값 검증
const projectName = document.getElementById('project-name').value;
const endUser = document.getElementById('end-user').value;
const deliveryDate = document.getElementById('delivery-date').value;
const deliveryMethod = document.getElementById('delivery-method').value;
if (!projectName || !endUser || !deliveryDate || !deliveryMethod) {
showNotification('필수 항목을 모두 입력해주세요.', 'warning');
return;
}
// 제출 버튼 상태 변경
const submitBtn = document.getElementById('submit-btn');
const originalText = submitBtn.textContent;
submitBtn.textContent = '📤 요청 중...';
submitBtn.disabled = true;
// 가상 제출 처리 (2초 후 완료)
setTimeout(() => {
// 새로운 Job No. 생성
const newJobNo = generateJobNo();
// 성공 메시지
showNotification(`프로젝트 등록 요청이 완료되었습니다! (예상 Job No: ${newJobNo})`, 'success');
// 요청 리스트에 새 항목 추가
addNewRequestToList(projectName, endUser, deliveryDate, deliveryMethod);
// 폼 초기화
clearForm();
// 버튼 복원
submitBtn.textContent = originalText;
submitBtn.disabled = false;
}, 2000);
}
// Job No. 생성
function generateJobNo() {
const year = new Date().getFullYear();
const randomNum = Math.floor(Math.random() * 900) + 100; // 100-999
return `TK-${year}-${randomNum}`;
}
// Job No. 미리보기 업데이트
function updateJobNoPreview() {
const projectName = document.getElementById('project-name')?.value;
const previewElement = document.getElementById('preview-job-no');
if (!previewElement) return;
if (projectName && projectName.length > 0) {
const year = new Date().getFullYear();
const nextNum = String(Math.floor(Math.random() * 900) + 100);
previewElement.textContent = `TK-${year}-${nextNum}`;
previewElement.style.color = 'var(--dt-primary)';
} else {
previewElement.textContent = 'TK-2024-XXX';
previewElement.style.color = 'var(--dt-gray-500)';
}
}
// 새 요청을 리스트에 추가
function addNewRequestToList(projectName, endUser, deliveryDate, deliveryMethod) {
const requestList = document.querySelector('.request-list');
if (!requestList) return;
const epcCustomer = document.getElementById('epc-customer')?.value;
const customerText = epcCustomer ? `${endUser} / ${epcCustomer}` : endUser;
const newItem = document.createElement('div');
newItem.className = 'request-item status-pending';
newItem.innerHTML = `
<div class="request-info">
<div class="request-title">${projectName}</div>
<div class="request-details">
<span class="customer">${customerText}</span>
<span class="delivery">${deliveryMethod}</span>
<span class="date">납기: ${deliveryDate}</span>
</div>
</div>
<div class="request-status">
<span class="status-badge status-pending">검토중</span>
<span class="job-no">대기중</span>
</div>
`;
// 리스트 맨 위에 추가
requestList.insertBefore(newItem, requestList.firstChild);
// 애니메이션
newItem.style.opacity = '0';
newItem.style.transform = 'translateY(-20px)';
setTimeout(() => {
newItem.style.transition = 'all 0.3s ease';
newItem.style.opacity = '1';
newItem.style.transform = 'translateY(0)';
}, 100);
}
// 폼 초기화
function clearForm() {
const form = document.querySelector('.project-form');
if (form) {
form.reset();
updateJobNoPreview();
}
}
@@ -637,5 +769,6 @@ window.showPage = showPage;
window.showModal = showModal;
window.hideModal = hideModal;
window.showNotification = showNotification;
window.clearForm = clearForm;
console.log('TK Project Demo JavaScript 로드 완료');