refactor: 회사 폼 UI 개선 및 코드 정리
- 담당자 연락처 필드를 드롭다운 + 입력 방식으로 분리 - 사용자 폼과 동일한 전화번호 UI 패턴 적용 - 미사용 위젯 파일 4개 정리 (branch_card, contact_info_* 등) - 파일명 통일성 확보 (branch_edit_screen → branch_form, company_form_simplified → company_form) - 네이밍 일관성 개선으로 유지보수성 향상
This commit is contained in:
@@ -759,12 +759,9 @@ class _EquipmentListState extends State<EquipmentList> {
|
||||
if (_showDetailedColumns) {
|
||||
totalWidth += 120; // 시리얼번호
|
||||
totalWidth += 120; // 바코드
|
||||
|
||||
// 출고 정보 (조건부)
|
||||
if (pagedEquipments.any((e) => e.status == EquipmentStatus.out || e.status == EquipmentStatus.rent)) {
|
||||
totalWidth += 120; // 회사
|
||||
totalWidth += 80; // 담당자
|
||||
}
|
||||
totalWidth += 120; // 현재 위치
|
||||
totalWidth += 100; // 창고 위치
|
||||
totalWidth += 100; // 점검일
|
||||
}
|
||||
|
||||
// padding 추가 (좌우 각 16px)
|
||||
@@ -865,10 +862,11 @@ class _EquipmentListState extends State<EquipmentList> {
|
||||
_buildHeaderCell('상태', flex: 2, useExpanded: useExpanded, minWidth: 70),
|
||||
// 날짜
|
||||
_buildHeaderCell('날짜', flex: 2, useExpanded: useExpanded, minWidth: 80),
|
||||
// 출고 정보 (조건부)
|
||||
if (_showDetailedColumns && hasOutOrRent) ...[
|
||||
_buildHeaderCell('회사', flex: 3, useExpanded: useExpanded, minWidth: 120),
|
||||
_buildHeaderCell('담당자', flex: 2, useExpanded: useExpanded, minWidth: 80),
|
||||
// 상세 정보 (조건부)
|
||||
if (_showDetailedColumns) ...[
|
||||
_buildHeaderCell('현재 위치', flex: 3, useExpanded: useExpanded, minWidth: 120),
|
||||
_buildHeaderCell('창고 위치', flex: 2, useExpanded: useExpanded, minWidth: 100),
|
||||
_buildHeaderCell('점검일', flex: 2, useExpanded: useExpanded, minWidth: 100),
|
||||
],
|
||||
// 관리
|
||||
_buildHeaderCell('관리', flex: 2, useExpanded: useExpanded, minWidth: 90),
|
||||
@@ -989,25 +987,34 @@ class _EquipmentListState extends State<EquipmentList> {
|
||||
useExpanded: useExpanded,
|
||||
minWidth: 80,
|
||||
),
|
||||
// 출고 정보 (조건부)
|
||||
if (_showDetailedColumns && hasOutOrRent) ...[
|
||||
// 상세 정보 (조건부)
|
||||
if (_showDetailedColumns) ...[
|
||||
// 현재 위치 (회사 + 지점)
|
||||
_buildDataCell(
|
||||
_buildTextWithTooltip(
|
||||
'-', // TODO: 출고 정보 추가 필요
|
||||
'-',
|
||||
_buildCurrentLocationText(equipment),
|
||||
_buildCurrentLocationText(equipment),
|
||||
),
|
||||
flex: 3,
|
||||
useExpanded: useExpanded,
|
||||
minWidth: 120,
|
||||
),
|
||||
// 창고 위치
|
||||
_buildDataCell(
|
||||
Text(
|
||||
'-', // TODO: 담당자 정보 추가 필요
|
||||
equipment.warehouseLocation ?? '-',
|
||||
style: ShadcnTheme.bodySmall,
|
||||
),
|
||||
flex: 2,
|
||||
useExpanded: useExpanded,
|
||||
minWidth: 80,
|
||||
minWidth: 100,
|
||||
),
|
||||
// 점검일 (최근/다음)
|
||||
_buildDataCell(
|
||||
_buildInspectionDateWidget(equipment),
|
||||
flex: 2,
|
||||
useExpanded: useExpanded,
|
||||
minWidth: 100,
|
||||
),
|
||||
],
|
||||
// 관리
|
||||
@@ -1325,4 +1332,50 @@ class _EquipmentListState extends State<EquipmentList> {
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
/// 현재 위치 텍스트 생성 (회사명 + 지점명)
|
||||
String _buildCurrentLocationText(UnifiedEquipment equipment) {
|
||||
final currentCompany = equipment.currentCompany ?? '-';
|
||||
final currentBranch = equipment.currentBranch ?? '';
|
||||
|
||||
if (currentBranch.isNotEmpty) {
|
||||
return '$currentCompany ($currentBranch)';
|
||||
} else {
|
||||
return currentCompany;
|
||||
}
|
||||
}
|
||||
|
||||
/// 점검일 위젯 생성 (최근 점검일/다음 점검일)
|
||||
Widget _buildInspectionDateWidget(UnifiedEquipment equipment) {
|
||||
final lastInspection = equipment.lastInspectionDate;
|
||||
final nextInspection = equipment.nextInspectionDate;
|
||||
|
||||
String displayText = '-';
|
||||
Color? textColor;
|
||||
|
||||
if (nextInspection != null) {
|
||||
final now = DateTime.now();
|
||||
final difference = nextInspection.difference(now).inDays;
|
||||
|
||||
if (difference < 0) {
|
||||
displayText = '점검 필요';
|
||||
textColor = Colors.red;
|
||||
} else if (difference <= 30) {
|
||||
displayText = '${difference}일 후';
|
||||
textColor = Colors.orange;
|
||||
} else {
|
||||
displayText = '${nextInspection.month}/${nextInspection.day}';
|
||||
textColor = Colors.green;
|
||||
}
|
||||
} else if (lastInspection != null) {
|
||||
displayText = '${lastInspection.month}/${lastInspection.day}';
|
||||
}
|
||||
|
||||
return Text(
|
||||
displayText,
|
||||
style: ShadcnTheme.bodySmall.copyWith(
|
||||
color: textColor ?? ShadcnTheme.bodySmall.color,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user