|
|
|
@ -1,9 +1,13 @@
|
|
|
|
|
|
|
|
import 'dart:convert';
|
|
|
|
|
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:flutter/widgets.dart';
|
|
|
|
import 'package:flutter/widgets.dart';
|
|
|
|
import 'package:fluttertoast/fluttertoast.dart';
|
|
|
|
import 'package:fluttertoast/fluttertoast.dart';
|
|
|
|
import 'package:test_sa/extensions/context_extension.dart';
|
|
|
|
import 'package:test_sa/extensions/context_extension.dart';
|
|
|
|
import 'package:test_sa/models/lookup.dart';
|
|
|
|
import 'package:test_sa/models/lookup.dart';
|
|
|
|
import 'package:test_sa/models/service_request/supplier_details.dart';
|
|
|
|
import 'package:test_sa/models/service_request/supplier_details.dart';
|
|
|
|
import 'package:test_sa/models/timer_model.dart';
|
|
|
|
import 'package:test_sa/models/timer_model.dart';
|
|
|
|
|
|
|
|
import 'package:test_sa/service_request_latest/utilities/service_request_utils.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class PlanPreventiveVisit {
|
|
|
|
class PlanPreventiveVisit {
|
|
|
|
String? id;
|
|
|
|
String? id;
|
|
|
|
@ -24,7 +28,7 @@ class PlanPreventiveVisit {
|
|
|
|
String? fromDate;
|
|
|
|
String? fromDate;
|
|
|
|
String? toDate;
|
|
|
|
String? toDate;
|
|
|
|
AssignedEmployee? assignedEmployee;
|
|
|
|
AssignedEmployee? assignedEmployee;
|
|
|
|
String? acutalDateOfVisit;
|
|
|
|
DateTime? acutalDateOfVisit;
|
|
|
|
Lookup? typeOfService;
|
|
|
|
Lookup? typeOfService;
|
|
|
|
Lookup? visitStatus;
|
|
|
|
Lookup? visitStatus;
|
|
|
|
num? travelingHours;
|
|
|
|
num? travelingHours;
|
|
|
|
@ -32,11 +36,12 @@ class PlanPreventiveVisit {
|
|
|
|
int? executionTimeFrame;
|
|
|
|
int? executionTimeFrame;
|
|
|
|
Lookup? taskStatus;
|
|
|
|
Lookup? taskStatus;
|
|
|
|
Lookup? deviceStatus;
|
|
|
|
Lookup? deviceStatus;
|
|
|
|
Lookup? assetAvailability;
|
|
|
|
Lookup? assetAvailability = Lookup();
|
|
|
|
Lookup? safety;
|
|
|
|
Lookup? safety;
|
|
|
|
String? engSignature;
|
|
|
|
String? engSignature;
|
|
|
|
String? nurseSignature;
|
|
|
|
String? nurseSignature;
|
|
|
|
List<PreventiveVisitAttachments>? preventiveVisitAttachments;
|
|
|
|
List<PreventiveVisitAttachments>? preventiveVisitAttachments;
|
|
|
|
|
|
|
|
List<File>? attachments = [];
|
|
|
|
List<PreventiveVisitCalibrations>? preventiveVisitCalibrations;
|
|
|
|
List<PreventiveVisitCalibrations>? preventiveVisitCalibrations;
|
|
|
|
List<PreventiveVisitChecklists>? preventiveVisitChecklists;
|
|
|
|
List<PreventiveVisitChecklists>? preventiveVisitChecklists;
|
|
|
|
List<PreventiveVisitKits>? preventiveVisitKits;
|
|
|
|
List<PreventiveVisitKits>? preventiveVisitKits;
|
|
|
|
@ -76,6 +81,7 @@ class PlanPreventiveVisit {
|
|
|
|
this.engSignature,
|
|
|
|
this.engSignature,
|
|
|
|
this.nurseSignature,
|
|
|
|
this.nurseSignature,
|
|
|
|
this.preventiveVisitAttachments,
|
|
|
|
this.preventiveVisitAttachments,
|
|
|
|
|
|
|
|
this.attachments,
|
|
|
|
this.preventiveVisitCalibrations,
|
|
|
|
this.preventiveVisitCalibrations,
|
|
|
|
this.preventiveVisitChecklists,
|
|
|
|
this.preventiveVisitChecklists,
|
|
|
|
this.preventiveVisitKits,
|
|
|
|
this.preventiveVisitKits,
|
|
|
|
@ -85,7 +91,7 @@ class PlanPreventiveVisit {
|
|
|
|
PlanPreventiveVisit.fromJson(Map<String, dynamic> json) {
|
|
|
|
PlanPreventiveVisit.fromJson(Map<String, dynamic> json) {
|
|
|
|
id = json['id'];
|
|
|
|
id = json['id'];
|
|
|
|
visitNo = json['visitNo'];
|
|
|
|
visitNo = json['visitNo'];
|
|
|
|
asset = json['asset'] != null ? new Asset.fromJson(json['asset']) : null;
|
|
|
|
asset = json['asset'] != null ? Asset.fromJson(json['asset']) : null;
|
|
|
|
planNo = json['planNo'];
|
|
|
|
planNo = json['planNo'];
|
|
|
|
planName = json['planName'];
|
|
|
|
planName = json['planName'];
|
|
|
|
nextPMDate = json['nextPMDate'];
|
|
|
|
nextPMDate = json['nextPMDate'];
|
|
|
|
@ -100,53 +106,54 @@ class PlanPreventiveVisit {
|
|
|
|
roomName = json['roomName'];
|
|
|
|
roomName = json['roomName'];
|
|
|
|
fromDate = json['fromDate'];
|
|
|
|
fromDate = json['fromDate'];
|
|
|
|
toDate = json['toDate'];
|
|
|
|
toDate = json['toDate'];
|
|
|
|
assignedEmployee = json['assignedEmployee'] != null ? new AssignedEmployee.fromJson(json['assignedEmployee']) : null;
|
|
|
|
assignedEmployee = json['assignedEmployee'] != null ? AssignedEmployee.fromJson(json['assignedEmployee']) : null;
|
|
|
|
acutalDateOfVisit = json['acutalDateOfVisit'];
|
|
|
|
acutalDateOfVisit = json['acutalDateOfVisit'] != null ? DateTime.parse(json['acutalDateOfVisit']) : null;
|
|
|
|
typeOfService = json['typeOfService'] != null ? new Lookup.fromJson(json['typeOfService']) : null;
|
|
|
|
typeOfService = json['typeOfService'] != null ? Lookup.fromJson(json['typeOfService']) : null;
|
|
|
|
visitStatus = json['visitStatus'] != null ? new Lookup.fromJson(json['visitStatus']) : null;
|
|
|
|
visitStatus = json['visitStatus'] != null ? Lookup.fromJson(json['visitStatus']) : null;
|
|
|
|
travelingHours = json['travelingHours'];
|
|
|
|
travelingHours = json['travelingHours'];
|
|
|
|
comments = json['comments'];
|
|
|
|
comments = json['comments'];
|
|
|
|
executionTimeFrame = json['executionTimeFrame'];
|
|
|
|
executionTimeFrame = json['executionTimeFrame'];
|
|
|
|
taskStatus = json['taskStatus'] != null ? new Lookup.fromJson(json['taskStatus']) : null;
|
|
|
|
taskStatus = json['taskStatus'] != null ? Lookup.fromJson(json['taskStatus']) : null;
|
|
|
|
deviceStatus = json['deviceStatus'] != null ? new Lookup.fromJson(json['deviceStatus']) : null;
|
|
|
|
deviceStatus = json['deviceStatus'] != null ? Lookup.fromJson(json['deviceStatus']) : null;
|
|
|
|
assetAvailability = json['assetAvailability'];
|
|
|
|
assetAvailability = json['assetAvailability'] != null ? Lookup.fromJson(json['assetAvailability']) : null;
|
|
|
|
safety = json['safety'] != null ? new Lookup.fromJson(json['safety']) : null;
|
|
|
|
safety = json['safety'] != null ? Lookup.fromJson(json['safety']) : null;
|
|
|
|
engSignature = json['engSignature'];
|
|
|
|
engSignature = json['engSignature'];
|
|
|
|
nurseSignature = json['nurseSignature'];
|
|
|
|
nurseSignature = json['nurseSignature'];
|
|
|
|
if (json['preventiveVisitAttachments'] != null) {
|
|
|
|
if (json['preventiveVisitAttachments'] != null) {
|
|
|
|
preventiveVisitAttachments = <PreventiveVisitAttachments>[];
|
|
|
|
preventiveVisitAttachments = <PreventiveVisitAttachments>[];
|
|
|
|
json['preventiveVisitAttachments'].forEach((v) {
|
|
|
|
json['preventiveVisitAttachments'].forEach((v) {
|
|
|
|
preventiveVisitAttachments!.add(new PreventiveVisitAttachments.fromJson(v));
|
|
|
|
preventiveVisitAttachments!.add(PreventiveVisitAttachments.fromJson(v));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (json['preventiveVisitCalibrations'] != null) {
|
|
|
|
if (json['preventiveVisitCalibrations'] != null) {
|
|
|
|
preventiveVisitCalibrations = <PreventiveVisitCalibrations>[];
|
|
|
|
preventiveVisitCalibrations = <PreventiveVisitCalibrations>[];
|
|
|
|
json['preventiveVisitCalibrations'].forEach((v) {
|
|
|
|
json['preventiveVisitCalibrations'].forEach((v) {
|
|
|
|
preventiveVisitCalibrations!.add(new PreventiveVisitCalibrations.fromJson(v));
|
|
|
|
preventiveVisitCalibrations!.add(PreventiveVisitCalibrations.fromJson(v));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (json['preventiveVisitChecklists'] != null) {
|
|
|
|
if (json['preventiveVisitChecklists'] != null) {
|
|
|
|
preventiveVisitChecklists = <PreventiveVisitChecklists>[];
|
|
|
|
preventiveVisitChecklists = <PreventiveVisitChecklists>[];
|
|
|
|
json['preventiveVisitChecklists'].forEach((v) {
|
|
|
|
json['preventiveVisitChecklists'].forEach((v) {
|
|
|
|
preventiveVisitChecklists!.add(new PreventiveVisitChecklists.fromJson(v));
|
|
|
|
preventiveVisitChecklists!.add(PreventiveVisitChecklists.fromJson(v));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (json['preventiveVisitKits'] != null) {
|
|
|
|
if (json['preventiveVisitKits'] != null) {
|
|
|
|
preventiveVisitKits = <PreventiveVisitKits>[];
|
|
|
|
preventiveVisitKits = <PreventiveVisitKits>[];
|
|
|
|
json['preventiveVisitKits'].forEach((v) {
|
|
|
|
json['preventiveVisitKits'].forEach((v) {
|
|
|
|
preventiveVisitKits!.add(new PreventiveVisitKits.fromJson(v));
|
|
|
|
preventiveVisitKits!.add(PreventiveVisitKits.fromJson(v));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (json['preventiveVisitTimers'] != null) {
|
|
|
|
if (json['preventiveVisitTimers'] != null) {
|
|
|
|
preventiveVisitTimers = <PreventiveVisitTimers>[];
|
|
|
|
preventiveVisitTimers = <PreventiveVisitTimers>[];
|
|
|
|
json['preventiveVisitTimers'].forEach((v) {
|
|
|
|
json['preventiveVisitTimers'].forEach((v) {
|
|
|
|
preventiveVisitTimers!.add(new PreventiveVisitTimers.fromJson(v));
|
|
|
|
preventiveVisitTimers!.add(PreventiveVisitTimers.fromJson(v));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (json['preventiveVisitSuppliers'] != null) {
|
|
|
|
if (json['preventiveVisitSuppliers'] != null) {
|
|
|
|
preventiveVisitSuppliers = <PreventiveVisitSuppliers>[];
|
|
|
|
preventiveVisitSuppliers = <PreventiveVisitSuppliers>[];
|
|
|
|
json['preventiveVisitSuppliers'].forEach((v) {
|
|
|
|
json['preventiveVisitSuppliers'].forEach((v) {
|
|
|
|
preventiveVisitSuppliers!.add( PreventiveVisitSuppliers.fromJson(v));
|
|
|
|
preventiveVisitSuppliers!.add(PreventiveVisitSuppliers.fromJson(v));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -154,10 +161,9 @@ class PlanPreventiveVisit {
|
|
|
|
Map<String, dynamic> toJson({required int status}) {
|
|
|
|
Map<String, dynamic> toJson({required int status}) {
|
|
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
|
|
data['id'] = id;
|
|
|
|
data['id'] = id;
|
|
|
|
data['acutalDateOfVisit'] = acutalDateOfVisit;
|
|
|
|
data['acutalDateOfVisit'] = acutalDateOfVisit?.toIso8601String();
|
|
|
|
data['statusValue'] = status;
|
|
|
|
|
|
|
|
data['typeOfServiceId'] = typeOfService?.id;
|
|
|
|
data['typeOfServiceId'] = typeOfService?.id;
|
|
|
|
data['visitStatusValue'] = visitStatus?.value;
|
|
|
|
data['visitStatusValue'] = status;
|
|
|
|
data['travelingHours'] = travelingHours;
|
|
|
|
data['travelingHours'] = travelingHours;
|
|
|
|
data['comments'] = comments;
|
|
|
|
data['comments'] = comments;
|
|
|
|
data['taskStatusId'] = taskStatus?.id;
|
|
|
|
data['taskStatusId'] = taskStatus?.id;
|
|
|
|
@ -211,8 +217,8 @@ class PlanPreventiveVisit {
|
|
|
|
// data['engSignature'] = engSignature;
|
|
|
|
// data['engSignature'] = engSignature;
|
|
|
|
// data['nurseSignature'] = nurseSignature;
|
|
|
|
// data['nurseSignature'] = nurseSignature;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (preventiveVisitAttachments != null) {
|
|
|
|
if (preventiveVisitAttachments != null) {
|
|
|
|
|
|
|
|
|
|
|
|
data['preventiveVisitAttachments'] = preventiveVisitAttachments!.map((v) => v.toJson()).toList();
|
|
|
|
data['preventiveVisitAttachments'] = preventiveVisitAttachments!.map((v) => v.toJson()).toList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (preventiveVisitCalibrations != null) {
|
|
|
|
if (preventiveVisitCalibrations != null) {
|
|
|
|
@ -354,7 +360,7 @@ class PlanPreventiveVisit {
|
|
|
|
// PlanPreventiveVisit.fromJson(Map<String, dynamic> json) {
|
|
|
|
// PlanPreventiveVisit.fromJson(Map<String, dynamic> json) {
|
|
|
|
// id = json['id'];
|
|
|
|
// id = json['id'];
|
|
|
|
// visitNo = json['visitNo'];
|
|
|
|
// visitNo = json['visitNo'];
|
|
|
|
// asset = json['asset'] != null ? new Asset.fromJson(json['asset']) : null;
|
|
|
|
// asset = json['asset'] != null ? Asset.fromJson(json['asset']) : null;
|
|
|
|
// planNo = json['planNo'];
|
|
|
|
// planNo = json['planNo'];
|
|
|
|
// planName = json['planName'];
|
|
|
|
// planName = json['planName'];
|
|
|
|
// nextPMDate = json['nextPMDate'];
|
|
|
|
// nextPMDate = json['nextPMDate'];
|
|
|
|
@ -369,10 +375,10 @@ class PlanPreventiveVisit {
|
|
|
|
// roomName = json['roomName'];
|
|
|
|
// roomName = json['roomName'];
|
|
|
|
// fromDate = json['fromDate'];
|
|
|
|
// fromDate = json['fromDate'];
|
|
|
|
// toDate = json['toDate'];
|
|
|
|
// toDate = json['toDate'];
|
|
|
|
// assignedEmployee = json['assignedEmployee'] != null ? new AssignedEmployee.fromJson(json['assignedEmployee']) : null;
|
|
|
|
// assignedEmployee = json['assignedEmployee'] != null ? AssignedEmployee.fromJson(json['assignedEmployee']) : null;
|
|
|
|
// acutalDateOfVisit = json['acutalDateOfVisit'];
|
|
|
|
// acutalDateOfVisit = json['acutalDateOfVisit'];
|
|
|
|
// typeOfService = json['typeOfService'] != null ? new TypeOfService.fromJson(json['typeOfService']) : null;
|
|
|
|
// typeOfService = json['typeOfService'] != null ? TypeOfService.fromJson(json['typeOfService']) : null;
|
|
|
|
// visitStatus = json['visitStatus'] != null ? new VisitStatus.fromJson(json['visitStatus']) : null;
|
|
|
|
// visitStatus = json['visitStatus'] != null ? VisitStatus.fromJson(json['visitStatus']) : null;
|
|
|
|
// travelingHours = json['travelingHours'];
|
|
|
|
// travelingHours = json['travelingHours'];
|
|
|
|
// comments = json['comments'];
|
|
|
|
// comments = json['comments'];
|
|
|
|
// executionTimeFrame = json['executionTimeFrame'];
|
|
|
|
// executionTimeFrame = json['executionTimeFrame'];
|
|
|
|
@ -391,37 +397,37 @@ class PlanPreventiveVisit {
|
|
|
|
// if (json['preventiveVisitCalibrations'] != null) {
|
|
|
|
// if (json['preventiveVisitCalibrations'] != null) {
|
|
|
|
// preventiveVisitCalibrations = <PreventiveVisitChecklists>[];
|
|
|
|
// preventiveVisitCalibrations = <PreventiveVisitChecklists>[];
|
|
|
|
// json['preventiveVisitCalibrations'].forEach((v) {
|
|
|
|
// json['preventiveVisitCalibrations'].forEach((v) {
|
|
|
|
// preventiveVisitCalibrations!.add(new PreventiveVisitChecklists.fromJson(v));
|
|
|
|
// preventiveVisitCalibrations!.add( PreventiveVisitChecklists.fromJson(v));
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// if (json['preventiveVisitChecklists'] != null) {
|
|
|
|
// if (json['preventiveVisitChecklists'] != null) {
|
|
|
|
// preventiveVisitChecklists = <PreventiveVisitChecklists>[];
|
|
|
|
// preventiveVisitChecklists = <PreventiveVisitChecklists>[];
|
|
|
|
// json['preventiveVisitChecklists'].forEach((v) {
|
|
|
|
// json['preventiveVisitChecklists'].forEach((v) {
|
|
|
|
// preventiveVisitChecklists!.add(new PreventiveVisitChecklists.fromJson(v));
|
|
|
|
// preventiveVisitChecklists!.add( PreventiveVisitChecklists.fromJson(v));
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// if (json['preventiveVisitKits'] != null) {
|
|
|
|
// if (json['preventiveVisitKits'] != null) {
|
|
|
|
// preventiveVisitKits = <PreventiveVisitChecklists>[];
|
|
|
|
// preventiveVisitKits = <PreventiveVisitChecklists>[];
|
|
|
|
// json['preventiveVisitKits'].forEach((v) {
|
|
|
|
// json['preventiveVisitKits'].forEach((v) {
|
|
|
|
// preventiveVisitKits!.add(new PreventiveVisitChecklists.fromJson(v));
|
|
|
|
// preventiveVisitKits!.add( PreventiveVisitChecklists.fromJson(v));
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// if (json['preventiveVisitTimers'] != null) {
|
|
|
|
// if (json['preventiveVisitTimers'] != null) {
|
|
|
|
// preventiveVisitTimers = <PreventiveVisitTimers>[];
|
|
|
|
// preventiveVisitTimers = <PreventiveVisitTimers>[];
|
|
|
|
// json['preventiveVisitTimers'].forEach((v) {
|
|
|
|
// json['preventiveVisitTimers'].forEach((v) {
|
|
|
|
// preventiveVisitTimers!.add(new PreventiveVisitTimers.fromJson(v));
|
|
|
|
// preventiveVisitTimers!.add( PreventiveVisitTimers.fromJson(v));
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// if (json['preventiveVisitSuppliers'] != null) {
|
|
|
|
// if (json['preventiveVisitSuppliers'] != null) {
|
|
|
|
// preventiveVisitSuppliers = <PreventiveVisitChecklists>[];
|
|
|
|
// preventiveVisitSuppliers = <PreventiveVisitChecklists>[];
|
|
|
|
// json['preventiveVisitSuppliers'].forEach((v) {
|
|
|
|
// json['preventiveVisitSuppliers'].forEach((v) {
|
|
|
|
// preventiveVisitSuppliers!.add(new PreventiveVisitChecklists.fromJson(v));
|
|
|
|
// preventiveVisitSuppliers!.add( PreventiveVisitChecklists.fromJson(v));
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Map<String, dynamic> toJson() {
|
|
|
|
// Map<String, dynamic> toJson() {
|
|
|
|
// final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
|
|
// final Map<String, dynamic> data = Map<String, dynamic>();
|
|
|
|
// data['id'] = this.id;
|
|
|
|
// data['id'] = this.id;
|
|
|
|
// data['visitNo'] = this.visitNo;
|
|
|
|
// data['visitNo'] = this.visitNo;
|
|
|
|
// if (this.asset != null) {
|
|
|
|
// if (this.asset != null) {
|
|
|
|
@ -536,7 +542,7 @@ class Asset {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
|
|
|
Map<String, dynamic> toJson() {
|
|
|
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
|
|
final Map<String, dynamic> data = Map<String, dynamic>();
|
|
|
|
data['id'] = this.id;
|
|
|
|
data['id'] = this.id;
|
|
|
|
data['assetNumber'] = this.assetNumber;
|
|
|
|
data['assetNumber'] = this.assetNumber;
|
|
|
|
data['assetSerialNo'] = this.assetSerialNo;
|
|
|
|
data['assetSerialNo'] = this.assetSerialNo;
|
|
|
|
@ -562,7 +568,7 @@ class AssignedEmployee {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
|
|
|
Map<String, dynamic> toJson() {
|
|
|
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
|
|
final Map<String, dynamic> data = Map<String, dynamic>();
|
|
|
|
data['userId'] = this.userId;
|
|
|
|
data['userId'] = this.userId;
|
|
|
|
data['userName'] = this.userName;
|
|
|
|
data['userName'] = this.userName;
|
|
|
|
data['email'] = this.email;
|
|
|
|
data['email'] = this.email;
|
|
|
|
@ -586,7 +592,7 @@ class AssignedEmployee {
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Map<String, dynamic> toJson() {
|
|
|
|
// Map<String, dynamic> toJson() {
|
|
|
|
// final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
|
|
// final Map<String, dynamic> data = Map<String, dynamic>();
|
|
|
|
// data['id'] = this.id;
|
|
|
|
// data['id'] = this.id;
|
|
|
|
// data['name'] = this.name;
|
|
|
|
// data['name'] = this.name;
|
|
|
|
// data['value'] = this.value;
|
|
|
|
// data['value'] = this.value;
|
|
|
|
@ -608,7 +614,7 @@ class AssignedEmployee {
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Map<String, dynamic> toJson() {
|
|
|
|
// Map<String, dynamic> toJson() {
|
|
|
|
// final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
|
|
// final Map<String, dynamic> data = Map<String, dynamic>();
|
|
|
|
// data['id'] = this.id;
|
|
|
|
// data['id'] = this.id;
|
|
|
|
// data['name'] = this.name;
|
|
|
|
// data['name'] = this.name;
|
|
|
|
// data['value'] = this.value;
|
|
|
|
// data['value'] = this.value;
|
|
|
|
@ -634,14 +640,14 @@ class PreventiveVisitChecklists {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
|
|
|
Map<String, dynamic> toJson() {
|
|
|
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
|
|
data['id'] = this.id;
|
|
|
|
data['id'] = id;
|
|
|
|
data['taskStatus'] = this.taskStatus?.toJson();
|
|
|
|
data['taskStatusId'] = taskStatus?.id;
|
|
|
|
data['taskComment'] = this.taskComment;
|
|
|
|
data['taskComment'] = taskComment;
|
|
|
|
data['measuredValue'] = this.measuredValue;
|
|
|
|
data['measuredValue'] = measuredValue;
|
|
|
|
if (this.instructionText != null) {
|
|
|
|
// if (instructionText != null) {
|
|
|
|
data['instructionText'] = this.instructionText!.toJson();
|
|
|
|
// data['instructionText'] = instructionText!.toJson();
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
return data;
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -658,9 +664,9 @@ class InstructionText {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
|
|
|
Map<String, dynamic> toJson() {
|
|
|
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
|
|
data['id'] = this.id;
|
|
|
|
data['id'] = id;
|
|
|
|
data['text'] = this.text;
|
|
|
|
data['text'] = text;
|
|
|
|
return data;
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -726,7 +732,8 @@ class PreventiveVisitCalibrations {
|
|
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
|
|
data['id'] = id;
|
|
|
|
data['id'] = id;
|
|
|
|
if (asset != null) {
|
|
|
|
if (asset != null) {
|
|
|
|
data['asset'] = asset!.toJson();
|
|
|
|
// data['asset'] = asset!.toJson();
|
|
|
|
|
|
|
|
data['assetId'] = asset?.id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
data['calibrationDateOfTesters'] = calibrationDateOfTesters;
|
|
|
|
data['calibrationDateOfTesters'] = calibrationDateOfTesters;
|
|
|
|
return data;
|
|
|
|
return data;
|
|
|
|
@ -737,18 +744,19 @@ class PreventiveVisitSuppliers {
|
|
|
|
int? id;
|
|
|
|
int? id;
|
|
|
|
SupplierDetails? supplier;
|
|
|
|
SupplierDetails? supplier;
|
|
|
|
SuppPersons? suppPerson;
|
|
|
|
SuppPersons? suppPerson;
|
|
|
|
String? startDateTime;
|
|
|
|
DateTime? startDateTime;
|
|
|
|
String? endDateTime;
|
|
|
|
DateTime? endDateTime;
|
|
|
|
|
|
|
|
TextEditingController? workingHoursController;
|
|
|
|
num? workingHours;
|
|
|
|
num? workingHours;
|
|
|
|
|
|
|
|
|
|
|
|
PreventiveVisitSuppliers({this.id, this.supplier, this.suppPerson, this.startDateTime, this.endDateTime, this.workingHours});
|
|
|
|
PreventiveVisitSuppliers({this.id, this.supplier, this.suppPerson, this.startDateTime, this.endDateTime, this.workingHours, this.workingHoursController});
|
|
|
|
|
|
|
|
|
|
|
|
PreventiveVisitSuppliers.fromJson(Map<String, dynamic> json) {
|
|
|
|
PreventiveVisitSuppliers.fromJson(Map<String, dynamic> json) {
|
|
|
|
id = json['id'];
|
|
|
|
id = json['id'];
|
|
|
|
supplier = json['supplier'] != null ? SupplierDetails.fromJson(json['supplier']) : null;
|
|
|
|
supplier = json['supplier'] != null ? SupplierDetails.fromJson(json['supplier']) : null;
|
|
|
|
suppPerson = json['suppPerson'] != null ? SuppPersons.fromJson(json['suppPerson']) : null;
|
|
|
|
suppPerson = json['suppPerson'] != null ? SuppPersons.fromJson(json['suppPerson']) : null;
|
|
|
|
startDateTime = json['startDateTime'];
|
|
|
|
startDateTime = json['startDateTime'] != null ? DateTime.parse(json['startDateTime']) : null;
|
|
|
|
endDateTime = json['endDateTime'];
|
|
|
|
endDateTime = json['endDateTime'] != null ? DateTime.parse(json['endDateTime']) : null;
|
|
|
|
workingHours = json['workingHours'];
|
|
|
|
workingHours = json['workingHours'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -756,13 +764,15 @@ class PreventiveVisitSuppliers {
|
|
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
|
|
data['id'] = id;
|
|
|
|
data['id'] = id;
|
|
|
|
if (supplier != null) {
|
|
|
|
if (supplier != null) {
|
|
|
|
data['supplier'] = supplier!.toJson();
|
|
|
|
// data['supplier'] = supplier!.toJson();
|
|
|
|
|
|
|
|
data['supplierId'] = supplier?.id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (suppPerson != null) {
|
|
|
|
if (suppPerson != null) {
|
|
|
|
data['suppPerson'] = suppPerson!.toJson();
|
|
|
|
// data['suppPerson'] = suppPerson!.toJson();
|
|
|
|
|
|
|
|
data['suppPersonId'] = suppPerson?.id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
data['startDateTime'] = startDateTime;
|
|
|
|
data['startDateTime'] = startDateTime?.toIso8601String();
|
|
|
|
data['endDateTime'] = endDateTime;
|
|
|
|
data['endDateTime'] = endDateTime?.toIso8601String();
|
|
|
|
data['workingHours'] = workingHours;
|
|
|
|
data['workingHours'] = workingHours;
|
|
|
|
return data;
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -851,7 +861,7 @@ class Supplier {
|
|
|
|
if (json['suppPersons'] != null) {
|
|
|
|
if (json['suppPersons'] != null) {
|
|
|
|
suppPersons = <SuppPersons>[];
|
|
|
|
suppPersons = <SuppPersons>[];
|
|
|
|
json['suppPersons'].forEach((v) {
|
|
|
|
json['suppPersons'].forEach((v) {
|
|
|
|
suppPersons!.add(new SuppPersons.fromJson(v));
|
|
|
|
suppPersons!.add(SuppPersons.fromJson(v));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (json['suppTCodes'] != null) {
|
|
|
|
if (json['suppTCodes'] != null) {
|
|
|
|
@ -921,7 +931,7 @@ class Supplier {
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Map<String, dynamic> toJson() {
|
|
|
|
// Map<String, dynamic> toJson() {
|
|
|
|
// final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
|
|
// final Map<String, dynamic> data = Map<String, dynamic>();
|
|
|
|
// data['id'] = this.id;
|
|
|
|
// data['id'] = this.id;
|
|
|
|
// data['supplierId'] = this.supplierId;
|
|
|
|
// data['supplierId'] = this.supplierId;
|
|
|
|
// data['personName'] = this.personName;
|
|
|
|
// data['personName'] = this.personName;
|
|
|
|
@ -941,14 +951,15 @@ class PreventiveVisitKits {
|
|
|
|
|
|
|
|
|
|
|
|
PreventiveVisitKits.fromJson(Map<String, dynamic> json) {
|
|
|
|
PreventiveVisitKits.fromJson(Map<String, dynamic> json) {
|
|
|
|
id = json['id'];
|
|
|
|
id = json['id'];
|
|
|
|
partCatalogItem = json['partCatalogItem'] != null ? new PartCatalogItem.fromJson(json['partCatalogItem']) : null;
|
|
|
|
partCatalogItem = json['partCatalogItem'] != null ? PartCatalogItem.fromJson(json['partCatalogItem']) : null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
|
|
|
Map<String, dynamic> toJson() {
|
|
|
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
|
|
final Map<String, dynamic> data = Map<String, dynamic>();
|
|
|
|
data['id'] = id;
|
|
|
|
data['id'] = id;
|
|
|
|
if (partCatalogItem != null) {
|
|
|
|
if (partCatalogItem != null) {
|
|
|
|
data['partCatalogItem'] = partCatalogItem!.toJson();
|
|
|
|
// data['partCatalogItem'] = partCatalogItem!.toJson();
|
|
|
|
|
|
|
|
data['partCatalogItemId'] = partCatalogItem?.id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return data;
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|