|
|
|
|
@ -22,7 +22,6 @@ import 'package:test_sa/views/app_style/sizing.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/app_text_form_field.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/buttons/app_back_button.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/buttons/app_button.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/equipment/auto_complete_devices_field.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/images/mini_one_image_picker.dart';
|
|
|
|
|
@ -35,6 +34,7 @@ import 'package:test_sa/views/widgets/status/report/service_report_reasons.dart'
|
|
|
|
|
import 'package:test_sa/views/widgets/titles/app_sub_title.dart';
|
|
|
|
|
|
|
|
|
|
import '../../../../../controllers/providers/api/status_drop_down/report/service_types_provider.dart';
|
|
|
|
|
import '../../../../widgets/date_and_time/date_picker.dart';
|
|
|
|
|
import '../../../../widgets/status/report/service_report_fault_description.dart';
|
|
|
|
|
import '../../../../widgets/status/report/service_report_repair_location.dart';
|
|
|
|
|
import '../../../../widgets/timer/app_timer.dart';
|
|
|
|
|
@ -69,7 +69,7 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
_serviceReport = ServiceReport(
|
|
|
|
|
visitDate: DateTime.now(),
|
|
|
|
|
returnToService: DateTime.now(),
|
|
|
|
|
//type: const Lookup(value: 2),
|
|
|
|
|
device: widget.request.device,
|
|
|
|
|
parts: [],
|
|
|
|
|
@ -200,63 +200,6 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
// Report type and Reasons
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
// Report Status
|
|
|
|
|
// Expanded(
|
|
|
|
|
// child: Column(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// children: [
|
|
|
|
|
// ASubTitle(_subtitle.reportType),
|
|
|
|
|
// _validate && _serviceReport.type == null ?
|
|
|
|
|
// ASubTitle(_subtitle.requiredWord,color: Colors.red,):
|
|
|
|
|
// const SizedBox.shrink(),
|
|
|
|
|
// const SizedBox(height: 4,),
|
|
|
|
|
// ServiceReportTypeMenu(
|
|
|
|
|
// initialValue: _serviceReport.type,
|
|
|
|
|
// onSelect: (status){
|
|
|
|
|
// _serviceReport.type = status;
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// const SizedBox(width: 8,),
|
|
|
|
|
// visit date
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
ASubTitle(_subtitle.visitDate),
|
|
|
|
|
_validate && _serviceReport.visitDate == null
|
|
|
|
|
? ASubTitle(
|
|
|
|
|
_subtitle.requiredWord,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
)
|
|
|
|
|
: const SizedBox.shrink(),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ADatePicker(
|
|
|
|
|
date: _serviceReport.visitDate,
|
|
|
|
|
from: DateTime.now().subtract(const Duration(days: 365)),
|
|
|
|
|
to: DateTime.now().add(const Duration(days: 365)),
|
|
|
|
|
onDatePicker: (date) {
|
|
|
|
|
_serviceReport.visitDate = date;
|
|
|
|
|
setState(() {});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
),
|
|
|
|
|
// device sn
|
|
|
|
|
Visibility(
|
|
|
|
|
visible: widget.request.deviceSerialNumber == null,
|
|
|
|
|
@ -420,6 +363,63 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 8 * AppStyle.getScaleFactor(context),
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
// Report Status
|
|
|
|
|
// Expanded(
|
|
|
|
|
// child: Column(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// children: [
|
|
|
|
|
// ASubTitle(_subtitle.reportType),
|
|
|
|
|
// _validate && _serviceReport.type == null ?
|
|
|
|
|
// ASubTitle(_subtitle.requiredWord,color: Colors.red,):
|
|
|
|
|
// const SizedBox.shrink(),
|
|
|
|
|
// const SizedBox(height: 4,),
|
|
|
|
|
// ServiceReportTypeMenu(
|
|
|
|
|
// initialValue: _serviceReport.type,
|
|
|
|
|
// onSelect: (status){
|
|
|
|
|
// _serviceReport.type = status;
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// const SizedBox(width: 8,),
|
|
|
|
|
// visit date
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
const ASubTitle("Return to Service"),
|
|
|
|
|
_validate && _serviceReport.returnToService == null
|
|
|
|
|
? ASubTitle(
|
|
|
|
|
_subtitle.requiredWord,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
)
|
|
|
|
|
: const SizedBox.shrink(),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ADatePicker(
|
|
|
|
|
date: _serviceReport.returnToService,
|
|
|
|
|
from: DateTime.now().subtract(const Duration(days: 365)),
|
|
|
|
|
to: DateTime.now().add(const Duration(days: 365)),
|
|
|
|
|
onDatePicker: (date) {
|
|
|
|
|
_serviceReport.returnToService = date;
|
|
|
|
|
setState(() {});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
),
|
|
|
|
|
ASubTitle(_subtitle.workingHours),
|
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
|
Row(
|
|
|
|
|
@ -569,7 +569,7 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
ASubTitle(_subtitle.workPreformed),
|
|
|
|
|
const ASubTitle("Solutions"),
|
|
|
|
|
// Expanded(
|
|
|
|
|
// child: SizedBox(
|
|
|
|
|
// height: 32 * AppStyle.getScaleFactor(context),
|
|
|
|
|
@ -609,7 +609,7 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
ASubTitle(_subtitle.reasons),
|
|
|
|
|
const ASubTitle("Failure Reason"),
|
|
|
|
|
_validate && _serviceReport.reason?.id == null
|
|
|
|
|
? ASubTitle(
|
|
|
|
|
_subtitle.requiredWord,
|
|
|
|
|
@ -655,7 +655,7 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
|
ASubTitle(_subtitle.travelingExpense),
|
|
|
|
|
const ASubTitle("Travel Expenses"),
|
|
|
|
|
const SizedBox(
|
|
|
|
|
height: 4,
|
|
|
|
|
),
|
|
|
|
|
@ -791,7 +791,7 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
|
ASubTitle(_subtitle.comment),
|
|
|
|
|
const ASubTitle("Technical comment"),
|
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
|
ATextFormField(
|
|
|
|
|
initialValue: _serviceReport?.comment,
|
|
|
|
|
@ -858,7 +858,7 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
ASubTitle(_subtitle.partNumber),
|
|
|
|
|
ASubTitle(_subtitle.partNumberName),
|
|
|
|
|
_validate && _serviceReport.parts == null
|
|
|
|
|
? ASubTitle(
|
|
|
|
|
_subtitle.requiredWord,
|
|
|
|
|
|