diff --git a/src/components/shopping/FullShoppingListPage.vue b/src/components/shopping/FullShoppingListPage.vue index 77b5b6a..28c2bf1 100644 --- a/src/components/shopping/FullShoppingListPage.vue +++ b/src/components/shopping/FullShoppingListPage.vue @@ -1,13 +1,19 @@ @@ -49,7 +55,7 @@ export default { const to = new Date(); to.setDate(to.getDate() + 7); - return { from, to, availableMeals: [], shoppingList: null, includedMeals: [], listByProduct: [] } + return { from, to, availableMeals: [], shoppingList: null, includedMeals: [], listByProduct: [], stockTaking: true, productsToShow: []} }, async beforeMount() { this.availableMeals = await data.getMeals(this.from, this.to); @@ -59,7 +65,8 @@ export default { shoppingList: { handler: 'updateLists', deep: true - } + }, + stockTaking: 'updateLists' }, methods: { async updateLists() { @@ -68,6 +75,7 @@ export default { this.includedMeals = this.shoppingList.requests.map(r => r.meal).filter(m => m); this.listByProduct = toProductsModel(this.shoppingList); + this.productsToShow = this.stockTaking ? this.listByProduct : this.listByProduct.filter(p => !p.fullyFound); }, async mealSelected(meal) { const request = await data.requestMeal(meal.id);