added checks emergency fixed bugs
This commit is contained in:
@@ -238,7 +238,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-span-12 py-5 " v-if="deliveryOrder.payment_type == 1">
|
||||
<div class="flex">
|
||||
<div class="flex" v-if="userCardfound">
|
||||
<div class="rounded-md border-2 bg-accent">
|
||||
<div class="flex p-2">
|
||||
{{ userCard.type_of_card }}
|
||||
@@ -256,7 +256,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-span-12 py-5 " v-if="deliveryOrder.payment_type == 2">
|
||||
<div class="flex ">
|
||||
<div class="flex " v-if="userCardfound">
|
||||
<div class=" rounded-md border-2 bg-accent ">
|
||||
<div class="flex p-1 pl-4">
|
||||
{{ userCard.name_on_card }}
|
||||
@@ -271,7 +271,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-span-12 py-5 " v-if="deliveryOrder.payment_type == 3">
|
||||
<div class="flex ">
|
||||
<div class="flex " v-if="userCardfound">
|
||||
<div class=" rounded-md border-2 bg-accent ">
|
||||
<div class="flex p-1 pl-4">
|
||||
{{ userCard.name_on_card }}
|
||||
@@ -310,32 +310,30 @@
|
||||
${{ total_amount }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="col-span-6">
|
||||
<form class="rounded-md px-8 pb-8 mb-4 w-full" enctype="multipart/form-data" @submit.prevent="onSubmit">
|
||||
|
||||
|
||||
<div class="col-span-12 md:col-span-4 mb-5 md:mb-0 gap-10">
|
||||
<label class="block text-white text-sm font-bold cursor-pointer label">Cash</label>
|
||||
<input v-model="FinalizeOilOrderForm.cash" class="checkbox checkbox-xs" id="cash" type="checkbox" />
|
||||
</div>
|
||||
|
||||
<div class="col-span-12 md:col-span-4 mb-5 md:mb-0 gap-10">
|
||||
<label class="block text-white text-sm font-bold cursor-pointer label">Credit Card</label>
|
||||
<input v-model="FinalizeOilOrderForm.card" class="checkbox checkbox-xs" id="Credit" type="checkbox" />
|
||||
</div>
|
||||
|
||||
<div class="col-span-12 md:col-span-4 mb-5 md:mb-0 gap-10">
|
||||
<label class="block text-white text-sm font-bold cursor-pointer label">Check</label>
|
||||
<input v-model="FinalizeOilOrderForm.check" class="checkbox checkbox-xs" id="check" type="checkbox" />
|
||||
</div>
|
||||
|
||||
<div class="col-span-12 md:col-span-4 mb-5 md:mb-0 gap-10">
|
||||
<label class="block text-white text-sm font-bold cursor-pointer label">Other</label>
|
||||
<input v-model="FinalizeOilOrderForm.other" class="checkbox checkbox-xs" id="check" type="checkbox" />
|
||||
@@ -347,12 +345,14 @@
|
||||
class="input input-bordered input-sm w-full max-w-xs" id="title" type="text"
|
||||
placeholder="Cash from delivery recieved" />
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block text-white text-sm font-bold mb-2">check Number</label>
|
||||
<input v-model="FinalizeOilOrderForm.check_number"
|
||||
class="input input-bordered input-sm w-full max-w-xs" id="title" type="text"
|
||||
placeholder="Check Number" />
|
||||
</div>
|
||||
|
||||
<div class="flex-1 mb-4">
|
||||
<label class="block text-white text-sm font-bold mb-2">Customer Cards Payment</label>
|
||||
<select class="select select-bordered select-sm w-full max-w-xs" aria-label="Default select example"
|
||||
@@ -372,15 +372,14 @@
|
||||
{{ delivery['text'] }}
|
||||
</option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-span-12 md:col-span-4 mb-5 md:mb-0 gap-10">
|
||||
<label class="block text-white text-sm font-bold cursor-pointer label">Filled </label>
|
||||
<input v-model="FinalizeOilOrderForm.customer_filled" class="checkbox checkbox-xs" id="fill"
|
||||
type="checkbox" />
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block text-white text-sm font-bold mb-2">Gallons Delivered</label>
|
||||
<input v-model="FinalizeOilOrderForm.gallons_delivered"
|
||||
@@ -393,26 +392,33 @@
|
||||
<input v-model="FinalizeOilOrderForm.emergency" class="checkbox checkbox-xs" id="prime"
|
||||
type="checkbox" />
|
||||
</div>
|
||||
|
||||
<div class="col-span-12 md:col-span-4 mb-5 md:mb-0 gap-10">
|
||||
<label class="block text-white text-sm font-bold cursor-pointer label">Prime</label>
|
||||
<input v-model="FinalizeOilOrderForm.prime" class="checkbox checkbox-xs" id="prime" type="checkbox" />
|
||||
</div>
|
||||
|
||||
<div class="col-span-12 md:col-span-4 mb-5 md:mb-0 gap-10">
|
||||
<label class="block text-white text-sm font-bold cursor-pointer label">Same Day</label>
|
||||
<input v-model="FinalizeOilOrderForm.same_day" class="checkbox checkbox-xs" id="same_day"
|
||||
type="checkbox" />
|
||||
</div>
|
||||
|
||||
<div class="mb-4 ">
|
||||
<label class="block text-white text-sm font-bold mb-2">Fill Location</label>
|
||||
<input v-model="FinalizeOilOrderForm.fill_location"
|
||||
class="input input-bordered input-sm w-full max-w-xs" id="title" type="text"
|
||||
placeholder="Fill location in clock format" />
|
||||
</div>
|
||||
|
||||
<div class="col-span-12 md:col-span-12 flex mt-5 mb-5">
|
||||
<button class="btn btn-accent btn-sm">
|
||||
Finalize Delivery
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -448,6 +454,7 @@ export default defineComponent({
|
||||
user: {
|
||||
id: 0
|
||||
},
|
||||
userCardfound: false,
|
||||
deliveryStatus: [],
|
||||
userCards: [],
|
||||
deliveryNotesDriver: [],
|
||||
@@ -461,6 +468,7 @@ export default defineComponent({
|
||||
check: false,
|
||||
other: false,
|
||||
cash_recieved: '',
|
||||
fill_location: 0,
|
||||
check_number: 0,
|
||||
delivery_status: '',
|
||||
userCards: [],
|
||||
@@ -509,6 +517,13 @@ export default defineComponent({
|
||||
customer_home_type: 0,
|
||||
customer_phone_number: '',
|
||||
},
|
||||
customerDescription: {
|
||||
customer_id: 0,
|
||||
account_number: '',
|
||||
company_id: 0,
|
||||
fill_location: 0,
|
||||
description: '',
|
||||
},
|
||||
deliveryMoney: {
|
||||
time_added: '',
|
||||
total_amount_oil: '',
|
||||
@@ -606,7 +621,6 @@ export default defineComponent({
|
||||
this.deliveryOrder = response.data
|
||||
this.getCustomer(this.deliveryOrder.customer_id)
|
||||
|
||||
|
||||
if (this.deliveryOrder.payment_type === 1) {
|
||||
this.getPaymentCard(this.deliveryOrder.payment_card_id);
|
||||
}
|
||||
@@ -667,16 +681,10 @@ export default defineComponent({
|
||||
this.FinalizeOilOrderForm.check = false
|
||||
this.FinalizeOilOrderForm.other = true
|
||||
}
|
||||
|
||||
this.FinalizeOilOrderForm.gallons_delivered = response.data.gallons_delivered;
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
getPaymentCard(card_id: any) {
|
||||
let path = import.meta.env.VITE_BASE_URL + "/payment/card/" + card_id;
|
||||
axios({
|
||||
@@ -685,7 +693,15 @@ export default defineComponent({
|
||||
withCredentials: true,
|
||||
})
|
||||
.then((response: any) => {
|
||||
this.userCard = response.data;
|
||||
|
||||
if (response.data.userCard.card_number === ''){
|
||||
this.userCard === null;
|
||||
this.userCardfound = false;
|
||||
}
|
||||
else{
|
||||
this.userCard = response.data;
|
||||
this.userCardfound = true;
|
||||
}
|
||||
this.FinalizeOilOrderForm.userCards = response.data.id
|
||||
})
|
||||
.catch(() => {
|
||||
@@ -704,8 +720,6 @@ export default defineComponent({
|
||||
.catch(() => {
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
getCustomer(user_id: any) {
|
||||
let path = import.meta.env.VITE_BASE_URL + "/customer/" + user_id;
|
||||
axios({
|
||||
@@ -715,6 +729,7 @@ export default defineComponent({
|
||||
})
|
||||
.then((response: any) => {
|
||||
this.customer = response.data;
|
||||
this.getCustomerDescription(this.deliveryOrder.customer_id);
|
||||
this.getPaymentCards(this.deliveryOrder.customer_id);
|
||||
if (this.deliveryOrder.payment_type == 1) {
|
||||
this.getPaymentCard(this.deliveryOrder.payment_card_id)
|
||||
@@ -734,8 +749,25 @@ export default defineComponent({
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
getCustomerDescription(user_id: any) {
|
||||
let path = import.meta.env.VITE_BASE_URL + "/customer/description/" + user_id;
|
||||
axios({
|
||||
method: "get",
|
||||
url: path,
|
||||
withCredentials: true,
|
||||
})
|
||||
.then((response: any) => {
|
||||
this.customerDescription = response.data;
|
||||
this.FinalizeOilOrderForm.fill_location =this.customerDescription.fill_location
|
||||
})
|
||||
.catch(() => {
|
||||
notify({
|
||||
title: "Error",
|
||||
text: "Could not find customer",
|
||||
type: "error",
|
||||
});
|
||||
});
|
||||
},
|
||||
getOilPricing() {
|
||||
let path = import.meta.env.VITE_BASE_URL + "/info/price/oil/table";
|
||||
axios({
|
||||
@@ -767,9 +799,7 @@ export default defineComponent({
|
||||
this.priceprime = response.data.priceprime;
|
||||
this.pricesameday = response.data.pricesameday;
|
||||
this.total_amount = response.data.total_amount;
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
.catch(() => {
|
||||
notify({
|
||||
@@ -779,8 +809,6 @@ export default defineComponent({
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
UpdateAuto(payload: {
|
||||
gallons: string,
|
||||
delivery_id: string,
|
||||
@@ -811,7 +839,6 @@ export default defineComponent({
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getDeliveryStatusList() {
|
||||
let path = import.meta.env.VITE_BASE_URL + "/query/deliverystatus";
|
||||
axios({
|
||||
@@ -825,7 +852,6 @@ export default defineComponent({
|
||||
.catch(() => {
|
||||
});
|
||||
},
|
||||
|
||||
FinalizeOrder(payload: {
|
||||
cash: boolean,
|
||||
card: boolean,
|
||||
@@ -841,7 +867,7 @@ export default defineComponent({
|
||||
prime: boolean,
|
||||
same_day: boolean,
|
||||
emergency: boolean,
|
||||
|
||||
fill_location: number,
|
||||
|
||||
}) {
|
||||
let path = import.meta.env.VITE_BASE_URL + "/deliverydata/finalize/" + this.deliveryOrder.id;
|
||||
@@ -877,11 +903,9 @@ export default defineComponent({
|
||||
let auto_payload = {
|
||||
gallons: this.CreateOilOrderForm.basicInfo.gallons_delivered,
|
||||
delivery_id: this.deliveryOrder.id
|
||||
|
||||
}
|
||||
this.UpdateAuto(auto_payload);
|
||||
}
|
||||
|
||||
let payload = {
|
||||
cash: this.FinalizeOilOrderForm.cash,
|
||||
card: this.FinalizeOilOrderForm.card,
|
||||
@@ -897,7 +921,7 @@ export default defineComponent({
|
||||
prime: this.FinalizeOilOrderForm.prime,
|
||||
same_day: this.FinalizeOilOrderForm.same_day,
|
||||
emergency: this.FinalizeOilOrderForm.emergency,
|
||||
|
||||
fill_location: this.FinalizeOilOrderForm.fill_location,
|
||||
};
|
||||
this.FinalizeOrder(payload);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user