|
|
@ -142,34 +142,44 @@ class DeviceTransferProvider extends ChangeNotifier {
|
|
|
|
"destDepartmentId": oldModel.receiver.department.id,
|
|
|
|
"destDepartmentId": oldModel.receiver.department.id,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
if (isSender) {
|
|
|
|
if(isSender){
|
|
|
|
body.addAll({
|
|
|
|
body.addAll(
|
|
|
|
//"senderSiteId": newModel.client.id,
|
|
|
|
{
|
|
|
|
//"senderDepartmentId": newModel.department.id,
|
|
|
|
"senderSiteId": newModel.client.id,
|
|
|
|
"senderAssignedEmployeeId": newModel.userId,
|
|
|
|
"senderDepartmentId": newModel.department.id,
|
|
|
|
"senderMachineStatusId": newModel.status.id,
|
|
|
|
"senderAssignedEmployeeId": newModel.userId,
|
|
|
|
"senderComment": newModel.comment,
|
|
|
|
"senderMachineStatusId": newModel.status.id,
|
|
|
|
"senderWorkingHours": newModel.workingHours,
|
|
|
|
"senderComment": newModel.comment,
|
|
|
|
"senderTravelingHours": newModel.travelingHours,
|
|
|
|
"senderWorkingHours": newModel.workingHours,
|
|
|
|
"senderAttachmentName": "${DateTime.now().toIso8601String()}.png|${newModel.signature}",
|
|
|
|
"senderTravelingHours": newModel.travelingHours,
|
|
|
|
});
|
|
|
|
"senderAttachmentName": "${newModel.signature}.png",
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
body.addAll({
|
|
|
|
);
|
|
|
|
//"destSiteId": newModel.client.id,
|
|
|
|
}else{
|
|
|
|
//"destDepartmentId": newModel.department.id,
|
|
|
|
body.addAll(
|
|
|
|
"receiverAssignedEmployeeId": newModel.userId,
|
|
|
|
{
|
|
|
|
"receiverMachineStatusId": newModel.status.id,
|
|
|
|
"destSiteId": newModel.client.id,
|
|
|
|
"receiverComment": newModel.comment,
|
|
|
|
"destDepartmentId": newModel.department.id,
|
|
|
|
"receiverWorkingHours": newModel.workingHours,
|
|
|
|
"receiverAssignedEmployeeId": newModel.userId,
|
|
|
|
"receiverTravelingHours": newModel.travelingHours,
|
|
|
|
"receiverMachineStatusId": newModel.status?.id??"",
|
|
|
|
"receiverAttachmentName": "${DateTime.now().toIso8601String()}.png|${newModel.signature}",
|
|
|
|
"receiverComment": newModel.comment,
|
|
|
|
});
|
|
|
|
"receiverWorkingHours": newModel.workingHours,
|
|
|
|
|
|
|
|
"receiverTravelingHours": newModel.travelingHours,
|
|
|
|
|
|
|
|
"receiverAttachmentName": "${newModel.signature}.png",
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
body.addAll(newModel.toJson(isSender));
|
|
|
|
body.addAll(newModel.toJson(isSender));
|
|
|
|
Response response;
|
|
|
|
Response response;
|
|
|
|
try {
|
|
|
|
try{
|
|
|
|
response = await ApiManager.instance.put(URLs.updateDeviceTransfer, body: body);
|
|
|
|
response = await ApiManager.instance.put(
|
|
|
|
|
|
|
|
URLs.updateDeviceTransfer,
|
|
|
|
|
|
|
|
body: body
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print(response.body);
|
|
|
|
|
|
|
|
print("${newModel.signature}.png");
|
|
|
|
// response = await post(
|
|
|
|
// response = await post(
|
|
|
|
// Uri.parse("$host${URLs.updateDeviceTransfer}/$requestId"),
|
|
|
|
// Uri.parse("$host${URLs.updateDeviceTransfer}/$requestId"),
|
|
|
|
// body: body,
|
|
|
|
// body: body,
|
|
|
@ -190,4 +200,4 @@ class DeviceTransferProvider extends ChangeNotifier {
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|