device transfer and Gas refill new data added

main_design2.1
WaseemAbbasi22 10 months ago
parent b6731e786f
commit c8862bbb63

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

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

@ -35,6 +35,10 @@ class GasRefillModel {
this.localEngineerSignature,
this.localNurseSignature,
this.timer,
this.extensionNo,
this.employeeId,
this.name,
this.createdDate,
});
GasRefillModel.fromJson(dynamic json) {
@ -48,6 +52,11 @@ class GasRefillModel {
endTime = json['endTime'];
comment = json['comment'];
workingHours = json['workingHours'];
extensionNo = json['extensionNo'];
employeeId = json['employeeId'];
name = json['name'];
createdDate = json['createdDate'];
try {
final sd = DateTime.tryParse(startDate ?? "");
final st = DateTime.tryParse(startTime ?? "");
@ -102,6 +111,11 @@ class GasRefillModel {
Uint8List localNurseSignature;
Uint8List localEngineerSignature;
TimerModel timer = TimerModel();
String extensionNo;
String employeeId;
String name;
String createdDate;
GasRefillModel copyWith({
num id,
@ -124,6 +138,10 @@ class GasRefillModel {
String comment,
List<GasRefillDetails> gazRefillDetails,
TimerModel timer,
String extensionNo,
String employeeId,
String name,
String createdDate,
}) =>
GasRefillModel(
id: id ?? this.id,
@ -146,6 +164,10 @@ class GasRefillModel {
comment: comment ?? this.comment,
gazRefillDetails: gazRefillDetails ?? this.gazRefillDetails,
timer: timer ?? this.timer,
extensionNo: extensionNo ?? this.extensionNo,
employeeId: employeeId ?? this.employeeId,
name: name ?? this.name,
createdDate: createdDate ?? this.createdDate,
);
Map<String, dynamic> toJson() {
@ -162,6 +184,10 @@ class GasRefillModel {
map['nurseSignature'] = nurseSignature;
map['workingHours'] = workingHours;
map['comment'] = comment;
map['extensionNo'] = extensionNo;
map['employeeId'] = employeeId;
map['name'] = name;
map['createdDate'] = createdDate;
if (site != null) {
map['site'] = site.toJson(addBuildings: false);
}
@ -223,6 +249,10 @@ class GasRefillModel {
engSignature = model.engSignature;
nurseSignature = model.nurseSignature;
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 ?? ""}'),
if (_model?.receiverEndUserName != null) _buildTextWidget('${context.translation.receiverName} : ${_model?.receiverEndUserName ?? ""}'),
_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) ...[
8.height,
const Divider().defaultStyle(context),
@ -225,4 +229,12 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
],
).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.department}: ${gasRefillModel.department?.name?.cleanupWhitespace?.capitalizeFirstOfEach}'.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),
'${context.translation.requestedQuantity}: ${gasRefillModel.gazRefillDetails[0]?.requestedQty ?? 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);
}
Widget infoText({String label,String value,}){
if(value==null||value.isEmpty){
return const SizedBox();
}
else {
return '$label: $value'.bodyText(context);
}
}
}

Loading…
Cancel
Save