|
|
|
@ -8,9 +8,12 @@ import 'package:test_sa/controllers/api_routes/http_status_manger.dart';
|
|
|
|
import 'package:test_sa/controllers/localization/localization.dart';
|
|
|
|
import 'package:test_sa/controllers/localization/localization.dart';
|
|
|
|
import 'package:test_sa/controllers/providers/api/service_requests_provider.dart';
|
|
|
|
import 'package:test_sa/controllers/providers/api/service_requests_provider.dart';
|
|
|
|
import 'package:test_sa/controllers/providers/api/status_drop_down/report/service_report_last_calls_provider.dart';
|
|
|
|
import 'package:test_sa/controllers/providers/api/status_drop_down/report/service_report_last_calls_provider.dart';
|
|
|
|
|
|
|
|
import 'package:test_sa/controllers/providers/api/status_drop_down/report/service_types_provider.dart';
|
|
|
|
import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
|
|
import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
|
|
import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
|
|
import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
|
|
import 'package:test_sa/controllers/validator/validator.dart';
|
|
|
|
import 'package:test_sa/controllers/validator/validator.dart';
|
|
|
|
|
|
|
|
import 'package:test_sa/models/call_request_for_work_order_model.dart';
|
|
|
|
|
|
|
|
import 'package:test_sa/models/engineer.dart';
|
|
|
|
import 'package:test_sa/models/part.dart';
|
|
|
|
import 'package:test_sa/models/part.dart';
|
|
|
|
import 'package:test_sa/models/service_report.dart';
|
|
|
|
import 'package:test_sa/models/service_report.dart';
|
|
|
|
import 'package:test_sa/models/service_request/service_request.dart';
|
|
|
|
import 'package:test_sa/models/service_request/service_request.dart';
|
|
|
|
@ -21,6 +24,7 @@ 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_back_button.dart';
|
|
|
|
import 'package:test_sa/views/widgets/buttons/app_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/date_and_time/date_picker.dart';
|
|
|
|
|
|
|
|
import 'package:test_sa/views/widgets/date_and_time/time_picker.dart';
|
|
|
|
import 'package:test_sa/views/widgets/e_signature/e_signature.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/equipment/auto_complete_devices_field.dart';
|
|
|
|
import 'package:test_sa/views/widgets/images/mini_one_image_picker.dart';
|
|
|
|
import 'package:test_sa/views/widgets/images/mini_one_image_picker.dart';
|
|
|
|
@ -28,8 +32,11 @@ import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
|
|
|
|
import 'package:test_sa/views/widgets/parts/auto_complete_parts_field.dart';
|
|
|
|
import 'package:test_sa/views/widgets/parts/auto_complete_parts_field.dart';
|
|
|
|
import 'package:test_sa/views/widgets/parts/part_item.dart';
|
|
|
|
import 'package:test_sa/views/widgets/parts/part_item.dart';
|
|
|
|
import 'package:test_sa/views/widgets/status/employee/engineers_mune.dart';
|
|
|
|
import 'package:test_sa/views/widgets/status/employee/engineers_mune.dart';
|
|
|
|
|
|
|
|
import 'package:test_sa/views/widgets/status/report/service_report_equipment_status.dart';
|
|
|
|
|
|
|
|
import 'package:test_sa/views/widgets/status/report/service_report_fault_description.dart';
|
|
|
|
import 'package:test_sa/views/widgets/status/report/service_report_last_call.dart';
|
|
|
|
import 'package:test_sa/views/widgets/status/report/service_report_last_call.dart';
|
|
|
|
import 'package:test_sa/views/widgets/status/report/service_report_reasons.dart';
|
|
|
|
import 'package:test_sa/views/widgets/status/report/service_report_reasons.dart';
|
|
|
|
|
|
|
|
import 'package:test_sa/views/widgets/status/report/service_report_repair_location.dart';
|
|
|
|
import 'package:test_sa/views/widgets/status/report/service_report_status.dart';
|
|
|
|
import 'package:test_sa/views/widgets/status/report/service_report_status.dart';
|
|
|
|
import 'package:test_sa/views/widgets/status/report/service_report_type.dart';
|
|
|
|
import 'package:test_sa/views/widgets/status/report/service_report_type.dart';
|
|
|
|
import 'package:test_sa/views/widgets/status/report/service_status.dart';
|
|
|
|
import 'package:test_sa/views/widgets/status/report/service_status.dart';
|
|
|
|
@ -42,6 +49,7 @@ class EditServiceReport extends StatefulWidget {
|
|
|
|
final ServiceReport report;
|
|
|
|
final ServiceReport report;
|
|
|
|
|
|
|
|
|
|
|
|
const EditServiceReport({Key key, this.request, this.report}) : super(key: key);
|
|
|
|
const EditServiceReport({Key key, this.request, this.report}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
_EditServiceReportState createState() => _EditServiceReportState();
|
|
|
|
_EditServiceReportState createState() => _EditServiceReportState();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -54,6 +62,7 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
bool _validate = false;
|
|
|
|
bool _validate = false;
|
|
|
|
ServiceReport _serviceReport;
|
|
|
|
ServiceReport _serviceReport;
|
|
|
|
bool _isLoading = false;
|
|
|
|
bool _isLoading = false;
|
|
|
|
|
|
|
|
bool _showCommentField = false;
|
|
|
|
|
|
|
|
|
|
|
|
Subtitle _subtitle;
|
|
|
|
Subtitle _subtitle;
|
|
|
|
File _image;
|
|
|
|
File _image;
|
|
|
|
@ -62,12 +71,26 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
TextEditingController _faultController = TextEditingController();
|
|
|
|
TextEditingController _faultController = TextEditingController();
|
|
|
|
TextEditingController _workPreformedController = TextEditingController();
|
|
|
|
TextEditingController _workPreformedController = TextEditingController();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ServiceStatusProvider _assetTypeProvider;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CallRequestForWorkOrder _callRequestForWorkOrder;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
_serviceReport = widget.report;
|
|
|
|
_serviceReport = widget.report;
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void getRequestForWorkOrder() async {
|
|
|
|
|
|
|
|
_isLoading = true;
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
_callRequestForWorkOrder = await _serviceRequestsProvider.getCallRequestForWorkOrder(callId: widget.request.id);
|
|
|
|
|
|
|
|
_serviceReport.engineer = Engineer.fromJson(_callRequestForWorkOrder?.assignedEmployee?.toJson());
|
|
|
|
|
|
|
|
await _assetTypeProvider.getTypes(user: _userProvider.user, host: _settingProvider.host);
|
|
|
|
|
|
|
|
_isLoading = false;
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void dispose() {
|
|
|
|
void dispose() {
|
|
|
|
_faultController.dispose();
|
|
|
|
_faultController.dispose();
|
|
|
|
@ -80,6 +103,15 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
_userProvider = Provider.of<UserProvider>(context);
|
|
|
|
_userProvider = Provider.of<UserProvider>(context);
|
|
|
|
_settingProvider = Provider.of<SettingProvider>(context);
|
|
|
|
_settingProvider = Provider.of<SettingProvider>(context);
|
|
|
|
_serviceRequestsProvider = Provider.of<ServiceRequestsProvider>(context);
|
|
|
|
_serviceRequestsProvider = Provider.of<ServiceRequestsProvider>(context);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_assetTypeProvider = Provider.of<ServiceStatusProvider>(context);
|
|
|
|
|
|
|
|
if (_callRequestForWorkOrder == null) {
|
|
|
|
|
|
|
|
getRequestForWorkOrder();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
_serviceReport.assetType = _assetTypeProvider.statuses?.firstWhere(
|
|
|
|
|
|
|
|
(element) => element.value == _callRequestForWorkOrder?.assetType,
|
|
|
|
|
|
|
|
orElse: () => null,
|
|
|
|
|
|
|
|
);
|
|
|
|
_subtitle = AppLocalization.of(context).subtitle;
|
|
|
|
_subtitle = AppLocalization.of(context).subtitle;
|
|
|
|
return Scaffold(
|
|
|
|
return Scaffold(
|
|
|
|
key: _scaffoldKey,
|
|
|
|
key: _scaffoldKey,
|
|
|
|
@ -94,11 +126,9 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
child: Stack(
|
|
|
|
child: Stack(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
ListView(
|
|
|
|
ListView(
|
|
|
|
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
//AppNameBar(),
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
const SizedBox(
|
|
|
|
|
|
|
|
height: 16,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Center(
|
|
|
|
Center(
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
@ -108,22 +138,22 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
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(
|
|
|
|
@ -146,38 +176,53 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const Divider(),
|
|
|
|
),
|
|
|
|
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
|
|
|
|
ASubTitle("Work Order Details"),
|
|
|
|
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
|
|
|
|
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: [
|
|
|
|
|
|
|
|
const BoxShadow(
|
|
|
|
|
|
|
|
color: AColors.grey,
|
|
|
|
|
|
|
|
offset: Offset(0, -1),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
]),
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
// Report type and Reasons
|
|
|
|
// Report type and Reasons
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
// Report Status
|
|
|
|
// Report Status
|
|
|
|
Expanded(
|
|
|
|
// Expanded(
|
|
|
|
child: Column(
|
|
|
|
// child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
// children: [
|
|
|
|
ASubTitle(_subtitle.reportType),
|
|
|
|
// ASubTitle(_subtitle.reportType),
|
|
|
|
_validate && _serviceReport.type == null
|
|
|
|
// _validate && _serviceReport.type == null
|
|
|
|
? ASubTitle(
|
|
|
|
// ? ASubTitle(
|
|
|
|
_subtitle.requiredWord,
|
|
|
|
// _subtitle.requiredWord,
|
|
|
|
color: Colors.red,
|
|
|
|
// color: Colors.red,
|
|
|
|
)
|
|
|
|
// )
|
|
|
|
: const SizedBox.shrink(),
|
|
|
|
// : const SizedBox.shrink(),
|
|
|
|
const SizedBox(
|
|
|
|
// const SizedBox(
|
|
|
|
height: 4,
|
|
|
|
// height: 4,
|
|
|
|
),
|
|
|
|
// ),
|
|
|
|
ServiceReportTypeMenu(
|
|
|
|
// ServiceReportTypeMenu(
|
|
|
|
initialValue: _serviceReport.type,
|
|
|
|
// initialValue: _serviceReport.type,
|
|
|
|
onSelect: (status) {
|
|
|
|
// onSelect: (status) {
|
|
|
|
_serviceReport.type = status;
|
|
|
|
// _serviceReport.type = status;
|
|
|
|
},
|
|
|
|
// },
|
|
|
|
),
|
|
|
|
// ),
|
|
|
|
],
|
|
|
|
// ],
|
|
|
|
),
|
|
|
|
// ),
|
|
|
|
),
|
|
|
|
// ),
|
|
|
|
const SizedBox(
|
|
|
|
// const SizedBox(
|
|
|
|
width: 8,
|
|
|
|
// width: 8,
|
|
|
|
),
|
|
|
|
// ),
|
|
|
|
// visit date
|
|
|
|
// visit date
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
@ -215,7 +260,7 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// device sn
|
|
|
|
// device sn
|
|
|
|
Visibility(
|
|
|
|
Visibility(
|
|
|
|
visible: true, //widget.report.device == null,
|
|
|
|
visible: widget.request.deviceSerialNumber == null,
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
@ -233,15 +278,11 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
_serviceReport.device.id = id;
|
|
|
|
_serviceReport.device.id = id;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
height: 8,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
height: 8,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
ASubTitle(_subtitle.serviceType),
|
|
|
|
ASubTitle(_subtitle.serviceType),
|
|
|
|
_validate && _serviceReport.assetType == null
|
|
|
|
_validate && _serviceReport.assetType == null
|
|
|
|
? ASubTitle(
|
|
|
|
? ASubTitle(
|
|
|
|
@ -252,41 +293,34 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(
|
|
|
|
height: 4,
|
|
|
|
height: 4,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
ServiceAssetTypeMenu(
|
|
|
|
LoadingManager(
|
|
|
|
initialValue: _serviceReport.assetType,
|
|
|
|
isLoading: _assetTypeProvider.isLoading,
|
|
|
|
onSelect: (status) {
|
|
|
|
isFailedLoading: _assetTypeProvider.statuses == null,
|
|
|
|
_serviceReport.assetType = status;
|
|
|
|
stateCode: _assetTypeProvider.stateCode,
|
|
|
|
|
|
|
|
onRefresh: () async {
|
|
|
|
|
|
|
|
_assetTypeProvider.reset();
|
|
|
|
|
|
|
|
await _assetTypeProvider.getTypes(user: _userProvider.user, host: _settingProvider.host);
|
|
|
|
|
|
|
|
_serviceReport?.assetType = _assetTypeProvider.statuses?.firstWhere(
|
|
|
|
|
|
|
|
(element) => element.value == _callRequestForWorkOrder.assetType,
|
|
|
|
|
|
|
|
orElse: () => null,
|
|
|
|
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
child: ATextFormField(
|
|
|
|
|
|
|
|
initialValue: _serviceReport?.assetType?.name ?? "NULL",
|
|
|
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
|
|
|
enable: false,
|
|
|
|
|
|
|
|
style: Theme.of(context).textTheme.titleMedium,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
|
|
|
|
height: 8,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 8 * AppStyle.getScaleFactor(context),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
const ASubTitle("Assign Employee"),
|
|
|
|
|
|
|
|
const SizedBox(
|
|
|
|
|
|
|
|
height: 8,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
_validate && _serviceReport.engineer == null
|
|
|
|
|
|
|
|
? ASubTitle(
|
|
|
|
|
|
|
|
_subtitle.requiredWord,
|
|
|
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: const SizedBox.shrink(),
|
|
|
|
|
|
|
|
const SizedBox(
|
|
|
|
|
|
|
|
height: 4,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
EngineersMenu(
|
|
|
|
|
|
|
|
initialValue: _serviceReport.engineer,
|
|
|
|
|
|
|
|
onSelect: (engineer) {
|
|
|
|
|
|
|
|
_serviceReport.engineer = engineer;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
// ServiceAssetTypeMenu(
|
|
|
|
|
|
|
|
// initialValue: _serviceReport.assetType,
|
|
|
|
|
|
|
|
// onSelect: (status) {
|
|
|
|
|
|
|
|
// _serviceReport.assetType = status;
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// ),
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(
|
|
|
|
height: 8,
|
|
|
|
height: 8,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// Report status and Service Type
|
|
|
|
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
// report status
|
|
|
|
// report status
|
|
|
|
@ -294,7 +328,8 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
ASubTitle(_subtitle.reportStatus),
|
|
|
|
// ASubTitle(_subtitle.reportStatus),
|
|
|
|
|
|
|
|
ASubTitle("Equipment Status"),
|
|
|
|
_validate && _serviceReport.equipmentStatus == null
|
|
|
|
_validate && _serviceReport.equipmentStatus == null
|
|
|
|
? ASubTitle(
|
|
|
|
? ASubTitle(
|
|
|
|
_subtitle.requiredWord,
|
|
|
|
_subtitle.requiredWord,
|
|
|
|
@ -304,19 +339,29 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(
|
|
|
|
height: 4,
|
|
|
|
height: 4,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
ServiceReportStatusMenu(
|
|
|
|
// ServiceReportStatusMenu(
|
|
|
|
|
|
|
|
// report: _serviceReport,
|
|
|
|
|
|
|
|
// request: widget.request,
|
|
|
|
|
|
|
|
// onSelect: (status) {
|
|
|
|
|
|
|
|
// _serviceReport.status = status;
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
ServiceReportEquipmentStatusMenu(
|
|
|
|
report: _serviceReport,
|
|
|
|
report: _serviceReport,
|
|
|
|
request: widget.request,
|
|
|
|
request: widget.request,
|
|
|
|
onSelect: (status) {
|
|
|
|
onSelect: (status) {
|
|
|
|
_serviceReport.equipmentStatus = status;
|
|
|
|
_serviceReport.equipmentStatus = status;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(
|
|
|
|
width: 8,
|
|
|
|
width: 8,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
// Provider.of<ServiceReportLastCallsProvider>(context).isLoading == null
|
|
|
|
|
|
|
|
// ? const SizedBox.shrink():
|
|
|
|
|
|
|
|
// Call's last Situation
|
|
|
|
Consumer<ServiceReportLastCallsProvider>(
|
|
|
|
Consumer<ServiceReportLastCallsProvider>(
|
|
|
|
builder: (_, provider, __) {
|
|
|
|
builder: (_, provider, __) {
|
|
|
|
if (provider.isLoading == null) return const SizedBox.shrink();
|
|
|
|
if (provider.isLoading == null) return const SizedBox.shrink();
|
|
|
|
@ -331,9 +376,7 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
color: Colors.red,
|
|
|
|
color: Colors.red,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: const SizedBox.shrink(),
|
|
|
|
: const SizedBox.shrink(),
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
height: 4,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
ServiceReportLastCallsMenu(
|
|
|
|
ServiceReportLastCallsMenu(
|
|
|
|
report: _serviceReport,
|
|
|
|
report: _serviceReport,
|
|
|
|
onSelect: (status) {
|
|
|
|
onSelect: (status) {
|
|
|
|
@ -352,6 +395,113 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
if (_showCommentField)
|
|
|
|
|
|
|
|
const SizedBox(
|
|
|
|
|
|
|
|
height: 8,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
if (_showCommentField)
|
|
|
|
|
|
|
|
ATextFormField(
|
|
|
|
|
|
|
|
initialValue: _serviceReport?.reviewComment,
|
|
|
|
|
|
|
|
hintText: "Review Comment",
|
|
|
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
|
|
|
style: Theme.of(context).textTheme.titleMedium,
|
|
|
|
|
|
|
|
textInputType: TextInputType.multiline,
|
|
|
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
|
|
|
_serviceReport.reviewComment = value;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 8 * AppStyle.getScaleFactor(context),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
// const ASubTitle("Assign Employee"),
|
|
|
|
|
|
|
|
// const SizedBox(
|
|
|
|
|
|
|
|
// height: 8,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// _validate && _serviceReport.engineer == null
|
|
|
|
|
|
|
|
// ? ASubTitle(
|
|
|
|
|
|
|
|
// _subtitle.requiredWord,
|
|
|
|
|
|
|
|
// color: Colors.red,
|
|
|
|
|
|
|
|
// )
|
|
|
|
|
|
|
|
// : const SizedBox.shrink(),
|
|
|
|
|
|
|
|
// const SizedBox(
|
|
|
|
|
|
|
|
// height: 4,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// EngineersMenu(
|
|
|
|
|
|
|
|
// initialValue: _serviceReport.engineer,
|
|
|
|
|
|
|
|
// onSelect: (engineer) {
|
|
|
|
|
|
|
|
// _serviceReport.engineer = engineer;
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// const SizedBox(
|
|
|
|
|
|
|
|
// height: 8,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// Report status and Service Type
|
|
|
|
|
|
|
|
// Row(
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
|
|
// // report status
|
|
|
|
|
|
|
|
// Expanded(
|
|
|
|
|
|
|
|
// child: Column(
|
|
|
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
|
|
// ASubTitle(_subtitle.reportStatus),
|
|
|
|
|
|
|
|
// _validate && _serviceReport.equipmentStatus == null
|
|
|
|
|
|
|
|
// ? ASubTitle(
|
|
|
|
|
|
|
|
// _subtitle.requiredWord,
|
|
|
|
|
|
|
|
// color: Colors.red,
|
|
|
|
|
|
|
|
// )
|
|
|
|
|
|
|
|
// : const SizedBox.shrink(),
|
|
|
|
|
|
|
|
// const SizedBox(
|
|
|
|
|
|
|
|
// height: 4,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ServiceReportStatusMenu(
|
|
|
|
|
|
|
|
// report: _serviceReport,
|
|
|
|
|
|
|
|
// request: widget.request,
|
|
|
|
|
|
|
|
// onSelect: (status) {
|
|
|
|
|
|
|
|
// _serviceReport.equipmentStatus = status;
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// const SizedBox(
|
|
|
|
|
|
|
|
// width: 8,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// Consumer<ServiceReportLastCallsProvider>(
|
|
|
|
|
|
|
|
// builder: (_, provider, __) {
|
|
|
|
|
|
|
|
// if (provider.isLoading == null) return const SizedBox.shrink();
|
|
|
|
|
|
|
|
// return Expanded(
|
|
|
|
|
|
|
|
// child: Column(
|
|
|
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
|
|
// ASubTitle(_subtitle.callLastSituation),
|
|
|
|
|
|
|
|
// _validate && _serviceReport.callLastSituation == null
|
|
|
|
|
|
|
|
// ? ASubTitle(
|
|
|
|
|
|
|
|
// _subtitle.requiredWord,
|
|
|
|
|
|
|
|
// color: Colors.red,
|
|
|
|
|
|
|
|
// )
|
|
|
|
|
|
|
|
// : const SizedBox.shrink(),
|
|
|
|
|
|
|
|
// const SizedBox(
|
|
|
|
|
|
|
|
// height: 4,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ServiceReportLastCallsMenu(
|
|
|
|
|
|
|
|
// report: _serviceReport,
|
|
|
|
|
|
|
|
// onSelect: (status) {
|
|
|
|
|
|
|
|
// if (status?.value == 12 || _serviceReport.callLastSituation?.value == 12) {
|
|
|
|
|
|
|
|
// _serviceReport.callLastSituation = status;
|
|
|
|
|
|
|
|
// setState(() {});
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// _serviceReport.callLastSituation = status;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(
|
|
|
|
height: 8,
|
|
|
|
height: 8,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -467,10 +617,121 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// const SizedBox(height: 8,),
|
|
|
|
// const SizedBox(height: 8,),
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
const ASubTitle("Start of Work"),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 8 * AppStyle.getScaleFactor(context),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
ADateTimePicker(
|
|
|
|
|
|
|
|
date: _serviceReport.startDate,
|
|
|
|
|
|
|
|
from: DateTime.now().subtract(const Duration(days: 365)),
|
|
|
|
|
|
|
|
to: DateTime.now().add(const Duration(days: 365)),
|
|
|
|
|
|
|
|
onDateTimePicker: (date) {
|
|
|
|
|
|
|
|
_serviceReport.startDate = date;
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
const SizedBox(width: 8),
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
const ASubTitle("End of Work"),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 8 * AppStyle.getScaleFactor(context),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
ADateTimePicker(
|
|
|
|
|
|
|
|
date: _serviceReport.endDate,
|
|
|
|
|
|
|
|
from: DateTime.now().subtract(const Duration(days: 365)),
|
|
|
|
|
|
|
|
to: DateTime.now().add(const Duration(days: 365)),
|
|
|
|
|
|
|
|
onDateTimePicker: (date) {
|
|
|
|
|
|
|
|
_serviceReport.endDate = date;
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
|
|
|
|
ASubTitle(_subtitle.workingHours),
|
|
|
|
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
|
|
|
|
ATextFormField(
|
|
|
|
|
|
|
|
initialValue: null,
|
|
|
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
|
|
|
hintText: _serviceReport.startDate == null
|
|
|
|
|
|
|
|
? "0"
|
|
|
|
|
|
|
|
: ((_serviceReport?.endDate?.difference(_serviceReport?.startDate)?.inMinutes ?? 0) / 60)?.toStringAsFixed(2)?.toString() ?? "0",
|
|
|
|
|
|
|
|
enable: false,
|
|
|
|
|
|
|
|
style: Theme.of(context).textTheme.subtitle1,
|
|
|
|
|
|
|
|
validator: (value) => Validator.isNumeric(value) ? null : _subtitle.requiredWord,
|
|
|
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
|
|
|
// _serviceReport.workHours = value;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
const SizedBox(
|
|
|
|
|
|
|
|
height: 8,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
if (_showCommentField)
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(
|
|
|
|
height: 8,
|
|
|
|
height: 8,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
if (_showCommentField)
|
|
|
|
|
|
|
|
ATextFormField(
|
|
|
|
|
|
|
|
initialValue: _serviceReport?.reviewComment,
|
|
|
|
|
|
|
|
hintText: "Review Comment",
|
|
|
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
|
|
|
style: Theme.of(context).textTheme.titleMedium,
|
|
|
|
|
|
|
|
textInputType: TextInputType.multiline,
|
|
|
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
|
|
|
_serviceReport.reviewComment = value;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 8 * AppStyle.getScaleFactor(context),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
|
|
|
|
ASubTitle(_subtitle.faultDescription),
|
|
|
|
|
|
|
|
const SizedBox(
|
|
|
|
|
|
|
|
height: 4,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
ServiceReportFaultDescription(
|
|
|
|
|
|
|
|
requestId: widget.request?.id,
|
|
|
|
|
|
|
|
initialValue: _serviceReport.faultDescription,
|
|
|
|
|
|
|
|
onSelect: (status) {
|
|
|
|
|
|
|
|
print("faluttt:${status?.toJson()}");
|
|
|
|
|
|
|
|
_serviceReport.faultDescription = status;
|
|
|
|
|
|
|
|
if(mounted)
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
|
|
|
|
ASubTitle(_subtitle.workPreformed),
|
|
|
|
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
|
|
|
|
ATextFormField(
|
|
|
|
|
|
|
|
initialValue: _serviceReport?.workPreformed,
|
|
|
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
|
|
|
enable: false,
|
|
|
|
|
|
|
|
hintText: _serviceReport.faultDescription?.workPerformed ?? "",
|
|
|
|
|
|
|
|
controller: _workPreformedController,
|
|
|
|
|
|
|
|
style: Theme.of(context).textTheme.subtitle1,
|
|
|
|
|
|
|
|
validator: (value) => Validator.hasValue(value) ? null : _subtitle.requiredWord,
|
|
|
|
|
|
|
|
textInputType: TextInputType.multiline,
|
|
|
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
|
|
|
// _serviceReport.workPreformed = value;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
// reasons
|
|
|
|
// reasons
|
|
|
|
@ -515,74 +776,118 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(
|
|
|
|
height: 8,
|
|
|
|
height: 8,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// Traveling Hours & Working Hours
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
Row(
|
|
|
|
ASubTitle(_subtitle.repairLocation),
|
|
|
|
children: [
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
Expanded(
|
|
|
|
ServiceReportRepairLocation(
|
|
|
|
child: Column(
|
|
|
|
initialValue: _serviceReport.repairLocation,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
onSelect: (status) {
|
|
|
|
children: [
|
|
|
|
_serviceReport.repairLocation = status;
|
|
|
|
ASubTitle(_subtitle.workingHours),
|
|
|
|
|
|
|
|
const SizedBox(
|
|
|
|
|
|
|
|
height: 8,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: AppTimer(
|
|
|
|
|
|
|
|
timer: _serviceReport.timer,
|
|
|
|
|
|
|
|
onChange: (timer) async {
|
|
|
|
|
|
|
|
_serviceReport.timer = timer;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
|
|
|
|
ASubTitle(_subtitle.travelingExpense),
|
|
|
|
|
|
|
|
const SizedBox(
|
|
|
|
|
|
|
|
height: 4,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
ATextFormField(
|
|
|
|
|
|
|
|
initialValue: _serviceReport?.travelingExpense?.toString(),
|
|
|
|
|
|
|
|
hintText: _subtitle.travelingExpense,
|
|
|
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
|
|
|
style: Theme.of(context).textTheme.titleMedium,
|
|
|
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
|
|
|
if (value != null && value.isEmpty) {
|
|
|
|
|
|
|
|
_serviceReport.travelingExpense = int.tryParse(_serviceReport?.travelingExpense?.toString() ?? "") ?? 0;
|
|
|
|
|
|
|
|
} else
|
|
|
|
|
|
|
|
_serviceReport.travelingExpense = int.tryParse(value) ?? 0;
|
|
|
|
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// ATextFormField(
|
|
|
|
|
|
|
|
// initialValue: _serviceReport?.workHours,
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
// textAlign: TextAlign.center,
|
|
|
|
ASubTitle(_subtitle.travelingHours),
|
|
|
|
// hintText: "i.e 3, 3.5, 4",
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
// style: Theme.of(context).textTheme.subtitle1,
|
|
|
|
ATextFormField(
|
|
|
|
|
|
|
|
initialValue: _serviceReport?.travelingHours?.toString(),
|
|
|
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
|
|
|
hintText: "i.e 3, 3.5, 4",
|
|
|
|
|
|
|
|
style: Theme.of(context).textTheme.subtitle1,
|
|
|
|
// validator: (value) =>
|
|
|
|
// validator: (value) =>
|
|
|
|
// Validator.isNumeric(value)
|
|
|
|
// Validator.isNumeric(value)
|
|
|
|
// ? null : _subtitle.requiredWord,
|
|
|
|
// ? null : _subtitle.requiredWord,
|
|
|
|
// textInputType: TextInputType.number,
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
// onSaved: (value){
|
|
|
|
onSaved: (value) {
|
|
|
|
// _serviceReport.workHours = value;
|
|
|
|
_serviceReport.travelingHours = double.tryParse(value) ?? 0.0;
|
|
|
|
// },
|
|
|
|
},
|
|
|
|
// ),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// const SizedBox(width: 8,),
|
|
|
|
// Traveling Hours & Working Hours
|
|
|
|
|
|
|
|
// Row(
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
// Expanded(
|
|
|
|
// Expanded(
|
|
|
|
// child: Column(
|
|
|
|
// child: Column(
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
// children: [
|
|
|
|
// children: [
|
|
|
|
// ASubTitle(_subtitle.travelingHours),
|
|
|
|
// ASubTitle(_subtitle.workingHours),
|
|
|
|
// const SizedBox(height: 4,),
|
|
|
|
// const SizedBox(
|
|
|
|
// ATextFormField(
|
|
|
|
// height: 8,
|
|
|
|
// initialValue: _serviceReport?.travelingHours,
|
|
|
|
// ),
|
|
|
|
// textAlign: TextAlign.center,
|
|
|
|
// Row(
|
|
|
|
// hintText: "i.e 3, 3.5, 4",
|
|
|
|
// children: [
|
|
|
|
// style: Theme.of(context).textTheme.subtitle1,
|
|
|
|
// Expanded(
|
|
|
|
// validator: (value) =>
|
|
|
|
// child: AppTimer(
|
|
|
|
// Validator.isNumeric(value)
|
|
|
|
// timer: _serviceReport.timer,
|
|
|
|
// ? null : _subtitle.requiredWord,
|
|
|
|
// onChange: (timer) async {
|
|
|
|
// textInputType: TextInputType.number,
|
|
|
|
// _serviceReport.timer = timer;
|
|
|
|
// onSaved: (value){
|
|
|
|
// return true;
|
|
|
|
// _serviceReport.travelingHours = value;
|
|
|
|
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
// ],
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// // ATextFormField(
|
|
|
|
|
|
|
|
// // initialValue: _serviceReport?.workHours,
|
|
|
|
|
|
|
|
// // textAlign: TextAlign.center,
|
|
|
|
|
|
|
|
// // hintText: "i.e 3, 3.5, 4",
|
|
|
|
|
|
|
|
// // style: Theme.of(context).textTheme.subtitle1,
|
|
|
|
|
|
|
|
// // validator: (value) =>
|
|
|
|
|
|
|
|
// // Validator.isNumeric(value)
|
|
|
|
|
|
|
|
// // ? null : _subtitle.requiredWord,
|
|
|
|
|
|
|
|
// // textInputType: TextInputType.number,
|
|
|
|
|
|
|
|
// // onSaved: (value){
|
|
|
|
|
|
|
|
// // _serviceReport.workHours = value;
|
|
|
|
|
|
|
|
// // },
|
|
|
|
|
|
|
|
// // ),
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// // const SizedBox(width: 8,),
|
|
|
|
|
|
|
|
// // Expanded(
|
|
|
|
|
|
|
|
// // child: Column(
|
|
|
|
|
|
|
|
// // crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
// // children: [
|
|
|
|
|
|
|
|
// // ASubTitle(_subtitle.travelingHours),
|
|
|
|
|
|
|
|
// // const SizedBox(height: 4,),
|
|
|
|
|
|
|
|
// // ATextFormField(
|
|
|
|
|
|
|
|
// // initialValue: _serviceReport?.travelingHours,
|
|
|
|
|
|
|
|
// // textAlign: TextAlign.center,
|
|
|
|
|
|
|
|
// // hintText: "i.e 3, 3.5, 4",
|
|
|
|
|
|
|
|
// // style: Theme.of(context).textTheme.subtitle1,
|
|
|
|
|
|
|
|
// // validator: (value) =>
|
|
|
|
|
|
|
|
// // Validator.isNumeric(value)
|
|
|
|
|
|
|
|
// // ? null : _subtitle.requiredWord,
|
|
|
|
|
|
|
|
// // textInputType: TextInputType.number,
|
|
|
|
|
|
|
|
// // onSaved: (value){
|
|
|
|
|
|
|
|
// // _serviceReport.travelingHours = value;
|
|
|
|
|
|
|
|
// // },
|
|
|
|
|
|
|
|
// // ),
|
|
|
|
|
|
|
|
// // ],
|
|
|
|
|
|
|
|
// // ),
|
|
|
|
|
|
|
|
// // ),
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// const SizedBox(
|
|
|
|
|
|
|
|
// height: 8,
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
const SizedBox(
|
|
|
|
|
|
|
|
height: 8,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
// Operating Hours and Job Sheet Number
|
|
|
|
// Operating Hours and Job Sheet Number
|
|
|
|
// Row(
|
|
|
|
// Row(
|
|
|
|
// children: [
|
|
|
|
// children: [
|
|
|
|
@ -630,14 +935,26 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
// ],
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
//const SizedBox(height: 8,),
|
|
|
|
//const SizedBox(height: 8,),
|
|
|
|
const SizedBox(
|
|
|
|
|
|
|
|
height: 8,
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
|
|
|
|
ASubTitle(_subtitle.comment),
|
|
|
|
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
|
|
|
|
ATextFormField(
|
|
|
|
|
|
|
|
initialValue: _serviceReport?.comment,
|
|
|
|
|
|
|
|
hintText: "Technical Comment",
|
|
|
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
|
|
|
style: Theme.of(context).textTheme.titleMedium,
|
|
|
|
|
|
|
|
textInputType: TextInputType.multiline,
|
|
|
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
|
|
|
_serviceReport.comment = value;
|
|
|
|
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
const ASubTitle("Nurse Signature"),
|
|
|
|
const ASubTitle("Nurse Signature"),
|
|
|
|
ESignature(
|
|
|
|
ESignature(
|
|
|
|
oldSignature: _serviceReport.signatureNurse,
|
|
|
|
oldSignature: _serviceReport.signatureNurse,
|
|
|
|
newSignature: _serviceReport.localNurseSignature,
|
|
|
|
newSignature: _serviceReport.localNurseSignature,
|
|
|
|
onChange: (signature) {
|
|
|
|
onSaved: (signature) {
|
|
|
|
if (signature == null || signature.isEmpty) {
|
|
|
|
if (signature == null || signature.isEmpty) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -652,7 +969,7 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
ESignature(
|
|
|
|
ESignature(
|
|
|
|
oldSignature: _serviceReport.signatureEngineer,
|
|
|
|
oldSignature: _serviceReport.signatureEngineer,
|
|
|
|
newSignature: _serviceReport.localNurseSignature,
|
|
|
|
newSignature: _serviceReport.localNurseSignature,
|
|
|
|
onChange: (signature) {
|
|
|
|
onSaved: (signature) {
|
|
|
|
if (signature == null || signature.isEmpty) {
|
|
|
|
if (signature == null || signature.isEmpty) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -664,6 +981,25 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
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(
|
|
|
|
@ -713,27 +1049,27 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(
|
|
|
|
height: 16,
|
|
|
|
height: 16,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
AButton(
|
|
|
|
padding: const EdgeInsets.all(16.0),
|
|
|
|
|
|
|
|
child: AButton(
|
|
|
|
|
|
|
|
text: _subtitle.update,
|
|
|
|
text: _subtitle.update,
|
|
|
|
onPressed: () async {
|
|
|
|
onPressed: () async {
|
|
|
|
_validate = true;
|
|
|
|
_validate = true;
|
|
|
|
if (!_formKey.currentState.validate()) {
|
|
|
|
print("jere1245");
|
|
|
|
setState(() {});
|
|
|
|
// if (!_formKey.currentState.validate()) {
|
|
|
|
return;
|
|
|
|
// setState(() {});
|
|
|
|
}
|
|
|
|
// return;
|
|
|
|
if (!_serviceReport.validate()) {
|
|
|
|
// }
|
|
|
|
setState(() {});
|
|
|
|
// print("jere124");
|
|
|
|
return;
|
|
|
|
// if (!_serviceReport.validate()) {
|
|
|
|
}
|
|
|
|
// setState(() {});
|
|
|
|
|
|
|
|
// return;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// print("jere14");
|
|
|
|
_formKey.currentState.save();
|
|
|
|
_formKey.currentState.save();
|
|
|
|
|
|
|
|
|
|
|
|
_isLoading = true;
|
|
|
|
_isLoading = true;
|
|
|
|
@ -756,10 +1092,6 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
const SizedBox(
|
|
|
|
|
|
|
|
height: 300,
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const ABackButton(),
|
|
|
|
const ABackButton(),
|
|
|
|
|