bug fixes. added auto table

This commit is contained in:
2024-12-28 15:53:49 -05:00
parent 01c448f368
commit 76877853cd
5 changed files with 69 additions and 29 deletions

View File

@@ -25,8 +25,6 @@
<form class="col-span-12 rounded-md px-8 pt-6 pb-8 mb-4 w-full" enctype="multipart/form-data"
@submit.prevent="onSubmit">
<div class="grid grid-cols-12">
<div class="col-span-6">
<div class="col-span-12 text-[18px] mt-5 mb-5">General Info</div>
@@ -292,12 +290,8 @@ export default defineComponent({
customer_home_type: number,
customer_state: number;
customer_description: string;
})
{
let path = import.meta.env.VITE_BASE_URL + "/customer/create";
axios({
method: "post",

View File

@@ -472,6 +472,41 @@
<hr class=" h-1 mx-auto my-4 bg-gray-800 border-0 rounded dark:bg-gray-400">
</div>
<div class="col-span-12 p-5">
<div class="grid grid-cols-12">
<div class="col-span-12 font-bold flex text-2xl">Automatic Deliveries</div>
</div>
<div class="grid grid-cols-12 bg-neutral">
<table class="table col-span-12">
<!-- head -->
<thead>
<tr>
<th>id</th>
<th>Name</th>
<th>Address</th>
<th>Town</th>
<th>Gallons</th>
<th>Date</th>
</tr>
</thead>
<tbody>
<!-- row 1 -->
<tr v-for="auto in autodeliveries" :key="auto['id']">
<td>{{ auto['id'] }}</td>
<td>{{ auto['customer_full_name'] }}</td>
<td>{{ auto['customer_address'] }}</td>
<td>{{ auto['customer_town'] }}</td>
<td>{{ auto['gallons_delivered'] }}</td>
<td>{{ auto['fill_date'] }}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col-span-12 p-5">
<div class="grid grid-cols-12">
<div class="col-span-12 font-bold flex text-2xl">Orders</div>
@@ -485,8 +520,6 @@
<th>id</th>
<th>Status</th>
<th>Name</th>
<th>Address</th>
<th>Town</th>
<th>Gallons</th>
@@ -529,7 +562,6 @@
<button class="btn btn-sm btn-secondary">Edit</button>
</router-link>
<router-link :to="{ name: 'finalizeTicket', params: { id: oil['id'] } }"
v-if="oil['delivery_status'] != 10">
<button class="btn btn-secondary btn-sm">Finalize</button>
@@ -538,20 +570,20 @@
<router-link :to="{ name: 'Ticket', params: { id: oil['id'] } }">
<button class="btn btn-success btn-sm">Print Ticket</button>
</router-link>
<!--
<a @click.prevent="deleteCall(oil['id'])">
<button class="btn btn-sm btn-error">Delete</button>
</a> -->
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
@@ -675,6 +707,7 @@ export default defineComponent({
},
deliveries: [],
autodeliveries: [],
delivery_page: 1,
delivery_perPage: 50,
delivery_recordsLength: 0,
@@ -733,6 +766,13 @@ export default defineComponent({
headers: authHeader(),
}).then((response: any) => {
this.automatic_status = response.data.status
if (this.automatic_status === 1){
this.getCustomerAutoDelivery(this.customer.id)
}
this.checktotalOil(this.customer.id)
})
},
@@ -877,6 +917,17 @@ export default defineComponent({
})
},
getCustomerAutoDelivery(userid: any) {
let path = import.meta.env.VITE_AUTO_URL + '/delivery/all/profile/' + userid ;
axios({
method: 'get',
url: path,
headers: authHeader(),
}).then((response: any) => {
this.autodeliveries = response.data
})
},
getCustomerDelivery(userid: any, delivery_page: any) {
let path = import.meta.env.VITE_BASE_URL + '/delivery/customer/' + userid + '/' + delivery_page;
axios({

View File

@@ -54,8 +54,6 @@
<div class="mb-4">
<label class="block text-white text-sm font-bold mb-2">Tank Size</label>
<input v-model="CreateTankForm.basicInfo.tank_size"
@@ -65,7 +63,6 @@
</div>
<div class="mb-4">
<label class="block text-white text-sm font-bold mb-2">Inside or Outside</label>
<label>

View File

@@ -747,7 +747,7 @@ export default defineComponent({
type: 'postive',
title: 'top'
})
this.$router.push({ name: "DeliveryHome" });
this.$router.push({ name: "deliveryOutForDelivery" });
}
else {
notify({
@@ -783,31 +783,29 @@ export default defineComponent({
.then((response: any) => {
if (response.status == 201) {
notify({
message: 'Confirmed Transaction',
type: 'positive',
position: 'top'
title: "Success",
text: "Confirmed Transaction",
type: "success",
})
this.$router.push({ name: "today" });
this.$router.push({ name: "deliveryOutForDelivery" });
}
else {
notify({
message: 'Form Error',
type: 'negative',
position: 'top'
title: "Error",
text: "Error Confirming Transaction",
type: "error",
})
}
})
},
FinalizeOrder(payload: {
cash_recieved: string,
check_number: number,
delivery_status: any,
driver_employee_id: number,
gallons_delivered: string,
customer_filled: boolean,
fill_location: number,
}) {
@@ -827,7 +825,7 @@ export default defineComponent({
type: "success",
});
this.CreateTransaction()
this.$router.push({ name: "deliveryWaiting" });
this.$router.push({ name: "deliveryOutForDelivery" });
}
if (response.data.error) {

View File

@@ -414,7 +414,7 @@
type: 'postive',
title: 'top'
})
this.$router.push({ name: "DeliveryHome" });
this.$router.push({ name: "auto" });
}
else {
notify({
@@ -503,7 +503,7 @@
type: 'positive',
position: 'top'
})
this.$router.push({ name: "today" });
this.$router.push({ name: "auto" });
}
else {
notify({