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.
This commit is contained in:
Torsten Schulz (local)
2025-12-08 09:36:18 +01:00
parent fadc301d41
commit 4dbcebfab8

View File

@@ -682,6 +682,28 @@ export default {
} }
} }
break; 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': case 'inventory_updated':
// Inventar wurde aktualisiert (durch Transporte) // Inventar wurde aktualisiert (durch Transporte)
if (eventData.branch_id) { if (eventData.branch_id) {