Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(stats): new location total stat #140

Merged
merged 1 commit into from
Jan 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/views/Stats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
</v-card-text>
</v-card>
</v-col>

<v-col cols="12" md="6" lg="4">
<v-card title="Products" height="100%">
<v-card-text>
Expand All @@ -37,6 +38,17 @@
</v-card-text>
</v-card>
</v-col>

<v-col cols="12" md="6" lg="4">
<v-card title="Locations" height="100%">
<v-card-text>
<p>
Total
<strong>{{ locationTotal }}</strong>
</p>
</v-card-text>
</v-card>
</v-col>
</v-row>
</template>

Expand All @@ -51,6 +63,7 @@ export default {
priceWithoutProduct: null,
productTotal: null,
productWithPriceTotal: null,
locationTotal: null,
loading: false,
}
},
Expand All @@ -64,6 +77,7 @@ export default {
this.getPricesWithProduct()
this.getProducts()
this.getProductsWithPrice()
this.getLocations()
},
methods: {
getPrices() {
Expand Down Expand Up @@ -98,6 +112,14 @@ export default {
this.loading = false
})
},
getLocations() {
this.loading = true
return api.getLocations({ size: 1 })
.then((data) => {
this.locationTotal = data.total
this.loading = false
})
}
}
}
</script>