From df8d22f7925d14102025b85757136e68371105ea Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Tue, 10 Feb 2026 15:18:57 +0300 Subject: [PATCH] chat employee id changes. --- .../medical_gas_inspection_detail_page.dart | 148 ++++--- .../update_delivery_notes_page.dart | 394 +++++++++--------- .../device_transfer_details.dart | 4 +- .../gas_refill/gas_refill_details.dart | 2 +- .../gas_refill/update_gas_refill_request.dart | 1 - .../create_request_type_bottom_sheet.dart | 16 +- .../my_request/all_requests_filter_page.dart | 14 +- .../my_request/my_requests_page.dart | 3 +- 8 files changed, 288 insertions(+), 294 deletions(-) diff --git a/lib/modules/medical_gas_inspection/medical_gas_inspection_detail_page.dart b/lib/modules/medical_gas_inspection/medical_gas_inspection_detail_page.dart index 023af466..9cb704a7 100644 --- a/lib/modules/medical_gas_inspection/medical_gas_inspection_detail_page.dart +++ b/lib/modules/medical_gas_inspection/medical_gas_inspection_detail_page.dart @@ -53,90 +53,88 @@ class _MedicalGasInspectionDetailPageState extends State URLs.getFileUrl(e.name ?? '') ?? '').toList() ?? []), + 1.width.expanded, + Text(model!.requestedDate!.toServiceRequestCardFormat, + textAlign: TextAlign.end, style: AppTextStyles.tinyFont.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral50)) ], + ), + 8.height, + Text("Request Details", style: AppTextStyles.heading4.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50)), + '${context.translation.requestNo}: ${model?.requestNumber ?? '-'}'.bodyText(context), + 'Requested by: ${model?.requestedBy ?? '-'}'.bodyText(context), + if (model?.lastModifiedBy != null) + 'Last Modified by: ${model?.lastModifiedBy ?? '-'}'.bodyText(context), + 'Order Type: ${model?.requestOrderType ?? '-'}'.bodyText(context), + 'Item Type: ${model?.itemType ?? '-'}'.bodyText(context), + 'Site: ${model?.site ?? '-'}'.bodyText(context), + 'Supplier Name: ${model?.supplier ?? '-'}'.bodyText(context), + 'Supplier Contact: ${model?.contact ?? '-'}'.bodyText(context), + 'Supplier Email: ${model?.email ?? '-'}'.bodyText(context), + if (model!.deliveryNoteAttachmentDto.isNotEmpty) ...[ + const Divider().defaultStyle(context), + Text( + "Attachments".addTranslation, + style: AppTextStyles.heading4.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50), + ), + FilesList(images: model!.deliveryNoteAttachmentDto.map((e) => URLs.getFileUrl(e.name ?? '') ?? '').toList() ?? []), ], - ).toShadowContainer(context, padding: 12), - ], - ).expanded, - if (model?.requestStatus?.value != null && model!.requestStatus!.value! < 3) - FooterActionButton.footerContainer( - context: context, - child: AppFilledButton( - buttonColor: AppColor.primary10, - label: model?.isSubmitted == true ? "Upload Delivery Note" : 'Update', - onPressed: () async { - if (model?.isSubmitted == true) { - bool? isRefresh = await Navigator.of(context).push(MaterialPageRoute(builder: (_) => UpdateDeliveryNotes(dataModel: model))); - if (isRefresh == true) { - _loadData(); - } - return; - } - bool? isRefresh = await Navigator.of(context).push(MaterialPageRoute( - builder: (_) => CreateMedicalGasRequestPage( - dataModel: model, - ))); + ], + ).toShadowContainer(context, padding: 12), + ], + ).expanded, + if (model?.requestStatus?.value != null && model!.requestStatus!.value! < 3) + FooterActionButton.footerContainer( + context: context, + child: AppFilledButton( + buttonColor: AppColor.primary10, + label: model?.isSubmitted == true ? "Upload Delivery Note" : 'Update', + onPressed: () async { + if (model?.isSubmitted == true) { + bool? isRefresh = await Navigator.of(context).push(MaterialPageRoute(builder: (_) => UpdateDeliveryNotes(dataModel: model))); if (isRefresh == true) { _loadData(); } - }), - ), - ], - ), - )); + return; + } + bool? isRefresh = await Navigator.of(context).push(MaterialPageRoute( + builder: (_) => CreateMedicalGasRequestPage( + dataModel: model, + ))); + if (isRefresh == true) { + _loadData(); + } + }), + ), + ], + )); } Widget labelValueText(BuildContext context, String label, String? value) { diff --git a/lib/modules/medical_gas_inspection/update_delivery_notes_page.dart b/lib/modules/medical_gas_inspection/update_delivery_notes_page.dart index 9351070a..45f2e604 100644 --- a/lib/modules/medical_gas_inspection/update_delivery_notes_page.dart +++ b/lib/modules/medical_gas_inspection/update_delivery_notes_page.dart @@ -80,211 +80,209 @@ class _UpdateDeliveryNotesState extends State { // _update(context: context); // }, ), - body: SafeArea( - child: Form( - key: _formKey, - child: Column( - children: [ - ListView( - padding: const EdgeInsets.all(16), - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ADatePicker( - label: "Delivered Date", - hideShadow: true, - backgroundColor: AppColor.fieldBgColor(context), - from: DateTime.now().subtract(const Duration(days: 365 * 3)), - date: formModel.deliveredDate, - formatDateWithTime: true, - onDatePicker: (selectedDate) { - showTimePicker( - context: context, - initialTime: TimeOfDay.now(), - ).then((selectedTime) { - if (selectedTime != null) { - formModel.deliveredDate = DateTime(selectedDate.year, selectedDate.month, selectedDate.day, selectedTime.hour, selectedTime.minute); - setState(() {}); - } - }); - }, - ), - 16.height, - AppTextFormField( - initialValue: formModel.deliveryNoteNumber, - labelText: "Delivery Notes", - // validator: (value) { - // if ((value ?? "").isEmpty) return "Delivery Notes Required"; - // return null; - // }, - backgroundColor: AppColor.fieldBgColor(context), - labelStyle: AppTextStyles.textFieldLabelStyle.copyWith(color: AppColor.textColor(context)), - floatingLabelStyle: AppTextStyles.textFieldLabelStyle.copyWith(color: AppColor.textColor(context)), - showShadow: false, - textInputType: TextInputType.multiline, - makeMultiLinesNull: true, - onChange: (value) { - formModel.deliveryNoteNumber = value; - }, - ), - 16.height, - - //Older design code - // MultipleItemDropDownMenu( - // context: context, - // showAsBottomSheet: true, - // backgroundColor: AppColor.neutral100, - // showShadow: false, - // showCancel: true, - // requestById: context.userProvider.user?.clientId, - // title: 'Delivered Items'.addTranslation, - // staticData: formModel.deliveredItemList, - // initialValue: selectedItemList, - // onSelect: (value) { - // if ((value ?? []).isNotEmpty) { - // WidgetsBinding.instance.addPostFrameCallback((_) { - // if (!mounted) return; - // setState(() { - // selectedItemList = value ?? []; - // }); - // }); - // } - // }, - // ), - // if (selectedItemList.isNotEmpty) ...[ - // 8.height, - // ListView.separated( - // separatorBuilder: (_, __) => 12.height, - // itemCount: selectedItemList.length, - // shrinkWrap: true, - // physics: const NeverScrollableScrollPhysics(), - // itemBuilder: (context, index) { - // MedicalGasRequestDetailModel model = selectedItemList[index]; - // return AppTextFormField( - // labelText: '${model.name} (Req Qty =${model.requestedQuantity})', - // hintText: 'Enter Delivered Quantity'.addTranslation, - // backgroundColor: AppColor.fieldBgColor(context), - // initialValue: model.deliveredQuantity != null ? model.deliveredQuantity?.toInt().toString() : '', - // textAlign: TextAlign.center, - // enable: true, - // textInputType: TextInputType.number, - // labelStyle: AppTextStyles.textFieldLabelStyle, - // showShadow: false, - // onChange: (value) { - // if (value.isNotEmpty) { - // model.deliveredQuantity = double.tryParse(value); - // } - // }, - // style: Theme.of(context).textTheme.titleMedium, - // ); - // }, - // ) - // ], - if (formModel.deliveredItemList.isNotEmpty) ...[ - _ItemRowLayout( - left: 'Items'.addTranslation.bodyText(context).custom(color: AppColor.textColor(context)), - right: 'Delivered Qty'.addTranslation.bodyText(context).custom(color: AppColor.textColor(context)), - ), - 8.height, - ListView.separated( - separatorBuilder: (_, __) => 12.height, - itemCount: formModel.deliveredItemList.length, - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemBuilder: (context, index) { - MedicalGasRequestDetailModel model = formModel.deliveredItemList[index]; - return itemQuantityFieldWidget(index: index, model: model, context: context); - }, - ) - ], - 16.height, + body: Form( + key: _formKey, + child: Column( + children: [ + ListView( + padding: const EdgeInsets.all(16), + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ADatePicker( + label: "Delivered Date", + hideShadow: true, + backgroundColor: AppColor.fieldBgColor(context), + from: DateTime.now().subtract(const Duration(days: 365 * 3)), + date: formModel.deliveredDate, + formatDateWithTime: true, + onDatePicker: (selectedDate) { + showTimePicker( + context: context, + initialTime: TimeOfDay.now(), + ).then((selectedTime) { + if (selectedTime != null) { + formModel.deliveredDate = DateTime(selectedDate.year, selectedDate.month, selectedDate.day, selectedTime.hour, selectedTime.minute); + setState(() {}); + } + }); + }, + ), + 16.height, + AppTextFormField( + initialValue: formModel.deliveryNoteNumber, + labelText: "Delivery Notes", + // validator: (value) { + // if ((value ?? "").isEmpty) return "Delivery Notes Required"; + // return null; + // }, + backgroundColor: AppColor.fieldBgColor(context), + labelStyle: AppTextStyles.textFieldLabelStyle.copyWith(color: AppColor.textColor(context)), + floatingLabelStyle: AppTextStyles.textFieldLabelStyle.copyWith(color: AppColor.textColor(context)), + showShadow: false, + textInputType: TextInputType.multiline, + makeMultiLinesNull: true, + onChange: (value) { + formModel.deliveryNoteNumber = value; + }, + ), + 16.height, - AttachmentPicker( - label: 'Upload Attachment', - attachment: formModel.attachments, - buttonColor: AppColor.primary10, - // showAsListView: true, - onlyImages: false, - buttonIcon: 'attachment_icon'.toSvgAsset( - color: AppColor.primary10, - ), - ), - 16.height, - //should create a reusable widget. - Row( - children: [ - Checkbox( - value: formModel.isPressureChecked, - visualDensity: const VisualDensity(horizontal: -4.0, vertical: -4.0), - activeColor: AppColor.blueStatus(context), - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - onChanged: (value) { - setState(() { - formModel.isPressureChecked = value!; - }); - }), - 12.width, - "I Acknowledge that the received medical gases cylinders have been tested for pressure." - .addTranslation - .bodyText(context) - .custom(color: context.isDark ? AppColor.primary50 : AppColor.neutral120) - .expanded, - ], + //Older design code + // MultipleItemDropDownMenu( + // context: context, + // showAsBottomSheet: true, + // backgroundColor: AppColor.neutral100, + // showShadow: false, + // showCancel: true, + // requestById: context.userProvider.user?.clientId, + // title: 'Delivered Items'.addTranslation, + // staticData: formModel.deliveredItemList, + // initialValue: selectedItemList, + // onSelect: (value) { + // if ((value ?? []).isNotEmpty) { + // WidgetsBinding.instance.addPostFrameCallback((_) { + // if (!mounted) return; + // setState(() { + // selectedItemList = value ?? []; + // }); + // }); + // } + // }, + // ), + // if (selectedItemList.isNotEmpty) ...[ + // 8.height, + // ListView.separated( + // separatorBuilder: (_, __) => 12.height, + // itemCount: selectedItemList.length, + // shrinkWrap: true, + // physics: const NeverScrollableScrollPhysics(), + // itemBuilder: (context, index) { + // MedicalGasRequestDetailModel model = selectedItemList[index]; + // return AppTextFormField( + // labelText: '${model.name} (Req Qty =${model.requestedQuantity})', + // hintText: 'Enter Delivered Quantity'.addTranslation, + // backgroundColor: AppColor.fieldBgColor(context), + // initialValue: model.deliveredQuantity != null ? model.deliveredQuantity?.toInt().toString() : '', + // textAlign: TextAlign.center, + // enable: true, + // textInputType: TextInputType.number, + // labelStyle: AppTextStyles.textFieldLabelStyle, + // showShadow: false, + // onChange: (value) { + // if (value.isNotEmpty) { + // model.deliveredQuantity = double.tryParse(value); + // } + // }, + // style: Theme.of(context).textTheme.titleMedium, + // ); + // }, + // ) + // ], + if (formModel.deliveredItemList.isNotEmpty) ...[ + _ItemRowLayout( + left: 'Items'.addTranslation.bodyText(context).custom(color: AppColor.textColor(context)), + right: 'Delivered Qty'.addTranslation.bodyText(context).custom(color: AppColor.textColor(context)), ), 8.height, - Row( - // mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Checkbox( - value: formModel.isInspectedGasLeak, - visualDensity: const VisualDensity(horizontal: -4.0, vertical: -4.0), - activeColor: AppColor.blueStatus(context), - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - onChanged: (value) { - setState(() { - formModel.isInspectedGasLeak = value!; - }); - }), - 12.width, - "I Acknowledge that the received medical gases cylinders have been inspected for leak test." - .addTranslation - .bodyText(context) - .custom(color: context.isDark ? AppColor.primary50 : AppColor.neutral120) - .expanded, - ], - ), + ListView.separated( + separatorBuilder: (_, __) => 12.height, + itemCount: formModel.deliveredItemList.length, + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (context, index) { + MedicalGasRequestDetailModel model = formModel.deliveredItemList[index]; + return itemQuantityFieldWidget(index: index, model: model, context: context); + }, + ) ], - ).toShadowContainer(context, padding: 12), - ], - ).expanded, - FooterActionButton.footerContainer( - context: context, - child: Row( - children: [ - AppFilledButton( - buttonColor: AppColor.primary10, - label: 'Save'.addTranslation, - onPressed: () { - _update(context: context); - }, - // buttonColor: AppColor.primary10, - ).expanded, - 8.width, - AppFilledButton( + 16.height, + + AttachmentPicker( + label: 'Upload Attachment', + attachment: formModel.attachments, buttonColor: AppColor.primary10, - label: 'Submit'.addTranslation, - onPressed: () { - _update(context: context, isSubmitted: true); - }, - // buttonColor: AppColor.primary10, - ).expanded, + // showAsListView: true, + onlyImages: false, + buttonIcon: 'attachment_icon'.toSvgAsset( + color: AppColor.primary10, + ), + ), + 16.height, + //should create a reusable widget. + Row( + children: [ + Checkbox( + value: formModel.isPressureChecked, + visualDensity: const VisualDensity(horizontal: -4.0, vertical: -4.0), + activeColor: AppColor.blueStatus(context), + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + onChanged: (value) { + setState(() { + formModel.isPressureChecked = value!; + }); + }), + 12.width, + "I Acknowledge that the received medical gases cylinders have been tested for pressure." + .addTranslation + .bodyText(context) + .custom(color: context.isDark ? AppColor.primary50 : AppColor.neutral120) + .expanded, + ], + ), + 8.height, + Row( + // mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Checkbox( + value: formModel.isInspectedGasLeak, + visualDensity: const VisualDensity(horizontal: -4.0, vertical: -4.0), + activeColor: AppColor.blueStatus(context), + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + onChanged: (value) { + setState(() { + formModel.isInspectedGasLeak = value!; + }); + }), + 12.width, + "I Acknowledge that the received medical gases cylinders have been inspected for leak test." + .addTranslation + .bodyText(context) + .custom(color: context.isDark ? AppColor.primary50 : AppColor.neutral120) + .expanded, + ], + ), ], - ), + ).toShadowContainer(context, padding: 12), + ], + ).expanded, + FooterActionButton.footerContainer( + context: context, + child: Row( + children: [ + AppFilledButton( + buttonColor: AppColor.primary10, + label: 'Save'.addTranslation, + onPressed: () { + _update(context: context); + }, + // buttonColor: AppColor.primary10, + ).expanded, + 8.width, + AppFilledButton( + buttonColor: AppColor.primary10, + label: 'Submit'.addTranslation, + onPressed: () { + _update(context: context, isSubmitted: true); + }, + // buttonColor: AppColor.primary10, + ).expanded, + ], ), - ], - ), + ), + ], ), )); // .handlePopScope( diff --git a/lib/modules/tm_module/device_transfer/device_transfer_details.dart b/lib/modules/tm_module/device_transfer/device_transfer_details.dart index 6e843398..9ef3aac9 100644 --- a/lib/modules/tm_module/device_transfer/device_transfer_details.dart +++ b/lib/modules/tm_module/device_transfer/device_transfer_details.dart @@ -228,7 +228,7 @@ class _DeviceTransferDetailsState extends State { requestId: widget.model.id!.toInt(), assigneeEmployeeNumber: _model!.senderAssignedEmployeeNumber, myLoginUserID: context.userProvider.user!.employeeId ?? context.userProvider.user!.username!, - contactEmployeeINumber: _model!.assetTransferContactPersons!.first.employeeNumber, + contactEmployeeINumber: _model!.assetTransferContactPersons!.first.employeeId ?? _model!.assetTransferContactPersons!.first.employeeNumber, ), if ((_userProvider!.user?.type == UsersTypes.engineer)) if (isCurrentEngineerEligibleForEdit && isCurrentRequestEditAble) @@ -289,7 +289,7 @@ class _DeviceTransferDetailsState extends State { requestId: widget.model.id!.toInt(), assigneeEmployeeNumber: isSender ? _deviceTransfer.senderAssignedEmployeeNumber! : _deviceTransfer.receiverAssignedEmployeeNumber!, myLoginUserID: context.userProvider.user!.employeeId ?? context.userProvider.user!.username!, - contactEmployeeINumber: _deviceTransfer.assetTransferContactPersons!.first.employeeNumber, + contactEmployeeINumber: _model!.assetTransferContactPersons!.first.employeeId ?? _deviceTransfer.assetTransferContactPersons!.first.employeeNumber, ), if ((_userProvider!.user?.type == UsersTypes.engineer)) if (isCurrentEngineerEligibleForEdit && !isCurrentRequestClosed) diff --git a/lib/modules/tm_module/gas_refill/gas_refill_details.dart b/lib/modules/tm_module/gas_refill/gas_refill_details.dart index c785a6a1..91fac826 100644 --- a/lib/modules/tm_module/gas_refill/gas_refill_details.dart +++ b/lib/modules/tm_module/gas_refill/gas_refill_details.dart @@ -73,7 +73,7 @@ class _GasRefillDetailsPageState extends State { requestId: widget.model.id!.toInt(), assigneeEmployeeNumber: _gasRefillModel.assignedEmployee?.employeeId!, myLoginUserID: context.userProvider.user!.employeeId ?? context.userProvider.user!.username!, - contactEmployeeINumber: _gasRefillModel.gasRefillContactPerson!.first.employeeCode!, + contactEmployeeINumber: _gasRefillModel.gasRefillContactPerson!.first.employeeId ?? _gasRefillModel.gasRefillContactPerson!.first.employeeCode!, ); }) ], diff --git a/lib/modules/tm_module/gas_refill/update_gas_refill_request.dart b/lib/modules/tm_module/gas_refill/update_gas_refill_request.dart index 5184dd54..2084be5a 100644 --- a/lib/modules/tm_module/gas_refill/update_gas_refill_request.dart +++ b/lib/modules/tm_module/gas_refill/update_gas_refill_request.dart @@ -254,7 +254,6 @@ class _UpdateGasRefillRequestState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - 8.height, SingleItemDropDownMenu( context: context, title: context.translation.quantity, diff --git a/lib/new_views/pages/land_page/create_request_type_bottom_sheet.dart b/lib/new_views/pages/land_page/create_request_type_bottom_sheet.dart index d01098a2..2f0fdf37 100644 --- a/lib/new_views/pages/land_page/create_request_type_bottom_sheet.dart +++ b/lib/new_views/pages/land_page/create_request_type_bottom_sheet.dart @@ -116,11 +116,9 @@ class CreateRequestModel { if (context.userProvider.isQualityUser && context.settingProvider.isUserFlowMedical) { list.add(CreateRequestModel("Equipment Internal Audit Checklist".addTranslation, "add_icon", CreateEquipmentInternalAuditForm.id)); list.add(CreateRequestModel("System Internal Audit Checklist".addTranslation, "add_icon", CreateSystemInternalAuditForm.id)); - } - else if (context.userProvider.isAssessor) { + } else if (context.userProvider.isAssessor) { list.add(CreateRequestModel("TRAF".addTranslation, "add_icon", CreateTRAFRequestPage.id)); - } - else if (context.userProvider.isEngineer) { + } else if (context.userProvider.isEngineer) { if (Provider.of(context, listen: false).engineerCanCreateCM) { list.add(CreateRequestModel(context.translation.correctiveMaintenance, "add_icon", CreateCMRequest.id)); } @@ -128,16 +126,18 @@ class CreateRequestModel { //TODO uncommit this to enable task. list.add(CreateRequestModel(context.translation.task, "add_icon", CreateTaskView.id)); //Need to add check from permission Api. - // if (Provider.of(context, listen: false).engineerCanCreateCM) { - list.add(CreateRequestModel('Medical Gas'.addTranslation, "add_icon", CreateMedicalGasRequestPage.id)); - // } + if ((context.settingProvider.isUserFlowMedical)) { + list.add(CreateRequestModel('Medical Gas'.addTranslation, "add_icon", CreateMedicalGasRequestPage.id)); + } } else { list.add(CreateRequestModel(context.translation.correctiveMaintenance, "add_icon", CreateCMRequest.id)); list.add(CreateRequestModel(context.translation.gasRefill, "add_icon", GasRefillRequestForm.routeName)); list.add(CreateRequestModel(context.translation.transferAsset, "add_icon", CreateDeviceTransferRequest.id)); //TODO uncommit this to enable task. list.add(CreateRequestModel(context.translation.task, "add_icon", CreateTaskView.id)); - list.add(CreateRequestModel("TRAF".addTranslation, "add_icon", CreateTRAFRequestPage.id)); + if ((context.settingProvider.isUserFlowMedical)) { + list.add(CreateRequestModel("TRAF".addTranslation, "add_icon", CreateTRAFRequestPage.id)); + } // Hide Loan // list.add(CreateRequestModel('Loan Equipment Request'.addTranslation, "add_icon", CreateLoanRequestPage.id)); } diff --git a/lib/new_views/pages/land_page/my_request/all_requests_filter_page.dart b/lib/new_views/pages/land_page/my_request/all_requests_filter_page.dart index 7cb33051..bca9e7f6 100644 --- a/lib/new_views/pages/land_page/my_request/all_requests_filter_page.dart +++ b/lib/new_views/pages/land_page/my_request/all_requests_filter_page.dart @@ -81,9 +81,9 @@ class _AllRequestsFilterPageState extends State { if (isEngineer) { types[context.translation.recurrentWo] = 5; - if (context.settingProvider.isUserFlowMedical) types["Equipment Internal Audit".addTranslation] = 10; - if (context.settingProvider.isUserFlowMedical) types["System Internal Audit".addTranslation] = 11; - if (context.settingProvider.isUserFlowMedical) types["Medical Gas Inspection".addTranslation] = 11; + if (context.settingProvider.isUserFlowMedical) types["Equipment Internal Audit".addTranslation] = 10; + if (context.settingProvider.isUserFlowMedical) types["System Internal Audit".addTranslation] = 11; + if (context.settingProvider.isUserFlowMedical) types["Medical Gas Inspection".addTranslation] = 11; } if (context.settingProvider.isUserFlowMedical && isEngineer) { @@ -97,17 +97,17 @@ class _AllRequestsFilterPageState extends State { } }); //Hide traf - if (!isEngineer) { + if (!isEngineer && context.settingProvider.isUserFlowMedical) { types['TRAF'] = 9; } - if (context.userProvider.isAssessor) { + if (context.settingProvider.isUserFlowMedical && context.userProvider.isAssessor) { types = {"TRAF": 9}; } if (context.userProvider.isQualityUser) { if (context.settingProvider.isUserFlowMedical) types = {'Recall and Alert': 7}; - if (context.settingProvider.isUserFlowMedical) types['Equipment Internal Audit'] = 10; - if (context.settingProvider.isUserFlowMedical) types['System Internal Audit'] = 11; + if (context.settingProvider.isUserFlowMedical) types['Equipment Internal Audit'] = 10; + if (context.settingProvider.isUserFlowMedical) types['System Internal Audit'] = 11; } if (context.userProvider.isCommissioningEngineer) { ///TODO need to check what other requests type needed here. diff --git a/lib/new_views/pages/land_page/my_request/my_requests_page.dart b/lib/new_views/pages/land_page/my_request/my_requests_page.dart index 8209f2c8..dc3f93c5 100644 --- a/lib/new_views/pages/land_page/my_request/my_requests_page.dart +++ b/lib/new_views/pages/land_page/my_request/my_requests_page.dart @@ -63,7 +63,7 @@ class _MyRequestsPageState extends State { } }); //Hide TRAF. - if (context.userProvider.user!.type == UsersTypes.normal_user) { + if (context.settingProvider.isUserFlowMedical && context.userProvider.user!.type == UsersTypes.normal_user) { requestsList.add(Request(9, 'TRAF')); } if (context.userProvider.isEngineer && context.settingProvider.isUserFlowMedical) { @@ -74,7 +74,6 @@ class _MyRequestsPageState extends State { requestsList.add(Request(14, "Medical Gas Inspection")); } - // Hide Loan // requestsList.add(Request(12, "Loan Equipment"));