mr number and exchange cost added

design_3.0_TM_Module
WaseemAbbasi22 3 months ago
parent 2f1efaccee
commit 8d02ff5ec1

@ -3,14 +3,14 @@ class URLs {
static const String appReleaseBuildNumber = "21";
static const host1 = "https://atomsm.hmg.com"; // production url
// static const host1 = "https://atomsmdev.hmg.com"; // local DEV url
// static const host1 = "https://atomsm.hmg.com"; // production url
static const host1 = "https://atomsmdev.hmg.com"; // local DEV url
// static const host1 = "https://atomsmuat.hmg.com"; // local UAT url
// 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/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;

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

@ -336,7 +336,7 @@ class _ServiceRequestDetailViewState extends State<ServiceRequestDetailView> {
"Attachments".addTranslation,
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) ...[
8.height,
@ -530,6 +530,14 @@ class _ServiceRequestDetailViewState extends State<ServiceRequestDetailView> {
'PO No: ${provider.currentWorkOrder!.data?.poNo ?? '-'}',
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,
prNo: currentWorkOrderData.prNo,
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,
),
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),
).expanded,

Loading…
Cancel
Save