|
|
|
@ -66,7 +66,6 @@ class ServiceRequestDetailProvider extends ChangeNotifier {
|
|
|
|
bool _isArrivalLoading = false;
|
|
|
|
bool _isArrivalLoading = false;
|
|
|
|
bool _isVerifyArrivalBottomSheetOpen = false;
|
|
|
|
bool _isVerifyArrivalBottomSheetOpen = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool get isVerifyArrivalBottomSheetOpen => _isVerifyArrivalBottomSheetOpen;
|
|
|
|
bool get isVerifyArrivalBottomSheetOpen => _isVerifyArrivalBottomSheetOpen;
|
|
|
|
|
|
|
|
|
|
|
|
set isVerifyArrivalBottomSheetOpen(bool value) {
|
|
|
|
set isVerifyArrivalBottomSheetOpen(bool value) {
|
|
|
|
@ -566,9 +565,7 @@ class ServiceRequestDetailProvider extends ChangeNotifier {
|
|
|
|
//Nurse confirm arrival
|
|
|
|
//Nurse confirm arrival
|
|
|
|
Future<int?> nurseConfirmEngineerArrival({required int workOrderId}) async {
|
|
|
|
Future<int?> nurseConfirmEngineerArrival({required int workOrderId}) async {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
Map<String,dynamic> body = {
|
|
|
|
Map<String, dynamic> body = {"workOrderId": workOrderId};
|
|
|
|
"workOrderId": workOrderId
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
isLoading = true;
|
|
|
|
isLoading = true;
|
|
|
|
notifyListeners();
|
|
|
|
notifyListeners();
|
|
|
|
final response = await ApiManager.instance.post(URLs.nurseConfirmEngineerArrivalUrl, body: body);
|
|
|
|
final response = await ApiManager.instance.post(URLs.nurseConfirmEngineerArrivalUrl, body: body);
|
|
|
|
@ -586,11 +583,10 @@ class ServiceRequestDetailProvider extends ChangeNotifier {
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} //Nurse confirm arrival
|
|
|
|
} //Nurse confirm arrival
|
|
|
|
|
|
|
|
|
|
|
|
Future<int?> nurseRejectEngineerArrival({required int workOrderId}) async {
|
|
|
|
Future<int?> nurseRejectEngineerArrival({required int workOrderId}) async {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
Map<String,dynamic> body = {
|
|
|
|
Map<String, dynamic> body = {"workOrderId": workOrderId};
|
|
|
|
"workOrderId": workOrderId
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
isLoading = true;
|
|
|
|
isLoading = true;
|
|
|
|
notifyListeners();
|
|
|
|
notifyListeners();
|
|
|
|
final response = await ApiManager.instance.post(URLs.nurseRejectEngineerArrivedUrl, body: body);
|
|
|
|
final response = await ApiManager.instance.post(URLs.nurseRejectEngineerArrivedUrl, body: body);
|
|
|
|
@ -610,25 +606,25 @@ class ServiceRequestDetailProvider extends ChangeNotifier {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//Nurse confirm close
|
|
|
|
//Nurse confirm close
|
|
|
|
Future<CommonResponseModel> nurseConfirm() async {
|
|
|
|
Future<WorkOrderDetail?> nurseConfirm() async {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
isLoading = true;
|
|
|
|
isLoading = true;
|
|
|
|
notifyListeners();
|
|
|
|
notifyListeners();
|
|
|
|
final response = await ApiManager.instance.post(URLs.nurseConfirmUrl, body: nurseActionHelperModel!.toJson());
|
|
|
|
final response = await ApiManager.instance.post(URLs.nurseConfirmUrl, body: nurseActionHelperModel!.toJson());
|
|
|
|
|
|
|
|
|
|
|
|
stateCode = response.statusCode;
|
|
|
|
stateCode = response.statusCode;
|
|
|
|
CommonResponseModel commonResponseModel = CommonResponseModel();
|
|
|
|
WorkOrderDetail? workOrderDetail;
|
|
|
|
if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
|
|
if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
|
|
// commonResponseModel = CommonResponseModel.fromJson(json.decode(response.body));
|
|
|
|
workOrderDetail = WorkOrderDetail.fromJson(json.decode(response.body));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
isLoading = false;
|
|
|
|
isLoading = false;
|
|
|
|
notifyListeners();
|
|
|
|
notifyListeners();
|
|
|
|
return commonResponseModel;
|
|
|
|
return workOrderDetail;
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
|
log("engineer accept [error] : $e");
|
|
|
|
log("engineer accept [error] : $e");
|
|
|
|
isLoading = false;
|
|
|
|
isLoading = false;
|
|
|
|
notifyListeners();
|
|
|
|
notifyListeners();
|
|
|
|
return CommonResponseModel();
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|