added checks emergency fixed bugs

This commit is contained in:
2024-09-27 14:13:09 -04:00
parent 54fa47268d
commit 7832e40bf3
17 changed files with 304 additions and 148 deletions

View File

@@ -26,6 +26,7 @@
View Oil Order # {{ deliveryOrder.id }}
</div>
<div class="grid grid-cols-12">
<div class="col-span-6">
<div class="col-span-12 font-bold">
Customer
@@ -78,6 +79,7 @@
</div>
<div class="col-span-6 ">
<div class="flex justify-end" v-if="deliveryOrder.id">
<router-link :to="{ name: 'deliveryEdit', params: { id: deliveryOrder.id } }">
<button class="btn btn-accent btn-sm">Edit Order</button>
@@ -264,6 +266,11 @@
{{ deliveryOrder.dispatcher_notes }}
</div>
</div>
<div class="col-span-6">
<a @click.prevent="deleteCall(deliveryOrder.id)">
<button class="btn btn-sm btn-error">Delete</button>
</a>
</div>
</div>
@@ -392,7 +399,29 @@ export default defineComponent({
return moment(String(value)).format('LLLL')
}
},
deleteCall(delivery_id: any) {
let path = import.meta.env.VITE_BASE_URL + '/delivery/delete/' + delivery_id;
axios({
method: 'delete',
url: path,
headers: authHeader(),
}).then((response: any) => {
if (response.data.ok) {
notify({
title: "Success",
text: "deleted oil order",
type: "success",
});
this.$router.push({ name: "customerProfile", params: { id: this.customer.id } });
} else {
notify({
title: "Failure",
text: "error deleting oil order",
type: "success",
});
}
})
},
userStatus() {
let path = import.meta.env.VITE_BASE_URL + '/auth/whoami';
axios({