Update BranchView to refresh active tab data on tab change and modify 3D model for female toddler character
- Enhanced the activeTab watcher to refresh data only when the selected branch changes and the tab is switched. - Introduced a new refreshActiveTab method to load data for the currently active tab, improving data management and user experience. - Updated the female toddler 3D model file for better integration in the application.
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -468,10 +468,14 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
activeTab(newVal) {
|
activeTab(newVal, oldVal) {
|
||||||
if (newVal === 'taxes') {
|
// Nur neu laden, wenn der Tab wirklich gewechselt wurde und ein Branch ausgewählt ist
|
||||||
this.loadBranchTaxes();
|
if (!this.selectedBranch || newVal === oldVal) return;
|
||||||
}
|
|
||||||
|
// Alle Tabs neu laden, wenn gewechselt wird
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.refreshActiveTab();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
selectedBranch: {
|
selectedBranch: {
|
||||||
handler(newBranch) {
|
handler(newBranch) {
|
||||||
@@ -537,6 +541,33 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
refreshActiveTab() {
|
||||||
|
// Lade die Daten für den aktiven Tab neu
|
||||||
|
switch (this.activeTab) {
|
||||||
|
case 'director':
|
||||||
|
this.$refs.directorInfo?.refresh();
|
||||||
|
break;
|
||||||
|
case 'inventory':
|
||||||
|
this.$refs.saleSection?.loadInventory();
|
||||||
|
this.$refs.saleSection?.loadTransports();
|
||||||
|
break;
|
||||||
|
case 'production':
|
||||||
|
this.$refs.productionSection?.loadProductions();
|
||||||
|
this.$refs.productionSection?.loadStorage();
|
||||||
|
this.$refs.revenueSection?.refresh && this.$refs.revenueSection.refresh();
|
||||||
|
break;
|
||||||
|
case 'taxes':
|
||||||
|
this.loadBranchTaxes();
|
||||||
|
break;
|
||||||
|
case 'storage':
|
||||||
|
this.$refs.storageSection?.loadStorageData();
|
||||||
|
break;
|
||||||
|
case 'transport':
|
||||||
|
this.loadVehicles();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
async onBranchSelected(newBranch) {
|
async onBranchSelected(newBranch) {
|
||||||
this.selectedBranch = newBranch;
|
this.selectedBranch = newBranch;
|
||||||
// Branches neu laden, um das Wetter zu aktualisieren
|
// Branches neu laden, um das Wetter zu aktualisieren
|
||||||
@@ -549,13 +580,8 @@ export default {
|
|||||||
await this.loadVehicles();
|
await this.loadVehicles();
|
||||||
await this.loadProductPricesForCurrentBranch();
|
await this.loadProductPricesForCurrentBranch();
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.directorInfo?.refresh();
|
// Alle Tabs neu laden
|
||||||
this.$refs.saleSection?.loadInventory();
|
this.refreshActiveTab();
|
||||||
this.$refs.saleSection?.loadTransports();
|
|
||||||
this.$refs.productionSection?.loadProductions();
|
|
||||||
this.$refs.productionSection?.loadStorage();
|
|
||||||
this.$refs.storageSection?.loadStorageData();
|
|
||||||
this.$refs.revenueSection?.refresh && this.$refs.revenueSection.refresh();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// load tax info for this branch
|
// load tax info for this branch
|
||||||
|
|||||||
Reference in New Issue
Block a user