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

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