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" <form class="col-span-12 rounded-md px-8 pt-6 pb-8 mb-4 w-full" enctype="multipart/form-data"
@submit.prevent="onSubmit"> @submit.prevent="onSubmit">
<div class="grid grid-cols-12"> <div class="grid grid-cols-12">
<div class="col-span-6"> <div class="col-span-6">
<div class="col-span-12 text-[18px] mt-5 mb-5">General Info</div> <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_home_type: number,
customer_state: number; customer_state: number;
customer_description: string; customer_description: string;
}) })
{ {
let path = import.meta.env.VITE_BASE_URL + "/customer/create"; let path = import.meta.env.VITE_BASE_URL + "/customer/create";
axios({ axios({
method: "post", 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"> <hr class=" h-1 mx-auto my-4 bg-gray-800 border-0 rounded dark:bg-gray-400">
</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">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="col-span-12 p-5">
<div class="grid grid-cols-12"> <div class="grid grid-cols-12">
<div class="col-span-12 font-bold flex text-2xl">Orders</div> <div class="col-span-12 font-bold flex text-2xl">Orders</div>
@@ -485,8 +520,6 @@
<th>id</th> <th>id</th>
<th>Status</th> <th>Status</th>
<th>Name</th> <th>Name</th>
<th>Address</th> <th>Address</th>
<th>Town</th> <th>Town</th>
<th>Gallons</th> <th>Gallons</th>
@@ -529,7 +562,6 @@
<button class="btn btn-sm btn-secondary">Edit</button> <button class="btn btn-sm btn-secondary">Edit</button>
</router-link> </router-link>
<router-link :to="{ name: 'finalizeTicket', params: { id: oil['id'] } }" <router-link :to="{ name: 'finalizeTicket', params: { id: oil['id'] } }"
v-if="oil['delivery_status'] != 10"> v-if="oil['delivery_status'] != 10">
<button class="btn btn-secondary btn-sm">Finalize</button> <button class="btn btn-secondary btn-sm">Finalize</button>
@@ -538,20 +570,20 @@
<router-link :to="{ name: 'Ticket', params: { id: oil['id'] } }"> <router-link :to="{ name: 'Ticket', params: { id: oil['id'] } }">
<button class="btn btn-success btn-sm">Print Ticket</button> <button class="btn btn-success btn-sm">Print Ticket</button>
</router-link> </router-link>
<!-- <!--
<a @click.prevent="deleteCall(oil['id'])"> <a @click.prevent="deleteCall(oil['id'])">
<button class="btn btn-sm btn-error">Delete</button> <button class="btn btn-sm btn-error">Delete</button>
</a> --> </a> -->
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@@ -675,6 +707,7 @@ export default defineComponent({
}, },
deliveries: [], deliveries: [],
autodeliveries: [],
delivery_page: 1, delivery_page: 1,
delivery_perPage: 50, delivery_perPage: 50,
delivery_recordsLength: 0, delivery_recordsLength: 0,
@@ -733,6 +766,13 @@ export default defineComponent({
headers: authHeader(), headers: authHeader(),
}).then((response: any) => { }).then((response: any) => {
this.automatic_status = response.data.status 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) { getCustomerDelivery(userid: any, delivery_page: any) {
let path = import.meta.env.VITE_BASE_URL + '/delivery/customer/' + userid + '/' + delivery_page; let path = import.meta.env.VITE_BASE_URL + '/delivery/customer/' + userid + '/' + delivery_page;
axios({ axios({

View File

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

View File

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

View File

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