fix: [equipment] 담당자 → 관리자 정/부 라벨 변경 및 sub_manager_id 저장 버그 수정

- 설비 등록/수정 폼 라벨: 정 담당자 → 관리자 정, 부 담당자 → 관리자 부
- 상세보기(basic-info) 라벨 동일 변경
- StoreEquipmentRequest, UpdateEquipmentRequest에 sub_manager_id 검증 규칙 추가
- 기존에 sub_manager_id가 validated()에서 누락되어 저장되지 않던 버그 수정
This commit is contained in:
김보곤
2026-02-28 16:03:00 +09:00
parent 603767cb0e
commit f6803e40d6
5 changed files with 10 additions and 8 deletions

View File

@@ -37,6 +37,7 @@ public function rules(): array
'status' => 'nullable|in:active,idle,disposed',
'disposed_date' => 'nullable|date',
'manager_id' => 'nullable|exists:users,id',
'sub_manager_id' => 'nullable|exists:users,id',
'photo_path' => 'nullable|string|max:500',
'memo' => 'nullable|string',
'is_active' => 'nullable|boolean',

View File

@@ -39,6 +39,7 @@ public function rules(): array
'status' => 'nullable|in:active,idle,disposed',
'disposed_date' => 'nullable|date',
'manager_id' => 'nullable|exists:users,id',
'sub_manager_id' => 'nullable|exists:users,id',
'photo_path' => 'nullable|string|max:500',
'memo' => 'nullable|string',
'is_active' => 'nullable|boolean',

View File

@@ -122,10 +122,10 @@ class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none foc
<!-- 담당자/비고 -->
<div class="bg-white rounded-lg shadow-sm p-6">
<h2 class="text-lg font-semibold text-gray-800 mb-4 pb-2 border-b">담당 / 비고</h2>
<h2 class="text-lg font-semibold text-gray-800 mb-4 pb-2 border-b">관리 / 비고</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-semibold text-gray-700 mb-2"> 담당자</label>
<label class="block text-sm font-semibold text-gray-700 mb-2">관리자 </label>
<select name="manager_id"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
<option value="">선택</option>
@@ -135,7 +135,7 @@ class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none foc
</select>
</div>
<div>
<label class="block text-sm font-semibold text-gray-700 mb-2"> 담당자</label>
<label class="block text-sm font-semibold text-gray-700 mb-2">관리자 </label>
<select name="sub_manager_id"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
<option value="">선택</option>

View File

@@ -130,10 +130,10 @@ class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none foc
<!-- 담당자/비고 -->
<div class="bg-white rounded-lg shadow-sm p-6">
<h2 class="text-lg font-semibold text-gray-800 mb-4 pb-2 border-b">담당 / 비고</h2>
<h2 class="text-lg font-semibold text-gray-800 mb-4 pb-2 border-b">관리 / 비고</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-semibold text-gray-700 mb-2"> 담당자</label>
<label class="block text-sm font-semibold text-gray-700 mb-2">관리자 </label>
<select name="manager_id" id="manager_id"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
<option value="">선택</option>
@@ -143,7 +143,7 @@ class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none foc
</select>
</div>
<div>
<label class="block text-sm font-semibold text-gray-700 mb-2"> 담당자</label>
<label class="block text-sm font-semibold text-gray-700 mb-2">관리자 </label>
<select name="sub_manager_id" id="sub_manager_id"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
<option value="">선택</option>

View File

@@ -67,11 +67,11 @@
<p class="text-gray-900">{{ $equipment->useful_life ? $equipment->useful_life . '년' : '-' }}</p>
</div>
<div>
<label class="block text-sm text-gray-500 mb-1"> 담당자</label>
<label class="block text-sm text-gray-500 mb-1">관리자 </label>
<p class="text-gray-900">{{ $equipment->manager?->name ?? '-' }}</p>
</div>
<div>
<label class="block text-sm text-gray-500 mb-1"> 담당자</label>
<label class="block text-sm text-gray-500 mb-1">관리자 </label>
<p class="text-gray-900">{{ $equipment->subManager?->name ?? '-' }}</p>
</div>
<div>