refactor: 회사 폼 UI 개선 및 코드 정리
- 담당자 연락처 필드를 드롭다운 + 입력 방식으로 분리 - 사용자 폼과 동일한 전화번호 UI 패턴 적용 - 미사용 위젯 파일 4개 정리 (branch_card, contact_info_* 등) - 파일명 통일성 확보 (branch_edit_screen → branch_form, company_form_simplified → company_form) - 네이밍 일관성 개선으로 유지보수성 향상
This commit is contained in:
@@ -2374,6 +2374,184 @@ class _EquipmentInFormScreenState extends State<EquipmentInFormScreen> {
|
||||
),
|
||||
),
|
||||
|
||||
// 현재 위치 및 상태 정보 섹션
|
||||
const SizedBox(height: 24),
|
||||
|
||||
// 현재 회사 및 지점 정보
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: FormFieldWrapper(
|
||||
label: '현재 회사',
|
||||
required: false,
|
||||
child: DropdownButtonFormField<String>(
|
||||
value: _controller.currentCompanyId?.toString(),
|
||||
decoration: const InputDecoration(
|
||||
hintText: '현재 배치된 회사를 선택하세요',
|
||||
),
|
||||
items: const [
|
||||
DropdownMenuItem(value: null, child: Text('선택하지 않음')),
|
||||
// TODO: 실제 회사 목록으로 대체 필요
|
||||
],
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_controller.currentCompanyId = value != null ? int.tryParse(value) : null;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: FormFieldWrapper(
|
||||
label: '현재 지점',
|
||||
required: false,
|
||||
child: DropdownButtonFormField<String>(
|
||||
value: _controller.currentBranchId?.toString(),
|
||||
decoration: const InputDecoration(
|
||||
hintText: '현재 배치된 지점을 선택하세요',
|
||||
),
|
||||
items: const [
|
||||
DropdownMenuItem(value: null, child: Text('선택하지 않음')),
|
||||
// TODO: 실제 지점 목록으로 대체 필요
|
||||
],
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_controller.currentBranchId = value != null ? int.tryParse(value) : null;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
// 점검 날짜 정보
|
||||
const SizedBox(height: 16),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: FormFieldWrapper(
|
||||
label: '최근 점검일',
|
||||
required: false,
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
final DateTime? picked = await showDatePicker(
|
||||
context: context,
|
||||
initialDate: _controller.lastInspectionDate ?? DateTime.now(),
|
||||
firstDate: DateTime(2000),
|
||||
lastDate: DateTime.now(),
|
||||
);
|
||||
if (picked != null) {
|
||||
setState(() {
|
||||
_controller.lastInspectionDate = picked;
|
||||
});
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 15,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.grey.shade400),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
_controller.lastInspectionDate != null
|
||||
? '${_controller.lastInspectionDate!.year}-${_controller.lastInspectionDate!.month.toString().padLeft(2, '0')}-${_controller.lastInspectionDate!.day.toString().padLeft(2, '0')}'
|
||||
: '날짜를 선택하세요',
|
||||
style: TextStyle(
|
||||
color: _controller.lastInspectionDate != null
|
||||
? Colors.black87
|
||||
: Colors.grey.shade600,
|
||||
),
|
||||
),
|
||||
const Icon(Icons.calendar_today, size: 16),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: FormFieldWrapper(
|
||||
label: '다음 점검일',
|
||||
required: false,
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
final DateTime? picked = await showDatePicker(
|
||||
context: context,
|
||||
initialDate: _controller.nextInspectionDate ?? DateTime.now().add(const Duration(days: 365)),
|
||||
firstDate: DateTime.now(),
|
||||
lastDate: DateTime(2100),
|
||||
);
|
||||
if (picked != null) {
|
||||
setState(() {
|
||||
_controller.nextInspectionDate = picked;
|
||||
});
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 15,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.grey.shade400),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
_controller.nextInspectionDate != null
|
||||
? '${_controller.nextInspectionDate!.year}-${_controller.nextInspectionDate!.month.toString().padLeft(2, '0')}-${_controller.nextInspectionDate!.day.toString().padLeft(2, '0')}'
|
||||
: '날짜를 선택하세요',
|
||||
style: TextStyle(
|
||||
color: _controller.nextInspectionDate != null
|
||||
? Colors.black87
|
||||
: Colors.grey.shade600,
|
||||
),
|
||||
),
|
||||
const Icon(Icons.calendar_today, size: 16),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
// 장비 상태
|
||||
const SizedBox(height: 16),
|
||||
FormFieldWrapper(
|
||||
label: '장비 상태',
|
||||
required: false,
|
||||
child: DropdownButtonFormField<String>(
|
||||
value: _controller.equipmentStatus,
|
||||
decoration: const InputDecoration(
|
||||
hintText: '장비 상태를 선택하세요',
|
||||
),
|
||||
items: const [
|
||||
DropdownMenuItem(value: 'available', child: Text('사용 가능')),
|
||||
DropdownMenuItem(value: 'inuse', child: Text('사용 중')),
|
||||
DropdownMenuItem(value: 'maintenance', child: Text('유지보수')),
|
||||
DropdownMenuItem(value: 'disposed', child: Text('폐기')),
|
||||
],
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_controller.equipmentStatus = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
// 비고 입력란 추가
|
||||
const SizedBox(height: 16),
|
||||
FormFieldWrapper(
|
||||
|
||||
Reference in New Issue
Block a user