diff --git a/lib/controllers/api_routes/urls.dart b/lib/controllers/api_routes/urls.dart index efafd2a4..b8199481 100644 --- a/lib/controllers/api_routes/urls.dart +++ b/lib/controllers/api_routes/urls.dart @@ -28,6 +28,7 @@ class URLs { static get updateProfileImage => "$_baseUrl/Account/ChangeImageEmployee"; // post static get getSites => "$_baseUrl/Customer/GetCustomers"; // get static get getSitesAutoComplete => "$_baseUrl/Customer/GetCustomersAutoComplete"; // get + static get getSiteAutoCompleteWithoutConditionSites => "$_baseUrl/Customer/GetCustomersAutoCompleteWithoutConditionSites"; // get static get getDepartments => "$_baseUrl/Customer/GetDepartmentLookup"; // get static get getAssets => "$_baseUrl/Asset/GetAssets"; // get @@ -79,6 +80,7 @@ class URLs { static get getServiceReportReasons => "$_baseUrl/Lookups/GetLookup?lookupEnum=522"; // get static get getServiceReportTypes => "$_baseUrl/Lookups/GetLookup?lookupEnum=501"; // get + static get getServiceReportTypesForWO => "$_baseUrl/Lookups/GetLookup?lookupEnum=34"; // get static get getServiceReportStatus => "$_baseUrl/Lookups/GetLookup?lookupEnum=521"; // get static get getServiceReportLastCalls => "$_baseUrl/WorkOrder/GetLookupCallLastSituationBasedOnCase"; // get static get getAssetTypes => "$_baseUrl/Lookups/GetLookup?lookupEnum=500"; // get diff --git a/lib/models/service_request/service_report.dart b/lib/models/service_request/service_report.dart index 1a7f501e..e0c50dde 100644 --- a/lib/models/service_request/service_report.dart +++ b/lib/models/service_request/service_report.dart @@ -38,6 +38,7 @@ class ServiceReport { this.currentSituation, this.repairLocation, this.reason, + this.serviceType, this.startofWorkTime, this.endofWorkTime, this.workingHours, @@ -87,6 +88,7 @@ class ServiceReport { currentSituation = json['currentSituation'] != null ? Lookup.fromJson(json['currentSituation']) : null; repairLocation = json['repairLocation'] != null ? Lookup.fromJson(json['repairLocation']) : null; reason = json['reason'] != null ? Lookup.fromJson(json['reason']) : null; + serviceType = json['serviceType'] != null ? Lookup.fromJson(json['serviceType']) : null; startofWorkTime = json['startofWorkTime']; endofWorkTime = json['endofWorkTime']; workingHours = json['workingHours']; @@ -148,6 +150,7 @@ class ServiceReport { Lookup currentSituation; Lookup repairLocation; Lookup reason; + Lookup serviceType; String startofWorkTime; String endofWorkTime; num workingHours; @@ -188,6 +191,7 @@ class ServiceReport { Lookup currentSituation, Lookup repairLocation, Lookup reason, + Lookup serviceType, String startofWorkTime, String endofWorkTime, num workingHours, @@ -226,6 +230,7 @@ class ServiceReport { currentSituation: currentSituation ?? this.currentSituation, repairLocation: repairLocation ?? this.repairLocation, reason: reason ?? this.reason, + serviceType: serviceType ?? this.serviceType, startofWorkTime: startofWorkTime ?? this.startofWorkTime, endofWorkTime: endofWorkTime ?? this.endofWorkTime, workingHours: workingHours ?? this.workingHours, @@ -286,6 +291,9 @@ class ServiceReport { if (reason != null) { map['reason'] = reason.toJson(); } + if (serviceType != null) { + map['serviceType'] = serviceType.toJson(); + } map['startofWorkTime'] = timer.startAt.toString(); map['endofWorkTime'] = timer.endAt.toString(); map['workingHours'] = workingHours; diff --git a/lib/providers/gas_request_providers/site_provider.dart b/lib/providers/gas_request_providers/site_provider.dart index a9930131..5d55cb88 100644 --- a/lib/providers/gas_request_providers/site_provider.dart +++ b/lib/providers/gas_request_providers/site_provider.dart @@ -14,7 +14,7 @@ class SiteProvider extends LoadingListNotifier { loading = true; notifyListeners(); try { - Response response = await ApiManager.instance.get(URLs.getSitesAutoComplete); + Response response = await ApiManager.instance.get(URLs.getSiteAutoCompleteWithoutConditionSites); stateCode = response.statusCode; if (response.statusCode >= 200 && response.statusCode < 300) { // client's request was successfully received diff --git a/lib/providers/work_order/service_type_provider.dart b/lib/providers/work_order/service_type_provider.dart index 824a7ae1..83522ec1 100644 --- a/lib/providers/work_order/service_type_provider.dart +++ b/lib/providers/work_order/service_type_provider.dart @@ -16,7 +16,7 @@ class ServiceTypeProvider extends LoadingListNotifier { loading = true; notifyListeners(); try { - Response response = await ApiManager.instance.get(URLs.getServiceReportTypes); + Response response = await ApiManager.instance.get(URLs.getServiceReportTypesForWO); stateCode = response.statusCode; if (response.statusCode >= 200 && response.statusCode < 300) { // client's request was successfully received diff --git a/lib/views/pages/user/requests/work_order/create_service_report.dart b/lib/views/pages/user/requests/work_order/create_service_report.dart index f8638a94..3828e189 100644 --- a/lib/views/pages/user/requests/work_order/create_service_report.dart +++ b/lib/views/pages/user/requests/work_order/create_service_report.dart @@ -204,7 +204,10 @@ class _CreateServiceReportState extends State with TickerPr SingleItemDropDownMenu( context: context, title: context.translation.serviceType, - onSelect: (value) {}, + initialValue: _serviceReport.serviceType, + onSelect: (value) { + _serviceReport.serviceType = value; + }, ), 8.height, ServiceReportLastCallsMenu( diff --git a/lib/views/pages/user/requests/work_order/edit_service_report.dart b/lib/views/pages/user/requests/work_order/edit_service_report.dart index 7d12c800..abef7791 100644 --- a/lib/views/pages/user/requests/work_order/edit_service_report.dart +++ b/lib/views/pages/user/requests/work_order/edit_service_report.dart @@ -189,8 +189,9 @@ class _EditServiceReportState extends State with TickerProvid SingleItemDropDownMenu( context: context, title: context.translation.serviceType, + initialValue: _serviceReport.serviceType, onSelect: (value) { - + _serviceReport.serviceType = value; }, ), 8.height,