Added description

This commit is contained in:
2024-09-18 12:48:28 -04:00
parent ec59223755
commit 94ce4af245
5 changed files with 141 additions and 10 deletions

View File

@@ -26,7 +26,7 @@
@submit.prevent="onSubmit"> @submit.prevent="onSubmit">
<div class="grid grid-cols-12"> <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 text-[18px] mt-5 mb-5">General Info</div>
<div class="col-span-6 mb-4"> <div class="col-span-12 mb-4">
<label class="block text-white text-sm font-bold mb-2"> First Name</label> <label class="block text-white text-sm font-bold mb-2"> First Name</label>
<input v-model="CreateCustomerForm.basicInfo.customer_first_name" <input v-model="CreateCustomerForm.basicInfo.customer_first_name"
class="input input-bordered input-sm w-full max-w-xs" id="title" type="text" class="input input-bordered input-sm w-full max-w-xs" id="title" type="text"
@@ -36,7 +36,7 @@
{{ v$.CreateCustomerForm.basicInfo.customer_first_name.$errors[0].$message }} {{ v$.CreateCustomerForm.basicInfo.customer_first_name.$errors[0].$message }}
</span> </span>
</div> </div>
<div class="col-span-6 mb-4"> <div class="col-span-12 mb-4">
<label class="block text-white text-sm font-bold mb-2"> Last Name</label> <label class="block text-white text-sm font-bold mb-2"> Last Name</label>
<input v-model="CreateCustomerForm.basicInfo.customer_last_name" <input v-model="CreateCustomerForm.basicInfo.customer_last_name"
class="input input-bordered input-sm w-full max-w-xs" id="title" type="text" class="input input-bordered input-sm w-full max-w-xs" id="title" type="text"
@@ -128,6 +128,17 @@
type="checkbox" /> type="checkbox" />
</div> </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"> <div class="col-span-12 md:col-span-12 flex mt-5 mb-5">
<button class="btn btn-accent btn-sm"> <button class="btn btn-accent btn-sm">
Create Customer Create Customer
@@ -178,6 +189,7 @@ export default defineComponent({
company_state: "", company_state: "",
company_phone_number: "", company_phone_number: "",
}, },
CreateCustomerForm: { CreateCustomerForm: {
basicInfo: { basicInfo: {
customer_last_name: "", customer_last_name: "",
@@ -191,6 +203,7 @@ export default defineComponent({
customer_phone_number: "", customer_phone_number: "",
customer_state: "", customer_state: "",
customer_address: "", customer_address: "",
customer_description: "",
}, },
}, },
} }
@@ -273,6 +286,7 @@ export default defineComponent({
customer_automatic: string; customer_automatic: string;
customer_home_type: string, customer_home_type: string,
customer_state: string; customer_state: string;
customer_description: string;
}) { }) {
let path = import.meta.env.VITE_BASE_URL + "/customer/create"; let path = import.meta.env.VITE_BASE_URL + "/customer/create";
@@ -306,6 +320,7 @@ export default defineComponent({
customer_state: this.CreateCustomerForm.basicInfo.customer_state, customer_state: this.CreateCustomerForm.basicInfo.customer_state,
customer_apt: this.CreateCustomerForm.basicInfo.customer_apt, customer_apt: this.CreateCustomerForm.basicInfo.customer_apt,
customer_address: this.CreateCustomerForm.basicInfo.customer_address, customer_address: this.CreateCustomerForm.basicInfo.customer_address,
customer_description: this.CreateCustomerForm.basicInfo.customer_description,
}; };
this.CreateCustomer(payload); this.CreateCustomer(payload);

View File

@@ -141,6 +141,20 @@
<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"> <div class="col-span-12 md:col-span-12 flex mt-5 mb-5">
<button class="btn btn-primary"> <button class="btn btn-primary">
Edit Customer Edit Customer
@@ -177,6 +191,7 @@ export default defineComponent({
return { return {
v$: useValidate(), v$: useValidate(),
user: null, user: null,
stateList: [], stateList: [],
custList: [], custList: [],
customer: { customer: {
@@ -193,6 +208,14 @@ export default defineComponent({
customer_phone_number: '', customer_phone_number: '',
account_number: '', account_number: '',
}, },
customer_description_overall: {
id: 0,
customer_id: 0,
account_number: '',
company_id: '',
fill_location: 0,
description: '',
},
CreateCustomerForm: { CreateCustomerForm: {
basicInfo: { basicInfo: {
customer_last_name: "", customer_last_name: "",
@@ -206,6 +229,8 @@ export default defineComponent({
customer_phone_number: "", customer_phone_number: "",
customer_state: "", customer_state: "",
customer_address: "", customer_address: "",
customer_description: "",
}, },
}, },
} }
@@ -262,6 +287,20 @@ export default defineComponent({
this.user = null this.user = null
}) })
}, },
getCustomerDescription(userid: any) {
let path = import.meta.env.VITE_BASE_URL + '/customer/description/' + userid;
axios({
method: 'get',
url: path,
headers: authHeader(),
}).then((response: any) => {
this.customer_description_overall = response.data
console.log(response.data)
this.CreateCustomerForm.basicInfo.customer_description = response.data.description;
console.log(this.CreateCustomerForm.basicInfo.customer_description )
})
},
// gets the item from parameter router // gets the item from parameter router
getCustomer(userid: any) { getCustomer(userid: any) {
@@ -274,7 +313,9 @@ export default defineComponent({
}) })
.then((response: any) => { .then((response: any) => {
if (response.data) { if (response.data) {
this.customer = response.data; this.customer = response.data;
this.getCustomerDescription(this.customer.id)
this.CreateCustomerForm.basicInfo.customer_last_name = response.data.customer_last_name; this.CreateCustomerForm.basicInfo.customer_last_name = response.data.customer_last_name;
this.CreateCustomerForm.basicInfo.customer_first_name = response.data.customer_first_name; this.CreateCustomerForm.basicInfo.customer_first_name = response.data.customer_first_name;
this.CreateCustomerForm.basicInfo.customer_town = response.data.customer_town; this.CreateCustomerForm.basicInfo.customer_town = response.data.customer_town;
@@ -286,14 +327,14 @@ export default defineComponent({
this.CreateCustomerForm.basicInfo.customer_apt = response.data.customer_apt; this.CreateCustomerForm.basicInfo.customer_apt = response.data.customer_apt;
this.CreateCustomerForm.basicInfo.customer_email = response.data.customer_email; this.CreateCustomerForm.basicInfo.customer_email = response.data.customer_email;
this.CreateCustomerForm.basicInfo.customer_address = response.data.customer_address; 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 this.CreateCustomerForm.basicInfo.customer_automatic = true
console.log("poop")
} }
if (response.data.customer_automatic === 0){ if (response.data.customer_automatic === 0){
this.CreateCustomerForm.basicInfo.customer_automatic = false this.CreateCustomerForm.basicInfo.customer_automatic = false
console.log("butt")
} }
} }
@@ -310,6 +351,7 @@ export default defineComponent({
customer_home_type: string, customer_home_type: string,
customer_state: string; customer_state: string;
customer_address: string; customer_address: string;
customer_description: string;
}) { }) {
let path = import.meta.env.VITE_BASE_URL + "/customer/edit/" + this.customer.id; let path = import.meta.env.VITE_BASE_URL + "/customer/edit/" + this.customer.id;
axios({ axios({
@@ -342,6 +384,8 @@ export default defineComponent({
customer_home_type: this.CreateCustomerForm.basicInfo.customer_home_type, customer_home_type: this.CreateCustomerForm.basicInfo.customer_home_type,
customer_state: this.CreateCustomerForm.basicInfo.customer_state, customer_state: this.CreateCustomerForm.basicInfo.customer_state,
customer_address: this.CreateCustomerForm.basicInfo.customer_address, customer_address: this.CreateCustomerForm.basicInfo.customer_address,
customer_description: this.CreateCustomerForm.basicInfo.customer_description,
}; };
this.editItem(payload); this.editItem(payload);
}, },

View File

@@ -104,6 +104,25 @@
</div> </div>
</div> </div>
<div class="col-span-12 p-5">
<div class="grid grid-cols-12">
<div class="col-span-12 font-bold flex text-2xl">
Description
</div>
<div class="col-span-6">
<div class="col-span-12 py-2 font-bold">Home Description</div>
<div class="col-span-12 py-2">
{{ customer_description.description }}
</div>
<div class="col-span-12 py-2 font-bold">Fill Location</div>
<div class="col-span-12 py-2">
{{ customer_description.fill_location }}
</div>
</div>
</div>
</div>
<div class="col-span-12 p-5"> <div class="col-span-12 p-5">
<div class="grid grid-cols-12"> <div class="grid grid-cols-12">
<div class="col-span-12 font-bold flex text-2xl"> <div class="col-span-12 font-bold flex text-2xl">
@@ -123,6 +142,9 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-span-12 p-5"> <div class="col-span-12 p-5">
<div class="grid grid-cols-12"> <div class="grid grid-cols-12">
<div class="col-span-6 font-bold flex text-2xl"> <div class="col-span-6 font-bold flex text-2xl">
@@ -154,7 +176,7 @@
{{ card.name_on_card }} {{ card.name_on_card }}
</div> </div>
<div class="flex p-1 pl-4"> <div class="flex p-1 pl-4">
****-****-****-{{ card.last_four_digits }} {{ card.card_number }}
</div> </div>
<div class="flex p-1 pl-4"> <div class="flex p-1 pl-4">
{{ card.expiration_month }}/ {{ card.expiration_year }} {{ card.expiration_month }}/ {{ card.expiration_year }}
@@ -179,7 +201,7 @@
{{ card.name_on_card }} {{ card.name_on_card }}
</div> </div>
<div class="flex p-1 pl-4"> <div class="flex p-1 pl-4">
****-****-****-{{ card.last_four_digits }} {{ card.card_number }}
</div> </div>
<div class="flex p-1 pl-4"> <div class="flex p-1 pl-4">
{{ card.expiration_month }}/ {{ card.expiration_year }} {{ card.expiration_month }}/ {{ card.expiration_year }}
@@ -264,13 +286,24 @@
<div v-if="oil['same_day'] == 0">No</div> <div v-if="oil['same_day'] == 0">No</div>
<div v-else>Yes</div> <div v-else>Yes</div>
</td> </td>
<td class="flex gap-5"> <td class="lg:flex">
<div class="pb-2 pr-2">
<router-link :to="{ name: 'Ticket', params: { id: oil['id'] } }">
<button class="btn btn-accent btn-sm">
Print
</button>
</router-link>
</div>
<div class="pb-2 pr-2">
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }"> <router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
<button class="btn btn-sm btn-accent">Edit</button> <button class="btn btn-sm btn-accent">Edit</button>
</router-link> </router-link>
</div>
<div class="pb-2 pr-2">
<a @click.prevent="deleteCall(oil['id'])"> <a @click.prevent="deleteCall(oil['id'])">
<button class="btn btn-sm btn-error">Delete</button> <button class="btn btn-sm btn-error">Delete</button>
</a> </a>
</div>
</td> </td>
</tr> </tr>
</tbody> </tbody>
@@ -339,6 +372,14 @@ export default defineComponent({
customer_phone_number: '', customer_phone_number: '',
account_number: '', account_number: '',
}, },
customer_description: {
id: 0,
customer_id: 0,
account_number: '',
company_id: '',
fill_location: 0,
description: '',
},
deliveries: [], deliveries: [],
delivery_page: 1, delivery_page: 1,
delivery_perPage: 50, delivery_perPage: 50,
@@ -455,9 +496,23 @@ export default defineComponent({
this.customer = response.data this.customer = response.data
this.userAutomaticStatus(this.customer.id); this.userAutomaticStatus(this.customer.id);
this.getCustomerDescription(this.customer.id);
}) })
}, },
getCustomerDescription(userid: any) {
let path = import.meta.env.VITE_BASE_URL + '/customer/description/' + userid;
axios({
method: 'get',
url: path,
headers: authHeader(),
}).then((response: any) => {
this.customer_description = response.data
})
},
getCreditCards(user_id: any) { getCreditCards(user_id: any) {
let path = import.meta.env.VITE_BASE_URL + '/payment/cards/' + user_id; let path = import.meta.env.VITE_BASE_URL + '/payment/cards/' + user_id;
axios({ axios({

View File

@@ -111,6 +111,18 @@
<input v-model="CreateOilOrderForm.basicInfo.credit" class="checkbox checkbox-xs" id="Credit" <input v-model="CreateOilOrderForm.basicInfo.credit" class="checkbox checkbox-xs" id="Credit"
type="checkbox" /> 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">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">Other </label>
<input v-model="CreateOilOrderForm.basicInfo.other" class="checkbox checkbox-xs" id="Other"
type="checkbox" />
</div>
<div class="col-span-12 md:col-span-12 flex mt-5 mb-5"> <div class="col-span-12 md:col-span-12 flex mt-5 mb-5">
<button class="btn btn-sm btn-accent"> <button class="btn btn-sm btn-accent">
Create Oil Order Create Oil Order
@@ -256,6 +268,8 @@ export default defineComponent({
same_day: false, same_day: false,
credit: false, credit: false,
cash: false, cash: false,
check: false,
other: false,
credit_card_id: 0, credit_card_id: 0,
driver_driver: '', driver_driver: '',
}, },
@@ -344,7 +358,6 @@ export default defineComponent({
}); });
}, },
getCustomerDelivery(userid: any) { getCustomerDelivery(userid: any) {
console.log("here")
let path = import.meta.env.VITE_BASE_URL + '/delivery/customer/' + userid + '/1'; let path = import.meta.env.VITE_BASE_URL + '/delivery/customer/' + userid + '/1';
axios({ axios({
method: 'get', method: 'get',
@@ -390,6 +403,8 @@ export default defineComponent({
same_day: boolean; same_day: boolean;
cash: boolean; cash: boolean;
credit: boolean; credit: boolean;
check: boolean;
other: boolean;
expected_delivery_date: string; expected_delivery_date: string;
dispatcher_notes_taken: string; dispatcher_notes_taken: string;
credit_card_id: any; credit_card_id: any;
@@ -424,6 +439,8 @@ export default defineComponent({
same_day: this.CreateOilOrderForm.basicInfo.same_day, same_day: this.CreateOilOrderForm.basicInfo.same_day,
cash: this.CreateOilOrderForm.basicInfo.cash, cash: this.CreateOilOrderForm.basicInfo.cash,
credit: this.CreateOilOrderForm.basicInfo.credit, credit: this.CreateOilOrderForm.basicInfo.credit,
check: this.CreateOilOrderForm.basicInfo.check,
other: this.CreateOilOrderForm.basicInfo.other,
credit_card_id: this.CreateOilOrderForm.basicInfo.userCards, credit_card_id: this.CreateOilOrderForm.basicInfo.userCards,
driver_employee_id: this.CreateOilOrderForm.basicInfo.driver_driver, driver_employee_id: this.CreateOilOrderForm.basicInfo.driver_driver,
}; };
@@ -436,7 +453,7 @@ export default defineComponent({
}); });
pass += 1; pass += 1;
} }
if (this.CreateOilOrderForm.basicInfo.cash === false && this.CreateOilOrderForm.basicInfo.credit === false) { if (this.CreateOilOrderForm.basicInfo.cash === false && this.CreateOilOrderForm.basicInfo.credit === false && this.CreateOilOrderForm.basicInfo.check === false && this.CreateOilOrderForm.basicInfo.other === false) {
notify({ notify({
title: "Error", title: "Error",
text: "Did not select a payment method", text: "Did not select a payment method",

View File

@@ -34,7 +34,7 @@
<div class="col-span-12 text-lg" v-else-if="delivery.payment_type == 1">Credit Card</div> <div class="col-span-12 text-lg" v-else-if="delivery.payment_type == 1">Credit Card</div>
<div class="col-span-12 text-lg" v-else-if="delivery.payment_type == 2">Credit Card/Cash</div> <div class="col-span-12 text-lg" v-else-if="delivery.payment_type == 2">Credit Card/Cash</div>
<div class="col-span-12" v-else></div> <div class="col-span-12" v-else></div>
</div>{{ }} </div>
<div class="grid grid-cols-12 pl-10 pt-5" v-if="past_deliveries1.length > 1"> <div class="grid grid-cols-12 pl-10 pt-5" v-if="past_deliveries1.length > 1">
<div class="col-span-6" v-for="past_delivery in past_deliveries1"> <div class="col-span-6" v-for="past_delivery in past_deliveries1">
<div class="">{{ past_delivery.when_delivered }} - {{ past_delivery.gallons_delivered }} <div class="">{{ past_delivery.when_delivered }} - {{ past_delivery.gallons_delivered }}