From a04538a089a8e981d9ef56d73a746999b349806b Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Fri, 27 Dec 2024 14:45:48 +0530 Subject: [PATCH 1/4] Improved: clearing the hard count component state on leaving the component (#528) --- src/locales/en.json | 2 ++ src/views/HardCount.vue | 57 +++++++++++++++++++++++++++-------------- 2 files changed, 40 insertions(+), 19 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index f83207d1..22206690 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -172,6 +172,8 @@ "Nearest due": "Nearest due", "No cycle counts found": "No cycle counts found", "No data found": "No data found", + "No facility found.": "No facility found.", + "No facility group found.": "No facility group found.", "No items found": "No items found", "No new file upload. Please try again.": "No new file upload. Please try again.", "No products found.": "No products found.", diff --git a/src/views/HardCount.vue b/src/views/HardCount.vue index fb665e3c..b1a9bd6c 100644 --- a/src/views/HardCount.vue +++ b/src/views/HardCount.vue @@ -67,28 +67,38 @@ - {{ translate("Select a facility group to hard count") }} - - - - {{ group.facilityGroupName }} - - + +
+

{{ translate("No facility group found.") }}

+
- {{ translate("Select facilities to hard count") }} - - - - - {{ facility.facilityName ? facility.facilityName : facility.facilityId }} -

{{ facility.facilityId }}

-
-
-
+ +
+

{{ translate("No facility found.") }}

+
import { translate } from "@/i18n"; import { calendarNumberOutline, checkmarkDoneOutline, storefrontOutline } from "ionicons/icons"; -import { IonBackButton, IonButton, IonCheckbox, IonContent, IonDatetime, IonFab, IonFabButton, IonHeader, IonIcon, IonInfiniteScroll, IonInfiniteScrollContent, IonInput, IonItem, IonLabel, IonList, IonListHeader, IonModal, IonPage, IonRadio, IonRadioGroup, IonSearchbar, IonSegment, IonSegmentButton, IonTitle, IonToggle, IonToolbar, onIonViewWillEnter} from "@ionic/vue"; +import { IonBackButton, IonButton, IonCheckbox, IonContent, IonDatetime, IonFab, IonFabButton, IonHeader, IonIcon, IonInfiniteScroll, IonInfiniteScrollContent, IonInput, IonItem, IonLabel, IonList, IonListHeader, IonModal, IonPage, IonRadio, IonRadioGroup, IonSearchbar, IonSegment, IonSegmentButton, IonTitle, IonToggle, IonToolbar, onIonViewWillEnter, onIonViewWillLeave} from "@ionic/vue"; import { ref, nextTick, computed, Ref } from "vue" import { hasError, getDateTime, getDateWithOrdinalSuffix, handleDateTimeInput, showToast } from "@/utils"; import logger from "@/logger" @@ -124,7 +134,7 @@ import store from "@/store"; import router from "@/router" import { UtilService } from "@/services/UtilService"; -const countName = ref(`Hard count - ${DateTime.now().toFormat('dd-MM-yyyy hh:mm:ss')}`); +const countName = ref(""); const selectedSegment = ref("group"); const dueDate = ref("") as Ref; const queryString = ref(""); @@ -143,9 +153,18 @@ const infiniteScrollRef = ref(""); const facilityGroups = computed(() => store.getters["util/getFacilityGroups"]) onIonViewWillEnter(async () => { + countName.value = `Hard count - ${DateTime.now().toFormat('dd-MM-yyyy hh:mm:ss')}`; await Promise.allSettled([store.dispatch("util/fetchFacilityGroups"), fetchFacilities()]); }) +onIonViewWillLeave(() => { + selectedFacilityGroupId.value = ""; + selectedFacilityIds.value = []; + selectedSegment.value = "group"; + dueDate.value = ""; + isAutoAssignEnabled.value = false; +}) + async function saveCount() { if(selectedSegment.value === "group" && !selectedFacilityGroupId.value) { showToast(translate("Please select a facility group.")) From 9c8e007966d14c0278a56bf929ceca443b4038ca Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Fri, 27 Dec 2024 15:01:43 +0530 Subject: [PATCH 2/4] Fixed: stopped enable scrolling in the facility group (#528) --- src/views/HardCount.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/HardCount.vue b/src/views/HardCount.vue index b1a9bd6c..294b4e24 100644 --- a/src/views/HardCount.vue +++ b/src/views/HardCount.vue @@ -7,7 +7,7 @@ - +