Merge branch 'design_3.0_TM_Module_snagsFix' into design_3.0_dark_mode

design_3.0_dark_mode
WaseemAbbasi22 3 months ago
commit 0f7a8e0955

@ -3,14 +3,14 @@ class URLs {
static const String appReleaseBuildNumber = "21"; static const String appReleaseBuildNumber = "21";
static const host1 = "https://atomsm.hmg.com"; // production url // static const host1 = "https://atomsm.hmg.com"; // production url
// static const host1 = "https://atomsmdev.hmg.com"; // local DEV url static const host1 = "https://atomsmdev.hmg.com"; // local DEV url
// static const host1 = "https://atomsmuat.hmg.com"; // local UAT url // static const host1 = "https://atomsmuat.hmg.com"; // local UAT url
// static String _baseUrl = "$_host/mobile"; // static String _baseUrl = "$_host/mobile";
// static final String _baseUrl = "$_host/v2/mobile"; // new V2 apis static final String _baseUrl = "$_host/v2/mobile"; // new V2 apis
// static final String _baseUrl = "$_host/mobile"; // host local UAT // static final String _baseUrl = "$_host/mobile"; // host local UAT
static final String _baseUrl = "$_host/v3/mobile"; // v3 for new CM,PM,TM // static final String _baseUrl = "$_host/v3/mobile"; // v3 for new CM,PM,TM
static String _host = host1; static String _host = host1;

@ -170,10 +170,12 @@ class WorkOrderCostModel {
num? qAmount; num? qAmount;
String? prNo; String? prNo;
String? poNo; String? poNo;
String? mrNo;
num? exchangeCost;
WorkOrderCostModel({this.workOrderId, this.sparePartCost, this.labourCost, this.travelCost, this.qAmount, this.poNo, this.prNo}); WorkOrderCostModel({this.workOrderId, this.sparePartCost, this.labourCost, this.travelCost, this.qAmount, this.poNo, this.prNo,this.mrNo,this.exchangeCost});
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
return {'workOrderId': workOrderId, 'sparePartCost': sparePartCost, 'laborCost': labourCost, 'travelCost': travelCost, 'qAmount': qAmount, 'prNo': prNo, 'poNo': poNo}; return {'workOrderId': workOrderId, 'sparePartCost': sparePartCost, 'laborCost': labourCost, 'travelCost': travelCost, 'qAmount': qAmount, 'prNo': prNo, 'poNo': poNo,'mrNo':mrNo,'exchangeCost':exchangeCost};
} }
} }

@ -106,6 +106,8 @@ class WorkOrderData {
this.qAmount, this.qAmount,
this.prNo, this.prNo,
this.poNo, this.poNo,
this.mrNo,
this.exchangeCost,
required this.workOrderHistory, required this.workOrderHistory,
required this.activities, required this.activities,
required this.activityAssetToBeRetireds, required this.activityAssetToBeRetireds,
@ -171,6 +173,8 @@ class WorkOrderData {
num? qAmount; num? qAmount;
String? prNo; String? prNo;
String? poNo; String? poNo;
String? mrNo;
num? exchangeCost;
List<WorkOrderHistory> workOrderHistory; List<WorkOrderHistory> workOrderHistory;
List<Activities> activities; List<Activities> activities;
List<dynamic> activityAssetToBeRetireds; List<dynamic> activityAssetToBeRetireds;
@ -207,6 +211,8 @@ class WorkOrderData {
qAmount: json['qAmount'], qAmount: json['qAmount'],
prNo: json['prNo'], prNo: json['prNo'],
poNo: json['poNo'], poNo: json['poNo'],
mrNo: json['mrNo'],
exchangeCost: json['exchangeCost'],
assetType: json["assetType"] == null ? null : Lookup.fromJson(json["assetType"]), assetType: json["assetType"] == null ? null : Lookup.fromJson(json["assetType"]),
assignedEmployee: json["assignedEmployee"] == null ? null : WorkOrderAssignedEmployee.fromJson(json["assignedEmployee"]), assignedEmployee: json["assignedEmployee"] == null ? null : WorkOrderAssignedEmployee.fromJson(json["assignedEmployee"]),
lastActivityStatus: json["lastActivityStatus"] != null ? Lookup.fromJson(json["lastActivityStatus"]) : null, lastActivityStatus: json["lastActivityStatus"] != null ? Lookup.fromJson(json["lastActivityStatus"]) : null,
@ -278,6 +284,8 @@ class WorkOrderData {
"comments": comments, "comments": comments,
"voiceNote": voiceNote, "voiceNote": voiceNote,
"edd": edd, "edd": edd,
'mrNo': mrNo,
'exchangeCost': exchangeCost,
"workOrderAttachments": workOrderAttachments.map((e) => e.toJson()).toList(), "workOrderAttachments": workOrderAttachments.map((e) => e.toJson()).toList(),
"returnToService": returnToService, "returnToService": returnToService,
"serviceType": serviceType?.toJson(), "serviceType": serviceType?.toJson(),
@ -828,20 +836,19 @@ class ActivityMaintenanceAssistantEmployees {
double? workingHours; double? workingHours;
String? technicalComment; String? technicalComment;
AssignedEmployee? user; AssignedEmployee? user;
AssistantEmployees ?employee; AssistantEmployees? employee;
ActivityMaintenanceAssistantEmployees({this.startDate, this.endDate, this.workingHours, this.technicalComment, this.user,this.employee}); ActivityMaintenanceAssistantEmployees({this.startDate, this.endDate, this.workingHours, this.technicalComment, this.user, this.employee});
ActivityMaintenanceAssistantEmployees.fromJson(Map<String, dynamic> json) { ActivityMaintenanceAssistantEmployees.fromJson(Map<String, dynamic> json) {
Map<String,dynamic> assistEmpData={}; Map<String, dynamic> assistEmpData = {};
startDate = json['startDate'] != null ? DateTime.parse(json['startDate']) : null; startDate = json['startDate'] != null ? DateTime.parse(json['startDate']) : null;
endDate = json['endDate'] != null ? DateTime.parse(json['endDate']) : null; endDate = json['endDate'] != null ? DateTime.parse(json['endDate']) : null;
workingHours = json['workingHours']; workingHours = json['workingHours'];
technicalComment = json['technicalComment']; technicalComment = json['technicalComment'];
user = json['user'] != null ? AssignedEmployee.fromJson(json['user']) : null; user = json['user'] != null ? AssignedEmployee.fromJson(json['user']) : null;
if(json['user']!=null) { if (json['user'] != null) {
assistEmpData = { assistEmpData = {
'id': null, 'id': null,
'user': { 'user': {
@ -866,7 +873,6 @@ class ActivityMaintenanceAssistantEmployees {
} }
} }
// class ActivityMaintenanceAssistantEmployees { // class ActivityMaintenanceAssistantEmployees {
// DateTime? startDate; // DateTime? startDate;
// DateTime? endDate; // DateTime? endDate;
@ -923,27 +929,25 @@ class ActivityMaintenanceTimers {
} }
} }
class AssistantEmployeesModel { class AssistantEmployeesModel {
DateTime? startDate; DateTime? startDate;
DateTime? endDate; DateTime? endDate;
double? workingHours; double? workingHours;
String? technicalComment; String? technicalComment;
AssignedEmployee? user; AssignedEmployee? user;
AssistantEmployees ?employee; AssistantEmployees? employee;
AssistantEmployeesModel({this.startDate, this.endDate, this.workingHours, this.technicalComment, this.user,this.employee}); AssistantEmployeesModel({this.startDate, this.endDate, this.workingHours, this.technicalComment, this.user, this.employee});
AssistantEmployeesModel.fromJson(Map<String, dynamic> json) { AssistantEmployeesModel.fromJson(Map<String, dynamic> json) {
Map<String,dynamic> assistEmpData={}; Map<String, dynamic> assistEmpData = {};
startDate = json['startDate'] != null ? DateTime.parse(json['startDate']) : null; startDate = json['startDate'] != null ? DateTime.parse(json['startDate']) : null;
endDate = json['endDate'] != null ? DateTime.parse(json['endDate']) : null; endDate = json['endDate'] != null ? DateTime.parse(json['endDate']) : null;
workingHours = json['workingHours']; workingHours = json['workingHours'];
technicalComment = json['technicalComment']; technicalComment = json['technicalComment'];
user = json['user'] != null ? AssignedEmployee.fromJson(json['user']) : null; user = json['user'] != null ? AssignedEmployee.fromJson(json['user']) : null;
if(json['user']!=null) { if (json['user'] != null) {
assistEmpData = { assistEmpData = {
'id': null, 'id': null,
'user': { 'user': {

@ -337,7 +337,7 @@ class _ServiceRequestDetailViewState extends State<ServiceRequestDetailView> {
"Attachments".addTranslation, "Attachments".addTranslation,
style: AppTextStyles.heading4.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50), style: AppTextStyles.heading4.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
), ),
FilesList(images: _attachments.map((toElement) => URLs.getFileUrl(toElement.name!)!).toList()), FilesList(images: _attachments.map((toElement) => URLs.getFileUrl(toElement.name!)??'').toList()),
], ],
if (!requestProvider.isReadOnlyRequest && workOrder.nextStep?.workOrderNextStepEnum == WorkOrderNextStepEnum.activity) ...[ if (!requestProvider.isReadOnlyRequest && workOrder.nextStep?.workOrderNextStepEnum == WorkOrderNextStepEnum.activity) ...[
8.height, 8.height,
@ -532,6 +532,14 @@ class _ServiceRequestDetailViewState extends State<ServiceRequestDetailView> {
'PO No: ${provider.currentWorkOrder!.data?.poNo ?? '-'}', 'PO No: ${provider.currentWorkOrder!.data?.poNo ?? '-'}',
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120), style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
), ),
Text(
'MR No: ${provider.currentWorkOrder!.data?.mrNo ?? '-'}',
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
),
Text(
'Exchange Cost: ${provider.currentWorkOrder!.data?.exchangeCost ?? '-'}',
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
),
], ],
), ),
], ],

@ -46,6 +46,8 @@ class _CostDetailFormScreenState extends State<CostDetailFormScreen> with Ticker
qAmount: currentWorkOrderData.qAmount, qAmount: currentWorkOrderData.qAmount,
prNo: currentWorkOrderData.prNo, prNo: currentWorkOrderData.prNo,
poNo: currentWorkOrderData.poNo, poNo: currentWorkOrderData.poNo,
mrNo: currentWorkOrderData.mrNo,
exchangeCost: currentWorkOrderData.exchangeCost,
); );
} }
@ -152,6 +154,34 @@ class _CostDetailFormScreenState extends State<CostDetailFormScreen> with Ticker
}, },
style: Theme.of(context).textTheme.titleMedium, style: Theme.of(context).textTheme.titleMedium,
), ),
8.height,
AppTextFormField(
labelText: "MR No",
backgroundColor: AppColor.neutral100,
initialValue: requestDetailProvider.workOrderCostModel?.mrNo,
textAlign: TextAlign.center,
labelStyle: AppTextStyles.textFieldLabelStyle,
textInputType: TextInputType.text,
showShadow: false,
onChange: (value) {
requestDetailProvider.workOrderCostModel?.mrNo = value;
},
style: Theme.of(context).textTheme.titleMedium,
),
8.height,
AppTextFormField(
labelText: "Exchange Cost",
backgroundColor: AppColor.neutral100,
initialValue: requestDetailProvider.workOrderCostModel?.exchangeCost!=null?requestDetailProvider.workOrderCostModel?.exchangeCost.toString():'',
textAlign: TextAlign.center,
labelStyle: AppTextStyles.textFieldLabelStyle,
textInputType: const TextInputType.numberWithOptions(decimal: true),
showShadow: false,
onChange: (value) {
requestDetailProvider.workOrderCostModel?.exchangeCost = num.parse(value);
},
style: Theme.of(context).textTheme.titleMedium,
),
], ],
).toShadowContainer(context).paddingAll(16), ).toShadowContainer(context).paddingAll(16),
).expanded, ).expanded,

Loading…
Cancel
Save