Stats working

This commit is contained in:
2024-08-06 11:08:43 -04:00
parent 99055964cf
commit d80862ea12
5 changed files with 66 additions and 14 deletions

View File

@@ -527,7 +527,7 @@ export default defineComponent({
text: "deleted oil order", text: "deleted oil order",
type: "success", type: "success",
}); });
this.getPage this.getPage(1)
} else { } else {
notify({ notify({
title: "Failure", title: "Failure",

View File

@@ -17,9 +17,7 @@
<div class="flex start pb-10 text-2xl">Todays Deliveries </div> <div class="flex start pb-10 text-2xl">Todays Deliveries </div>
<div class="flex justify-end pb-5"> <div class="flex justify-end pb-5">
<!-- <button @click.prevent="printtTicketAll" class="btn btn-accent btn-sm">
Print All
</button> -->
</div> </div>
<div class="overflow-x-auto bg-neutral"> <div class="overflow-x-auto bg-neutral">

View File

@@ -17,9 +17,7 @@
<div class="flex start pb-10 text-2xl">Tommorrows Deliveries </div> <div class="flex start pb-10 text-2xl">Tommorrows Deliveries </div>
<div class="flex justify-end pb-5"> <div class="flex justify-end pb-5">
<button @click.prevent="printtTicketAll" class="btn btn-accent btn-sm">
Print All
</button>
</div> </div>
<div class="overflow-x-auto bg-neutral"> <div class="overflow-x-auto bg-neutral">

View File

@@ -17,9 +17,7 @@
<div class="flex start pb-10 text-2xl">Waiting Deliveries </div> <div class="flex start pb-10 text-2xl">Waiting Deliveries </div>
<div class="flex justify-end pb-5"> <div class="flex justify-end pb-5">
<button @click.prevent="printtTicketAll" class="btn btn-accent btn-sm">
Print All
</button>
</div> </div>
<div class="overflow-x-auto bg-neutral"> <div class="overflow-x-auto bg-neutral">

View File

@@ -93,13 +93,13 @@
</div> </div>
<div class="col-span-6"> <div class="col-span-6">
<div class="col-span-12 py-2"> <div class="col-span-12 py-2">
Total Deliverys Done: 0 Total Deliverys Done: {{ total_deliviers_done }}
</div> </div>
<div class="col-span-12 py-2"> <div class="col-span-12 py-2">
Total Gallons Delivered: 0 Total Gallons Delivered: {{ total_gallons_delivered }}
</div> </div>
<div class="col-span-12 py-2"> <div class="col-span-12 py-2">
Total Prime: 0 Total Prime: {{ total_primes }}
</div> </div>
</div> </div>
</div> </div>
@@ -151,6 +151,9 @@ export default defineComponent({
employee_type: '', employee_type: '',
employee_state: '', employee_state: '',
}, },
total_deliviers_done: 0,
total_gallons_delivered: 0,
total_primes: 0,
} }
}, },
created() { created() {
@@ -181,6 +184,7 @@ export default defineComponent({
.then((response: any) => { .then((response: any) => {
if (response.data.ok) { if (response.data.ok) {
this.user = response.data.user; this.user = response.data.user;
} }
}) })
.catch(() => { .catch(() => {
@@ -200,12 +204,66 @@ export default defineComponent({
if (response.data) { if (response.data) {
this.employee = response.data; this.employee = response.data;
this.loaded = true; if (this.employee.id){
this.getEmployeeStatsDeliveriesDone(this.employee.id)
this.getEmployeeStatsGallonsDone(this.employee.id)
this.getEmployeeStatsPrimesDone(this.employee.id)
}
this.loaded = true
} }
}) })
}, },
getEmployeeStatsDeliveriesDone(userid: any) {
let path = import.meta.env.VITE_BASE_URL + "/stats/delivery/total/" + userid;
axios({
method: "get",
url: path,
withCredentials: true,
headers: authHeader(),
})
.then((response: any) => {
if (response.data) {
this.total_deliviers_done = response.data.data;
}
})
},
getEmployeeStatsGallonsDone(userid: any) {
let path = import.meta.env.VITE_BASE_URL + "/stats/gallons/total/" + userid;
axios({
method: "get",
url: path,
withCredentials: true,
headers: authHeader(),
})
.then((response: any) => {
if (response.data) {
this.total_gallons_delivered = response.data.data;
}
})
},
getEmployeeStatsPrimesDone(userid: any) {
let path = import.meta.env.VITE_BASE_URL + "/stats/primes/total/" + userid;
axios({
method: "get",
url: path,
withCredentials: true,
headers: authHeader(),
})
.then((response: any) => {
if (response.data) {
this.total_primes = response.data.data;
}
})
},
}, },
}) })
</script> </script>