|
|
|
|
@ -16,9 +16,9 @@ import 'package:test_sa/providers/ppm_service_provider.dart';
|
|
|
|
|
import 'package:test_sa/providers/ppm_task_status_provider.dart';
|
|
|
|
|
import 'package:test_sa/service_request_latest/utilities/service_request_utils.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/date_and_time/date_picker.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/e_signature/e_signature.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/images/multi_image_picker.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/requests/request_status.dart';
|
|
|
|
|
|
|
|
|
|
import '../../../../../models/lookup.dart';
|
|
|
|
|
import '../../../../../new_views/common_widgets/app_text_form_field.dart';
|
|
|
|
|
import '../../../../../new_views/common_widgets/single_item_drop_down_menu.dart';
|
|
|
|
|
@ -77,12 +77,8 @@ class _WoInfoFormState extends State<WoInfoForm> {
|
|
|
|
|
'${context.translation.pmPlanNo}: ${widget.planPreventiveVisit.planNo}'.bodyText2(context).custom(color: AppColor.neutral120),
|
|
|
|
|
//need to add in translation it's suggestion from ahmed..
|
|
|
|
|
'Work Order Number: ${widget.planPreventiveVisit.visitNo}'.bodyText2(context).custom(color: AppColor.neutral120),
|
|
|
|
|
'${context.translation.from}: ${widget.planPreventiveVisit.fromDate?.toMonthYearFormat}'
|
|
|
|
|
.bodyText2(context)
|
|
|
|
|
.custom(color: AppColor.neutral120),
|
|
|
|
|
'${context.translation.to}: ${widget.planPreventiveVisit.toDate?.toMonthYearFormat}'
|
|
|
|
|
.bodyText2(context)
|
|
|
|
|
.custom(color: AppColor.neutral120),
|
|
|
|
|
'${context.translation.from}: ${widget.planPreventiveVisit.fromDate?.toMonthYearFormat}'.bodyText2(context).custom(color: AppColor.neutral120),
|
|
|
|
|
'${context.translation.to}: ${widget.planPreventiveVisit.toDate?.toMonthYearFormat}'.bodyText2(context).custom(color: AppColor.neutral120),
|
|
|
|
|
|
|
|
|
|
'${context.translation.nextPmDate}: ${widget.planPreventiveVisit.nextPMDate != null ? widget.planPreventiveVisit.nextPMDate!.toMonthYearFormat : '-'}'
|
|
|
|
|
.bodyText2(context)
|
|
|
|
|
@ -147,6 +143,7 @@ class _WoInfoFormState extends State<WoInfoForm> {
|
|
|
|
|
|
|
|
|
|
SingleItemDropDownMenu<Lookup, PpmTaskStatusProvider>(
|
|
|
|
|
context: context,
|
|
|
|
|
showShadow: false,
|
|
|
|
|
initialValue: widget.planPreventiveVisit.taskStatus == null ? null : Lookup(name: widget.planPreventiveVisit.taskStatus?.name ?? "", id: widget.planPreventiveVisit.taskStatus?.id),
|
|
|
|
|
title: context.translation.pmTestResult,
|
|
|
|
|
backgroundColor: AppColor.neutral100,
|
|
|
|
|
@ -176,10 +173,9 @@ class _WoInfoFormState extends State<WoInfoForm> {
|
|
|
|
|
selectedTime.hour,
|
|
|
|
|
selectedTime.minute,
|
|
|
|
|
);
|
|
|
|
|
setState(() {
|
|
|
|
|
widget.planPreventiveVisit.acutalDateOfVisit = selectedDate;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
widget.planPreventiveVisit.acutalDateOfVisit = selectedDate;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
@ -202,6 +198,7 @@ class _WoInfoFormState extends State<WoInfoForm> {
|
|
|
|
|
SingleItemDropDownMenu<Lookup, PpmElectricalSafetyProvider>(
|
|
|
|
|
context: context,
|
|
|
|
|
backgroundColor: AppColor.neutral100,
|
|
|
|
|
showShadow: false,
|
|
|
|
|
initialValue: widget.planPreventiveVisit.safety?.id == null ? null : Lookup(name: widget.planPreventiveVisit.safety?.name ?? "", id: widget.planPreventiveVisit.safety?.id),
|
|
|
|
|
title: "Electrical Safety",
|
|
|
|
|
onSelect: (value) {
|
|
|
|
|
@ -214,6 +211,7 @@ class _WoInfoFormState extends State<WoInfoForm> {
|
|
|
|
|
SingleItemDropDownMenu<Lookup, PpmAssetAvailabilityProvider>(
|
|
|
|
|
context: context,
|
|
|
|
|
backgroundColor: AppColor.neutral100,
|
|
|
|
|
showShadow: false,
|
|
|
|
|
initialValue: widget.planPreventiveVisit.assetAvailability == null
|
|
|
|
|
? null
|
|
|
|
|
: Lookup(name: widget.planPreventiveVisit.assetAvailability?.name ?? "", id: widget.planPreventiveVisit.assetAvailability?.id),
|
|
|
|
|
@ -228,6 +226,7 @@ class _WoInfoFormState extends State<WoInfoForm> {
|
|
|
|
|
SingleItemDropDownMenu<Lookup, PpmServiceProvider>(
|
|
|
|
|
context: context,
|
|
|
|
|
backgroundColor: AppColor.neutral100,
|
|
|
|
|
showShadow: false,
|
|
|
|
|
initialValue: widget.planPreventiveVisit.typeOfService == null
|
|
|
|
|
? null
|
|
|
|
|
: Lookup(name: widget.planPreventiveVisit.typeOfService?.name ?? "", id: widget.planPreventiveVisit.typeOfService?.id?.toInt()),
|
|
|
|
|
@ -251,6 +250,7 @@ class _WoInfoFormState extends State<WoInfoForm> {
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
labelText: context.translation.callComments,
|
|
|
|
|
backgroundColor: AppColor.neutral100,
|
|
|
|
|
showShadow: false,
|
|
|
|
|
initialValue: (widget.planPreventiveVisit.comments ?? "").toString(),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: Theme.of(context).textTheme.titleMedium,
|
|
|
|
|
@ -304,6 +304,10 @@ class _WoInfoFormState extends State<WoInfoForm> {
|
|
|
|
|
timerProgress: (isRunning) {},
|
|
|
|
|
onChange: (timer) async {
|
|
|
|
|
widget.planPreventiveVisit.tbsTimer = timer;
|
|
|
|
|
if (timer.startAt != null && timer.endAt != null) {
|
|
|
|
|
widget.planPreventiveVisit.timerModelList = widget.planPreventiveVisit.timerModelList ?? [];
|
|
|
|
|
widget.planPreventiveVisit.timerModelList!.add(timer);
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
|