Verbesserung: Hinzufügen von Protokollausgaben zur Eventverarbeitung in StatusBar.vue und BranchView.vue

Änderungen:
- In der StatusBar.vue wurden Protokollausgaben hinzugefügt, um den Event-Typ und den Erfolg oder Fehler des fetchStatus-Aufrufs zu dokumentieren.
- In der BranchView.vue wurden Protokollausgaben hinzugefügt, um den Event-Typ und den Status der Aktualisierung aller Sektionen zu protokollieren.

Diese Anpassungen verbessern die Nachvollziehbarkeit der Eventverarbeitung und erleichtern die Fehlersuche.
This commit is contained in:
Torsten Schulz (local)
2025-09-08 13:43:57 +02:00
parent 368c3e0578
commit 5e2a091380
2 changed files with 12 additions and 1 deletions

View File

@@ -126,11 +126,17 @@ export default {
},
handleEvent(eventData) {
console.log('🔄 StatusBar: handleEvent aufgerufen mit:', eventData);
console.log('🔄 StatusBar: Event-Typ:', eventData.event);
switch (eventData.event) {
case 'falukantUpdateStatus':
case 'stock_change':
case 'familychanged':
this.fetchStatus();
console.log('🔄 StatusBar: Rufe fetchStatus() auf...');
this.fetchStatus().then(() => {
console.log('✅ StatusBar: fetchStatus() erfolgreich abgeschlossen');
}).catch((error) => {
console.error('❌ StatusBar: fetchStatus() Fehler:', error);
});
break;
default:
console.log('⚠️ StatusBar: Unbekanntes Event:', eventData.event);

View File

@@ -218,6 +218,8 @@ export default {
},
handleEvent(eventData) {
console.log('🔄 BranchView: handleEvent aufgerufen mit:', eventData);
console.log('🔄 BranchView: Event-Typ:', eventData.event);
switch (eventData.event) {
case 'production_ready':
this.$refs.productionSection?.loadProductions();
@@ -243,10 +245,13 @@ export default {
break;
case 'falukantUpdateStatus':
case 'falukantBranchUpdate':
console.log('🔄 BranchView: Lade alle Sektionen für', eventData.event);
console.log('🔄 BranchView: StatusBar ref:', this.$refs.statusBar);
this.$refs.statusBar?.fetchStatus();
this.$refs.productionSection?.loadProductions();
this.$refs.storageSection?.loadStorageData();
this.$refs.saleSection?.loadInventory();
console.log('✅ BranchView: Alle Sektionen aktualisiert');
break;
case 'knowledge_update':
this.loadProducts();