From 66547b37b7a04a3ae3364c6206be1d3c01dfdcfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Wed, 11 Mar 2026 16:43:50 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[hr]=20=EC=97=B0=EB=B4=89=EC=9D=B4?= =?UTF-8?q?=EB=A0=A5=20=EC=82=AD=EC=A0=9C=20=EB=B2=84=ED=8A=BC=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 이력 테이블에 삭제 컬럼/버튼 추가 - Alpine.js deleteHistory() 메서드 추가 (confirm 확인 후 API 호출) - reverse 표시 인덱스를 원본 인덱스로 변환하여 API 전달 --- .../employees/partials/salary-info.blade.php | 38 ++++++++++++++++++- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/resources/views/hr/employees/partials/salary-info.blade.php b/resources/views/hr/employees/partials/salary-info.blade.php index 2e419930..f53dc51c 100644 --- a/resources/views/hr/employees/partials/salary-info.blade.php +++ b/resources/views/hr/employees/partials/salary-info.blade.php @@ -99,7 +99,8 @@ class="px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg transition- 적용일 비고 기록일 - 기록자 + 기록자 + 삭제 @@ -109,7 +110,17 @@ class="px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg transition- - + + + + @@ -143,6 +154,29 @@ function salaryManager() { return isNaN(num) ? '' : num; }, + async deleteHistory(originalIndex) { + if (!confirm('이 연봉 이력을 삭제하시겠습니까?')) return; + try { + const res = await fetch(`/api/admin/hr/employees/{{ $employee->id }}/salary/history/${originalIndex}`, { + method: 'DELETE', + headers: { + 'X-CSRF-TOKEN': '{{ csrf_token() }}', + 'Accept': 'application/json', + 'X-Requested-With': 'XMLHttpRequest', + }, + }); + const json = await res.json(); + if (json.success) { + this.salaryData = json.data; + showToast(json.message, 'success'); + } else { + showToast(json.message || '삭제에 실패했습니다.', 'error'); + } + } catch (e) { + showToast('이력 삭제 중 오류가 발생했습니다.', 'error'); + } + }, + async saveSalary() { this.saving = true; try {