Updated forms
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
{{ customer.customer_first_name }}
|
||||
{{ customer.customer_last_name }}
|
||||
</div>
|
||||
<div class="col-span-12 font-bold ">{{customer.customer_address}}</div>
|
||||
<div class="col-span-12 font-bold flex">
|
||||
<div class="pr-2">
|
||||
{{ customer.customer_town }},
|
||||
@@ -213,6 +214,8 @@
|
||||
{{ deliveryOrder.gallons_delivered }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-span-12" v-if="deliveryOrder.prime == 1">
|
||||
<div class="">
|
||||
Prime Fee:
|
||||
@@ -318,52 +321,37 @@
|
||||
|
||||
<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 class="grid grid-cols-12">
|
||||
<div class="col-span-12 mb-4">
|
||||
<label class="block text-white text-sm font-bold mb-2">Gallons Delivered</label>
|
||||
<input v-model="FinalizeOilOrderForm.gallons_delivered"
|
||||
class="input input-bordered input-sm w-full max-w-xs" id="title" type="text"
|
||||
placeholder="# gallons" />
|
||||
</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 class="col-span-12 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 (1-12)" />
|
||||
</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" />
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<div class="col-span-12 mb-4">
|
||||
<label class="block text-white text-sm font-bold mb-2">Cash Recieved</label>
|
||||
<input v-model="FinalizeOilOrderForm.cash_recieved"
|
||||
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>
|
||||
<div class="col-span-12 mb-4">
|
||||
<label class="block text-white text-sm font-bold mb-2">Check #</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"
|
||||
id="userCards" v-model="FinalizeOilOrderForm.userCards">
|
||||
<option class="text-white" v-for="(card, index) in userCards" :key="index" :value="card['id']">
|
||||
{{ card['type_of_card'] }} {{ card['card_number'] }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="flex-1 mb-4">
|
||||
<div class="col-span-12 flex-1 mb-4">
|
||||
<label class="block text-white text-sm font-bold mb-2">Delivery Status</label>
|
||||
<select class="select select-bordered select-sm w-full max-w-xs" aria-label="Default select example"
|
||||
id="delivery_status" v-model="FinalizeOilOrderForm.delivery_status">
|
||||
@@ -380,43 +368,16 @@
|
||||
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"
|
||||
class="input input-bordered input-sm w-full max-w-xs" id="title" type="text"
|
||||
placeholder="# gallons" />
|
||||
</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">Emergency</label>
|
||||
<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-secondary btn-sm">
|
||||
Finalize Delivery
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -470,7 +431,7 @@ export default defineComponent({
|
||||
cash_recieved: '',
|
||||
fill_location: 0,
|
||||
check_number: 0,
|
||||
delivery_status: '',
|
||||
delivery_status: 10,
|
||||
userCards: [],
|
||||
credit_card_id: 0,
|
||||
driver: 0,
|
||||
@@ -508,6 +469,7 @@ export default defineComponent({
|
||||
customer: {
|
||||
id: 0,
|
||||
user_id: 0,
|
||||
customer_address: '',
|
||||
customer_first_name: '',
|
||||
customer_last_name: '',
|
||||
customer_town: '',
|
||||
@@ -630,58 +592,15 @@ export default defineComponent({
|
||||
if (this.deliveryOrder.payment_type === 3) {
|
||||
this.getPaymentCard(this.deliveryOrder.payment_card_id);
|
||||
}
|
||||
if (response.data.prime == 1) {
|
||||
this.FinalizeOilOrderForm.prime = true
|
||||
}
|
||||
if (response.data.same_day == 1) {
|
||||
this.FinalizeOilOrderForm.same_day = true
|
||||
}
|
||||
if (response.data.emergency == 1) {
|
||||
this.FinalizeOilOrderForm.emergency = true
|
||||
}
|
||||
|
||||
this.FinalizeOilOrderForm.cash_recieved = response.data.cash_recieved;
|
||||
this.FinalizeOilOrderForm.check_number = response.data.check_number;
|
||||
this.FinalizeOilOrderForm.delivery_status = response.data.delivery_status;
|
||||
this.FinalizeOilOrderForm.credit_card_id = response.data.payment_card_id;
|
||||
|
||||
if (response.data.customer_filled == 1) {
|
||||
this.FinalizeOilOrderForm.customer_filled = true
|
||||
}
|
||||
// Cash
|
||||
if (response.data.payment_type == 0) {
|
||||
this.FinalizeOilOrderForm.card = false
|
||||
this.FinalizeOilOrderForm.cash = true
|
||||
this.FinalizeOilOrderForm.check = false
|
||||
this.FinalizeOilOrderForm.other = false
|
||||
}
|
||||
// Credit card
|
||||
if (response.data.payment_type == 1) {
|
||||
this.FinalizeOilOrderForm.card = true
|
||||
this.FinalizeOilOrderForm.cash = false
|
||||
this.FinalizeOilOrderForm.check = false
|
||||
this.FinalizeOilOrderForm.other = false
|
||||
}
|
||||
// Credit card/Cash
|
||||
if (response.data.payment_type == 2) {
|
||||
this.FinalizeOilOrderForm.card = true
|
||||
this.FinalizeOilOrderForm.cash = true
|
||||
this.FinalizeOilOrderForm.check = false
|
||||
this.FinalizeOilOrderForm.other = false
|
||||
}
|
||||
// Check
|
||||
if (response.data.payment_type == 3) {
|
||||
this.FinalizeOilOrderForm.card = false
|
||||
this.FinalizeOilOrderForm.cash = false
|
||||
this.FinalizeOilOrderForm.check = true
|
||||
this.FinalizeOilOrderForm.other = false
|
||||
}
|
||||
// Other
|
||||
if (response.data.payment_type == 4) {
|
||||
this.FinalizeOilOrderForm.card = false
|
||||
this.FinalizeOilOrderForm.cash = false
|
||||
this.FinalizeOilOrderForm.check = false
|
||||
this.FinalizeOilOrderForm.other = true
|
||||
}
|
||||
this.FinalizeOilOrderForm.gallons_delivered = response.data.gallons_delivered;
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -881,20 +800,14 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
FinalizeOrder(payload: {
|
||||
cash: boolean,
|
||||
card: boolean,
|
||||
check: boolean,
|
||||
other: boolean,
|
||||
|
||||
cash_recieved: string,
|
||||
check_number: number,
|
||||
delivery_status: any,
|
||||
credit_card_id: number,
|
||||
driver_employee_id: number,
|
||||
gallons_delivered: string,
|
||||
customer_filled: boolean,
|
||||
prime: boolean,
|
||||
same_day: boolean,
|
||||
emergency: boolean,
|
||||
|
||||
fill_location: number,
|
||||
|
||||
}) {
|
||||
@@ -914,7 +827,7 @@ export default defineComponent({
|
||||
type: "success",
|
||||
});
|
||||
this.CreateTransaction()
|
||||
this.$router.push({ name: "delivery" });
|
||||
this.$router.push({ name: "deliveryWaiting" });
|
||||
|
||||
}
|
||||
if (response.data.error) {
|
||||
@@ -936,20 +849,14 @@ export default defineComponent({
|
||||
this.UpdateAuto(auto_payload);
|
||||
}
|
||||
let payload = {
|
||||
cash: this.FinalizeOilOrderForm.cash,
|
||||
card: this.FinalizeOilOrderForm.card,
|
||||
check: this.FinalizeOilOrderForm.check,
|
||||
other: this.FinalizeOilOrderForm.other,
|
||||
|
||||
cash_recieved: this.FinalizeOilOrderForm.cash_recieved,
|
||||
check_number: this.FinalizeOilOrderForm.check_number,
|
||||
delivery_status: this.FinalizeOilOrderForm.delivery_status,
|
||||
credit_card_id: this.FinalizeOilOrderForm.credit_card_id,
|
||||
driver_employee_id: this.FinalizeOilOrderForm.driver,
|
||||
gallons_delivered: this.FinalizeOilOrderForm.gallons_delivered,
|
||||
customer_filled: this.FinalizeOilOrderForm.customer_filled,
|
||||
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