merge-requests/23/head
nextwo 3 years ago
parent e4c37ec052
commit 7b49f9f40e

@ -162,8 +162,8 @@ class DeviceTransferProvider extends ChangeNotifier{
if(isSender){ if(isSender){
body.addAll( body.addAll(
{ {
//"senderSiteId": newModel.client.id, "senderSiteId": newModel.client.id,
//"senderDepartmentId": newModel.department.id, "senderDepartmentId": newModel.department.id,
"senderAssignedEmployeeId": newModel.userId, "senderAssignedEmployeeId": newModel.userId,
"senderMachineStatusId": newModel.status.id, "senderMachineStatusId": newModel.status.id,
"senderComment": newModel.comment, "senderComment": newModel.comment,
@ -175,14 +175,14 @@ class DeviceTransferProvider extends ChangeNotifier{
}else{ }else{
body.addAll( body.addAll(
{ {
//"destSiteId": newModel.client.id, "destSiteId": newModel.client.id,
//"destDepartmentId": newModel.department.id, "destDepartmentId": newModel.department.id,
"receiverAssignedEmployeeId": newModel.userId, "receiverAssignedEmployeeId": newModel.userId,
"receiverMachineStatusId": newModel.status.id, "receiverMachineStatusId": newModel.status?.id??"",
"receiverComment": newModel.comment, "receiverComment": newModel.comment,
"receiverWorkingHours": newModel.workingHours, "receiverWorkingHours": newModel.workingHours,
"receiverTravelingHours": newModel.travelingHours, "receiverTravelingHours": newModel.travelingHours,
"receiverAttachmentName": "${DateTime.now().toIso8601String()}.png|${newModel.signature}", "receiverAttachmentName": "${newModel.signature}.png",
} }
); );
} }
@ -194,6 +194,9 @@ class DeviceTransferProvider extends ChangeNotifier{
URLs.updateDeviceTransfer, URLs.updateDeviceTransfer,
body: body body: body
); );
print(response.body);
print("${DateTime.now().toIso8601String()}.png|${newModel.signature}");
// response = await post( // response = await post(
// Uri.parse("$host${URLs.updateDeviceTransfer}/$requestId"), // Uri.parse("$host${URLs.updateDeviceTransfer}/$requestId"),
// body: body, // body: body,

@ -72,7 +72,7 @@ class DevicesProvider extends ChangeNotifier{
if(response.statusCode >= 200 && response.statusCode < 300) { if(response.statusCode >= 200 && response.statusCode < 300) {
// client's request was successfully received // client's request was successfully received
List equipmentListJson = json.decode(response.body)["data"]; List equipmentListJson = json.decode(response.body)["data"];
_devices = equipmentListJson.map((device) => Device.fromJson(device)).toList(); _devices = equipmentListJson.map<Device>((device) => Device.fromJson(device)).toList();
} }
_loading = false; _loading = false;
notifyListeners(); notifyListeners();

@ -34,7 +34,7 @@ class _SingleStatusMenuState extends State<SingleStatusMenu> {
}else{ }else{
_selectedStatus =null; _selectedStatus =null;
} }
if(widget.initialStatus.id != _selectedStatus.id) { if((widget.initialStatus?.id??"") != (_selectedStatus?.id??"")) {
widget.onSelect(_selectedStatus); widget.onSelect(_selectedStatus);
} }
} else { } else {

Loading…
Cancel
Save