|
|
|
@ -9,6 +9,7 @@ import 'package:test_sa/extensions/int_extensions.dart';
|
|
|
|
import 'package:test_sa/extensions/string_extensions.dart';
|
|
|
|
import 'package:test_sa/extensions/string_extensions.dart';
|
|
|
|
import 'package:test_sa/extensions/text_extensions.dart';
|
|
|
|
import 'package:test_sa/extensions/text_extensions.dart';
|
|
|
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
|
|
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
|
|
|
|
|
|
|
import 'package:test_sa/helper/utils.dart';
|
|
|
|
import 'package:test_sa/models/lookup.dart';
|
|
|
|
import 'package:test_sa/models/lookup.dart';
|
|
|
|
import 'package:test_sa/modules/asset_delivery_module/helper_function.dart';
|
|
|
|
import 'package:test_sa/modules/asset_delivery_module/helper_function.dart';
|
|
|
|
import 'package:test_sa/modules/asset_delivery_module/models/asset_delivery_data_model.dart';
|
|
|
|
import 'package:test_sa/modules/asset_delivery_module/models/asset_delivery_data_model.dart';
|
|
|
|
@ -28,6 +29,7 @@ import 'package:test_sa/new_views/app_style/app_color.dart';
|
|
|
|
import 'package:test_sa/new_views/common_widgets/app_lazy_loading.dart';
|
|
|
|
import 'package:test_sa/new_views/common_widgets/app_lazy_loading.dart';
|
|
|
|
import 'package:test_sa/new_views/common_widgets/default_app_bar.dart';
|
|
|
|
import 'package:test_sa/new_views/common_widgets/default_app_bar.dart';
|
|
|
|
import 'package:test_sa/new_views/common_widgets/single_item_drop_down_menu.dart';
|
|
|
|
import 'package:test_sa/new_views/common_widgets/single_item_drop_down_menu.dart';
|
|
|
|
|
|
|
|
import 'package:test_sa/new_views/swipe_module/dialoge/acknowledge_work_dialog.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/loaders/no_data_found.dart';
|
|
|
|
import 'package:test_sa/views/widgets/loaders/no_data_found.dart';
|
|
|
|
import '../../../../new_views/common_widgets/app_filled_button.dart';
|
|
|
|
import '../../../../new_views/common_widgets/app_filled_button.dart';
|
|
|
|
@ -77,9 +79,11 @@ class _DeliveryInspectionFormViewState extends State<DeliveryInspectionFormView>
|
|
|
|
),
|
|
|
|
),
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
model = results[0] as DeliveryInspectionFormModel;
|
|
|
|
model = results[0] as DeliveryInspectionFormModel;
|
|
|
|
setState(() {
|
|
|
|
if (mounted) {
|
|
|
|
isLoading = false;
|
|
|
|
setState(() {
|
|
|
|
});
|
|
|
|
isLoading = false;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
@ -91,12 +95,6 @@ class _DeliveryInspectionFormViewState extends State<DeliveryInspectionFormView>
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
// appBar: DefaultAppBar(
|
|
|
|
|
|
|
|
// title: 'Delivery Inspection'.addTranslation,
|
|
|
|
|
|
|
|
// onBackPress: () {
|
|
|
|
|
|
|
|
// Navigator.pop(context);
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
body: isLoading
|
|
|
|
body: isLoading
|
|
|
|
? const CircularProgressIndicator(color: AppColor.primary10).center
|
|
|
|
? const CircularProgressIndicator(color: AppColor.primary10).center
|
|
|
|
: Form(
|
|
|
|
: Form(
|
|
|
|
@ -104,52 +102,39 @@ class _DeliveryInspectionFormViewState extends State<DeliveryInspectionFormView>
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
SingleChildScrollView(
|
|
|
|
SingleChildScrollView(
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
if (!viewOnly) ...[inspectionDetailsForm()] else ...[inspectionDetails()],
|
|
|
|
if (!viewOnly) ...[inspectionDetailsForm()] else ...[inspectionDetails()],
|
|
|
|
8.height,
|
|
|
|
20.height,
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
'Total Time'.addTranslation,
|
|
|
|
"Lines",
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.black10),
|
|
|
|
style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.black10),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
8.height,
|
|
|
|
8.height,
|
|
|
|
Text(
|
|
|
|
linesList(context),
|
|
|
|
formatInspectionDuration(model.totalTime),
|
|
|
|
],
|
|
|
|
style: AppTextStyles.bodyText2.copyWith(
|
|
|
|
)).expanded,
|
|
|
|
color: context.isDark ? AppColor.neutral30 : AppColor.neutral120,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Text(
|
|
|
|
|
|
|
|
// model.totalTime != null ? '${model.totalTime.toString()} hours' : '-',
|
|
|
|
|
|
|
|
// style: AppTextStyles.bodyText2.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral120),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
8.height,
|
|
|
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
"Lines",
|
|
|
|
|
|
|
|
style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.black10),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
8.height,
|
|
|
|
|
|
|
|
linesList(context),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
).toShadowContainer(context, borderRadius: 20, padding: 12))
|
|
|
|
|
|
|
|
.expanded,
|
|
|
|
|
|
|
|
FooterActionButton.footerContainer(
|
|
|
|
FooterActionButton.footerContainer(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
child: !viewOnly
|
|
|
|
child: !viewOnly
|
|
|
|
? Column(
|
|
|
|
? Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
AppFilledButton(
|
|
|
|
Row(
|
|
|
|
buttonColor: AppColor.primary10,
|
|
|
|
children: [
|
|
|
|
label: 'Attachments'.addTranslation,
|
|
|
|
AppFilledButton(
|
|
|
|
maxWidth: true,
|
|
|
|
buttonColor: AppColor.primary10,
|
|
|
|
onPressed: () {
|
|
|
|
label: 'Attachments'.addTranslation,
|
|
|
|
HelperFunction.attachmentTap(context: context, assetDeliveryProvider: assetDeliveryProvider!, deliveryTableItemId: widget.deliveryTableModel.id);
|
|
|
|
maxWidth: true,
|
|
|
|
}),
|
|
|
|
onPressed: () {
|
|
|
|
16.height,
|
|
|
|
HelperFunction.attachmentTap(context: context, assetDeliveryProvider: assetDeliveryProvider!, deliveryTableItemId: widget.deliveryTableModel.id);
|
|
|
|
|
|
|
|
}).expanded,
|
|
|
|
|
|
|
|
12.width,
|
|
|
|
|
|
|
|
AppFilledButton(buttonColor: AppColor.primary10, label: 'Save'.addTranslation, maxWidth: true, onPressed: _saveTap).expanded,
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
AppFilledButton(
|
|
|
|
AppFilledButton(
|
|
|
|
@ -247,6 +232,7 @@ class _DeliveryInspectionFormViewState extends State<DeliveryInspectionFormView>
|
|
|
|
|
|
|
|
|
|
|
|
Widget inspectionDetailsForm() {
|
|
|
|
Widget inspectionDetailsForm() {
|
|
|
|
return Column(
|
|
|
|
return Column(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
_inspectionTile(
|
|
|
|
_inspectionTile(
|
|
|
|
title: 'Inspected by'.addTranslation,
|
|
|
|
title: 'Inspected by'.addTranslation,
|
|
|
|
@ -264,7 +250,6 @@ class _DeliveryInspectionFormViewState extends State<DeliveryInspectionFormView>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
8.height,
|
|
|
|
8.height,
|
|
|
|
_inspectionTile(
|
|
|
|
_inspectionTile(
|
|
|
|
title: 'Approved by'.addTranslation,
|
|
|
|
title: 'Approved by'.addTranslation,
|
|
|
|
@ -285,13 +270,13 @@ class _DeliveryInspectionFormViewState extends State<DeliveryInspectionFormView>
|
|
|
|
if (widget.requestModel?.paymentTerm?.value == 2) ...[
|
|
|
|
if (widget.requestModel?.paymentTerm?.value == 2) ...[
|
|
|
|
8.height,
|
|
|
|
8.height,
|
|
|
|
_inspectionTile(
|
|
|
|
_inspectionTile(
|
|
|
|
title: 'Third Approved by'.addTranslation,
|
|
|
|
title: 'ThirdApprover'.addTranslation,
|
|
|
|
model: model.thirdApprovalModel,
|
|
|
|
model: model.thirdApprovalModel,
|
|
|
|
isHmg: widget.requestModel?.isHMG == true,
|
|
|
|
isHmg: widget.requestModel?.isHMG == true,
|
|
|
|
onTap: () async {
|
|
|
|
onTap: () async {
|
|
|
|
final result = await showInspectionBottomSheet(
|
|
|
|
final result = await showInspectionBottomSheet(
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
title: 'Third Approved by'.addTranslation,
|
|
|
|
title: 'ThirdApprover'.addTranslation,
|
|
|
|
isHmg: widget.requestModel?.isHMG == true,
|
|
|
|
isHmg: widget.requestModel?.isHMG == true,
|
|
|
|
initialModel: model.thirdApprovalModel ?? InspectionPersonModel(),
|
|
|
|
initialModel: model.thirdApprovalModel ?? InspectionPersonModel(),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -301,57 +286,6 @@ class _DeliveryInspectionFormViewState extends State<DeliveryInspectionFormView>
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
|
|
// if (widget.requestModel?.isHMG == true) ...[
|
|
|
|
|
|
|
|
// OracleUserAutoCompleteField(
|
|
|
|
|
|
|
|
// clearAfterPick: false,
|
|
|
|
|
|
|
|
// initialValue: model.deliveryInspectionInspectedBy ?? '',
|
|
|
|
|
|
|
|
// label: 'Inspected by'.addTranslation,
|
|
|
|
|
|
|
|
// onPick: (value) {
|
|
|
|
|
|
|
|
// model.deliveryInspectionInspectedBy = value.fullName;
|
|
|
|
|
|
|
|
// setState(() {});
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// onChanged: (value) {},
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// 8.height,
|
|
|
|
|
|
|
|
// OracleUserAutoCompleteField(
|
|
|
|
|
|
|
|
// clearAfterPick: false,
|
|
|
|
|
|
|
|
// initialValue: model.deliveryInspectionApprovedBy ?? '',
|
|
|
|
|
|
|
|
// label: 'Approved by'.addTranslation,
|
|
|
|
|
|
|
|
// onChanged: (value) {},
|
|
|
|
|
|
|
|
// onPick: (value) {
|
|
|
|
|
|
|
|
// model.deliveryInspectionApprovedBy = value.fullName;
|
|
|
|
|
|
|
|
// setState(() {});
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ] //No HMG user free text insted of dropdown ...
|
|
|
|
|
|
|
|
// else ...[
|
|
|
|
|
|
|
|
// AppTextFormField(
|
|
|
|
|
|
|
|
// labelText: 'Inspected by'.addTranslation,
|
|
|
|
|
|
|
|
// backgroundColor: AppColor.fieldBgColor(context),
|
|
|
|
|
|
|
|
// initialValue: model.deliveryInspectionInspectedBy ?? '',
|
|
|
|
|
|
|
|
// textAlign: TextAlign.center,
|
|
|
|
|
|
|
|
// labelStyle: AppTextStyles.textFieldLabelStyle,
|
|
|
|
|
|
|
|
// showShadow: false,
|
|
|
|
|
|
|
|
// onChange: (value) {
|
|
|
|
|
|
|
|
// model.deliveryInspectionInspectedBy = value;
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// style: Theme.of(context).textTheme.titleMedium,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// 8.height,
|
|
|
|
|
|
|
|
// AppTextFormField(
|
|
|
|
|
|
|
|
// labelText: 'Approved by'.addTranslation,
|
|
|
|
|
|
|
|
// backgroundColor: AppColor.fieldBgColor(context),
|
|
|
|
|
|
|
|
// initialValue: model.deliveryInspectionApprovedBy ?? '',
|
|
|
|
|
|
|
|
// textAlign: TextAlign.center,
|
|
|
|
|
|
|
|
// labelStyle: AppTextStyles.textFieldLabelStyle,
|
|
|
|
|
|
|
|
// showShadow: false,
|
|
|
|
|
|
|
|
// onChange: (value) {
|
|
|
|
|
|
|
|
// model.deliveryInspectionApprovedBy = value;
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// style: Theme.of(context).textTheme.titleMedium,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
8.height,
|
|
|
|
8.height,
|
|
|
|
ADatePicker(
|
|
|
|
ADatePicker(
|
|
|
|
label: 'Inspected Date/Time From'.addTranslation,
|
|
|
|
label: 'Inspected Date/Time From'.addTranslation,
|
|
|
|
@ -385,7 +319,6 @@ class _DeliveryInspectionFormViewState extends State<DeliveryInspectionFormView>
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
8.height,
|
|
|
|
8.height,
|
|
|
|
ADatePicker(
|
|
|
|
ADatePicker(
|
|
|
|
label: 'Inspected Date/Time To'.addTranslation,
|
|
|
|
label: 'Inspected Date/Time To'.addTranslation,
|
|
|
|
@ -424,8 +357,20 @@ class _DeliveryInspectionFormViewState extends State<DeliveryInspectionFormView>
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
8.height,
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
'Total Time'.addTranslation,
|
|
|
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.black10),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
8.height,
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
formatInspectionDuration(model.totalTime),
|
|
|
|
|
|
|
|
style: AppTextStyles.bodyText2.copyWith(
|
|
|
|
|
|
|
|
color: context.isDark ? AppColor.neutral30 : AppColor.neutral120,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
);
|
|
|
|
).toShadowContainer(context, borderRadius: 20, padding: 12);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool _validateInspectionDates({DateTime? from, DateTime? to}) {
|
|
|
|
bool _validateInspectionDates({DateTime? from, DateTime? to}) {
|
|
|
|
@ -552,8 +497,20 @@ class _DeliveryInspectionFormViewState extends State<DeliveryInspectionFormView>
|
|
|
|
model.deliveryInspectionInspectedDateTo != null ? model.deliveryInspectionInspectedDateTo!.toString().toServiceRequestDetailsFormat : '-',
|
|
|
|
model.deliveryInspectionInspectedDateTo != null ? model.deliveryInspectionInspectedDateTo!.toString().toServiceRequestDetailsFormat : '-',
|
|
|
|
style: AppTextStyles.bodyText2.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral120),
|
|
|
|
style: AppTextStyles.bodyText2.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral120),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
8.height,
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
'Total Time'.addTranslation,
|
|
|
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.black10),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
8.height,
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
formatInspectionDuration(model.totalTime),
|
|
|
|
|
|
|
|
style: AppTextStyles.bodyText2.copyWith(
|
|
|
|
|
|
|
|
color: context.isDark ? AppColor.neutral30 : AppColor.neutral120,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
);
|
|
|
|
).toShadowContainer(context, borderRadius: 20, padding: 12);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget _inspectionTile({
|
|
|
|
Widget _inspectionTile({
|
|
|
|
@ -566,7 +523,7 @@ class _DeliveryInspectionFormViewState extends State<DeliveryInspectionFormView>
|
|
|
|
onTap: onTap,
|
|
|
|
onTap: onTap,
|
|
|
|
borderRadius: BorderRadius.circular(12),
|
|
|
|
borderRadius: BorderRadius.circular(12),
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
padding: const EdgeInsets.all(14),
|
|
|
|
padding: const EdgeInsets.all(12),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: AppColor.fieldBgColor(context),
|
|
|
|
color: AppColor.fieldBgColor(context),
|
|
|
|
borderRadius: BorderRadius.circular(12),
|
|
|
|
borderRadius: BorderRadius.circular(12),
|
|
|
|
@ -575,6 +532,7 @@ class _DeliveryInspectionFormViewState extends State<DeliveryInspectionFormView>
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Text(title, style: AppTextStyles.textFieldLabelStyle),
|
|
|
|
Text(title, style: AppTextStyles.textFieldLabelStyle),
|
|
|
|
6.height,
|
|
|
|
6.height,
|
|
|
|
@ -603,27 +561,34 @@ class _DeliveryInspectionFormViewState extends State<DeliveryInspectionFormView>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future<Lookup?> showAttachmentTypePicker() {
|
|
|
|
void _cancelTap() async {
|
|
|
|
return showDialog<Lookup>(
|
|
|
|
HelperFunction.cancelRequest(context: context, itemId: widget.deliveryTableModel.id!, requestId: widget.requestModel?.id);
|
|
|
|
context: context,
|
|
|
|
// showDialog(
|
|
|
|
builder: (_) {
|
|
|
|
// context: context,
|
|
|
|
return AlertDialog(
|
|
|
|
// builder: (BuildContext cxt) => AcknowledgeWorkDialog(
|
|
|
|
content: SingleItemDropDownMenu<Lookup, AttachmentTypeLookupProvider>(
|
|
|
|
// message: "Are you sure you want to mark this request as cancel ",
|
|
|
|
context: context,
|
|
|
|
// confirmButtonText: 'Ok',
|
|
|
|
title: context.translation.reason,
|
|
|
|
// cancelButtonText: 'Cancel',
|
|
|
|
showAsFullScreenDialog: false,
|
|
|
|
// onSave: () async {
|
|
|
|
onSelect: (value) {
|
|
|
|
// showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading());
|
|
|
|
Navigator.pop(context, value);
|
|
|
|
// await assetDeliveryProvider!.changeDeliveryStatusToCancel(itemId: widget.deliveryTableModel.id).then((status) async {
|
|
|
|
},
|
|
|
|
// Navigator.pop(context);
|
|
|
|
),
|
|
|
|
// if (status) {
|
|
|
|
);
|
|
|
|
// Navigator.pop(context);
|
|
|
|
},
|
|
|
|
// await assetDeliveryProvider!.getAssetDeliveryTableListById(requestId: widget.requestModel?.id);
|
|
|
|
);
|
|
|
|
// }
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// onDiscard: () {},
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void _cancelTap() async {
|
|
|
|
void _saveTap() async {
|
|
|
|
|
|
|
|
_formKey.currentState!.save();
|
|
|
|
showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading());
|
|
|
|
showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading());
|
|
|
|
await assetDeliveryProvider!.changeDeliveryStatusToCancel(itemId: widget.deliveryTableModel.id).then((status) async {
|
|
|
|
model.assetDeliveryExternalDeliveryId = widget.deliveryTableModel.id;
|
|
|
|
|
|
|
|
await assetDeliveryProvider!.saveMasterInfoDeliveryInspection(requestPayload: model.toJson()).then((status) async {
|
|
|
|
Navigator.pop(context);
|
|
|
|
Navigator.pop(context);
|
|
|
|
if (status) {
|
|
|
|
if (status) {
|
|
|
|
Navigator.pop(context);
|
|
|
|
Navigator.pop(context);
|
|
|
|
@ -678,8 +643,8 @@ class _DeliveryInspectionFormViewState extends State<DeliveryInspectionFormView>
|
|
|
|
void _changeStatusTap() async {
|
|
|
|
void _changeStatusTap() async {
|
|
|
|
_formKey.currentState!.save();
|
|
|
|
_formKey.currentState!.save();
|
|
|
|
showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading());
|
|
|
|
showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading());
|
|
|
|
model.assetDeliveryExternalDeliveryId = widget.deliveryTableModel.id;
|
|
|
|
// await assetDeliveryProvider!.changeDeliveryStatus(requestPayload: model.toJson()).then((status) async {
|
|
|
|
await assetDeliveryProvider!.changeDeliveryStatus(requestPayload: model.toJson()).then((status) async {
|
|
|
|
await assetDeliveryProvider!.changeDeliveryStatus(itemId: widget.deliveryTableModel.id).then((status) async {
|
|
|
|
Navigator.pop(context);
|
|
|
|
Navigator.pop(context);
|
|
|
|
if (status) {
|
|
|
|
if (status) {
|
|
|
|
Navigator.pop(context);
|
|
|
|
Navigator.pop(context);
|
|
|
|
@ -707,6 +672,7 @@ class _DeliveryInspectionFormViewState extends State<DeliveryInspectionFormView>
|
|
|
|
return InspectionPersonBottomSheet(
|
|
|
|
return InspectionPersonBottomSheet(
|
|
|
|
title: title,
|
|
|
|
title: title,
|
|
|
|
isHmg: isHmg,
|
|
|
|
isHmg: isHmg,
|
|
|
|
|
|
|
|
tableId: widget.deliveryTableModel.id,
|
|
|
|
model: InspectionPersonModel(
|
|
|
|
model: InspectionPersonModel(
|
|
|
|
name: initialModel.name,
|
|
|
|
name: initialModel.name,
|
|
|
|
email: initialModel.email,
|
|
|
|
email: initialModel.email,
|
|
|
|
|