Stats working
This commit is contained in:
@@ -527,7 +527,7 @@ export default defineComponent({
|
||||
text: "deleted oil order",
|
||||
type: "success",
|
||||
});
|
||||
this.getPage
|
||||
this.getPage(1)
|
||||
} else {
|
||||
notify({
|
||||
title: "Failure",
|
||||
|
||||
@@ -17,9 +17,7 @@
|
||||
|
||||
<div class="flex start pb-10 text-2xl">Todays Deliveries </div>
|
||||
<div class="flex justify-end pb-5">
|
||||
<!-- <button @click.prevent="printtTicketAll" class="btn btn-accent btn-sm">
|
||||
Print All
|
||||
</button> -->
|
||||
|
||||
</div>
|
||||
|
||||
<div class="overflow-x-auto bg-neutral">
|
||||
|
||||
@@ -17,9 +17,7 @@
|
||||
|
||||
<div class="flex start pb-10 text-2xl">Tommorrows Deliveries </div>
|
||||
<div class="flex justify-end pb-5">
|
||||
<button @click.prevent="printtTicketAll" class="btn btn-accent btn-sm">
|
||||
Print All
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="overflow-x-auto bg-neutral">
|
||||
|
||||
@@ -17,9 +17,7 @@
|
||||
|
||||
<div class="flex start pb-10 text-2xl">Waiting Deliveries </div>
|
||||
<div class="flex justify-end pb-5">
|
||||
<button @click.prevent="printtTicketAll" class="btn btn-accent btn-sm">
|
||||
Print All
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="overflow-x-auto bg-neutral">
|
||||
|
||||
@@ -93,13 +93,13 @@
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<div class="col-span-12 py-2">
|
||||
Total Deliverys Done: 0
|
||||
Total Deliverys Done: {{ total_deliviers_done }}
|
||||
</div>
|
||||
<div class="col-span-12 py-2">
|
||||
Total Gallons Delivered: 0
|
||||
Total Gallons Delivered: {{ total_gallons_delivered }}
|
||||
</div>
|
||||
<div class="col-span-12 py-2">
|
||||
Total Prime: 0
|
||||
Total Prime: {{ total_primes }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -151,6 +151,9 @@ export default defineComponent({
|
||||
employee_type: '',
|
||||
employee_state: '',
|
||||
},
|
||||
total_deliviers_done: 0,
|
||||
total_gallons_delivered: 0,
|
||||
total_primes: 0,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -181,6 +184,7 @@ export default defineComponent({
|
||||
.then((response: any) => {
|
||||
if (response.data.ok) {
|
||||
this.user = response.data.user;
|
||||
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
@@ -200,12 +204,66 @@ export default defineComponent({
|
||||
if (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>
|
||||
|
||||
Reference in New Issue
Block a user