device transfer and Gas refill new data added

main_design2.1
WaseemAbbasi22 10 months ago
parent b6731e786f
commit c8862bbb63

@ -404,5 +404,8 @@
"lastPmDate" : "موعد الزيارة الوقائية الأخيرة", "lastPmDate" : "موعد الزيارة الوقائية الأخيرة",
"assetScan" : "مسح الجهاز", "assetScan" : "مسح الجهاز",
"pickManually" : "اختر يدويا", "pickManually" : "اختر يدويا",
"searchAsset" : "ابحث عن جهاز" "searchAsset" : "ابحث عن جهاز",
"createdDate": "تاريخ الإنشاء",
"employeeId": "رقم الموظف",
"extensionNo": "رقم التمديد"
} }

@ -406,5 +406,8 @@
"lastPmDate" : "Last PM Date", "lastPmDate" : "Last PM Date",
"assetScan" : "Asset Scan", "assetScan" : "Asset Scan",
"pickManually" : "Pick Manually", "pickManually" : "Pick Manually",
"searchAsset" : "Search Asset" "searchAsset" : "Search Asset",
"createdDate": "Created Date",
"employeeId": "Employee ID",
"extensionNo": "Extension No"
} }

@ -8,71 +8,76 @@ import 'package:test_sa/models/timer_model.dart';
import 'asset_transfer_attachment.dart'; import 'asset_transfer_attachment.dart';
class AssetTransfer { class AssetTransfer {
AssetTransfer( AssetTransfer({
{this.id, this.id,
this.transferNo, this.transferNo,
this.transferCode, this.transferCode,
this.assetId, this.assetId,
this.destSiteId, this.destSiteId,
this.destBuildingId, this.destBuildingId,
this.destFloorId, this.destFloorId,
this.destDepartmentId, this.destDepartmentId,
this.destRoomId, this.destRoomId,
this.senderSiteId, this.senderSiteId,
this.senderBuildingId, this.senderBuildingId,
this.senderFloorId, this.senderFloorId,
this.senderDepartmentId, this.senderDepartmentId,
this.senderRoom, this.senderRoom,
this.senderAssignedEmployeeId, this.senderAssignedEmployeeId,
this.senderMachineStatusId, this.senderMachineStatusId,
this.senderComment, this.senderComment,
this.comment, this.comment,
this.receiverEndUserId, this.receiverEndUserId,
this.receiverEndUserName, this.receiverEndUserName,
this.senderStartDate, this.senderStartDate,
this.senderEndDate, this.senderEndDate,
this.senderWorkingHours, this.senderWorkingHours,
this.senderTravelingHours, this.senderTravelingHours,
this.senderEngSignature, this.senderEngSignature,
this.senderAttachments, this.senderAttachments,
this.receiverAssignedEmployeeId, this.receiverAssignedEmployeeId,
this.receiverMachineStatusId, this.receiverMachineStatusId,
this.receiverComment, this.receiverComment,
this.receiverStartDate, this.receiverStartDate,
this.receiverEndDate, this.receiverEndDate,
this.receiverWorkingHours, this.receiverWorkingHours,
this.receiverTravelingHours, this.receiverTravelingHours,
this.receiverEngSignature, this.receiverEngSignature,
this.receiverAttachments, this.receiverAttachments,
this.assetNumber, this.assetNumber,
this.assetName, this.assetName,
this.manufacturerName, this.manufacturerName,
this.modelName, this.modelName,
this.assetSerialNo, this.assetSerialNo,
this.destDepartmentName, this.destDepartmentName,
this.destBuildingName, this.destBuildingName,
this.applied, this.applied,
this.createdOn, this.createdOn,
this.destFloorName, this.destFloorName,
this.destSiteName, this.destSiteName,
this.manufacturerId, this.manufacturerId,
this.modelId, this.modelId,
this.modifiedOn, this.modifiedOn,
this.receiverAssignedEmployeeName, this.receiverAssignedEmployeeName,
this.receiverEngSignatureUrl, this.receiverEngSignatureUrl,
this.receiverMachineStatusName, this.receiverMachineStatusName,
this.senderAssignedEmployeeName, this.senderAssignedEmployeeName,
this.senderBuildingName, this.senderBuildingName,
this.senderDepartmentName, this.senderDepartmentName,
this.senderEngSignatureUrl, this.senderEngSignatureUrl,
this.senderFloorName, this.senderFloorName,
this.senderMachineStatusName, this.senderMachineStatusName,
this.senderSiteName, this.senderSiteName,
this.supplierId, this.supplierId,
this.supplierName, this.supplierName,
this.senderVisitTimers, this.senderVisitTimers,
this.receiverVisitTimers, this.receiverVisitTimers,
this.tbsTimer}); this.tbsTimer,
this.extensionNo,
this.employeeId,
this.name,
this.createdDate,
});
AssetTransfer.fromJson(dynamic json) { AssetTransfer.fromJson(dynamic json) {
id = json['id']; id = json['id'];
@ -100,6 +105,10 @@ class AssetTransfer {
senderWorkingHours = json['senderWorkingHours']; senderWorkingHours = json['senderWorkingHours'];
senderTravelingHours = json['senderTravelingHours']; senderTravelingHours = json['senderTravelingHours'];
senderEngSignature = json['senderEngSignature']; senderEngSignature = json['senderEngSignature'];
extensionNo = json['extensionNo'];
employeeId = json['employeeId'];
name = json['name'];
createdDate = json['createdDate'];
if (json['senderAttachments'] != null) { if (json['senderAttachments'] != null) {
senderAttachments = []; senderAttachments = [];
json['senderAttachments'].forEach((v) { json['senderAttachments'].forEach((v) {
@ -239,6 +248,10 @@ class AssetTransfer {
List<VisitTimers> senderVisitTimers; List<VisitTimers> senderVisitTimers;
List<VisitTimers> receiverVisitTimers; List<VisitTimers> receiverVisitTimers;
TimerModel tbsTimer = TimerModel(); TimerModel tbsTimer = TimerModel();
String extensionNo;
String employeeId;
String name;
String createdDate;
AssetTransfer copyWith( AssetTransfer copyWith(
{num id, {num id,
@ -305,6 +318,10 @@ class AssetTransfer {
String destDepartmentName, String destDepartmentName,
List<VisitTimers> senderVisitTimers, List<VisitTimers> senderVisitTimers,
List<VisitTimers> receiverVisitTimers, List<VisitTimers> receiverVisitTimers,
String extensionNo,
String employeeId,
String name,
String createdDate,
TimerModel tbsTimer}) => TimerModel tbsTimer}) =>
AssetTransfer( AssetTransfer(
id: id ?? this.id, id: id ?? this.id,
@ -370,7 +387,12 @@ class AssetTransfer {
senderVisitTimers: senderVisitTimers ?? this.senderVisitTimers, senderVisitTimers: senderVisitTimers ?? this.senderVisitTimers,
receiverVisitTimers: receiverVisitTimers ?? this.receiverVisitTimers, receiverVisitTimers: receiverVisitTimers ?? this.receiverVisitTimers,
tbsTimer: tbsTimer ?? this.tbsTimer, tbsTimer: tbsTimer ?? this.tbsTimer,
manufacturerName: manufacturerName ?? this.manufacturerName); manufacturerName: manufacturerName ?? this.manufacturerName,
extensionNo: extensionNo ?? this.extensionNo,
employeeId: employeeId ?? this.employeeId,
name: name ?? this.name,
createdDate: createdDate ?? this.createdDate,
);
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final map = <String, dynamic>{}; final map = <String, dynamic>{};
@ -399,6 +421,10 @@ class AssetTransfer {
map['senderWorkingHours'] = senderWorkingHours; map['senderWorkingHours'] = senderWorkingHours;
map['senderTravelingHours'] = senderTravelingHours; map['senderTravelingHours'] = senderTravelingHours;
map['senderEngSignature'] = senderEngSignature; map['senderEngSignature'] = senderEngSignature;
map['extensionNo'] = extensionNo;
map['employeeId'] = employeeId;
map['name'] = name;
map['createdDate'] = createdDate;
if (this.senderVisitTimers != null) { if (this.senderVisitTimers != null) {
map['assetTransferSenderTimers'] = this.senderVisitTimers.map((v) => v.toJson()).toList(); map['assetTransferSenderTimers'] = this.senderVisitTimers.map((v) => v.toJson()).toList();
} }

@ -35,6 +35,10 @@ class GasRefillModel {
this.localEngineerSignature, this.localEngineerSignature,
this.localNurseSignature, this.localNurseSignature,
this.timer, this.timer,
this.extensionNo,
this.employeeId,
this.name,
this.createdDate,
}); });
GasRefillModel.fromJson(dynamic json) { GasRefillModel.fromJson(dynamic json) {
@ -48,6 +52,11 @@ class GasRefillModel {
endTime = json['endTime']; endTime = json['endTime'];
comment = json['comment']; comment = json['comment'];
workingHours = json['workingHours']; workingHours = json['workingHours'];
extensionNo = json['extensionNo'];
employeeId = json['employeeId'];
name = json['name'];
createdDate = json['createdDate'];
try { try {
final sd = DateTime.tryParse(startDate ?? ""); final sd = DateTime.tryParse(startDate ?? "");
final st = DateTime.tryParse(startTime ?? ""); final st = DateTime.tryParse(startTime ?? "");
@ -102,6 +111,11 @@ class GasRefillModel {
Uint8List localNurseSignature; Uint8List localNurseSignature;
Uint8List localEngineerSignature; Uint8List localEngineerSignature;
TimerModel timer = TimerModel(); TimerModel timer = TimerModel();
String extensionNo;
String employeeId;
String name;
String createdDate;
GasRefillModel copyWith({ GasRefillModel copyWith({
num id, num id,
@ -124,6 +138,10 @@ class GasRefillModel {
String comment, String comment,
List<GasRefillDetails> gazRefillDetails, List<GasRefillDetails> gazRefillDetails,
TimerModel timer, TimerModel timer,
String extensionNo,
String employeeId,
String name,
String createdDate,
}) => }) =>
GasRefillModel( GasRefillModel(
id: id ?? this.id, id: id ?? this.id,
@ -146,6 +164,10 @@ class GasRefillModel {
comment: comment ?? this.comment, comment: comment ?? this.comment,
gazRefillDetails: gazRefillDetails ?? this.gazRefillDetails, gazRefillDetails: gazRefillDetails ?? this.gazRefillDetails,
timer: timer ?? this.timer, timer: timer ?? this.timer,
extensionNo: extensionNo ?? this.extensionNo,
employeeId: employeeId ?? this.employeeId,
name: name ?? this.name,
createdDate: createdDate ?? this.createdDate,
); );
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -162,6 +184,10 @@ class GasRefillModel {
map['nurseSignature'] = nurseSignature; map['nurseSignature'] = nurseSignature;
map['workingHours'] = workingHours; map['workingHours'] = workingHours;
map['comment'] = comment; map['comment'] = comment;
map['extensionNo'] = extensionNo;
map['employeeId'] = employeeId;
map['name'] = name;
map['createdDate'] = createdDate;
if (site != null) { if (site != null) {
map['site'] = site.toJson(addBuildings: false); map['site'] = site.toJson(addBuildings: false);
} }
@ -223,6 +249,10 @@ class GasRefillModel {
engSignature = model.engSignature; engSignature = model.engSignature;
nurseSignature = model.nurseSignature; nurseSignature = model.nurseSignature;
workingHours = model.workingHours; workingHours = model.workingHours;
extensionNo= model.extensionNo;
employeeId=model.employeeId;
name=model.name;
createdDate=model.createdDate;
} }
} }

@ -79,6 +79,10 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
_buildTextWidget('${context.translation.sn} : ${_model?.assetSerialNo ?? ""}'), _buildTextWidget('${context.translation.sn} : ${_model?.assetSerialNo ?? ""}'),
if (_model?.receiverEndUserName != null) _buildTextWidget('${context.translation.receiverName} : ${_model?.receiverEndUserName ?? ""}'), if (_model?.receiverEndUserName != null) _buildTextWidget('${context.translation.receiverName} : ${_model?.receiverEndUserName ?? ""}'),
_buildTextWidget('${context.translation.requestNo} : ${_model?.transferCode ?? ""}'), _buildTextWidget('${context.translation.requestNo} : ${_model?.transferCode ?? ""}'),
infoText(label:context.translation.extensionNo ,value:_model.extensionNo),
infoText(label:context.translation.employeeId ,value:_model.employeeId),
infoText(label:context.translation.name ,value:_model.name),
infoText(label:context.translation.createdDate ,value:_model.createdDate.toFirstActionFormat),
if ((_model?.comment ?? "").isNotEmpty) ...[ if ((_model?.comment ?? "").isNotEmpty) ...[
8.height, 8.height,
const Divider().defaultStyle(context), const Divider().defaultStyle(context),
@ -225,4 +229,12 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
], ],
).toShadowContainer(context); ).toShadowContainer(context);
} }
Widget infoText({String label,String value,}){
if(value==null||value.isEmpty){
return const SizedBox();
}
else {
return '$label: $value'.bodyText(context);
}
}
} }

@ -113,6 +113,10 @@ class _GasRefillDetailsPageState extends State<GasRefillDetailsPage> {
'${context.translation.site}: ${gasRefillModel.site?.name?.cleanupWhitespace?.capitalizeFirstOfEach}'.bodyText(context), '${context.translation.site}: ${gasRefillModel.site?.name?.cleanupWhitespace?.capitalizeFirstOfEach}'.bodyText(context),
'${context.translation.department}: ${gasRefillModel.department?.name?.cleanupWhitespace?.capitalizeFirstOfEach}'.bodyText(context), '${context.translation.department}: ${gasRefillModel.department?.name?.cleanupWhitespace?.capitalizeFirstOfEach}'.bodyText(context),
'${context.translation.requestNo}: ${gasRefillModel.gazRefillNo}'.bodyText(context), '${context.translation.requestNo}: ${gasRefillModel.gazRefillNo}'.bodyText(context),
infoText(label:context.translation.extensionNo ,value:gasRefillModel.extensionNo),
infoText(label:context.translation.employeeId ,value:gasRefillModel.employeeId),
infoText(label:context.translation.name ,value:gasRefillModel.name),
infoText(label:context.translation.createdDate ,value:gasRefillModel.createdDate.toFirstActionFormat),
const Divider().defaultStyle(context), const Divider().defaultStyle(context),
'${context.translation.requestedQuantity}: ${gasRefillModel.gazRefillDetails[0]?.requestedQty ?? 0}'.bodyText(context), '${context.translation.requestedQuantity}: ${gasRefillModel.gazRefillDetails[0]?.requestedQty ?? 0}'.bodyText(context),
'${context.translation.deliveredQuantity}: ${gasRefillModel.gazRefillDetails[0]?.deliverdQty ?? 0}'.bodyText(context), '${context.translation.deliveredQuantity}: ${gasRefillModel.gazRefillDetails[0]?.deliverdQty ?? 0}'.bodyText(context),
@ -220,4 +224,13 @@ class _GasRefillDetailsPageState extends State<GasRefillDetailsPage> {
], ],
).toShadowContainer(context, padding: 0); ).toShadowContainer(context, padding: 0);
} }
Widget infoText({String label,String value,}){
if(value==null||value.isEmpty){
return const SizedBox();
}
else {
return '$label: $value'.bodyText(context);
}
}
} }

Loading…
Cancel
Save