fix: 작업자 비활성화 기능 완전 수정

작업자 퇴사 시 비활성화 기능이 제대로 작동하지 않던 문제 해결

백엔드 수정:
- is_active 가상 필드 추가 (status 기반 자동 생성)
- ISO 8601 날짜 형식을 MySQL DATE 형식으로 변환
- 작업자 업데이트 필드 오류 수정 (salary, annual_leave 제거)

프론트엔드 수정 (11개 파일):
- 모든 페이지에서 비활성 작업자 필터링 로직 추가
- 대시보드, 작업보고서, 근태관리, 사용자관리 등 전체 페이지 적용

영향받는 기능:
- 작업자 관리: 비활성화 상태가 DB에 저장되고 새로고침 후에도 유지
- 모든 페이지: 비활성화된 작업자가 선택 목록에서 제외됨

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2025-12-09 17:45:57 +09:00
parent a2669e08c4
commit 5c8f553f87
13 changed files with 317 additions and 36 deletions

View File

@@ -8,17 +8,22 @@ import { apiGet, apiPost } from './api-helper.js';
*/
export async function getInitialData() {
try {
const [workers, projects, tasks] = await Promise.all([
const [allWorkers, projects, tasks] = await Promise.all([
apiGet('/workers'),
apiGet('/projects'),
apiGet('/tasks')
]);
// 활성화된 작업자만 필터링
const workers = allWorkers.filter(worker => {
return worker.status === 'active' || worker.is_active === 1 || worker.is_active === true;
});
// 데이터 형식 검증
if (!Array.isArray(workers) || !Array.isArray(projects) || !Array.isArray(tasks)) {
throw new Error('서버에서 받은 데이터 형식이 올바르지 않습니다.');
}
// 작업자 목록은 ID 기준으로 정렬
workers.sort((a, b) => a.worker_id - b.worker_id);