diff --git a/src/views/OtherStoresInventoryModal.vue b/src/views/OtherStoresInventoryModal.vue index 56a97f608..7c96536e0 100644 --- a/src/views/OtherStoresInventoryModal.vue +++ b/src/views/OtherStoresInventoryModal.vue @@ -10,9 +10,9 @@ - - - + + + {{ details.facilityName }} {{ details.stock }} @@ -36,7 +36,8 @@ import { IonNote, IonTitle, IonToolbar, - modalController } from "@ionic/vue"; + modalController +} from "@ionic/vue"; import { defineComponent } from "vue"; import { close } from "ionicons/icons"; import { useStore } from "@/store"; @@ -58,9 +59,26 @@ export default defineComponent({ IonToolbar }, props: ["otherStoresInventory"], + data() { + return{ + queryString: "", + filteredInventory: [] as any + } + }, + mounted() { + this.filteredInventory = this.otherStoresInventory.slice(); + }, methods: { closeModal() { modalController.dismiss({ dismissed: true }); + }, + searchFacilities(){ + if (this.queryString !== "") { + this.filteredInventory = this.otherStoresInventory.filter((facility: any) => + facility.facilityName.toLowerCase().includes(this.queryString.toLowerCase())); + } else { + this.filteredInventory = this.otherStoresInventory.slice(); + } } }, setup() {