|
|
|
@ -101,6 +101,7 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
child: Stack(
|
|
|
|
child: Stack(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
ListView(
|
|
|
|
ListView(
|
|
|
|
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
//AppNameBar(),
|
|
|
|
//AppNameBar(),
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(
|
|
|
|
@ -115,22 +116,22 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
Column(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
ASubTitle("Caller Info"),
|
|
|
|
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
|
|
width: double.infinity,
|
|
|
|
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
decoration: BoxDecoration(color: AColors.grey, borderRadius: BorderRadius.circular(AppStyle.getBorderRadius(context)), boxShadow: [
|
|
|
|
margin: const EdgeInsets.symmetric(vertical: 16),
|
|
|
|
const BoxShadow(
|
|
|
|
decoration: BoxDecoration(color: AColors.grey, borderRadius: BorderRadius.circular(AppStyle.getBorderRadius(context)), boxShadow: const [
|
|
|
|
|
|
|
|
BoxShadow(
|
|
|
|
color: AColors.grey,
|
|
|
|
color: AColors.grey,
|
|
|
|
offset: Offset(0, -1),
|
|
|
|
offset: Offset(0, -1),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
]),
|
|
|
|
]),
|
|
|
|
child: Column(
|
|
|
|
child: Wrap(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
const SizedBox(
|
|
|
|
|
|
|
|
height: 8,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Wrap(
|
|
|
|
|
|
|
|
spacing: 10,
|
|
|
|
spacing: 10,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
ASubTitle(
|
|
|
|
ASubTitle(
|
|
|
|
@ -153,8 +154,22 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const Divider(),
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ASubTitle("Work Order Details"),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
|
|
|
|
margin: const EdgeInsets.symmetric(vertical: 16),
|
|
|
|
|
|
|
|
decoration: BoxDecoration(color: AColors.grey, borderRadius: BorderRadius.circular(AppStyle.getBorderRadius(context)), boxShadow: [
|
|
|
|
|
|
|
|
BoxShadow(
|
|
|
|
|
|
|
|
color: AColors.grey,
|
|
|
|
|
|
|
|
offset: Offset(0, -1),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
]),
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
// Report type and Reasons
|
|
|
|
// Report type and Reasons
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
@ -383,7 +398,9 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
ATextFormField(
|
|
|
|
ATextFormField(
|
|
|
|
initialValue: null,
|
|
|
|
initialValue: null,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
hintText: _serviceReport.startDate == null ? "0" : _serviceReport?.endDate?.difference(_serviceReport?.startDate)?.inHours?.toString() ?? "0",
|
|
|
|
hintText: _serviceReport.startDate == null
|
|
|
|
|
|
|
|
? "0"
|
|
|
|
|
|
|
|
: ((_serviceReport?.endDate?.difference(_serviceReport?.startDate)?.inMinutes ?? 0) / 60)?.toStringAsFixed(2)?.toString() ?? "0",
|
|
|
|
enable: false,
|
|
|
|
enable: false,
|
|
|
|
style: Theme.of(context).textTheme.subtitle1,
|
|
|
|
style: Theme.of(context).textTheme.subtitle1,
|
|
|
|
validator: (value) => Validator.isNumeric(value) ? null : _subtitle.requiredWord,
|
|
|
|
validator: (value) => Validator.isNumeric(value) ? null : _subtitle.requiredWord,
|
|
|
|
@ -396,28 +413,22 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 8 * AppStyle.getScaleFactor(context),
|
|
|
|
height: 8 * AppStyle.getScaleFactor(context),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// const ASubTitle("Assigned Employee"),
|
|
|
|
const ASubTitle("Assigned Employee"),
|
|
|
|
// const SizedBox(
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
// height: 8,
|
|
|
|
_validate && _serviceReport.engineer == null
|
|
|
|
// ),
|
|
|
|
? ASubTitle(
|
|
|
|
// _validate && _serviceReport.engineer == null
|
|
|
|
_subtitle.requiredWord,
|
|
|
|
// ? ASubTitle(
|
|
|
|
color: Colors.red,
|
|
|
|
// _subtitle.requiredWord,
|
|
|
|
)
|
|
|
|
// color: Colors.red,
|
|
|
|
: const SizedBox.shrink(),
|
|
|
|
// )
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
// : const SizedBox.shrink(),
|
|
|
|
EngineersMenu(
|
|
|
|
// const SizedBox(
|
|
|
|
initialValue: _serviceReport.engineer,
|
|
|
|
// height: 4,
|
|
|
|
onSelect: (engineer) {
|
|
|
|
// ),
|
|
|
|
_serviceReport.engineer = engineer;
|
|
|
|
// EngineersMenu(
|
|
|
|
},
|
|
|
|
// initialValue: _serviceReport.engineer,
|
|
|
|
),
|
|
|
|
// onSelect: (engineer) {
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
// _serviceReport.engineer = engineer;
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// const SizedBox(
|
|
|
|
|
|
|
|
// height: 8,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// invoice number & code
|
|
|
|
// invoice number & code
|
|
|
|
_serviceReport.callLastSituation?.id != 12
|
|
|
|
_serviceReport.callLastSituation?.id != 12
|
|
|
|
? const SizedBox.shrink()
|
|
|
|
? const SizedBox.shrink()
|
|
|
|
@ -444,17 +455,13 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(width: 8),
|
|
|
|
width: 8,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
ASubTitle(_subtitle.invoiceCode),
|
|
|
|
ASubTitle(_subtitle.invoiceCode),
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
height: 4,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
ATextFormField(
|
|
|
|
ATextFormField(
|
|
|
|
initialValue: _serviceReport?.invoiceCode,
|
|
|
|
initialValue: _serviceReport?.invoiceCode,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
@ -485,9 +492,7 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
height: 4,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
ATextFormField(
|
|
|
|
ATextFormField(
|
|
|
|
initialValue: _serviceReport?.faultDescriptionId?.toString(),
|
|
|
|
initialValue: _serviceReport?.faultDescriptionId?.toString(),
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
@ -499,9 +504,7 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
_serviceReport.faultDescriptionId = int.tryParse(value) ?? 0;
|
|
|
|
_serviceReport.faultDescriptionId = int.tryParse(value) ?? 0;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
height: 8,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
ASubTitle(_subtitle.workPreformed),
|
|
|
|
ASubTitle(_subtitle.workPreformed),
|
|
|
|
@ -516,9 +519,7 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
height: 4,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
ATextFormField(
|
|
|
|
ATextFormField(
|
|
|
|
initialValue: _serviceReport?.workPreformed,
|
|
|
|
initialValue: _serviceReport?.workPreformed,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
@ -530,13 +531,9 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
_serviceReport.workPreformed = value;
|
|
|
|
_serviceReport.workPreformed = value;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
height: 8,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
height: 8,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
// reasons
|
|
|
|
// reasons
|
|
|
|
@ -545,9 +542,7 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
ASubTitle(_subtitle.reasons),
|
|
|
|
ASubTitle(_subtitle.reasons),
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
height: 4,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
ServiceReportReasonsMenu(
|
|
|
|
ServiceReportReasonsMenu(
|
|
|
|
initialValue: _serviceReport.reason,
|
|
|
|
initialValue: _serviceReport.reason,
|
|
|
|
onSelect: (status) {
|
|
|
|
onSelect: (status) {
|
|
|
|
@ -557,9 +552,7 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(width: 8),
|
|
|
|
width: 8,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
@ -578,22 +571,16 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
height: 8,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
ASubTitle(_subtitle.repairLocation),
|
|
|
|
ASubTitle(_subtitle.repairLocation),
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
height: 4,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
ServiceReportRepairLocation(
|
|
|
|
ServiceReportRepairLocation(
|
|
|
|
initialValue: _serviceReport.repairLocation,
|
|
|
|
initialValue: _serviceReport.repairLocation,
|
|
|
|
onSelect: (status) {
|
|
|
|
onSelect: (status) {
|
|
|
|
_serviceReport.repairLocation = status;
|
|
|
|
_serviceReport.repairLocation = status;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
height: 16,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
ASubTitle(_subtitle.travelingExpense),
|
|
|
|
ASubTitle(_subtitle.travelingExpense),
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(
|
|
|
|
height: 4,
|
|
|
|
height: 4,
|
|
|
|
@ -662,7 +649,7 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
height: 4,
|
|
|
|
height: 4,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
ATextFormField(
|
|
|
|
ATextFormField(
|
|
|
|
initialValue: _serviceReport?.travelingHours,
|
|
|
|
initialValue: _serviceReport?.travelingHours?.toString(),
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
hintText: "i.e 3, 3.5, 4",
|
|
|
|
hintText: "i.e 3, 3.5, 4",
|
|
|
|
style: Theme.of(context).textTheme.subtitle1,
|
|
|
|
style: Theme.of(context).textTheme.subtitle1,
|
|
|
|
@ -671,7 +658,7 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
// ? null : _subtitle.requiredWord,
|
|
|
|
// ? null : _subtitle.requiredWord,
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
onSaved: (value) {
|
|
|
|
onSaved: (value) {
|
|
|
|
_serviceReport.travelingHours = value;
|
|
|
|
_serviceReport.travelingHours = double.tryParse(value) ?? 0.0;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -729,13 +716,9 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
// ],
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
|
|
|
|
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
height: 8,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
ASubTitle(_subtitle.comment),
|
|
|
|
ASubTitle(_subtitle.comment),
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
height: 4,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
ATextFormField(
|
|
|
|
ATextFormField(
|
|
|
|
initialValue: _serviceReport?.comment,
|
|
|
|
initialValue: _serviceReport?.comment,
|
|
|
|
hintText: "Technical Comment",
|
|
|
|
hintText: "Technical Comment",
|
|
|
|
@ -759,9 +742,7 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
_serviceReport.signatureNurse = "${DateTime.now().toIso8601String()}.png|${base64Encode(signature)}";
|
|
|
|
_serviceReport.signatureNurse = "${DateTime.now().toIso8601String()}.png|${base64Encode(signature)}";
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
height: 8,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
const ASubTitle("Engineer Signature"),
|
|
|
|
const ASubTitle("Engineer Signature"),
|
|
|
|
ESignature(
|
|
|
|
ESignature(
|
|
|
|
oldSignature: _serviceReport.signatureEngineer,
|
|
|
|
oldSignature: _serviceReport.signatureEngineer,
|
|
|
|
@ -777,7 +758,25 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(
|
|
|
|
height: 8,
|
|
|
|
height: 8,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
// Part Number and Quantity
|
|
|
|
// Part Number and Quantity
|
|
|
|
|
|
|
|
ASubTitle("Spare Parts"),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
|
|
|
|
margin: const EdgeInsets.symmetric(vertical: 16),
|
|
|
|
|
|
|
|
decoration: BoxDecoration(color: AColors.grey, borderRadius: BorderRadius.circular(AppStyle.getBorderRadius(context)), boxShadow: [
|
|
|
|
|
|
|
|
BoxShadow(
|
|
|
|
|
|
|
|
color: AColors.grey,
|
|
|
|
|
|
|
|
offset: Offset(0, -1),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
]),
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
@ -832,16 +831,16 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
],
|
|
|
|
padding: const EdgeInsets.all(16.0),
|
|
|
|
),
|
|
|
|
child: AButton(
|
|
|
|
AButton(
|
|
|
|
text: _subtitle.submit,
|
|
|
|
text: _subtitle.submit,
|
|
|
|
onPressed: () async {
|
|
|
|
onPressed: () async {
|
|
|
|
_validate = true;
|
|
|
|
_validate = true;
|
|
|
|
if (!_formKey.currentState.validate()) {
|
|
|
|
// if (!_formKey.currentState.validate()) {
|
|
|
|
setState(() {});
|
|
|
|
// setState(() {});
|
|
|
|
return;
|
|
|
|
// return;
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
if (!_serviceReport.validate()) return;
|
|
|
|
if (!_serviceReport.validate()) return;
|
|
|
|
_formKey.currentState.save();
|
|
|
|
_formKey.currentState.save();
|
|
|
|
|
|
|
|
|
|
|
|
@ -872,7 +871,6 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(
|
|
|
|
height: 300,
|
|
|
|
height: 300,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|