|
|
|
|
@ -104,7 +104,7 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
|
getRequestForWorkOrder();
|
|
|
|
|
}
|
|
|
|
|
_serviceReport.assetType = _assetTypeProvider.statuses?.firstWhere(
|
|
|
|
|
(element) => element.value == _callRequestForWorkOrder?.assetType,
|
|
|
|
|
(element) => element.value == _callRequestForWorkOrder?.assetType,
|
|
|
|
|
orElse: () => null,
|
|
|
|
|
);
|
|
|
|
|
_subtitle = AppLocalization.of(context).subtitle;
|
|
|
|
|
@ -158,15 +158,15 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
|
widget.request.deviceSerialNumber == null
|
|
|
|
|
? const SizedBox()
|
|
|
|
|
: ASubTitle(
|
|
|
|
|
"${_subtitle.deviceSN}: ${widget.request.deviceSerialNumber}",
|
|
|
|
|
font: 14,
|
|
|
|
|
),
|
|
|
|
|
"${_subtitle.deviceSN}: ${widget.request.deviceSerialNumber}",
|
|
|
|
|
font: 14,
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
"${_subtitle.customer}: ${widget.request.hospitalName}",
|
|
|
|
|
style: Theme.of(context).textTheme.subtitle1.copyWith(
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
),
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
),
|
|
|
|
|
textScaleFactor: AppStyle.getScaleFactor(context),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
@ -226,9 +226,9 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
|
ASubTitle(_subtitle.visitDate),
|
|
|
|
|
_validate && _serviceReport.visitDate == null
|
|
|
|
|
? ASubTitle(
|
|
|
|
|
_subtitle.requiredWord,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
)
|
|
|
|
|
_subtitle.requiredWord,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
)
|
|
|
|
|
: const SizedBox.shrink(),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
@ -262,9 +262,9 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
|
ASubTitle(_subtitle.deviceSN),
|
|
|
|
|
_validate && _serviceReport.device?.id == null
|
|
|
|
|
? ASubTitle(
|
|
|
|
|
_subtitle.requiredWord,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
)
|
|
|
|
|
_subtitle.requiredWord,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
)
|
|
|
|
|
: const SizedBox.shrink(),
|
|
|
|
|
AutoCompleteDeviceField(
|
|
|
|
|
hospitalId: widget.request.hospitalId,
|
|
|
|
|
@ -281,9 +281,9 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
|
ASubTitle(_subtitle.AssetType),
|
|
|
|
|
_validate && _serviceReport.assetType == null
|
|
|
|
|
? ASubTitle(
|
|
|
|
|
_subtitle.requiredWord,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
)
|
|
|
|
|
_subtitle.requiredWord,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
)
|
|
|
|
|
: const SizedBox.shrink(),
|
|
|
|
|
const SizedBox(
|
|
|
|
|
height: 4,
|
|
|
|
|
@ -296,7 +296,7 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
|
_assetTypeProvider.reset();
|
|
|
|
|
await _assetTypeProvider.getTypes(user: _userProvider.user, host: _settingProvider.host);
|
|
|
|
|
_serviceReport?.assetType = _assetTypeProvider.statuses?.firstWhere(
|
|
|
|
|
(element) => element.value == _callRequestForWorkOrder.assetType,
|
|
|
|
|
(element) => element.value == _callRequestForWorkOrder.assetType,
|
|
|
|
|
orElse: () => null,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
@ -327,9 +327,9 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
|
ASubTitle("Equipment Status"),
|
|
|
|
|
_validate && _serviceReport.equipmentStatus == null
|
|
|
|
|
? ASubTitle(
|
|
|
|
|
_subtitle.requiredWord,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
)
|
|
|
|
|
_subtitle.requiredWord,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
)
|
|
|
|
|
: const SizedBox.shrink(),
|
|
|
|
|
const SizedBox(
|
|
|
|
|
height: 4,
|
|
|
|
|
@ -367,9 +367,9 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
|
ASubTitle(_subtitle.callLastSituation),
|
|
|
|
|
_validate && _serviceReport.callLastSituation == null
|
|
|
|
|
? ASubTitle(
|
|
|
|
|
_subtitle.requiredWord,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
)
|
|
|
|
|
_subtitle.requiredWord,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
)
|
|
|
|
|
: const SizedBox.shrink(),
|
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
|
ServiceReportLastCallsMenu(
|
|
|
|
|
@ -504,54 +504,54 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
|
_serviceReport.callLastSituation?.value != 12
|
|
|
|
|
? const SizedBox.shrink()
|
|
|
|
|
: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
ASubTitle(_subtitle.invoiceNumber),
|
|
|
|
|
const SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
),
|
|
|
|
|
ATextFormField(
|
|
|
|
|
initialValue: _serviceReport?.invoiceNumber,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: Theme.of(context).textTheme.subtitle1,
|
|
|
|
|
validator: (value) => Validator.hasValue(value) ? null : _subtitle.requiredWord,
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
_serviceReport.invoiceNumber = value;
|
|
|
|
|
},
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
ASubTitle(_subtitle.invoiceNumber),
|
|
|
|
|
const SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
),
|
|
|
|
|
ATextFormField(
|
|
|
|
|
initialValue: _serviceReport?.invoiceNumber,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: Theme.of(context).textTheme.subtitle1,
|
|
|
|
|
validator: (value) => Validator.hasValue(value) ? null : _subtitle.requiredWord,
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
_serviceReport.invoiceNumber = value;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
ASubTitle(_subtitle.invoiceCode),
|
|
|
|
|
const SizedBox(
|
|
|
|
|
height: 4,
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
ATextFormField(
|
|
|
|
|
initialValue: _serviceReport?.invoiceCode,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: Theme.of(context).textTheme.subtitle1,
|
|
|
|
|
validator: (value) => Validator.hasValue(value) ? null : _subtitle.requiredWord,
|
|
|
|
|
textInputType: TextInputType.text,
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
_serviceReport.invoiceCode = value;
|
|
|
|
|
},
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
ASubTitle(_subtitle.invoiceCode),
|
|
|
|
|
const SizedBox(
|
|
|
|
|
height: 4,
|
|
|
|
|
),
|
|
|
|
|
ATextFormField(
|
|
|
|
|
initialValue: _serviceReport?.invoiceCode,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: Theme.of(context).textTheme.subtitle1,
|
|
|
|
|
validator: (value) => Validator.hasValue(value) ? null : _subtitle.requiredWord,
|
|
|
|
|
textInputType: TextInputType.text,
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
_serviceReport.invoiceCode = value;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
// const SizedBox(height: 8,),
|
|
|
|
|
// Row(
|
|
|
|
|
@ -958,9 +958,9 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
|
ASubTitle(_subtitle.partNumber),
|
|
|
|
|
_validate && _serviceReport.parts == null
|
|
|
|
|
? ASubTitle(
|
|
|
|
|
_subtitle.requiredWord,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
)
|
|
|
|
|
_subtitle.requiredWord,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
)
|
|
|
|
|
: const SizedBox.shrink(),
|
|
|
|
|
const SizedBox(
|
|
|
|
|
height: 4,
|
|
|
|
|
|