|
|
|
@ -11,7 +11,12 @@ import 'package:test_sa/views/widgets/status/service_request/service_request_sta
|
|
|
|
import 'package:test_sa/views/widgets/switch_button.dart';
|
|
|
|
import 'package:test_sa/views/widgets/switch_button.dart';
|
|
|
|
import 'package:test_sa/views/widgets/titles/app_sub_title.dart';
|
|
|
|
import 'package:test_sa/views/widgets/titles/app_sub_title.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import '../../../models/call_request_for_work_order_model.dart';
|
|
|
|
|
|
|
|
import '../../../models/engineer.dart';
|
|
|
|
import '../app_text_form_field.dart';
|
|
|
|
import '../app_text_form_field.dart';
|
|
|
|
|
|
|
|
import '../date_and_time/date_picker.dart';
|
|
|
|
|
|
|
|
import '../status/report/service_report_all_users.dart';
|
|
|
|
|
|
|
|
import '../status/report/service_report_visit_date_operator.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class ServiceRequestsSearchDialog extends StatefulWidget {
|
|
|
|
class ServiceRequestsSearchDialog extends StatefulWidget {
|
|
|
|
final ServiceRequestSearch initialSearchValue;
|
|
|
|
final ServiceRequestSearch initialSearchValue;
|
|
|
|
@ -63,6 +68,7 @@ class _ServiceRequestsSearchDialogState extends State<ServiceRequestsSearchDialo
|
|
|
|
key: _formKey,
|
|
|
|
key: _formKey,
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.all(16.0),
|
|
|
|
padding: const EdgeInsets.all(16.0),
|
|
|
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
@ -101,6 +107,15 @@ class _ServiceRequestsSearchDialogState extends State<ServiceRequestsSearchDialo
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 8.0 * AppStyle.getScaleFactor(context),
|
|
|
|
height: 8.0 * AppStyle.getScaleFactor(context),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
ATextFormField(
|
|
|
|
|
|
|
|
labelText: "Call ID",
|
|
|
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
|
|
|
_search.callId = value;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 8.0 * AppStyle.getScaleFactor(context),
|
|
|
|
|
|
|
|
),
|
|
|
|
ATextFormField(
|
|
|
|
ATextFormField(
|
|
|
|
initialValue: _search.deviceSerialNumber,
|
|
|
|
initialValue: _search.deviceSerialNumber,
|
|
|
|
hintText: _subtitle.serialNumber,
|
|
|
|
hintText: _subtitle.serialNumber,
|
|
|
|
@ -172,15 +187,75 @@ class _ServiceRequestsSearchDialogState extends State<ServiceRequestsSearchDialo
|
|
|
|
height: 16 * AppStyle.getScaleFactor(context),
|
|
|
|
height: 16 * AppStyle.getScaleFactor(context),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const ASubTitle("Status"),
|
|
|
|
const ASubTitle("Status"),
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
height: 4,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
ServiceRequestStatusMenu(
|
|
|
|
ServiceRequestStatusMenu(
|
|
|
|
initialValue: _search.statusValue,
|
|
|
|
initialValue: _search.statusValue,
|
|
|
|
onSelect: (status) {
|
|
|
|
onSelect: (status) {
|
|
|
|
_search.statusValue = status;
|
|
|
|
_search.statusValue = status;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 16 * AppStyle.getScaleFactor(context),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
ASubTitle(_subtitle.assignedEmployee),
|
|
|
|
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
|
|
|
|
ServiceReportAllUsers(
|
|
|
|
|
|
|
|
initialValue: _search.assignedEmployee == null ? null : Engineer(id: _search.assignedEmployee.id, name: _search.assignedEmployee.name),
|
|
|
|
|
|
|
|
onSelect: (engineer) {
|
|
|
|
|
|
|
|
_search.assignedEmployee = AssignedEmployee(id: engineer.id, name: engineer.name);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 16 * AppStyle.getScaleFactor(context),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
const ASubTitle("Request Date"),
|
|
|
|
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
|
|
|
|
ServiceReportVisitDateOperator(
|
|
|
|
|
|
|
|
initialValue: _search.dateOperator,
|
|
|
|
|
|
|
|
onSelect: (status) {
|
|
|
|
|
|
|
|
_search.dateOperator = status;
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
const ASubTitle("From"),
|
|
|
|
|
|
|
|
ADatePicker(
|
|
|
|
|
|
|
|
date: DateTime.tryParse(_search.from ?? ""),
|
|
|
|
|
|
|
|
from: DateTime(1950),
|
|
|
|
|
|
|
|
onDatePicker: (date) {
|
|
|
|
|
|
|
|
_search.from = date?.toIso8601String();
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
if (_search?.dateOperator?.name?.toLowerCase()?.contains("between") ?? false) const SizedBox(width: 16),
|
|
|
|
|
|
|
|
if (_search?.dateOperator?.name?.toLowerCase()?.contains("between") ?? false)
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
const ASubTitle("To"),
|
|
|
|
|
|
|
|
ADatePicker(
|
|
|
|
|
|
|
|
date: DateTime.tryParse(_search.to ?? ""),
|
|
|
|
|
|
|
|
from: DateTime(1950),
|
|
|
|
|
|
|
|
onDatePicker: (date) {
|
|
|
|
|
|
|
|
_search.to = date?.toIso8601String();
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
const SizedBox(width: 16),
|
|
|
|
// Padding(
|
|
|
|
// Padding(
|
|
|
|
// padding: const EdgeInsets.symmetric(horizontal: 12),
|
|
|
|
// padding: const EdgeInsets.symmetric(horizontal: 12),
|
|
|
|
// child: Wrap(
|
|
|
|
// child: Wrap(
|
|
|
|
@ -228,6 +303,7 @@ class _ServiceRequestsSearchDialogState extends State<ServiceRequestsSearchDialo
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|