refactor: 회사 폼 UI 개선 및 코드 정리
- 담당자 연락처 필드를 드롭다운 + 입력 방식으로 분리 - 사용자 폼과 동일한 전화번호 UI 패턴 적용 - 미사용 위젯 파일 4개 정리 (branch_card, contact_info_* 등) - 파일명 통일성 확보 (branch_edit_screen → branch_form, company_form_simplified → company_form) - 네이밍 일관성 개선으로 유지보수성 향상
This commit is contained in:
@@ -16,6 +16,13 @@ class Equipment {
|
||||
final String? warrantyLicense; // 워런티 라이센스 명
|
||||
DateTime? warrantyStartDate; // 워런티 시작일(수정 가능)
|
||||
DateTime? warrantyEndDate; // 워런티 종료일(수정 가능)
|
||||
|
||||
// 백엔드 API 구조 변경으로 추가된 필드들
|
||||
final int? currentCompanyId; // 현재 배치된 회사 ID
|
||||
final int? currentBranchId; // 현재 배치된 지점 ID
|
||||
final DateTime? lastInspectionDate; // 최근 점검일
|
||||
final DateTime? nextInspectionDate; // 다음 점검일
|
||||
final String? equipmentStatus; // 장비 상태
|
||||
|
||||
Equipment({
|
||||
this.id,
|
||||
@@ -32,6 +39,12 @@ class Equipment {
|
||||
this.warrantyLicense,
|
||||
this.warrantyStartDate,
|
||||
this.warrantyEndDate,
|
||||
// 새로운 필드들
|
||||
this.currentCompanyId,
|
||||
this.currentBranchId,
|
||||
this.lastInspectionDate,
|
||||
this.nextInspectionDate,
|
||||
this.equipmentStatus,
|
||||
});
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -50,6 +63,12 @@ class Equipment {
|
||||
'warrantyLicense': warrantyLicense,
|
||||
'warrantyStartDate': warrantyStartDate?.toIso8601String(),
|
||||
'warrantyEndDate': warrantyEndDate?.toIso8601String(),
|
||||
// 새로운 필드들
|
||||
'currentCompanyId': currentCompanyId,
|
||||
'currentBranchId': currentBranchId,
|
||||
'lastInspectionDate': lastInspectionDate?.toIso8601String(),
|
||||
'nextInspectionDate': nextInspectionDate?.toIso8601String(),
|
||||
'equipmentStatus': equipmentStatus,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -75,6 +94,16 @@ class Equipment {
|
||||
json['warrantyEndDate'] != null
|
||||
? DateTime.parse(json['warrantyEndDate'])
|
||||
: null,
|
||||
// 새로운 필드들
|
||||
currentCompanyId: json['currentCompanyId'],
|
||||
currentBranchId: json['currentBranchId'],
|
||||
lastInspectionDate: json['lastInspectionDate'] != null
|
||||
? DateTime.parse(json['lastInspectionDate'])
|
||||
: null,
|
||||
nextInspectionDate: json['nextInspectionDate'] != null
|
||||
? DateTime.parse(json['nextInspectionDate'])
|
||||
: null,
|
||||
equipmentStatus: json['equipmentStatus'],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -194,6 +223,13 @@ class UnifiedEquipment {
|
||||
status; // 상태 코드: 'I'(입고), 'O'(출고), 'R'(수리중), 'D'(손상), 'L'(분실), 'E'(기타)
|
||||
final String? notes; // 추가 비고
|
||||
final String? _type; // 내부용: 입고 장비 유형
|
||||
|
||||
// 백엔드 API 구조 변경으로 추가된 필드들 (리스트 화면용)
|
||||
final String? currentCompany; // 현재 회사명
|
||||
final String? currentBranch; // 현재 지점명
|
||||
final String? warehouseLocation; // 창고 위치
|
||||
final DateTime? lastInspectionDate; // 최근 점검일
|
||||
final DateTime? nextInspectionDate; // 다음 점검일
|
||||
|
||||
UnifiedEquipment({
|
||||
this.id,
|
||||
@@ -202,6 +238,12 @@ class UnifiedEquipment {
|
||||
required this.status,
|
||||
this.notes,
|
||||
String? type,
|
||||
// 새로운 필드들
|
||||
this.currentCompany,
|
||||
this.currentBranch,
|
||||
this.warehouseLocation,
|
||||
this.lastInspectionDate,
|
||||
this.nextInspectionDate,
|
||||
}) : _type = type;
|
||||
|
||||
// 장비 유형 반환 (입고 장비만)
|
||||
@@ -263,6 +305,12 @@ class UnifiedEquipment {
|
||||
'date': date.toIso8601String(),
|
||||
'status': status,
|
||||
'notes': notes,
|
||||
// 새로운 필드들
|
||||
'currentCompany': currentCompany,
|
||||
'currentBranch': currentBranch,
|
||||
'warehouseLocation': warehouseLocation,
|
||||
'lastInspectionDate': lastInspectionDate?.toIso8601String(),
|
||||
'nextInspectionDate': nextInspectionDate?.toIso8601String(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -273,6 +321,16 @@ class UnifiedEquipment {
|
||||
date: DateTime.parse(json['date']),
|
||||
status: json['status'],
|
||||
notes: json['notes'],
|
||||
// 새로운 필드들
|
||||
currentCompany: json['currentCompany'],
|
||||
currentBranch: json['currentBranch'],
|
||||
warehouseLocation: json['warehouseLocation'],
|
||||
lastInspectionDate: json['lastInspectionDate'] != null
|
||||
? DateTime.parse(json['lastInspectionDate'])
|
||||
: null,
|
||||
nextInspectionDate: json['nextInspectionDate'] != null
|
||||
? DateTime.parse(json['nextInspectionDate'])
|
||||
: null,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user