From ea1285707226966286e46a80324c951669011d33 Mon Sep 17 00:00:00 2001 From: Killer2OP Date: Fri, 13 Oct 2023 12:39:04 +0530 Subject: [PATCH 1/2] Save button updated --- src/components/MissingFacilitiesModal.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/MissingFacilitiesModal.vue b/src/components/MissingFacilitiesModal.vue index 1a36a596..6f3ff95d 100644 --- a/src/components/MissingFacilitiesModal.vue +++ b/src/components/MissingFacilitiesModal.vue @@ -24,7 +24,7 @@ - + @@ -77,6 +77,7 @@ export default defineComponent({ data() { return { itemsByFacilityId: {}, + changesMade: false; facilityMapping: {} as any } }, @@ -97,10 +98,13 @@ export default defineComponent({ } else { this.store.dispatch('stock/updateMissingFacilities', this.facilityMapping) } - + this.changesMade = false; this.closeModal(); showToast(translate("Changes have been successfully applied")); }, + detectChanges(){ + this.changesMade = true; + }, updateFacility(ev: any, facilityId: any){ this.facilityMapping[facilityId] = ev.target.value }, @@ -113,6 +117,9 @@ export default defineComponent({ return itemsByFacilityId; }, {}); } + }, + mounted() { + this.detectChanges(); }, setup() { const store = useStore(); From f4d481d5222c5b477071c9e31039ad34676e3a95 Mon Sep 17 00:00:00 2001 From: Pratham Mahajan <111378171+Killer2OP@users.noreply.github.com> Date: Fri, 13 Oct 2023 14:01:32 +0530 Subject: [PATCH 2/2] Update MissingFacilitiesModal.vue --- src/components/MissingFacilitiesModal.vue | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/components/MissingFacilitiesModal.vue b/src/components/MissingFacilitiesModal.vue index 6f3ff95d..36f834f7 100644 --- a/src/components/MissingFacilitiesModal.vue +++ b/src/components/MissingFacilitiesModal.vue @@ -24,7 +24,7 @@ - + @@ -77,7 +77,6 @@ export default defineComponent({ data() { return { itemsByFacilityId: {}, - changesMade: false; facilityMapping: {} as any } }, @@ -98,13 +97,9 @@ export default defineComponent({ } else { this.store.dispatch('stock/updateMissingFacilities', this.facilityMapping) } - this.changesMade = false; this.closeModal(); showToast(translate("Changes have been successfully applied")); }, - detectChanges(){ - this.changesMade = true; - }, updateFacility(ev: any, facilityId: any){ this.facilityMapping[facilityId] = ev.target.value }, @@ -117,9 +112,6 @@ export default defineComponent({ return itemsByFacilityId; }, {}); } - }, - mounted() { - this.detectChanges(); }, setup() { const store = useStore(); @@ -130,4 +122,4 @@ export default defineComponent({ }; }, }); - \ No newline at end of file +