From 4dbcebfab8f8ca6ac26b4c958ae5dd89231d6e61 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Mon, 8 Dec 2025 09:36:18 +0100 Subject: [PATCH] Add handling for transport removal events in BranchView component - Implemented logic to update vehicle and inventory data when a transport is removed, ensuring real-time synchronization with the selected branch. - Enhanced the component to refresh relevant sections (vehicles, inventory, storage) based on the transport removal event, improving user experience and data accuracy. --- frontend/src/views/falukant/BranchView.vue | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/frontend/src/views/falukant/BranchView.vue b/frontend/src/views/falukant/BranchView.vue index 89a3c57..118071c 100644 --- a/frontend/src/views/falukant/BranchView.vue +++ b/frontend/src/views/falukant/BranchView.vue @@ -682,6 +682,28 @@ export default { } } break; + case 'transport_removed': + // Transport wurde entfernt (z.B. abgebrochen oder gelöscht) + if (eventData.branch_id) { + // Nur aktualisieren, wenn der betroffene Branch ausgewählt ist + if (this.selectedBranch && this.selectedBranch.id === eventData.branch_id) { + // Fahrzeuge im Transport-Tab aktualisieren + this.loadVehicles(); + // Laufende Transporte im Inventar-Tab aktualisieren + if (this.$refs.saleSection) { + this.$refs.saleSection.loadInventory(); + this.$refs.saleSection.loadTransports(); + } + // Lager aktualisieren + if (this.$refs.storageSection) { + this.$refs.storageSection.loadStorageData(); + } + if (this.$refs.productionSection) { + this.$refs.productionSection.loadStorage(); + } + } + } + break; case 'inventory_updated': // Inventar wurde aktualisiert (durch Transporte) if (eventData.branch_id) {