Updated forms

This commit is contained in:
2024-10-24 11:50:58 -04:00
parent c6f806f733
commit cae64eec86
21 changed files with 1186 additions and 924 deletions

View File

@@ -2,9 +2,9 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" href="./public/favicon.png" type="image/x-icon" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Oil</title>
<title>Rocket Services</title>
</head>
<body>

BIN
public/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

BIN
src/assets/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

View File

@@ -31,22 +31,38 @@
<div class=" hover:underline py-1">Home</div>
</router-link>
<router-link :to="{ name: 'deliveryOutForDelivery' }">
<div class=" hover:underline py-1">Todays Deliveries</div>
<div class=" hover:underline py-1" v-if="today_count > 0">
<div class="flex gap-5">
<div class="">Todays Deliveries </div>
<div class="text-orange-600"> ({{ today_count }})</div>
</div>
</div>
<div class=" hover:underline py-1" v-else>Todays Deliveries </div>
</router-link>
<router-link :to="{ name: 'deliveryTommorrow' }">
<div class=" hover:underline py-1">Tommorrow Deliveries</div>
<div class=" hover:underline py-1" v-if="tommorrow_count > 0">
<div class="flex gap-5">
<div class="">Tommorrows Deliveries </div>
<div class="text-orange-600"> ({{ tommorrow_count }})</div>
</div>
</div>
<div class=" hover:underline py-1" v-else>Tommorrow Deliveries </div>
</router-link>
<router-link :to="{ name: 'deliveryWaiting' }">
<div class=" hover:underline py-1">Waiting Deliverys</div>
</router-link>
<router-link :to="{ name: 'deliveryDelivered' }">
<div class=" hover:underline py-1">Delivered Payment </div>
<div class=" hover:underline py-1" v-if="waiting_count > 0">
<div class="flex gap-5">
<div class="">Waiting Deliveries </div>
<div class="text-orange-600"> ({{ waiting_count }})</div>
</div>
</div>
<div class=" hover:underline py-1" v-else>Waiting Deliveries </div>
</router-link>
<router-link :to="{ name: 'deliveryIssue' }">
<div class=" hover:underline py-1">Issue Tickets</div>
</router-link>
<router-link :to="{ name: 'deliveryFinalized' }">
<div class=" hover:underline py-1">Finished Tickets</div>
<div class=" hover:underline py-1">Finalized Tickets</div>
</router-link>
</li>
<div class="font-bold text-lg text-gray-500 pt-5">Automatics</div>
@@ -82,16 +98,59 @@
<script lang="ts">
import { defineComponent } from "vue";
import axios from 'axios';
import authHeader from '../../services/auth.header'
export default defineComponent({
name: "SideBar",
mounted() {
this.getTodayCount();
this.getTommorrowCount();
this.getWaitingCount();
},
data() {
return {};
return {
waiting_count: 0,
today_count: 0,
tommorrow_count: 0,
};
},
methods: {},
methods: {
getTodayCount() {
let path = import.meta.env.VITE_BASE_URL + '/deliverystatus/count/today';
axios({
method: 'get',
url: path,
headers: authHeader(),
}).then((response: any) => {
this.today_count = response.data.count
})
},
getTommorrowCount() {
let path = import.meta.env.VITE_BASE_URL + '/deliverystatus/count/tommorrow';
axios({
method: 'get',
url: path,
headers: authHeader(),
}).then((response: any) => {
this.tommorrow_count = response.data.count
})
},
getWaitingCount() {
let path = import.meta.env.VITE_BASE_URL + '/deliverystatus/count/waiting';
axios({
method: 'get',
url: path,
headers: authHeader(),
}).then((response: any) => {
this.waiting_count = response.data.count
})
},
},
});
</script>

View File

@@ -44,7 +44,6 @@
<div class="col-span-12 font-bold text-xl">Quick Tips</div>
<div class="col-span-12 py-2"> search: @ = last name search</div>
<div class="col-span-12 py-2"> search: ! = address</div>
<div class="col-span-12 py-2"> search: # = phone number</div>
<div class="col-span-12 py-2"> search: $ = account number</div>
</div>
</div>

View File

@@ -88,7 +88,7 @@
</button>
</router-link>
<router-link :to="{ name: 'TicketAuto', params: { id: oil['id'] } }">
<button class="btn btn-secondary btn-sm">
<button class="btn btn-success btn-sm">
Print Ticket
</button>
</router-link>

View File

@@ -24,127 +24,133 @@
<div class="col-span-12 text-[24px] ">Create a customer</div>
<form class="col-span-12 rounded-md px-8 pt-6 pb-8 mb-4 w-full" enctype="multipart/form-data"
@submit.prevent="onSubmit">
<div class="grid grid-cols-12">
<div class="col-span-12 text-[18px] mt-5 mb-5">General Info</div>
<div class="col-span-12 mb-4">
<label class="block text-white text-sm font-bold mb-2"> First Name</label>
<input v-model="CreateCustomerForm.basicInfo.customer_first_name"
class="input input-bordered input-sm w-full max-w-xs" id="title" type="text"
placeholder="First Name" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_first_name.$error"
class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_first_name.$errors[0].$message }}
</span>
</div>
<div class="col-span-12 mb-4">
<label class="block text-white text-sm font-bold mb-2"> Last Name</label>
<input v-model="CreateCustomerForm.basicInfo.customer_last_name"
class="input input-bordered input-sm w-full max-w-xs" id="title" type="text"
placeholder="Last Name" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_last_name.$error" class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_last_name.$errors[0].$message }}
</span>
</div>
<div class="col-span-12 gap-5">
<div class="flex-1 mb-4">
<label class="block text-white text-sm font-bold mb-2">Customer Type</label>
<select class="select select-bordered select-sm w-full max-w-xs" aria-label="Default select example"
id="customer_type" v-model="CreateCustomerForm.basicInfo.customer_home_type">
<option class="text-white" v-for="(customer, index) in custList" :key="index"
:value="customer['value']">
{{ customer['text'] }}
</option>
</select>
<div class="col-span-6">
<div class="col-span-12 text-[18px] mt-5 mb-5">General Info</div>
<div class="col-span-12 mb-4">
<label class="block text-white text-sm font-bold mb-2"> First Name</label>
<input v-model="CreateCustomerForm.basicInfo.customer_first_name"
class="input input-bordered input-sm w-full max-w-xs" id="title" type="text"
placeholder="First Name" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_first_name.$error"
class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_first_name.$errors[0].$message }}
</span>
</div>
<div class="col-span-12 mb-4">
<label class="block text-white text-sm font-bold mb-2"> Last Name</label>
<input v-model="CreateCustomerForm.basicInfo.customer_last_name"
class="input input-bordered input-sm w-full max-w-xs" id="title" type="text"
placeholder="Last Name" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_last_name.$error"
class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_last_name.$errors[0].$message }}
</span>
</div>
<div class="col-span-12 mb-4">
<label class="block text-white text-sm font-bold mb-2">Phone Number</label>
<input v-model="CreateCustomerForm.basicInfo.customer_phone_number"
class="input input-bordered input-sm w-full max-w-xs" id="phone number" type="tel"
placeholder="Phone Number" @input="acceptNumber()" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_phone_number.$error"
class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_phone_number.$errors[0].$message }}
</span>
</div>
<div class="col-span-12 mb-4">
<div class="flex-1 mb-4">
<label class="block text-white text-sm font-bold mb-2">Customer Type</label>
<select class="select select-bordered select-sm w-full max-w-xs" aria-label="Default select example"
id="customer_type" v-model="CreateCustomerForm.basicInfo.customer_home_type">
<option class="text-white" v-for="(customer, index) in custList" :key="index"
:value="customer['value']">
{{ customer['text'] }}
</option>
</select>
</div>
</div>
<div class="col-span-12 mb-4">
<label class="block text-white text-sm font-bold mb-2">Email (Optional)</label>
<input v-model="CreateCustomerForm.basicInfo.customer_email"
class="input input-bordered input-sm w-full max-w-xs" id="email" type="text" placeholder="Email" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_email.$error" class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_email.$errors[0].$message }}
</span>
</div>
</div>
<div class="col-span-6">
<div class="grid grid-cols-12">
<div class="text-[18px] mt-5 mb-5">Customer Address</div>
<div class="col-span-12 mb-5 md:mb-5">
<label class="block text-white text-sm font-bold mb-2">Street Address</label>
<input v-model="CreateCustomerForm.basicInfo.customer_address"
class="input input-bordered input-sm w-full max-w-xs" id="address" type="text"
placeholder="Address" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_address.$error"
class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_address.$errors[0].$message }}
</span>
</div>
<div class="col-span-12 mb-5 md:mb-5">
<input v-model="CreateCustomerForm.basicInfo.customer_apt"
class="input input-bordered input-sm w-full max-w-xs" id="apt" type="text"
placeholder="Apt, suite, unit, building, floor, etc" />
</div>
<div class="col-span-12 mb-20 md:mb-5 ">
<label class="block text-white text-sm font-bold mb-2">Town</label>
<input v-model="CreateCustomerForm.basicInfo.customer_town"
class="input input-bordered input-sm w-full max-w-xs" id="town" type="text" placeholder="Town" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_town.$error" class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_town.$errors[0].$message }}
</span>
</div>
<div class=" col-span-12 flex-1 mb-4">
<label class="block text-white text-sm font-bold mb-2">State</label>
<select class="select select-bordered select-sm w-full max-w-xs" aria-label="Default select example"
id="customer_state" v-model="CreateCustomerForm.basicInfo.customer_state">
<option class="text-white" v-for="(state, index) in stateList" :key="index"
:value="state['value']">
{{ state['text'] }}
</option>
</select>
<span v-if="v$.CreateCustomerForm.basicInfo.customer_state.$error" class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_state.$errors[0].$message }}
</span>
</div>
<div class="col-span-4 mb-5 md:mb-5">
<label class="block text-white text-sm font-bold mb-2">Zip Code</label>
<input v-model="CreateCustomerForm.basicInfo.customer_zip" class="w-full input input-bordered input-sm "
id="zip" type="text" placeholder="Zip" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_zip.$error" class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_zip.$errors[0].$message }}
</span>
</div>
</div>
</div>
</div>
<div class="col-span-6">
<div class="text-[18px] mt-5 mb-5"> Description</div>
<div class="text-[18px] mt-5 mb-5">Customer Address</div>
<div class="col-span-12 md:col-span-4 mb-5 md:mb-5">
<label class="block text-white text-sm font-bold mb-2">Phone Number</label>
<input v-model="CreateCustomerForm.basicInfo.customer_phone_number"
class="input input-bordered input-sm w-full max-w-xs" id="phone number" type="tel"
placeholder="Phone Number" @input="acceptNumber()" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_phone_number.$error"
class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_phone_number.$errors[0].$message }}
</span>
</div>
<div class="col-span-12 mb-5 md:mb-5">
<label class="block text-white text-sm font-bold mb-2">Street Address</label>
<input v-model="CreateCustomerForm.basicInfo.customer_address"
class="input input-bordered input-sm w-full max-w-xs" id="address" type="text" placeholder="Address" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_address.$error" class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_address.$errors[0].$message }}
</span>
</div>
<div class="col-span-12 mb-5 md:mb-5">
<input v-model="CreateCustomerForm.basicInfo.customer_apt"
class="input input-bordered input-sm w-full max-w-xs" id="apt" type="text"
placeholder="Apt, suite, unit, building, floor, etc" />
</div>
<div class="col-span-12 md:col-span-4 mb-20 md:mb-5 ">
<label class="block text-white text-sm font-bold mb-2">Town</label>
<input v-model="CreateCustomerForm.basicInfo.customer_town"
class="input input-bordered input-sm w-full max-w-xs" id="town" type="text" placeholder="Town" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_town.$error" class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_town.$errors[0].$message }}
</span>
</div>
<div class="flex-1 mb-4">
<label class="block text-white text-sm font-bold mb-2">State</label>
<select class="select select-bordered select-sm w-full max-w-xs" aria-label="Default select example"
id="customer_state" v-model="CreateCustomerForm.basicInfo.customer_state">
<option class="text-white" v-for="(state, index) in stateList" :key="index" :value="state['value']">
{{ state['text'] }}
</option>
</select>
<span v-if="v$.CreateCustomerForm.basicInfo.customer_state.$error" class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_state.$errors[0].$message }}
</span>
</div>
<div class="col-span-12 md:col-span-4 mb-5 md:mb-5">
<label class="block text-white text-sm font-bold mb-2">Zip Code</label>
<input v-model="CreateCustomerForm.basicInfo.customer_zip"
class="input input-bordered input-sm w-full max-w-xs" id="zip" type="text" placeholder="Zip" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_zip.$error" class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_zip.$errors[0].$message }}
</span>
</div>
<div class="col-span-12 md:col-span-4 mb-5 md:mb-0">
<textarea v-model="CreateCustomerForm.basicInfo.customer_description" rows="4"
class="textarea block p-2.5 w-full input-bordered " id="description" type="text"
placeholder="Description of Customer House" />
</div>
<div class="col-span-12 md:col-span-4 mb-5 md:mb-0">
<label class="block text-white text-sm font-bold mb-2">Email</label>
<input v-model="CreateCustomerForm.basicInfo.customer_email"
class="input input-bordered input-sm w-full max-w-xs" id="email" type="text" placeholder="Email" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_email.$error" class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_email.$errors[0].$message }}
</span>
</div>
<div class="col-span-12 md:col-span-4 mb-5 md:mb-0 py-5">
<label class="block text-white text-sm font-bold mb-2">Automatic</label>
<input v-model="CreateCustomerForm.basicInfo.customer_automatic" class="checkbox checkbox-xs" id="automatic"
type="checkbox" />
</div>
<div class="text-[18px] mt-5 mb-5"> Description</div>
<div class="col-span-12 md:col-span-4 mb-5 md:mb-0">
<textarea v-model="CreateCustomerForm.basicInfo.customer_description" rows="4"
class="textarea block p-2.5 w-full input-bordered " id="description" type="text" placeholder="Description of Customer House" />
</div>
<div class="col-span-12 md:col-span-12 flex mt-5 mb-5">
<button class="btn btn-accent btn-sm">
Submit Create Customer
</button>
</div>
<div class="col-span-12 md:col-span-12 flex mt-5 mb-5">
<button class="btn btn-accent btn-sm">
Submit Create Customer
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<Footer />
@@ -194,12 +200,12 @@ export default defineComponent({
customer_first_name: "",
customer_town: "",
customer_apt: "",
customer_home_type: "",
customer_home_type: 0,
customer_zip: "",
customer_automatic: "",
customer_email: "",
customer_phone_number: "",
customer_state: "",
customer_state: 0,
customer_address: "",
customer_description: "",
},
@@ -251,7 +257,7 @@ export default defineComponent({
})
.then((response: any) => {
this.company = response.data;
})
},
@@ -281,11 +287,10 @@ export default defineComponent({
customer_phone_number: string;
customer_address: string;
customer_apt: string;
customer_automatic: string;
customer_home_type: string,
customer_state: string;
customer_home_type: number,
customer_state: number;
customer_description: string;
}) {
let path = import.meta.env.VITE_BASE_URL + "/customer/create";
axios({
@@ -313,13 +318,12 @@ export default defineComponent({
customer_zip: this.CreateCustomerForm.basicInfo.customer_zip,
customer_email: this.CreateCustomerForm.basicInfo.customer_email,
customer_phone_number: this.CreateCustomerForm.basicInfo.customer_phone_number,
customer_automatic: this.CreateCustomerForm.basicInfo.customer_automatic,
customer_home_type: this.CreateCustomerForm.basicInfo.customer_home_type,
customer_state: this.CreateCustomerForm.basicInfo.customer_state,
customer_apt: this.CreateCustomerForm.basicInfo.customer_apt,
customer_address: this.CreateCustomerForm.basicInfo.customer_address,
customer_description: this.CreateCustomerForm.basicInfo.customer_description,
};
this.CreateCustomer(payload);
},

View File

@@ -23,142 +23,148 @@
<div class="grid grid-cols-12 rounded-md p-6 ">
<div class="col-span-12 text-2xl">Edit customer: {{ customer.account_number }}</div>
<div class="col-span-12 py-5">
<div class="col-span-12 py-5">
<router-link :to="{ name: 'customerProfile', params: { id: customer['id'] } }"
class="btn btn-secondary btn-sm">
View Profile
</router-link>
class="btn btn-secondary btn-sm">
View Profile
</router-link>
</div>
<form class="col-span-12 rounded-md px-8 pt-6 pb-8 mb-4 " enctype="multipart/form-data"
@submit.prevent="onSubmit">
<div class="text-[18px] mt-5 mb-5">General Info</div>
<div class="grid grid-cols-12">
<div class="col-span-12 mb-4">
<label class="block text-white text-sm font-bold mb-2"> First Name</label>
<input v-model="CreateCustomerForm.basicInfo.customer_first_name"
class="input input-bordered input-sm w-full max-w-xs" id="title" type="text"
placeholder="First Name" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_first_name.$error"
class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_first_name.$errors[0].$message }}
</span>
</div>
<div class="col-span-12 mb-4">
<label class="block text-white text-sm font-bold mb-2"> Last Name</label>
<input v-model="CreateCustomerForm.basicInfo.customer_last_name"
class="input input-bordered input-sm w-full max-w-xs" id="title" type="text"
placeholder="Last Name" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_last_name.$error" class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_last_name.$errors[0].$message }}
</span>
</div>
<div class="col-span-12 flex gap-5">
<div class="flex-1 mb-4">
<label class="block text-white text-sm font-bold mb-2">Customer Type</label>
<select class="select select-bordered select-sm w-full max-w-xs" aria-label="Default select example"
id="customer_type" v-model="CreateCustomerForm.basicInfo.customer_home_type">
<option class="text-white" v-for="(customer, index) in custList" :key="index"
:value="customer['value']">
{{ customer['text'] }}
</option>
</select>
<div class="grid grid-cols-12">
<div class="col-span-6">
<div class="col-span-12 text-[18px] mt-5 mb-5">General Info</div>
<div class="col-span-12 mb-4">
<label class="block text-white text-sm font-bold mb-2"> First Name</label>
<input v-model="CreateCustomerForm.basicInfo.customer_first_name"
class="input input-bordered input-sm w-full max-w-xs" id="title" type="text"
placeholder="First Name" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_first_name.$error"
class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_first_name.$errors[0].$message }}
</span>
</div>
<div class="col-span-12 mb-4">
<label class="block text-white text-sm font-bold mb-2"> Last Name</label>
<input v-model="CreateCustomerForm.basicInfo.customer_last_name"
class="input input-bordered input-sm w-full max-w-xs" id="title" type="text"
placeholder="Last Name" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_last_name.$error"
class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_last_name.$errors[0].$message }}
</span>
</div>
<div class="col-span-12 md:col-span-4 mb-5 md:mb-5">
<label class="block text-white text-sm font-bold mb-2">Phone Number</label>
<input v-model="CreateCustomerForm.basicInfo.customer_phone_number"
class="input input-bordered input-sm w-full max-w-xs" id="phone number" type="text"
placeholder="Phone Number" @input="acceptNumber()" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_phone_number.$error"
class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_phone_number.$errors[0].$message }}
</span>
</div>
<div class="col-span-12 flex gap-5">
<div class="flex-1 mb-4">
<label class="block text-white text-sm font-bold mb-2">Customer Type</label>
<select class="select select-bordered select-sm w-full max-w-xs" aria-label="Default select example"
id="customer_type" v-model="CreateCustomerForm.basicInfo.customer_home_type">
<option class="text-white" v-for="(customer, index) in custList" :key="index"
:value="customer['value']">
{{ customer['text'] }}
</option>
</select>
</div>
</div>
<div class="col-span-12 md:col-span-4 mb-5 md:mb-0">
<label class="block text-white text-sm font-bold mb-2">Email (Optional)</label>
<input v-model="CreateCustomerForm.basicInfo.customer_email"
class="input input-bordered input-sm w-full max-w-xs" id="email" type="text" placeholder="Email" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_email.$error" class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_email.$errors[0].$message }}
</span>
</div>
</div>
</div>
<div class="text-[18px] mt-5 mb-5">Customer Address</div>
<div class="col-span-12 md:col-span-4 mb-5 md:mb-5">
<label class="block text-white text-sm font-bold mb-2">Phone Number</label>
<input v-model="CreateCustomerForm.basicInfo.customer_phone_number"
class="input input-bordered input-sm w-full max-w-xs" id="phone number" type="text"
placeholder="Phone Number" @input="acceptNumber()" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_phone_number.$error"
class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_phone_number.$errors[0].$message }}
</span>
</div>
<div class="grid grid-cols-12">
<div class="col-span-12 mb-5 ">
<label class="block text-white text-sm font-bold mb-2">Street Address</label>
<input v-model="CreateCustomerForm.basicInfo.customer_address"
class="input input-bordered input-sm w-full max-w-xs" id="address" type="text"
placeholder="Address" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_address.$error" class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_address.$errors[0].$message }}
</span>
</div>
<div class="col-span-12 mb-5 ">
<label class="block text-white text-sm font-bold mb-2">Apt</label>
<input v-model="CreateCustomerForm.basicInfo.customer_apt"
class="input input-bordered input-sm w-full max-w-xs" id="apt" type="text"
placeholder="Apt, suite, unit, building, floor, etc" />
<div class="col-span-6 ">
<div class="text-[18px] mt-5 mb-5">Customer Address</div>
<div class="grid grid-cols-12">
<div class="col-span-12 mb-5 ">
<label class="block text-white text-sm font-bold mb-2">Street Address</label>
<input v-model="CreateCustomerForm.basicInfo.customer_address"
class="input input-bordered input-sm w-full max-w-xs" id="address" type="text"
placeholder="Address" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_address.$error"
class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_address.$errors[0].$message }}
</span>
</div>
<div class="col-span-12 mb-5 ">
<label class="block text-white text-sm font-bold mb-2">Apt</label>
<input v-model="CreateCustomerForm.basicInfo.customer_apt"
class="input input-bordered input-sm w-full max-w-xs" id="apt" type="text"
placeholder="Apt, suite, unit, building, floor, etc" />
</div>
<div class="col-span-12 ">
<label class="block text-white text-sm font-bold mb-2">Town</label>
<input v-model="CreateCustomerForm.basicInfo.customer_town"
class="input input-bordered input-sm w-full max-w-xs" id="town" type="text" placeholder="town" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_town.$error" class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_town.$errors[0].$message }}
</span>
</div>
<div class="col-span-12 flex-1 mb-4 ">
<label class="block text-white text-sm font-bold mb-2">State</label>
<select class="select select-bordered select-sm w-full max-w-xs" aria-label="Default select example"
id="customer_state" v-model="CreateCustomerForm.basicInfo.customer_state">
<option class="text-white" v-for="(state, index) in stateList" :key="index"
:value="state['value']">
{{ state['text'] }}
</option>
</select>
<span v-if="v$.CreateCustomerForm.basicInfo.customer_state.$error" class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_state.$errors[0].$message }}
</span>
</div>
<div class="col-span-4 mb-5 md:mb-5">
<label class="block text-white text-sm font-bold mb-2">Zip Code</label>
<input v-model="CreateCustomerForm.basicInfo.customer_zip"
class="input input-bordered input-sm w-full max-w-xs" id="zip" type="text" placeholder="Zip" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_zip.$error" class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_zip.$errors[0].$message }}
</span>
</div>
</div>
</div>
<div class="col-span-12 ">
<label class="block text-white text-sm font-bold mb-2">Town</label>
<input v-model="CreateCustomerForm.basicInfo.customer_town"
class="input input-bordered input-sm w-full max-w-xs" id="town" type="text" placeholder="town" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_town.$error" class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_town.$errors[0].$message }}
</span>
</div>
<div class="col-span-12 mb-5 md:mb-5">
<div class="col-span-12 flex-1 mb-4 ">
<label class="block text-white text-sm font-bold mb-2">State</label>
<select class="select select-bordered select-sm w-full max-w-xs" aria-label="Default select example"
id="customer_state" v-model="CreateCustomerForm.basicInfo.customer_state">
<option class="text-white" v-for="(state, index) in stateList" :key="index" :value="state['value']">
{{ state['text'] }}
</option>
</select>
<span v-if="v$.CreateCustomerForm.basicInfo.customer_state.$error" class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_state.$errors[0].$message }}
</span>
</div>
<div class="col-span-2 mb-5 md:mb-5">
<label class="block text-white text-sm font-bold mb-2">Zip Code</label>
<input v-model="CreateCustomerForm.basicInfo.customer_zip"
class="input input-bordered input-sm w-full max-w-xs" id="zip" type="text" placeholder="Zip" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_zip.$error" class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_zip.$errors[0].$message }}
</span>
</div>
</div>
<div class="col-span-12 text-[18px] mt-5 mb-5"> Description</div>
<div class="col-span-12 md:col-span-4 mb-2 ">
<label class="block text-white text-sm font-bold mb-2">Fill Location</label>
<input v-model="CreateCustomerForm.basicInfo.customer_fill_location"
class="input input-bordered input-sm w-full max-w-xs" id="fill" type="text" placeholder="Fill (1-12)" />
</div>
<div class="col-span-12 md:col-span-4 mb-5 md:mb-0">
<label class="block text-white text-sm font-bold mb-2">Email</label>
<input v-model="CreateCustomerForm.basicInfo.customer_email"
class="input input-bordered input-sm w-full max-w-xs" id="email" type="text" placeholder="Email" />
<span v-if="v$.CreateCustomerForm.basicInfo.customer_email.$error" class="text-red-600 text-center">
{{ v$.CreateCustomerForm.basicInfo.customer_email.$errors[0].$message }}
</span>
</div>
<div class="col-span-12 md:col-span-4 mb-5 md:mb-0 mt-5">
<label class="block text-white text-sm font-bold mb-2">Automatic</label>
<input v-model="CreateCustomerForm.basicInfo.customer_automatic" class="checkbox" type="checkbox" />
</div>
<div class="text-[18px] mt-5 mb-5"> Description</div>
<div class="col-span-12 md:col-span-4 mb-2 ">
<label class="block text-white text-sm font-bold mb-2">Fill Location</label>
<input v-model="CreateCustomerForm.basicInfo.customer_fill_location"
class="input input-bordered input-sm w-full max-w-xs" id="fill" type="text" placeholder="Fill" />
<div class="col-span-12 md:col-span-4 mb-5 md:mb-0">
<textarea v-model="CreateCustomerForm.basicInfo.customer_description" rows="4"
class="textarea block p-2.5 w-full input-bordered " id="description" type="text"
placeholder="Description of Customer House" />
</div>
</div>
<div class="col-span-12 md:col-span-4 mb-5 md:mb-0">
<textarea v-model="CreateCustomerForm.basicInfo.customer_description" rows="4"
class="textarea block p-2.5 w-full input-bordered " id="description" type="text" placeholder="Description of Customer House" />
</div>
</div>
<div class="col-span-12 md:col-span-12 flex mt-5 mb-5">
<button class="btn-sm btn btn-accent">
Submit Edit Customer
Save Changes
</button>
</div>
</form>
@@ -192,7 +198,7 @@ export default defineComponent({
return {
v$: useValidate(),
user: null,
stateList: [],
custList: [],
customer: {
@@ -299,7 +305,7 @@ export default defineComponent({
this.customerDescription = response.data
this.CreateCustomerForm.basicInfo.customer_description = this.customerDescription.description;
this.CreateCustomerForm.basicInfo.customer_fill_location =this.customerDescription.fill_location
this.CreateCustomerForm.basicInfo.customer_fill_location = this.customerDescription.fill_location
})
},
@@ -314,7 +320,7 @@ export default defineComponent({
})
.then((response: any) => {
if (response.data) {
this.customer = response.data;
this.getCustomerDescription(this.customer.id)
this.CreateCustomerForm.basicInfo.customer_last_name = response.data.customer_last_name;
@@ -330,14 +336,14 @@ export default defineComponent({
this.CreateCustomerForm.basicInfo.customer_address = response.data.customer_address;
if (response.data.customer_automatic === 1){
if (response.data.customer_automatic === 1) {
this.CreateCustomerForm.basicInfo.customer_automatic = true
}
if (response.data.customer_automatic === 0){
if (response.data.customer_automatic === 0) {
this.CreateCustomerForm.basicInfo.customer_automatic = false
}
}
})
},
@@ -348,7 +354,6 @@ export default defineComponent({
customer_zip: string;
customer_email: string;
customer_phone_number: string;
customer_automatic: boolean;
customer_home_type: string,
customer_state: string;
customer_address: string;
@@ -382,7 +387,6 @@ export default defineComponent({
customer_zip: this.CreateCustomerForm.basicInfo.customer_zip,
customer_email: this.CreateCustomerForm.basicInfo.customer_email,
customer_phone_number: this.CreateCustomerForm.basicInfo.customer_phone_number,
customer_automatic: this.CreateCustomerForm.basicInfo.customer_automatic,
customer_home_type: this.CreateCustomerForm.basicInfo.customer_home_type,
customer_state: this.CreateCustomerForm.basicInfo.customer_state,
customer_address: this.CreateCustomerForm.basicInfo.customer_address,

View File

@@ -25,15 +25,15 @@
<div class="col-span-4 p-5 ">
<div class="grid grid-cols-12 gap-5">
<div class="col-span-12 font-bold text-3xl ">
{{ customer.account_number }}
{{ customer.account_number }}
</div>
<div class="col-span-12 font-bold ">
<img src="../../../assets/images/user_placeholder.png" alt="Drone Image" width="200" height="250" />
</div>
</div>
</div>
</div>
<div class="col-span-8 p-5">
<div class="grid grid-cols-12">
<div class="grid grid-cols-12 ">
<div class="col-span-12 font-bold flex justify-evenly pb-5">
<router-link :to="{ name: 'deliveryCreate', params: { id: customer.id } }"
@@ -56,264 +56,309 @@
Become Will Call Customer
</button>
</div>
</div>
<div class="col-span-12 font-bold flex pb-5 text-lg" v-if="automatic_status === 1">Automatic </div>
<div class="col-span-12">
<div class="grid grid-cols-12">
<div class="col-span-6 ">
<div class="col-span-12 font-bold flex pb-5 text-lg" v-if="automatic_status === 1">Automatic
</div>
<div class="col-span-12 font-bold flex pb-5 text-lg" v-else>Will Call</div>
<div class="col-span-12 font-bold flex pb-5 text-lg" v-else>Will Call</div>
<div class="col-span-12 font-bold flex">
{{ customer.customer_first_name }}
{{ customer.customer_last_name }}
</div>
<div class="col-span-12 font-bold flex">
{{ customer.customer_address }}
<div v-if="customer.customer_apt != 'None'">
{{ customer.customer_apt }}
</div>
</div>
<div class="col-span-12 font-bold flex">
<div class="pr-2">
{{ customer.customer_town }},
</div>
<div class="pr-2">
<div v-if="customer.customer_state == 0">Massachusetts</div>
<div v-else-if="customer.customer_state == 1">Rhode Island</div>
<div v-else-if="customer.customer_state == 2">New Hampshire</div>
<div v-else-if="customer.customer_state == 3">Maine</div>
<div v-else-if="customer.customer_state == 4">Vermont</div>
<div v-else-if="customer.customer_state == 5">Maine</div>
<div v-else-if="customer.customer_state == 6">New York</div>
<div v-else>Unknown state</div>
</div>
<div class="pr-2">
{{ customer.customer_zip }}
</div>
</div>
<div class="col-span-12 font-bold flex" v-if="customer.customer_apt !== 'None'">
{{ customer.customer_apt }}
</div>
<div class="col-span-12 font-bold flex">
<div v-if="customer.customer_home_type == 0">Residential</div>
<div v-else-if="customer.customer_home_type == 1">apartment</div>
<div v-else-if="customer.customer_home_type == 2">condo</div>
<div v-else-if="customer.customer_home_type == 3">commercial</div>
<div v-else-if="customer.customer_home_type == 4">business</div>
<div v-else-if="customer.customer_home_type == 5">construction</div>
<div v-else-if="customer.customer_home_type == 6">container</div>
</div>
<div class="col-span-12 font-bold flex">
{{ customer.customer_phone_number }}
</div>
<div class="col-span-12 pt-10 font-bold">Home Description</div>
<div class="col-span-12 py-2 px-2">
{{ customer_description.description }}
</div>
</div>
</div>
<div class="col-span-12 ">
<hr class=" h-1 mx-auto my-4 bg-gray-800 border-0 rounded dark:bg-gray-400">
</div>
<div class="col-span-6 ">
<div class="grid grid-cols-12">
<div class="col-span-12 font-bold flex text-2xl">
Stats
</div>
<div class="col-span-6">
<div class="col-span-12 py-2 px-2">
Total Calls: {{ customer_stats.total_calls }}
</div>
</div>
</div>
</div>
<div class="col-span-6 ">
<div class="grid grid-cols-12">
<div class="col-span-12 font-bold flex text-2xl">
</div>
<div class="col-span-6">
<div class="col-span-12 py-2 px-2">
Total Delivery Orders: {{ customer_stats.oil_deliveries }}
</div>
<div class="col-span-12 py-2 px-2">
Total Gallons: {{ customer_stats.oil_total_gallons }}
</div>
<div class="col-span-12 py-2 px-2">
Last Delivery: {{ customer_last_delivery }}
</div>
</div>
</div>
</div>
<div class="col-span-12 ">
<hr class=" h-1 mx-auto my-4 bg-gray-800 border-0 rounded dark:bg-gray-400">
</div>
<div class="col-span-6 ">
<div class="grid grid-cols-12">
<div class="col-span-12 font-bold flex text-2xl">
Tank
</div>
<div class="col-span-6">
<div class="col-span-12 py-2 font-bold">Last Tank Inspection </div>
<div class="col-span-12 py-2 px-2 text-red-600" v-if="customer_tank.last_tank_inspection == null">
Not inspected
</div>
<div class="col-span-12 py-2 px-2" v-else>
{{ customer_tank.last_tank_inspection }}
</div>
<div class="col-span-12 py-2 font-bold">Tank Status</div>
<div class="col-span-12 py-2 px-2 text-red-600" v-if="customer_tank.tank_status == false">
Needs Inspection / Bad Tank
</div>
<div class="col-span-12 py-2 px-2" v-else>
Inspected
</div>
</div>
</div>
</div>
<div class="col-span-6 ">
<div class="grid grid-cols-12">
<div class="col-span-12 font-bold flex text-2xl">
<router-link :to="{ name: 'TankEdit', params: { id: customer.id } }"
class="btn-sm btn btn-secondary">
Edit Tank
</router-link>
</div>
<div class="col-span-12 py-2 font-bold">Fill Location</div>
<div class="col-span-12 py-2 px-2">
{{ customer_description.fill_location }}
</div>
<div class="col-span-12 py-2 font-bold">Tank Size</div>
<div class="col-span-12 py-2 px-2">
{{ customer_tank.tank_size }}
</div>
</div>
</div>
<div class="col-span-12 ">
<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-6 font-bold flex text-2xl">
Credit Cards
</div>
<div class="col-span-6 font-bold flex ">
<router-link :to="{ name: 'cardadd', params: { id: customer.user_id } }">
<button class="btn btn-sm btn-secondary text-white">Add Credit Card</button>
</router-link>
</div>
<div class="col-span-12 font-bold flex">
<div class="text-red-600" v-if="credit_cards_count == 0">
No Cards on File! Cash Customer till card added.
</div>
<div v-else>
{{ credit_cards_count }} credit card(s) on file.
</div>
</div>
<div v-for="card in credit_cards" class="col-span-12">
<div class="flex flex-row ">
<div v-if="card.main_card" class="basis-1/3 p-2">
<div class="bg-neutral rounded-md border-2 ">
<div class="flex p-3">
{{ card.type_of_card }}
</div>
<div class="flex p-1 pl-4">
{{ card.name_on_card }}
</div>
<div class="flex p-1 pl-4">
{{ card.card_number }}
</div>
<div class="flex p-1 pl-4">
{{ card.expiration_month }}/ {{ card.expiration_year }}
</div>
<div class="flex p-1 pl-4">
{{ card.zip_code }}
</div>
<div class="flex justify-between">
<a @click.prevent="editCard(card.id)" class="cursor-pointer underline hover:text-blue-300">
Edit Card
</a>
<a @click.prevent="removeCard(card.id)" class="cursor-pointer underline hover:text-blue-300">
RemoveCard
</a>
<div class="col-span-12 font-bold flex">
{{ customer.customer_first_name }}
{{ customer.customer_last_name }}
</div>
<div class="col-span-12 font-bold flex">
{{ customer.customer_address }}
<div v-if="customer.customer_apt != 'None'">
{{ customer.customer_apt }}
</div>
</div>
<div class="col-span-12 font-bold flex">
<div class="pr-2">
{{ customer.customer_town }},
</div>
<div class="pr-2">
<div v-if="customer.customer_state == 0">Massachusetts</div>
<div v-else-if="customer.customer_state == 1">Rhode Island</div>
<div v-else-if="customer.customer_state == 2">New Hampshire</div>
<div v-else-if="customer.customer_state == 3">Maine</div>
<div v-else-if="customer.customer_state == 4">Vermont</div>
<div v-else-if="customer.customer_state == 5">Maine</div>
<div v-else-if="customer.customer_state == 6">New York</div>
<div v-else>Unknown state</div>
</div>
<div class="pr-2">
{{ customer.customer_zip }}
</div>
</div>
<div class="col-span-12 font-bold flex" v-if="customer.customer_apt !== 'None'">
{{ customer.customer_apt }}
</div>
<div class="col-span-12 font-bold flex">
<div v-if="customer.customer_home_type == 0">Residential</div>
<div v-else-if="customer.customer_home_type == 1">apartment</div>
<div v-else-if="customer.customer_home_type == 2">condo</div>
<div v-else-if="customer.customer_home_type == 3">commercial</div>
<div v-else-if="customer.customer_home_type == 4">business</div>
<div v-else-if="customer.customer_home_type == 5">construction</div>
<div v-else-if="customer.customer_home_type == 6">container</div>
</div>
<div class="col-span-12 font-bold flex">
{{ customer.customer_phone_number }}
</div>
</div>
<div v-else class="basis-1/3 p-2">
<div class="rounded-md border-2 ">
<div class="flex p-3">
{{ card.type_of_card }}
</div>
<div class="flex p-1 pl-4">
{{ card.name_on_card }}
</div>
<div class="flex p-1 pl-4">
{{ card.card_number }}
</div>
<div class="flex p-1 pl-4">
{{ card.expiration_month }}/ {{ card.expiration_year }}
</div>
<div class="flex p-1 pl-4">
{{ card.zip_code }}
</div>
<div class="flex justify-between">
<a @click.prevent="editCard(card.id)"
class="cursor-pointer underline hover:text-blue-300">Edit
Card</a>
<a @click.prevent="removeCard(card.id)"
class="cursor-pointer underline hover:text-blue-300">Remove
Card</a>
</div>
<div class="col-span-6">
<div class="col-span-12 font-bold">Home Description</div>
<div class="col-span-12 py-2 px-2">
{{ customer_description.description }}
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-span-6">
<div class="col-span-12">
<hr class=" h-1 mx-auto my-4 bg-gray-800 border-0 rounded dark:bg-gray-400">
</div>
<div class="col-span-6 ">
<div class="grid grid-cols-12">
<div class="col-span-12 font-bold flex text-2xl">
Stats
</div>
<div class="col-span-6">
<div class="col-span-12 py-2 px-2">
Total Calls: {{ customer_stats.total_calls }}
</div>
</div>
</div>
</div>
<div class="col-span-6 ">
<div class="grid grid-cols-12">
<div class="col-span-12 font-bold flex text-2xl">
</div>
<div class="col-span-6">
<div class="col-span-12 py-2 px-2">
Total Delivery Orders: {{ customer_stats.oil_deliveries }}
</div>
<div class="col-span-12 py-2 px-2">
Total Gallons: {{ customer_stats.oil_total_gallons }}
</div>
<div class="col-span-12 py-2 px-2">
Last Delivery: {{ customer_last_delivery }}
</div>
</div>
</div>
</div>
<div class="col-span-12 ">
<hr class=" h-1 mx-auto my-4 bg-gray-800 border-0 rounded dark:bg-gray-400">
</div>
<div class="col-span-6 ">
<div class="grid grid-cols-12">
<div class="col-span-6 font-bold flex text-2xl">
Tank
</div>
<div class="col-span-6 font-bold flex text-2xl">
<router-link :to="{ name: 'TankEdit', params: { id: customer.id } }"
class="btn-sm btn btn-secondary">
Edit Tank
</router-link>
</div>
<div class="col-span-6 ">
<div class="col-span-12 py-2 font-bold">Last Tank Inspection </div>
<div class="col-span-12 py-2 px-2 text-red-600" v-if="customer_tank.last_tank_inspection == null">
Not inspected
</div>
<div class="col-span-12 py-2 px-2" v-else>
{{ customer_tank.last_tank_inspection }}
</div>
<div class="col-span-12 py-2 font-bold">Tank Status</div>
<div class="col-span-12 py-2 px-2 text-red-600" v-if="customer_tank.tank_status == false">
Needs Inspection / Bad Tank
</div>
<div class="col-span-12 py-2 px-2" v-else>
Inspected
</div>
</div>
<div class="col-span-6 ">
<div class="grid grid-cols-12">
<div class="col-span-12 py-2 font-bold">Fill Location</div>
<div class="col-span-12 py-2 px-2">
{{ customer_description.fill_location }}
</div>
<div class="col-span-12 py-2 font-bold">Tank Size</div>
<div class="col-span-12 py-2 px-2">
{{ customer_tank.tank_size }}
</div>
</div>
</div>
</div>
</div>
<div class="col-span-12 ">
<hr class=" h-1 mx-auto my-4 bg-gray-800 border-0 rounded dark:bg-gray-400">
</div>
<div class="col-span-12 ">
<div class="grid grid-cols-12">
<div class="col-span-6 font-bold flex text-2xl">
Credit Cards
</div>
<div class="col-span-6 font-bold flex ">
<router-link :to="{ name: 'cardadd', params: { id: customer.user_id } }">
<button class="btn btn-sm btn-secondary text-white">Add Credit Card</button>
</router-link>
</div>
<div class="col-span-12 font-bold flex">
<div class="text-red-600" v-if="credit_cards_count == 0">
No Cards on File! Cash Customer till card added.
</div>
<div v-else>
{{ credit_cards_count }} credit card(s) on file.
</div>
</div>
<div v-for="card in credit_cards" class="col-span-12 ">
<div class="flex flex-row ">
<div v-if="card.main_card" class="basis-1/2 p-2 ">
<div class="bg-neutral rounded-md border-2 ">
<div class="flex p-3">
{{ card.type_of_card }}
</div>
<div class="flex p-1 pl-4">
{{ card.name_on_card }}
</div>
<div class="flex p-1 pl-4">
{{ card.card_number }}
</div>
<div class="flex p-1 pl-4">
{{ card.expiration_month }}/ {{ card.expiration_year }}
</div>
<div class="flex p-1 pl-4">
{{ card.zip_code }}
</div>
<div class="flex justify-between">
<a @click.prevent="editCard(card.id)" class="cursor-pointer underline hover:text-blue-300">
Edit Card
</a>
<a @click.prevent="removeCard(card.id)"
class="cursor-pointer underline hover:text-blue-300">
RemoveCard
</a>
</div>
</div>
</div>
<div v-else class="basis-1/2 p-2">
<div class="rounded-md border-2 ">
<div class="flex p-3">
{{ card.type_of_card }}
</div>
<div class="flex p-1 pl-4">
{{ card.name_on_card }}
</div>
<div class="flex p-1 pl-4">
{{ card.card_number }}
</div>
<div class="flex p-1 pl-4">
{{ card.expiration_month }}/ {{ card.expiration_year }}
</div>
<div class="flex p-1 pl-4">
{{ card.zip_code }}
</div>
<div class="flex justify-between">
<a @click.prevent="editCard(card.id)"
class="cursor-pointer underline hover:text-blue-300">Edit
Card</a>
<a @click.prevent="removeCard(card.id)"
class="cursor-pointer underline hover:text-blue-300">Remove
Card</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-span-6 px-4">
<div class="grid grid-cols-12">
<form class="rounded-md col-span-12" enctype="multipart/form-data"
@submit.prevent="onSubmitSocial">
<div class="mb-4">
<label class="block text-white text-sm font-bold mb-2">Customer Comment</label>
<textarea v-model="CreateSocialForm.basicInfo.comment" rows="4"
class="textarea block p-2.5 w-full input-bordered " id="description" type="text"
placeholder="Leave a Customer Comment" />
</div>
<div class="col-span-12 md:col-span-12 flex mt-5 mb-5">
<button class="btn btn-sm btn-secondary">
Create Comment
</button>
</div>
</form>
<div class="col-span-12">
<div v-for="comment in comments" :key="comment['id']">
<div class="grid grid-cols-12 bg-neutral my-5">
<div class="col-span-2">
{{ comment.created }}
</div>
<div class="col-span-8">
</div>
<div class="col-span-1">
</div>
<div class="col-span-1">
<a href="" @click.prevent="deleteCustomerSocial(comment.id)" class="hover:text-blue-300">
Delete
</a>
</div>
<div class="col-span-12 p-5">
{{ comment.comment }}
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-span-12 ">
<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-6 font-bold flex text-2xl">
Financial
</div>
</div>
</div> -->
<div class="col-span-12 p-5">
<div class="grid grid-cols-12">
@@ -332,7 +377,7 @@
<th>Address</th>
<th>Gallons</th>
<th>Date</th>
<th></th>
</tr>
</thead>
@@ -354,8 +399,8 @@
<td>{{ oil['customer_name'] }}</td>
<td>{{ oil['customer_address'] }}</td>
<td>
{{ oil['gallons_delivered'] }}
{{ oil['gallons_delivered'] }}
</td>
<td>{{ oil['expected_delivery_date'] }}</td>
@@ -368,14 +413,18 @@
<button class="btn btn-sm btn-secondary">Edit</button>
</router-link>
<router-link :to="{ name: 'Ticket', params: { id: oil['id'] } }">
<button class="btn btn-secondary btn-sm">Print Ticket</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>
</router-link>
<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>
@@ -417,11 +466,31 @@ export default defineComponent({
data() {
return {
token: null,
user: null,
user: {
user_id: 0,
user_name: '',
confirmed: '',
},
isTrue: true,
automatic_status: 0,
automatic_response: 0,
customer_last_delivery: '',
comments: [
{
id: 0,
created: '',
customer_id: '',
poster_employee_id: '',
comment: '',
}
],
CreateSocialForm: {
basicInfo: {
comment: '',
},
},
credit_cards: [
{
id: 0,
@@ -497,6 +566,7 @@ export default defineComponent({
this.getCustomer(this.$route.params.id);
this.getCreditCards(this.$route.params.id)
this.getCreditCardsCount(this.$route.params.id)
this.getCustomerSocial(this.$route.params.id, 1)
},
mounted() {
this.getPage(this.delivery_page)
@@ -523,10 +593,11 @@ export default defineComponent({
.then((response: any) => {
if (response.data.ok) {
this.user = response.data.user;
console.log(this.user)
}
})
.catch(() => {
this.user = null
})
},
@@ -593,11 +664,13 @@ export default defineComponent({
}).then((response: any) => {
this.customer = response.data
this.checktotalOil(this.customer.id)
this.getCustomerTank(this.customer.id)
this.userAutomaticStatus(this.customer.id);
this.getCustomerDescription(this.customer.id);
this.getCustomerStats(this.customer.id);
this.getCustomerLastDelivery(this.customer.id);
})
},
getCustomerLastDelivery(userid: any) {
@@ -618,10 +691,23 @@ export default defineComponent({
url: path,
headers: authHeader(),
}).then((response: any) => {
this.customer_stats = response.data
})
},
checktotalOil(userid: any) {
let path = import.meta.env.VITE_BASE_URL + '/stats/gallons/check/total/' + userid;
axios({
method: 'get',
url: path,
headers: authHeader(),
}).then((response: any) => {
console.log(response)
console.log("updated gallons")
})
},
getCustomerDescription(userid: any) {
let path = import.meta.env.VITE_BASE_URL + '/customer/description/' + userid;
axios({
@@ -723,6 +809,65 @@ export default defineComponent({
}
})
},
deleteCustomerSocial(comment_id: number) {
let path = import.meta.env.VITE_BASE_URL + '/social/delete/' + comment_id;
axios({
method: 'delete',
url: path,
headers: authHeader(),
}).then((response: any) => {
console.log(response)
this.getCustomerSocial(this.customer.id, 1)
})
},
getCustomerSocial(userid: any, delivery_page: any) {
let path = import.meta.env.VITE_BASE_URL + '/social/posts/' + userid + '/' + delivery_page;
axios({
method: 'get',
url: path,
headers: authHeader(),
}).then((response: any) => {
this.comments = response.data
})
},
CreateSocialComment(payload: {
comment: string;
poster_employee_id: number
}) {
let path = import.meta.env.VITE_BASE_URL + "/social/create/" + this.customer.id;
axios({
method: "post",
url: path,
data: payload,
withCredentials: true,
headers: authHeader(),
})
.then((response: any) => {
if (response.data.ok) {
this.getCustomerSocial(this.customer.id, 1)
}
if (response.data.error) {
this.$router.push("/");
}
})
},
onSubmitSocial() {
let payload = {
comment: this.CreateSocialForm.basicInfo.comment,
poster_employee_id: this.user.user_id
};
this.CreateSocialComment(payload);
},
},
})
</script>

View File

@@ -92,7 +92,7 @@
<div class="col-span-12 md:col-span-12 flex mt-5 mb-5">
<button class="btn btn-accent btn-sm">
Edit Customer Tank
Save Changes
</button>
</div>
</form>

View File

@@ -21,22 +21,75 @@
</div>
<div class="grid grid-cols-12">
<div class="col-span-12 xl:col-span-6 rounded-md p-6 ">
<div class="grid grid-cols-12">
<div class="col-span-12 text-[24px]">
Create Oil Delivery
</div>
<div class="col-span-12 py-5">
<div class="grid grid-cols-12 ">
<div class="col-span-12 bg-neutral ">
<div class="col-span-12 py-5 ">
<router-link :to="{ name: 'customerProfile', params: { id: customer['id'] } }"
class="btn btn-secondary btn-sm">
View Profile
</router-link>
class="btn btn-secondary btn-sm">
View Profile
</router-link>
</div>
<div class="grid grid-cols-12">
<div class="col-span-12 font-bold flex pb-5 ">{{ customer.account_number }}</div>
<div class="col-span-12 font-bold flex">
{{ customer.customer_first_name }}
{{ customer.customer_last_name }}
</div>
<div class="col-span-12 font-bold flex">
{{ customer.customer_address }}
<div v-if="customer.customer_apt != 'None'">
{{ customer.customer_apt }}
</div>
</div>
<div class="col-span-12 font-bold flex">
<div class="pr-2">
{{ customer.customer_town }},
</div>
<div class="pr-2">
<div v-if="customer.customer_state == 0">Massachusetts</div>
<div v-else-if="customer.customer_state == 1">Rhode Island</div>
<div v-else-if="customer.customer_state == 2">New Hampshire</div>
<div v-else-if="customer.customer_state == 3">Maine</div>
<div v-else-if="customer.customer_state == 4">Vermont</div>
<div v-else-if="customer.customer_state == 5">Maine</div>
<div v-else-if="customer.customer_state == 6">New York</div>
<div v-else>Unknown state</div>
</div>
<div class="pr-2">
{{ customer.customer_zip }}
</div>
</div>
<div class="col-span-12 font-bold flex" v-if="customer.customer_apt !== 'None'">
{{ customer.customer_apt }}
</div>
<div class="col-span-12 font-bold flex">
<div v-if="customer.customer_home_type == 0">Residential</div>
<div v-else-if="customer.customer_home_type == 1">apartment</div>
<div v-else-if="customer.customer_home_type == 2">condo</div>
<div v-else-if="customer.customer_home_type == 3">commercial</div>
<div v-else-if="customer.customer_home_type == 4">business</div>
<div v-else-if="customer.customer_home_type == 5">construction</div>
<div v-else-if="customer.customer_home_type == 6">container</div>
</div>
<div class="col-span-12 font-bold flex">
{{ customer.customer_phone_number }}
</div>
</div>
</div>
<div class="col-span-6 rounded-md p-6 ">
<div class="grid grid-cols-12">
<div class="col-span-12 text-[24px] ">
Create Delivery
</div>
<form class="col-span-12 rounded-md px-8 pt-6 pb-8 mb-4 w-full" enctype="multipart/form-data"
@submit.prevent="onSubmit">
@@ -82,27 +135,29 @@
</div>
<div v-if="userCards.length > 0">
<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="CreateOilOrderForm.basicInfo.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>
<div v-else>
<div class="col-span-12 md:col-span-4 mb-5 md:mb-0 py-5">
No Cards on File!
<router-link :to="{ name: 'cardadd', params: { id: customer.id } }">
<button class="btn btn-sm bg-blue-700 text-white">Add CreditCard</button>
</router-link>
</div>
</div>
<div v-if="userCards.length > 0">
<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="CreateOilOrderForm.basicInfo.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>
<div v-else>
<div class="col-span-12 md:col-span-4 mb-5 md:mb-0 py-5">
No Cards on File!
<a @click.prevent="test()" class="cursor-pointer underline hover:text-blue-300">
Edit Card
</a>
<!-- <router-link :to="{ name: 'cardadd', params: { id: customer.id } }">
<button class="btn btn-sm bg-blue-700 text-white">Add Credit Card</button>
</router-link> -->
</div>
</div>
<div class="flex-1 mb-4">
<label class="block text-white text-sm font-bold mb-2">Delivery Driver </label>
@@ -123,18 +178,18 @@
type="checkbox" />
</div>
<div v-if="userCards.length > 0">
<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 </label>
<input v-model="CreateOilOrderForm.basicInfo.credit" 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">Credit </label>
<input v-model="CreateOilOrderForm.basicInfo.credit" class="checkbox checkbox-xs" id="Credit"
type="checkbox" />
</div>
</div>
<div v-if="userCards.length > 0">
<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="CreateOilOrderForm.basicInfo.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">Check </label>
<input v-model="CreateOilOrderForm.basicInfo.check" class="checkbox checkbox-xs" id="Check"
type="checkbox" />
</div>
</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>
@@ -161,97 +216,129 @@
</div>
</div>
<div class="col-span-12 xl:col-span-6 p-5">
<div class="grid grid-cols-12">
<div class="col-span-12 font-bold flex pb-5 text-lg">{{ customer.account_number }}</div>
<div class="col-span-12 font-bold flex">
{{ customer.customer_first_name }}
{{ customer.customer_last_name }}
<div class="grid grid-cols-12 ">
<div class="col-span-12 text-2xl">Add a Credit Card</div>
<div class="col-span-12">
<form class="rounded-md px-8 pt-6 pb-8 mb-4 w-full" enctype="multipart/form-data"
@submit.prevent="onSubmitCard">
<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">Main Card</label>
<input v-model="CreateCardForm.basicInfo.main_card" class="checkbox" id="fill" type="checkbox" />
</div>
<div class="mb-4">
<label class="block text-white text-sm font-bold mb-2">Name on Card</label>
<input v-model="CreateCardForm.basicInfo.card_name"
class="input input-bordered input-sm w-full max-w-xs" id="title" type="text"
placeholder="Name on Card" />
<span v-if="v$.CreateCardForm.basicInfo.card_name.$error" class="text-red-600 text-center">
{{ v$.CreateCardForm.basicInfo.card_name.$errors[0].$message }}
</span>
</div>
<div class="mb-4">
<label class="block text-white text-sm font-bold mb-2">Card Number</label>
<input v-model="CreateCardForm.basicInfo.card_number"
class="input input-bordered input-sm w-full max-w-xs" id="title" type="text"
placeholder="Card Number" />
<span v-if="v$.CreateCardForm.basicInfo.card_number.$error" class="text-red-600 text-center">
{{ v$.CreateCardForm.basicInfo.card_number.$errors[0].$message }}
</span>
</div>
<div class="mb-4">
<label class="block text-white text-sm font-bold mb-2">Expiration Month</label>
<select v-model="CreateCardForm.basicInfo.expiration_month"
class="input input-bordered input-sm w-full max-w-xs" id="Month">
<option>01</option>
<option>02</option>
<option>03</option>
<option>04</option>
<option>05</option>
<option>06</option>
<option>07</option>
<option>08</option>
<option>09</option>
<option>10</option>
<option>11</option>
<option>12</option>
</select>
</div>
<div class="mb-4">
<label class="block text-white text-sm font-bold mb-2">Expiration Year</label>
<select v-model="CreateCardForm.basicInfo.expiration_year"
class="input input-bordered input-sm w-full max-w-xs" id="Month">
<option>2024</option>
<option>2025</option>
<option>2026</option>
<option>2027</option>
<option>2028</option>
<option>2029</option>
<option>2030</option>
</select>
<span v-if="v$.CreateCardForm.basicInfo.expiration_year.$error" class="text-red-600 text-center">
{{ v$.CreateCardForm.basicInfo.expiration_year.$errors[0].$message }}
</span>
</div>
<div class="mb-4">
<label class="block text-white text-sm font-bold mb-2">Type of Card</label>
<select v-model="CreateCardForm.basicInfo.type_of_card"
class="input input-bordered input-sm w-full max-w-xs" id="Month">
<option>Visa</option>
<option>MasterCard</option>
<option>Discover</option>
<option>American Express</option>
</select>
<span v-if="v$.CreateCardForm.basicInfo.type_of_card.$error" class="text-red-600 text-center">
{{ v$.CreateCardForm.basicInfo.type_of_card.$errors[0].$message }}
</span>
</div>
<div class="mb-4">
<label class="block text-white text-sm font-bold mb-2">Security Number</label>
<input v-model="CreateCardForm.basicInfo.security_number"
class="input input-bordered input-sm w-full max-w-xs" id="title" type="text"
placeholder="Back of card" />
<span v-if="v$.CreateCardForm.basicInfo.security_number.$error" class="text-red-600 text-center">
{{ v$.CreateCardForm.basicInfo.security_number.$errors[0].$message }}
</span>
</div>
<div class="mb-4">
<label class="block text-white text-sm font-bold mb-2">Zip Code</label>
<input v-model="CreateCardForm.basicInfo.zip_code"
class="input input-bordered input-sm w-full max-w-xs" id="title" type="text"
placeholder="Zip Code" />
</div>
<div class="col-span-12 md:col-span-12 flex mt-5 mb-5">
<button class="btn-sm btn bg-orange-600 text-white">
Save Credit Card
</button>
</div>
</form>
</div>
<div class="col-span-12 font-bold flex">
<div class="pr-2">
{{ customer.customer_town }},
</div>
<div class="pr-2">
<div v-if="customer.customer_state == 0">Massachusetts</div>
<div v-else-if="customer.customer_state == 1">Rhode Island</div>
<div v-else-if="customer.customer_state == 2">New Hampshire</div>
<div v-else-if="customer.customer_state == 3">Maine</div>
<div v-else-if="customer.customer_state == 4">Vermont</div>
<div v-else-if="customer.customer_state == 5">Maine</div>
<div v-else-if="customer.customer_state == 6">New York</div>
<div v-else>Unknown state</div>
</div>
<div class="pr-2">
{{ customer.customer_zip }}
</div>
</div>
<div class="col-span-12 font-bold flex" v-if="customer.customer_apt !== 'None'">
{{ customer.customer_apt }}
</div>
<div class="col-span-12 font-bold flex">
<div v-if="customer.customer_home_type == 0">Residential</div>
<div v-else-if="customer.customer_home_type == 1">apartment</div>
<div v-else-if="customer.customer_home_type == 2">condo</div>
<div v-else-if="customer.customer_home_type == 3">commercial</div>
<div v-else-if="customer.customer_home_type == 4">business</div>
<div v-else-if="customer.customer_home_type == 5">construction</div>
<div v-else-if="customer.customer_home_type == 6">container</div>
</div>
<div class="col-span-12 font-bold flex">
{{ customer.customer_phone_number }}
</div>
<table class="table col-span-12">
<!-- head -->
<thead>
<tr>
<th>id</th>
<th>Date</th>
<th>Gallons</th>
<th>Status</th>
<th>Prime</th>
<th>Same Day</th>
</tr>
</thead>
<tbody>
<!-- row 1 -->
<tr v-for="oil in deliveries" :key="oil['id']">
<td>{{ oil['id'] }}</td>
<td>{{ oil['expected_delivery_date'] }}</td>
<td>
<div v-if="oil['customer_asked_for_fill'] == 1">Fill</div>
<div v-else> {{ oil['gallons_ordered'] }}</div>
</td>
<td>
<div v-if="oil['delivery_status'] == 0">Waiting</div>
<div v-else-if="oil['delivery_status'] == 1">delivered</div>
<div v-else-if="oil['delivery_status'] == 2">Out for Delivery</div>
<div v-else-if="oil['delivery_status'] == 3">Cancelled</div>
<div v-else-if="oil['delivery_status'] == 4">Partial Delivery</div>
<div v-else-if="oil['delivery_status'] == 5">Issue</div>
<div v-else-if="oil['delivery_status'] == 10">Finalized</div>
<div v-else></div>
</td>
<td>
<div v-if="oil['prime'] == 0">No</div>
<div v-else>Yes</div>
</td>
<td>
<div v-if="oil['same_day'] == 0">No</div>
<div v-else>Yes</div>
</td>
<td class="flex gap-5">
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
<button class="btn btn-sm btn-secondary">Edit</button>
</router-link>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="grid grid-cols-12 ">
<div class="col-span-12 text-center font-bold text-3xl">Remind customer of tank Inspection</div>
<div class="col-span-12 text-center font-bold text-3xl">Ask how they heard about us</div>
</div>
</div>
</div>
@@ -307,6 +394,18 @@ export default defineComponent({
driver_driver: '',
},
},
CreateCardForm: {
basicInfo: {
card_name: '',
expiration_month: '',
expiration_year: '',
type_of_card: '',
security_number: '',
card_number: '',
zip_code: '',
main_card: false,
},
},
deliveries: [],
customer: {
id: 0,
@@ -328,6 +427,17 @@ export default defineComponent({
},
validations() {
return {
CreateCardForm: {
basicInfo: {
card_name: { required, minLength: minLength(1) },
expiration_month: { required, minLength: minLength(1) },
expiration_year: { required, minLength: minLength(1) },
security_number: { required, minLength: minLength(1) },
type_of_card: { required, minLength: minLength(1) },
card_number: { required, minLength: minLength(1) },
},
},
CreateOilOrderForm: {
basicInfo: {
gallons_ordered: { required, minLength: minLength(1) },
@@ -350,7 +460,7 @@ export default defineComponent({
},
mounted() {
this.getCustomer(this.$route.params.id)
this.getPaymentCards(this.$route.params.id);
this.getCustomerDelivery(this.$route.params.id)
},
@@ -392,6 +502,9 @@ export default defineComponent({
});
});
},
test() {
this.CreateOilOrderForm.basicInfo.gallons_ordered = '100'
},
getCustomerDelivery(userid: any) {
let path = import.meta.env.VITE_BASE_URL + '/delivery/customer/' + userid + '/1';
axios({
@@ -412,12 +525,13 @@ export default defineComponent({
})
.then((response: any) => {
this.userCards = response.data;
})
.catch(() => {
});
},
getPromos() {
let path = import.meta.env.VITE_BASE_URL + "/promo/all" ;
let path = import.meta.env.VITE_BASE_URL + "/promo/all";
axios({
method: "get",
url: path,
@@ -502,7 +616,7 @@ export default defineComponent({
text: "Did not add a driver",
type: "error",
});
pass += 1;
pass += 1;
}
if (this.CreateOilOrderForm.basicInfo.cash === false && this.CreateOilOrderForm.basicInfo.credit === false && this.CreateOilOrderForm.basicInfo.check === false && this.CreateOilOrderForm.basicInfo.other === false) {
notify({
@@ -510,12 +624,59 @@ export default defineComponent({
text: "Did not select a payment method",
type: "error",
});
pass += 1;
pass += 1;
}
if (pass == 0) {
this.CreateOilOrder(payload);
}
},
CreateCard(payload: {
card_name: string;
expiration_month: string;
expiration_year: string;
type_of_card: string;
security_number: string;
zip_code: string;
card_number: string;
main_card: boolean;
}) {
let path = import.meta.env.VITE_BASE_URL + "/payment/card/create/" + this.customer.id;
axios({
method: "post",
url: path,
data: payload,
withCredentials: true,
headers: authHeader(),
})
.then((response: any) => {
if (response.data.ok) {
this.getPaymentCards(this.$route.params.id)
}
if (response.data.error) {
notify({
title: "Error",
text: "Error adding card",
type: "error",
});
}
})
},
onSubmitCard() {
let payload = {
card_name: this.CreateCardForm.basicInfo.card_name,
card_number: this.CreateCardForm.basicInfo.card_number,
expiration_month: this.CreateCardForm.basicInfo.expiration_month,
expiration_year: this.CreateCardForm.basicInfo.expiration_year,
type_of_card: this.CreateCardForm.basicInfo.type_of_card,
security_number: this.CreateCardForm.basicInfo.security_number,
main_card: this.CreateCardForm.basicInfo.main_card,
zip_code: this.CreateCardForm.basicInfo.zip_code,
};
this.CreateCard(payload);
},
},
})
</script>

View File

@@ -17,7 +17,8 @@
</div>
<div class="grid grid-cols-1 rounded-md p-6 ">
<div class="grid grid-cols-2 rounded-md p-6 ">
<div class="col-span-1">
<div class="text-2xl border-b border-gray-500 mb-10">
Edit Oil Delivery
</div>
@@ -38,6 +39,7 @@
{{ customer.customer_first_name }}
{{ customer.customer_last_name }}
</div>
<div class="col-span-12 flex">{{customer.customer_address}}</div>
<div class="col-span-12 flex">
<div class="pr-2">
{{ customer.customer_town }},
@@ -78,9 +80,9 @@
</div>
<div class="grid grid-cols-1" v-if="deliveryOrder.payment_type == 1">
<div class="flex ">
<div class="basis-1/3 p-2 ">
<div class="grid grid-cols-1 " v-if="deliveryOrder.payment_type == 1">
<div class=" p-2 ">
<div class="rounded-md border-2 bg-neutral">
<div class="flex p-3">
{{ userCard.type_of_card }}
@@ -94,8 +96,11 @@
<div class="flex p-1 pl-4">
{{ userCard.expiration_month }}/ {{ userCard.expiration_year }}
</div>
<div class="flex p-1 pl-4">
{{ userCard.security_number }}
</div>
</div>
</div>
</div>
</div>
@@ -122,8 +127,8 @@
{{ deliveryOrder.customer_price }}
</div>
</div>
</div>
<div class="col-span-1">
<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>
@@ -165,6 +170,14 @@
</div>
</div>
<div class="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"
@@ -255,11 +268,12 @@
<div class="col-span-12 md:col-span-12 flex mt-5 mb-5">
<button class="btn btn-accent btn-sm">
Submit Edit Oil Delivery
Save Changes
</button>
</div>
</form>
</div>
</div>
</div>
</div>
<Footer />
@@ -312,6 +326,7 @@ export default defineComponent({
id: 0,
user_id: 0,
customer_first_name: '',
customer_address: '',
customer_last_name: '',
customer_town: '',
customer_state: 0,

View File

@@ -29,7 +29,7 @@
</div>
</div>
<div class="col-span-12 flex start pb-10 text-2xl">All Deliveries Not Finished</div>
<div class="col-span-12 flex start pb-10 text-2xl">Recent 100 delivieres </div>
<div class="col-span-12 overflow-x-auto bg-neutral">
@@ -38,7 +38,7 @@
<!-- head -->
<thead>
<tr>
<th>ID</th>
<th>Account #</th>
<th>Name</th>
<th>Status</th>
<th>Town</th>
@@ -56,7 +56,7 @@
<!-- row 1 -->
<tr v-for="oil in deliveries" :key="oil['id']">
<td>{{ oil['id'] }} </td>
<router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
<router-link :to="{ name: 'customerProfile', params: { id: oil['id'] } }">
<td>
<div class="hover:text-accent">{{ oil['customer_name'] }} </div>
</td>
@@ -118,16 +118,16 @@
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
<button class="btn btn-secondary btn-sm">Edit Delivery</button>
</router-link>
<router-link :to="{ name: 'Ticket', params: { id: oil['id'] } }">
<button class="btn btn-secondary btn-sm">
<router-link :to="{ name: 'finalizeTicket', params: { id: oil['id'] } }" v-if="oil['delivery_status'] != 10">
<button class="btn btn-secondary btn-sm">Finalize</button>
</router-link>
<router-link :to="{ name: 'Ticket', params: { id: oil['id'] } }">
<button class="btn btn-success btn-sm">
Print Ticket
</button>
</router-link>
<router-link :to="{ name: 'finalizeTicket', params: { id: oil['id'] } }">
<button class="btn btn-secondary btn-sm">Finalize</button>
</router-link>
</td>
</tr>
</tbody>

View File

@@ -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);

View File

@@ -41,6 +41,7 @@
{{ customer.customer_first_name }}
{{ customer.customer_last_name }}
</div>
<div class="col-span-12 flex">{{customer.customer_address}}</div>
<div class="col-span-12 flex ">
<div class="pr-2">
{{ customer.customer_town }},
@@ -128,12 +129,12 @@
{{ (deliveryOrder.when_ordered) }}
</div>
<div v-if="deliveryOrder.delivery_status == 10">
<div class="col-span-12 font-bold">
When Delivered
</div>
<div class="col-span-12 mb-5 text-sm text-gray-500">
{{ (deliveryOrder.when_delivered) }}
</div>
<div class="col-span-12 font-bold">
When Delivered
</div>
<div class="col-span-12 mb-5 text-sm text-gray-500">
{{ (deliveryOrder.when_delivered) }}
</div>
</div>
@@ -181,20 +182,20 @@
</div>
<div v-if="deliveryOrder.delivery_status !== 10">
<div class="col-span-12 font-bold">
Promo
</div>
<div class="grid grid-cols-12 p-5">
<div class="col-span-12 text-sm text-gray-500">
<div v-if="deliveryOrder.promo_id !== null">
<div class="">{{ promo.name_of_promotion }}</div>
<div class="">{{ promo.description }}</div>
<div class="">{{ promo.money_off_delivery }} off a gallon</div>
<div class="">{{ promo.text_on_ticket }}</div>
</div>
<div v-else>No Promo Added</div>
<div class="col-span-12 font-bold">
Promo
</div>
<div class="grid grid-cols-12 p-5">
<div class="col-span-12 text-sm text-gray-500">
<div v-if="deliveryOrder.promo_id !== null">
<div class="">{{ promo.name_of_promotion }}</div>
<div class="">{{ promo.description }}</div>
<div class="">{{ promo.money_off_delivery }} off a gallon</div>
<div class="">{{ promo.text_on_ticket }}</div>
</div>
<div v-else>No Promo Added</div>
</div>
</div>
</div>
</div>
<div v-if="deliveryOrder.delivery_status !== 10">
@@ -204,36 +205,36 @@
<div class="grid grid-cols-12 p-5">
<div class="col-span-12 text-sm text-gray-500">
<div class="col-span-12 text-gray-500">
<div v-if="deliveryOrder.customer_asked_for_fill == 1"> FILL (250)</div>
<div v-else> Gallons Ordered: {{ deliveryOrder.gallons_ordered }}</div>
</div>
<div v-if="deliveryOrder.customer_asked_for_fill == 1"> FILL (250)</div>
<div v-else> Gallons Ordered: {{ deliveryOrder.gallons_ordered }}</div>
</div>
<div v-if="deliveryOrder.promo_id !== null">
<div class="col-span-12 text-sm text-gray-500">
Before Discount: {{ total_amount }}
<div v-if="deliveryOrder.promo_id !== null">
<div class="col-span-12 text-sm text-gray-500">
Before Discount: {{ total_amount }}
</div>
<div class="col-span-12 text-sm text-gray-500">
Discount Amount: ${{ discount }}
</div>
<div class="col-span-12 text-sm text-gray-500">
Promo Amount: ${{ total_amount_after_discount }}
</div>
</div>
<div class="col-span-12 text-sm text-gray-500">
Discount Amount: ${{ discount }}
<div v-else>
<div class="col-span-12 text-sm text-gray-500">
${{ total_amount }}
</div>
</div>
<div class="col-span-12 text-sm text-gray-500">
Promo Amount: ${{ total_amount_after_discount }}
</div>
</div>
<div v-else>
<div class="col-span-12 text-sm text-gray-500">
${{ total_amount }}
</div>
</div>
<div class="col-span-12 py-3" v-if="deliveryOrder.prime == 1">
Prime Fee: {{ pricing.price_prime }}
</div>
<div class="col-span-12 py-3" v-if="deliveryOrder.emergency == 1">
Emergency Fee: {{ pricing.price_emergency }}
</div>
<div class="col-span-12 py-3" v-if="deliveryOrder.same_day == 1">
Same Day: {{ pricing.price_same_day }}
</div>
<div class="col-span-12 py-3" v-if="deliveryOrder.prime == 1">
Prime Fee: {{ pricing.price_prime }}
</div>
<div class="col-span-12 py-3" v-if="deliveryOrder.emergency == 1">
Emergency Fee: {{ pricing.price_emergency }}
</div>
<div class="col-span-12 py-3" v-if="deliveryOrder.same_day == 1">
Same Day: {{ pricing.price_same_day }}
</div>
</div>
</div>
</div>
@@ -252,7 +253,7 @@
<div class="col-span-12 font-bold">
Payment
</div>
@@ -331,12 +332,25 @@
</div>
</div>
<div class="col-span-12 flex justify-center" v-if="deliveryOrder.id">
<router-link :to="{ name: 'customerProfile', params: { id: deliveryOrder['customer_id'] } }">
<div class="col-span-12 " v-if="deliveryOrder.id">
<router-link :to="{ name: 'customerProfile', params: { id: deliveryOrder['customer_id'] } }">
<button class="btn btn-neutral btn-sm">View Customer</button>
</router-link>
</div>
<div class="col-span-12 pt-5" v-if="deliveryOrder.id">
<router-link :to="{ name: 'deliveryEdit', params: { id: deliveryOrder['id'] } }">
<button class="btn btn-sm btn-secondary">Edit</button>
</router-link>
</div>
<div class="col-span-12 pt-5" v-if="deliveryOrder.id">
<router-link :to="{ name: 'Ticket', params: { id: deliveryOrder['id'] } }">
<button class="btn btn-success btn-sm">Print Ticket</button>
</router-link>
</div>
</div>
</div>
</div>
@@ -400,6 +414,7 @@ export default defineComponent({
customer_last_name: '',
customer_town: '',
customer_state: 0,
customer_address: '',
customer_zip: '',
customer_apt: '',
customer_home_type: 0,

View File

@@ -83,7 +83,7 @@
<button class="btn btn-secondary btn-sm">Edit Delivery</button>
</router-link>
<router-link :to="{ name: 'Ticket', params: { id: oil['id'] } }">
<button class="btn btn-secondary btn-sm">
<button class="btn btn-success btn-sm">
Print Ticket
</button>
</router-link>

View File

@@ -104,15 +104,15 @@
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
<button class="btn btn-secondary btn-sm">Edit Delivery</button>
</router-link>
<router-link :to="{ name: 'Ticket', params: { id: oil['id'] } }">
<button class="btn btn-secondary btn-sm">
Print Ticket
</button>
</router-link>
<router-link :to="{ name: 'finalizeTicket', params: { id: oil['id'] } }">
<button class="btn btn-secondary btn-sm">Finalize</button>
</router-link>
<router-link :to="{ name: 'Ticket', params: { id: oil['id'] } }">
<button class="btn btn-success btn-sm">
Print Ticket
</button>
</router-link>
<!-- <button @click.prevent="deleteCall(oil['id'])" class="btn btn-error btn-sm">
Delete
</button> -->
@@ -204,11 +204,7 @@ export default defineComponent({
headers: authHeader(),
}).then((response: any) => {
if (response.data.update)
notify({
title: "Success",
text: "Updated delivery",
type: "success",
});
console.log("success")
else { }
})
},

View File

@@ -87,11 +87,10 @@
<button class="btn btn-secondary btn-sm">Edit Delivery</button>
</router-link>
<router-link :to="{ name: 'Ticket', params: { id: oil['id'] } }">
<button class="btn btn-secondary btn-sm ">
<button class="btn btn-success btn-sm ">
Print Ticket
</button>
</router-link>
<!-- <button @click.prevent="deleteCall(oil['id'])" class="btn btn-error btn-sm">
Delete
</button> -->

View File

@@ -84,15 +84,16 @@
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
<button class="btn btn-secondary btn-sm">Edit Delivery</button>
</router-link>
<router-link :to="{ name: 'Ticket', params: { id: oil['id'] } }">
<button class="btn btn-secondary btn-sm">
Print Ticket
</button>
</router-link>
<router-link :to="{ name: 'finalizeTicket', params: { id: oil['id'] } }">
<button class="btn btn-secondary btn-sm">Finalize</button>
</router-link>
<router-link :to="{ name: 'Ticket', params: { id: oil['id'] } }">
<button class="btn btn-success btn-sm">
Print Ticket
</button>
</router-link>
<!-- <button @click.prevent="deleteCall(oil['id'])" class="btn btn-error btn-sm">
Delete
</button> -->
@@ -209,52 +210,8 @@ export default defineComponent({
}
})
},
printtTicketAll() {
let path = import.meta.env.VITE_PRINT_URL + '/command/printticket/print_waiting';
axios({
method: 'delete',
url: path,
headers: authHeader(),
}).then((response: any) => {
if (response.data.ok) {
notify({
title: "Success",
text: "Sent to Printer",
type: "success",
});
this.getPage(this.page)
} else {
notify({
title: "Failure",
text: "error printing",
type: "success",
});
}
})
},
printTicket(delivery_id: number) {
let path = import.meta.env.VITE_PRINT_URL + '/command/printticket/' + delivery_id;
axios({
method: 'delete',
url: path,
headers: authHeader(),
}).then((response: any) => {
if (response.data.ok) {
notify({
title: "Success",
text: "Sent to Printer",
type: "success",
});
this.getPage(this.page)
} else {
notify({
title: "Failure",
text: "error printing",
type: "success",
});
}
})
},
},
})

View File

@@ -160,7 +160,7 @@
<div class="col-span-12 text-gray-500" v-if="delivery.payment_type == 4">
Other (Rent, etc):
</div>
<div v-if="promo_active">
<div v-if="promo_active" class="col-span-12">
<div class="col-span-12 pt-3 font-bold">
Promo
</div>
@@ -267,28 +267,28 @@
<div class="" v-if="delivery.payment_type == 0">
<button class="btn bg-green-800 btn-sm" @click="checkoutOilUpdatePayment(0)">
Confirm Delivery
Confirm Payment
</button>
</div>
<div class="" v-if="delivery.payment_type == 1">
<button class="btn bg-green-800 btn-sm" @click="checkoutOilUpdatePayment(1)">
Confirm Delivery
Confirm Payment
</button>
</div>
<div class="" v-if="delivery.payment_type == 2">
<button class="btn bg-green-800 btn-sm" @click="checkoutOilUpdatePayment(2)">
Confirm Delivery
Confirm Payment
</button>
</div>
<div class="" v-if="delivery.payment_type == 3">
<button class="btn bg-green-800 btn-sm" @click="checkoutOilUpdatePayment(3)">
Confirm Delivery
Confirm Payment
</button>
</div>
<div class="" v-if="delivery.payment_type == 4">
<button class="btn bg-green-800 btn-sm" @click="checkoutOilUpdatePayment(3)">
Confirm Delivery
Confirm Payment
</button>
</div>
</div>

View File

@@ -44,8 +44,8 @@
<div class="col-span-12 text-lg" v-else-if="delivery.payment_type == 4">Other</div>
<div class="col-span-12" v-else></div>
<div class="col-span-12 " v-if="delivery.customer_asked_for_fill == 0">
{{delivery.gallons_ordered }}</div>
<div class="col-span-12 " v-else>Fill</div>
{{ delivery.gallons_ordered }}</div>
<div class="col-span-12 " v-else>Fill</div>
</div>
@@ -92,34 +92,33 @@
<div class="col-span-12 h-7 pl-4 pt-2">{{ delivery.expected_delivery_date }}</div>
<div class="col-span-12 h-7 pl-4 pt-2" v-if="delivery.customer_asked_for_fill == 0">
{{delivery.gallons_ordered }}</div>
{{ delivery.gallons_ordered }}</div>
<div class="col-span-12 h-7 pl-4 pt-2" v-else></div>
<div class="col-span-12 h-7 pl-4 pt-2" v-if="promo_active">
<div class="flex gap-2">
<div class="line-through"> {{ delivery.customer_price }}</div> ({{
delivery.customer_price - promo.money_off_delivery}})
delivery.customer_price - promo.money_off_delivery }})
</div>
</div>
<div class="col-span-12 h-7 pl-4 pt-2" v-else>{{ delivery.customer_price }}</div>
<div class="col-span-12 h-7 pl-4 pt-4" v-if="delivery.customer_asked_for_fill == 0">{{
total_amount }} </div>
<div class="col-span-12 h-7 pl-4 pt-4" v-if="delivery.customer_asked_for_fill == 0">
<div v-if="promo_active">
{{ total_amount_after_discount }}
</div>
<div v-else> {{ total_amount }}</div>
</div>
<div class="col-span-12 h-7 pl-4 pt-4" v-else></div>
<div class="col-span-12 h-7 pt-6"></div>
<div class="col-span-12 h-7"></div>
<div class="col-span-12 h-7 pl-8"></div>
</div>
</div>
</div>
</div>
</div>
</template>
@@ -142,7 +141,6 @@ export default defineComponent({
Header,
SideBar,
Footer,
},
data() {
@@ -298,7 +296,10 @@ export default defineComponent({
if (response.data.ok) {
this.priceprime = response.data.priceprime;
this.pricesameday = response.data.pricesameday;
this.priceemergency = response.data.priceemergency;
this.total_amount = response.data.total_amount;
this.discount = response.data.discount;
this.total_amount_after_discount = response.data.total_amount_after_discount;
}
})
.catch(() => {