diff --git a/assets/subtitles/ar_subtitle.json b/assets/subtitles/ar_subtitle.json index 16cad068..b9a51fd7 100644 --- a/assets/subtitles/ar_subtitle.json +++ b/assets/subtitles/ar_subtitle.json @@ -167,7 +167,7 @@ "newServiceReport": "تقرير خدمة جديد", "number": "رقم", "operatingHours": "ساعات العمل", - "partNumber": "رقم القطعة", + "partNumberName": "رقم/اسم القطعة", "quantity": "كمية", "reasons": "الاسباب", "reportStatus": "حالة التقرير", diff --git a/assets/subtitles/en_subtitle.json b/assets/subtitles/en_subtitle.json index 4b5352f9..fc57c444 100644 --- a/assets/subtitles/en_subtitle.json +++ b/assets/subtitles/en_subtitle.json @@ -167,7 +167,7 @@ "newServiceReport": "New Work Order", "number": "Number", "operatingHours": "Operating Hours", - "partNumber": "Part Number", + "partNumberName": "Part Number/Name", "quantity": "Quantity", "reasons": "Reasons", "reportStatus": "Report Status", diff --git a/lib/controllers/providers/api/service_requests_provider.dart b/lib/controllers/providers/api/service_requests_provider.dart index d255f7bc..ea03c7ee 100644 --- a/lib/controllers/providers/api/service_requests_provider.dart +++ b/lib/controllers/providers/api/service_requests_provider.dart @@ -312,7 +312,7 @@ class ServiceRequestsProvider extends ChangeNotifier { }, "assetType": report.assetType?.toMap(), "assignedEmployee": {"id": report.engineer?.id, "name": report.engineer?.name ?? ""}, - "visitDate": report.visitDate?.toIso8601String() ?? "", + "visitDate": report.returnToService?.toIso8601String() ?? "", // "assistantEmployees": [ // {"id": report.engineer.id, "name": report.engineer.name}, // ], diff --git a/lib/models/service_report.dart b/lib/models/service_report.dart index bf2f53d4..a5fed419 100644 --- a/lib/models/service_report.dart +++ b/lib/models/service_report.dart @@ -160,7 +160,7 @@ class ServiceReport { return false; } if (returnToService == null) { - await Fluttertoast.showToast(msg: "return To Service Date Required"); + await Fluttertoast.showToast(msg: "Return To Service Date Required"); return false; } if (timer?.startAt == null) { diff --git a/lib/models/subtitle.dart b/lib/models/subtitle.dart index 4007a7cb..6786ddd1 100644 --- a/lib/models/subtitle.dart +++ b/lib/models/subtitle.dart @@ -205,7 +205,7 @@ class Subtitle { String reasons; String attachImage; String operatingHours; - String partNumber; + String partNumberName; String number; String quantity; String orderWorkNumber; @@ -417,7 +417,7 @@ class Subtitle { @required this.newServiceReport, @required this.number, @required this.operatingHours, - @required this.partNumber, + @required this.partNumberName, @required this.reasons, @required this.reportStatus, @required this.reportType, @@ -618,7 +618,7 @@ class Subtitle { newServiceReport: parsedJson["newServiceReport"], number: parsedJson["number"], operatingHours: parsedJson["operatingHours"], - partNumber: parsedJson["partNumber"], + partNumberName: parsedJson["partNumberName"], quantity: parsedJson["quantity"], reasons: parsedJson["reasons"], reportStatus: parsedJson["reportStatus"], diff --git a/lib/views/pages/sub_workorder/spare_parts_details_bottom_sheet.dart b/lib/views/pages/sub_workorder/spare_parts_details_bottom_sheet.dart index feac7419..9cb43482 100644 --- a/lib/views/pages/sub_workorder/spare_parts_details_bottom_sheet.dart +++ b/lib/views/pages/sub_workorder/spare_parts_details_bottom_sheet.dart @@ -87,7 +87,7 @@ class _SparePartsBottomSheetState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - ASubTitle(subtitle.partNumber), + ASubTitle(subtitle.partNumberName), _validate && _workOrder.sparePartsWorkOrders == null ? ASubTitle( subtitle.requiredWord, diff --git a/lib/views/pages/user/gas_refill/gas_refill_details.dart b/lib/views/pages/user/gas_refill/gas_refill_details.dart index 943776ea..bc6f49a0 100644 --- a/lib/views/pages/user/gas_refill/gas_refill_details.dart +++ b/lib/views/pages/user/gas_refill/gas_refill_details.dart @@ -106,7 +106,7 @@ class _GasRefillDetailsState extends State { Expanded( child: Center( child: Text( - _subtitle.details, + "Gas Refill Request", style: Theme.of(context).textTheme.headline6.copyWith(color: AColors.white, fontStyle: FontStyle.italic), ), ), diff --git a/lib/views/pages/user/requests/report/create_service_report.dart b/lib/views/pages/user/requests/report/create_service_report.dart index 6187418a..89fdf8da 100644 --- a/lib/views/pages/user/requests/report/create_service_report.dart +++ b/lib/views/pages/user/requests/report/create_service_report.dart @@ -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 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 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 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 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 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 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 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 with TickerPr child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - ASubTitle(_subtitle.partNumber), + ASubTitle(_subtitle.partNumberName), _validate && _serviceReport.parts == null ? ASubTitle( _subtitle.requiredWord, diff --git a/lib/views/pages/user/requests/report/edit_service_report.dart b/lib/views/pages/user/requests/report/edit_service_report.dart index 8191fc4d..b783e5a6 100644 --- a/lib/views/pages/user/requests/report/edit_service_report.dart +++ b/lib/views/pages/user/requests/report/edit_service_report.dart @@ -1000,7 +1000,7 @@ class _EditServiceReportState extends State with TickerProvid child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - ASubTitle(_subtitle.partNumber), + ASubTitle(_subtitle.partNumberName), _validate && _serviceReport.parts == null ? ASubTitle( _subtitle.requiredWord,