From e4c37ec052f4ba18ffa8e4e775ba7874c4982292 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Tue, 9 May 2023 15:29:09 +0300 Subject: [PATCH] create report submission fix. --- lib/models/service_report.dart | 2 +- .../pages/user/requests/report/create_service_report.dart | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/models/service_report.dart b/lib/models/service_report.dart index 58eb2c98..7016d0d6 100644 --- a/lib/models/service_report.dart +++ b/lib/models/service_report.dart @@ -121,7 +121,7 @@ class ServiceReport { if(visitDate == null) return false; //if(serviceType == null) return false; if(status == null) return false; - if(type == null) return false; + if(type == null && assetType==null) return false; if(engineer == null) return false; if(callLastSituation == null) return false; if(callLastSituation?.value == 12){ diff --git a/lib/views/pages/user/requests/report/create_service_report.dart b/lib/views/pages/user/requests/report/create_service_report.dart index 2c1c2b43..f077fbd7 100644 --- a/lib/views/pages/user/requests/report/create_service_report.dart +++ b/lib/views/pages/user/requests/report/create_service_report.dart @@ -576,7 +576,7 @@ class _CreateServiceReportState extends State with TickerPr ESignature( oldSignature: _serviceReport.signatureNurse, newSignature: _serviceReport.localNurseSignature, - onChange: (signature){ + onSaved: (signature){ if(signature == null || signature.isEmpty) {return;} _serviceReport.localNurseSignature = signature; _serviceReport.signatureNurse = "${DateTime.now().toIso8601String()}.png|${base64Encode(signature)}"; @@ -587,7 +587,7 @@ class _CreateServiceReportState extends State with TickerPr ESignature( oldSignature: _serviceReport.signatureEngineer, newSignature: _serviceReport.localNurseSignature, - onChange: (signature){ + onSaved: (signature){ if(signature == null || signature.isEmpty) {return;} _serviceReport.localNurseSignature = signature; _serviceReport.signatureEngineer = "${DateTime.now().toIso8601String()}.png|${base64Encode(signature)}"; @@ -661,6 +661,8 @@ class _CreateServiceReportState extends State with TickerPr _isLoading =true; setState(() {}); + + int status = await _serviceRequestsProvider.createServiceReport( user: _userProvider.user, host: _settingProvider.host,