refactor: 회사 폼 UI 개선 및 코드 정리
- 담당자 연락처 필드를 드롭다운 + 입력 방식으로 분리 - 사용자 폼과 동일한 전화번호 UI 패턴 적용 - 미사용 위젯 파일 4개 정리 (branch_card, contact_info_* 등) - 파일명 통일성 확보 (branch_edit_screen → branch_form, company_form_simplified → company_form) - 네이밍 일관성 개선으로 유지보수성 향상
This commit is contained in:
@@ -71,6 +71,13 @@ class EquipmentInFormController extends ChangeNotifier {
|
||||
List<String> warehouseLocations = [];
|
||||
List<String> partnerCompanies = [];
|
||||
|
||||
// 새로운 필드들 (백엔드 API 구조 변경 대응)
|
||||
int? currentCompanyId;
|
||||
int? currentBranchId;
|
||||
DateTime? lastInspectionDate;
|
||||
DateTime? nextInspectionDate;
|
||||
String? equipmentStatus;
|
||||
|
||||
final TextEditingController remarkController = TextEditingController();
|
||||
|
||||
EquipmentInFormController({this.equipmentInId}) {
|
||||
@@ -234,6 +241,13 @@ class EquipmentInFormController extends ChangeNotifier {
|
||||
warrantyStartDate = equipment.warrantyStartDate ?? DateTime.now();
|
||||
warrantyEndDate = equipment.warrantyEndDate ?? DateTime.now().add(const Duration(days: 365));
|
||||
|
||||
// 새로운 필드들 설정 (백엔드 API에서 제공되면 사용, 아니면 기본값)
|
||||
currentCompanyId = equipment.currentCompanyId;
|
||||
currentBranchId = equipment.currentBranchId;
|
||||
lastInspectionDate = equipment.lastInspectionDate;
|
||||
nextInspectionDate = equipment.nextInspectionDate;
|
||||
equipmentStatus = equipment.equipmentStatus ?? 'available'; // 기본값: 사용 가능
|
||||
|
||||
// 입고 관련 정보는 현재 API에서 제공하지 않으므로 기본값 사용
|
||||
inDate = equipment.inDate ?? DateTime.now();
|
||||
equipmentType = EquipmentType.new_;
|
||||
@@ -337,6 +351,12 @@ class EquipmentInFormController extends ChangeNotifier {
|
||||
warrantyLicense: warrantyLicense,
|
||||
warrantyStartDate: warrantyStartDate,
|
||||
warrantyEndDate: warrantyEndDate,
|
||||
// 새로운 필드들 추가
|
||||
currentCompanyId: currentCompanyId,
|
||||
currentBranchId: currentBranchId,
|
||||
lastInspectionDate: lastInspectionDate,
|
||||
nextInspectionDate: nextInspectionDate,
|
||||
equipmentStatus: equipmentStatus,
|
||||
// 워런티 코드 저장 필요시 여기에 추가
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user