bug fixes. added auto table
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user