major update
This commit is contained in:
@@ -16,4 +16,6 @@
|
||||
#myfont {
|
||||
font-family: Arial, Helvetica, sans-serif, sans-serif !important;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
@@ -13,4 +13,5 @@ input[type=file]::file-selector-button {
|
||||
.WrapperPlain {
|
||||
min-height: calc(100vh - 75px);
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
<template>
|
||||
<section>
|
||||
<section >
|
||||
|
||||
<div v-for="user in customers" :key="user.id">
|
||||
<router-link :to="{ name: 'customerProfile', params: { id: user['id'] } }">
|
||||
<div class="grid grid-cols-12 bg-neutral pb-5 hover:bg-accent">
|
||||
<router-link :to="{ name: 'customerProfile', params: { id: user['id'] } }">
|
||||
<div class="grid grid-cols-12 bg-neutral pb-5 hover:bg-accent ">
|
||||
<div class="col-span-12"> {{ user['customer_first_name'] }} {{ user['customer_last_name'] }}</div>
|
||||
<div class="col-span-12">
|
||||
{{ user['customer_address'] }} {{ user['customer_town'] }} {{user.state}}
|
||||
</div>
|
||||
<div class="col-span-12"> {{user['customer_phone_number']}}</div>
|
||||
|
||||
<div class="col-span-12"> {{user['account_number']}}</div>
|
||||
</div>
|
||||
</router-link>
|
||||
|
||||
@@ -30,4 +32,5 @@ export default defineComponent({
|
||||
props: ["customers"],
|
||||
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<!-- <button class="btn btn-green btn-sm" @click.prevent="increaseCall()">Call</button> -->
|
||||
|
||||
<router-link :to="{ name: 'customerCreate' }">
|
||||
<button class="btn btn-accent btn-sm">Create Customer</button>
|
||||
<button class="btn bg-blue-700 btn-sm">Create Customer</button>
|
||||
</router-link>
|
||||
|
||||
<div v-if="employee.id">
|
||||
@@ -119,8 +119,12 @@ export default defineComponent({
|
||||
this.type_of_search = 1
|
||||
} else if (this.searchTerm.startsWith("#")) {
|
||||
this.type_of_search = 2
|
||||
|
||||
}else if (this.searchTerm.startsWith("$")) {
|
||||
this.type_of_search = 3
|
||||
|
||||
} else {
|
||||
this.type_of_search = 2
|
||||
this.type_of_search = 0
|
||||
}
|
||||
|
||||
const searchUrl = this.getSearchUrl();
|
||||
@@ -153,6 +157,14 @@ export default defineComponent({
|
||||
const searchParams = new URLSearchParams(params);
|
||||
return `${url}?${searchParams}`;
|
||||
}
|
||||
else if (this.type_of_search == 3) {
|
||||
const url = import.meta.env.VITE_BASE_URL +"/search/customer";
|
||||
const params = {
|
||||
q: this.searchTerm,
|
||||
};
|
||||
const searchParams = new URLSearchParams(params);
|
||||
return `${url}?${searchParams}`;
|
||||
}
|
||||
else {
|
||||
const url = import.meta.env.VITE_BASE_URL +"/search/customer";
|
||||
const params = {
|
||||
|
||||
@@ -69,6 +69,9 @@
|
||||
<router-link :to="{ name: 'promo' }">
|
||||
<div class=" hover:underline py-1">Promos</div>
|
||||
</router-link>
|
||||
<router-link :to="{ name: 'MoneyYear' }">
|
||||
<div class=" hover:underline py-1">Money</div>
|
||||
</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -45,6 +45,15 @@
|
||||
<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>
|
||||
<div class="col-span-12 bg-secondary">
|
||||
<div class="grid grid-cols-12 p-5 bg-neutral m-5">
|
||||
<div class="col-span-12 font-bold text-xl">This Weeks Stats</div>
|
||||
<div class="col-span-12 py-2"> Total Deliveries: {{ total_deliveries }}</div>
|
||||
<div class="col-span-12 py-2"> Total Gallons : {{ total_gallons_past_week }}</div>
|
||||
<div class="col-span-12 py-2"> Total Profit: ${{ total_profit_past_week }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -105,6 +114,11 @@ export default defineComponent({
|
||||
employee_type: '',
|
||||
employee_state: '',
|
||||
},
|
||||
total_gallons_past_week: 0,
|
||||
total_profit_past_week: 0,
|
||||
total_deliveries: 0,
|
||||
|
||||
|
||||
loaded: false,
|
||||
|
||||
}
|
||||
@@ -115,6 +129,10 @@ export default defineComponent({
|
||||
this.today_delivery_count()
|
||||
this.today_delivery_delivered()
|
||||
this.today_price_oil()
|
||||
this.totalgallonsweek()
|
||||
this.totalprofitweek()
|
||||
|
||||
|
||||
|
||||
},
|
||||
methods: {
|
||||
@@ -138,7 +156,33 @@ export default defineComponent({
|
||||
})
|
||||
|
||||
},
|
||||
totalgallonsweek() {
|
||||
let path = import.meta.env.VITE_BASE_URL + '/stats/gallons/week';
|
||||
axios({
|
||||
method: "get",
|
||||
url: path,
|
||||
withCredentials: true,
|
||||
headers: authHeader(),
|
||||
})
|
||||
.then((response: any) => {
|
||||
this.total_gallons_past_week = response.data.total;
|
||||
|
||||
})
|
||||
},
|
||||
totalprofitweek() {
|
||||
let path = import.meta.env.VITE_BASE_URL + '/money/profit/week';
|
||||
axios({
|
||||
method: "get",
|
||||
url: path,
|
||||
withCredentials: true,
|
||||
headers: authHeader(),
|
||||
})
|
||||
.then((response: any) => {
|
||||
this.total_profit_past_week = response.data.total_profit;
|
||||
this.total_deliveries = response.data.total_deliveries;
|
||||
|
||||
})
|
||||
},
|
||||
employeeStatus() {
|
||||
let path = import.meta.env.VITE_BASE_URL + '/employee/userid/' + this.user.user_id;
|
||||
axios({
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
|
||||
<div class="col-span-12 md:col-span-12 flex mt-5 mb-5">
|
||||
<button
|
||||
class="btn btn-accent btn-sm">
|
||||
class="btn btn-secondary btn-sm">
|
||||
Create Pricing
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
<div class="col-span-12 md:col-span-12 flex mt-5 mb-5">
|
||||
<button
|
||||
class="btn btn-accent btn-sm">
|
||||
class="btn btn-secondary btn-sm">
|
||||
Create Promo
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
<div class="col-span-12 md:col-span-12 flex mt-5 mb-5">
|
||||
<button
|
||||
class="btn btn-accent btn-sm">
|
||||
class="btn btn-secondary btn-sm">
|
||||
Edit Promo
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<div class="flex start pb-10 text-2xl">Promos </div>
|
||||
<div class="flex justify-end pb-5">
|
||||
<router-link :to="{ name: 'promocreate' }">
|
||||
<button class="btn btn-accent btn-sm">Create Promo</button>
|
||||
<button class="btn btn-secondary btn-sm">Create Promo</button>
|
||||
</router-link>
|
||||
</div>
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
|
||||
<td class="flex gap-2">
|
||||
<router-link :to="{ name: 'promoedit', params: { id: promo['id'] } }">
|
||||
<button class="btn btn-accent btn-sm">Edit Promo</button>
|
||||
<button class="btn btn-secondary btn-sm">Edit Promo</button>
|
||||
</router-link>
|
||||
|
||||
<button @click.prevent="deletepromo(promo['id'])" class="btn btn-error btn-sm">
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<button class="btn btn-accent btn-sm">
|
||||
<button class="btn btn-secondary btn-sm">
|
||||
Send for delivery
|
||||
</button>
|
||||
</form>
|
||||
@@ -83,13 +83,13 @@
|
||||
<td class="flex gap-5">
|
||||
|
||||
<router-link :to="{ name: 'customerEdit', params: { id: oil['customer_id'] } }">
|
||||
<button class="btn btn-accent btn-sm">
|
||||
Edit
|
||||
<button class="btn btn-secondary btn-sm">
|
||||
Edit Customer
|
||||
</button>
|
||||
</router-link>
|
||||
<router-link :to="{ name: 'TicketAuto', params: { id: oil['id'] } }">
|
||||
<button class="btn btn-accent btn-sm">
|
||||
Print
|
||||
<button class="btn btn-secondary btn-sm">
|
||||
Print Ticket
|
||||
</button>
|
||||
</router-link>
|
||||
</td>
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
|
||||
|
||||
<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-secondary">
|
||||
Save Credit Card
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<router-link :to="{ name: 'customerCreate' }">
|
||||
<button class="btn btn-sm btn-accent">Create Customer</button>
|
||||
<button class=" btn bg-blue-700 btn-sm">Create Customer</button>
|
||||
</router-link>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<div class="col-span-12 text-2xl">Edit customer: {{ customer.account_number }}</div>
|
||||
<div class="col-span-12 py-5">
|
||||
<router-link :to="{ name: 'customerProfile', params: { id: customer['id'] } }"
|
||||
class=" btn btn-accent btn-sm">
|
||||
class="btn btn-secondary btn-sm">
|
||||
View Profile
|
||||
</router-link>
|
||||
</div>
|
||||
@@ -128,7 +128,6 @@
|
||||
</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"
|
||||
@@ -138,17 +137,21 @@
|
||||
</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>
|
||||
|
||||
|
||||
<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>
|
||||
@@ -206,7 +209,7 @@ export default defineComponent({
|
||||
customer_phone_number: '',
|
||||
account_number: '',
|
||||
},
|
||||
customer_description_overall: {
|
||||
customerDescription: {
|
||||
id: 0,
|
||||
customer_id: 0,
|
||||
account_number: '',
|
||||
@@ -228,6 +231,7 @@ export default defineComponent({
|
||||
customer_state: "",
|
||||
customer_address: "",
|
||||
customer_description: "",
|
||||
customer_fill_location: 0,
|
||||
|
||||
},
|
||||
},
|
||||
@@ -293,10 +297,9 @@ export default defineComponent({
|
||||
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 )
|
||||
this.customerDescription = response.data
|
||||
this.CreateCustomerForm.basicInfo.customer_description = this.customerDescription.description;
|
||||
this.CreateCustomerForm.basicInfo.customer_fill_location =this.customerDescription.fill_location
|
||||
})
|
||||
},
|
||||
|
||||
@@ -350,6 +353,7 @@ export default defineComponent({
|
||||
customer_state: string;
|
||||
customer_address: string;
|
||||
customer_description: string;
|
||||
customer_fill_location: number;
|
||||
}) {
|
||||
let path = import.meta.env.VITE_BASE_URL + "/customer/edit/" + this.customer.id;
|
||||
axios({
|
||||
@@ -382,7 +386,7 @@ export default defineComponent({
|
||||
customer_home_type: this.CreateCustomerForm.basicInfo.customer_home_type,
|
||||
customer_state: this.CreateCustomerForm.basicInfo.customer_state,
|
||||
customer_address: this.CreateCustomerForm.basicInfo.customer_address,
|
||||
|
||||
customer_fill_location: this.CreateCustomerForm.basicInfo.customer_fill_location,
|
||||
customer_description: this.CreateCustomerForm.basicInfo.customer_description,
|
||||
};
|
||||
this.editItem(payload);
|
||||
|
||||
@@ -24,7 +24,15 @@
|
||||
Customers {{ customer_count }}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-span-12 bg-secondary">
|
||||
<div class="grid grid-cols-12 p-5 bg-neutral m-5">
|
||||
<div class="col-span-12 font-bold text-xl">Quick Tips</div>
|
||||
<div class="col-span-3 py-2"> @ = last name search</div>
|
||||
<div class="col-span-3 py-2"> ! = address</div>
|
||||
<div class="col-span-3 py-2"> # = phone number</div>
|
||||
<div class="col-span-3 py-2"> $ = account number</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overflow-x-auto bg-neutral font-bold">
|
||||
<table class="table">
|
||||
<!-- head -->
|
||||
@@ -41,7 +49,10 @@
|
||||
<tbody>
|
||||
<!-- row 1 -->
|
||||
<tr v-for="person in customers" :key="person['id']">
|
||||
<td>{{ person['account_number'] }}</td>
|
||||
<td>
|
||||
<router-link :to="{ name: 'customerProfile', params: { id: person['id'] } }">{{ person['account_number'] }}
|
||||
</router-link>
|
||||
</td>
|
||||
<td>
|
||||
<router-link :to="{ name: 'customerProfile', params: { id: person['id'] } }">
|
||||
{{ person['customer_first_name'] }} {{ person['customer_last_name'] }}
|
||||
@@ -56,17 +67,17 @@
|
||||
|
||||
<td class="flex gap-5">
|
||||
<router-link :to="{ name: 'deliveryCreate', params: { id: person['id'] } }"
|
||||
class="btn btn-accent btn-sm">
|
||||
Create Oil Order
|
||||
class="btn-sm btn bg-orange-600 text-white">
|
||||
Create Delivery
|
||||
</router-link>
|
||||
<router-link :to="{ name: 'customerEdit', params: { id: person['id'] } }" class="btn btn-accent btn-sm">
|
||||
<router-link :to="{ name: 'customerEdit', params: { id: person['id'] } }" class="btn-sm btn btn-secondary">
|
||||
Edit Customer
|
||||
</router-link>
|
||||
<router-link :to="{ name: 'cardadd', params: { id: person['id'] } }">
|
||||
<button class="btn btn-sm btn-accent">Add CreditCard</button>
|
||||
<button class="btn btn-sm btn-secondary text-white ">Add CreditCard</button>
|
||||
</router-link>
|
||||
<router-link :to="{ name: 'customerProfile', params: { id: person['id'] } }"
|
||||
class=" btn btn-accent btn-sm">
|
||||
class="btn btn-secondary btn-sm">
|
||||
View Profile
|
||||
</router-link>
|
||||
|
||||
|
||||
@@ -22,39 +22,46 @@
|
||||
<div class="w-full mt-10">
|
||||
|
||||
<div class="grid grid-cols-12 gap-5">
|
||||
<div class="col-span-4 p-5 ">
|
||||
<img src="../../../assets/images/user_placeholder.png" alt="Drone Image" width="200" height="250" />
|
||||
<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 }}
|
||||
</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 class="col-span-8 p-5">
|
||||
<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 } }"
|
||||
class="btn-sm btn btn-accent">
|
||||
class="btn-sm btn bg-orange-600 text-white">
|
||||
Create Delivery
|
||||
</router-link>
|
||||
|
||||
<router-link :to="{ name: 'customerEdit', params: { id: customer.id } }"
|
||||
class="btn-sm btn btn-accent">
|
||||
class="btn-sm btn btn-secondary">
|
||||
Edit Customer
|
||||
</router-link>
|
||||
|
||||
|
||||
<div v-if="automatic_status === 0">
|
||||
<button v-on:click="userAutomatic(customer.id)" class="btn btn-accent btn-sm">
|
||||
Become Automatic Customer
|
||||
</button>
|
||||
<button v-on:click="userAutomatic(customer.id)" class="btn-sm btn btn-secondary">
|
||||
Become Automatic Customer
|
||||
</button>
|
||||
</div>
|
||||
<div v-else>
|
||||
<button v-on:click="userAutomatic(customer.id)" class="btn btn-accent btn-sm">
|
||||
<button v-on:click="userAutomatic(customer.id)" class="btn bg-green-600 text-black btn-sm">
|
||||
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 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 }}
|
||||
@@ -101,42 +108,43 @@
|
||||
<div class="col-span-12 font-bold flex">
|
||||
{{ customer.customer_phone_number }}
|
||||
</div>
|
||||
<div class="col-span-12 font-bold flex">{{ customer.account_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-100 border-0 rounded dark:bg-gray-400">
|
||||
<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">
|
||||
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 px-2">
|
||||
{{ customer_description.description }}
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-span-6 ">
|
||||
<div class="grid grid-cols-12">
|
||||
<div class="col-span-12 font-bold flex text-2xl">
|
||||
Stats
|
||||
Stats
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<div class="col-span-12 py-2 px-2">
|
||||
Total Calls: {{ customer_stats.total_calls }}
|
||||
</div>
|
||||
<div class="col-span-12 py-2 font-bold">Delivery</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>
|
||||
@@ -150,8 +158,69 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="col-span-12 ">
|
||||
<hr class=" h-1 mx-auto my-4 bg-gray-100 border-0 rounded dark:bg-gray-400">
|
||||
<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">
|
||||
@@ -162,7 +231,7 @@
|
||||
<div class="col-span-6 font-bold flex ">
|
||||
|
||||
<router-link :to="{ name: 'cardadd', params: { id: customer.user_id } }">
|
||||
<button class="btn btn-sm btn-accent">Add CreditCard</button>
|
||||
<button class="btn btn-sm btn-secondary text-white">Add Credit Card</button>
|
||||
</router-link>
|
||||
</div>
|
||||
<div class="col-span-12 font-bold flex">
|
||||
@@ -177,7 +246,7 @@
|
||||
|
||||
<div class="flex flex-row ">
|
||||
<div v-if="card.main_card" class="basis-1/3 p-2">
|
||||
<div class="bg-accent rounded-md border-2 ">
|
||||
<div class="bg-neutral rounded-md border-2 ">
|
||||
<div class="flex p-3">
|
||||
{{ card.type_of_card }}
|
||||
</div>
|
||||
@@ -185,7 +254,7 @@
|
||||
{{ card.name_on_card }}
|
||||
</div>
|
||||
<div class="flex p-1 pl-4">
|
||||
{{ card.card_number }}
|
||||
{{ card.card_number }}
|
||||
</div>
|
||||
<div class="flex p-1 pl-4">
|
||||
{{ card.expiration_month }}/ {{ card.expiration_year }}
|
||||
@@ -235,7 +304,9 @@
|
||||
</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">
|
||||
@@ -261,9 +332,7 @@
|
||||
<th>Address</th>
|
||||
<th>Gallons</th>
|
||||
<th>Date</th>
|
||||
<th>Automatic</th>
|
||||
<th>Prime</th>
|
||||
<th>Same Day</th>
|
||||
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -285,42 +354,33 @@
|
||||
<td>{{ oil['customer_name'] }}</td>
|
||||
<td>{{ oil['customer_address'] }}</td>
|
||||
<td>
|
||||
<div v-if="oil['customer_asked_for_fill'] == 1">Fill</div>
|
||||
<div v-else> {{ oil['gallons_ordered'] }}</div>
|
||||
|
||||
{{ oil['gallons_delivered'] }}
|
||||
</td>
|
||||
<td>{{ oil['expected_delivery_date'] }}</td>
|
||||
<td>
|
||||
<div v-if="oil['automatic'] == 0">No</div>
|
||||
<div v-else>Yes</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: 'deliveryOrder', params: { id: oil['id'] } }">
|
||||
<button class="btn btn-accent btn-sm">View</button>
|
||||
</router-link>
|
||||
<router-link :to="{ name: 'Ticket', params: { id: oil['id'] } }">
|
||||
<button class="btn btn-accent btn-sm">Print</button>
|
||||
<button class="btn btn-secondary btn-sm">View</button>
|
||||
</router-link>
|
||||
|
||||
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
|
||||
<button class="btn btn-sm btn-accent">Edit</button>
|
||||
<button class="btn btn-sm btn-secondary">Edit</button>
|
||||
</router-link>
|
||||
|
||||
<router-link :to="{ name: 'finalizeTicket', params: { id: oil['id'] } }" v-if="oil['delivery_status'] != 10">
|
||||
<button class="btn btn-sm btn-success">Finalize</button>
|
||||
|
||||
<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>
|
||||
<!--
|
||||
<a @click.prevent="deleteCall(oil['id'])">
|
||||
<button class="btn btn-sm btn-error">Delete</button>
|
||||
</a> -->
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -399,6 +459,13 @@ export default defineComponent({
|
||||
fill_location: 0,
|
||||
description: '',
|
||||
},
|
||||
customer_tank: {
|
||||
id: 0,
|
||||
last_tank_inspection: null,
|
||||
tank_status: false,
|
||||
outside_or_inside: false,
|
||||
tank_size: 0,
|
||||
},
|
||||
customer_stats: {
|
||||
id: 0,
|
||||
customer_id: 0,
|
||||
@@ -462,7 +529,7 @@ export default defineComponent({
|
||||
this.user = null
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
userAutomaticStatus(userid: any) {
|
||||
let path = import.meta.env.VITE_BASE_URL + '/customer/automatic/status/' + userid;
|
||||
axios({
|
||||
@@ -471,7 +538,7 @@ export default defineComponent({
|
||||
headers: authHeader(),
|
||||
}).then((response: any) => {
|
||||
this.automatic_status = response.data.status
|
||||
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
@@ -510,7 +577,7 @@ export default defineComponent({
|
||||
type: 'Warning' // Adjust type if needed
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
this.getCustomer(this.$route.params.id);
|
||||
this.getCreditCards(this.$route.params.id)
|
||||
this.getCreditCardsCount(this.$route.params.id)
|
||||
@@ -526,6 +593,7 @@ export default defineComponent({
|
||||
}).then((response: any) => {
|
||||
|
||||
this.customer = response.data
|
||||
this.getCustomerTank(this.customer.id)
|
||||
this.userAutomaticStatus(this.customer.id);
|
||||
this.getCustomerDescription(this.customer.id);
|
||||
this.getCustomerStats(this.customer.id);
|
||||
@@ -539,9 +607,8 @@ export default defineComponent({
|
||||
url: path,
|
||||
headers: authHeader(),
|
||||
}).then((response: any) => {
|
||||
|
||||
|
||||
this.customer_last_delivery = response.data.date
|
||||
console.log(response.data)
|
||||
})
|
||||
},
|
||||
getCustomerStats(userid: any) {
|
||||
@@ -566,7 +633,16 @@ export default defineComponent({
|
||||
this.customer_description = response.data
|
||||
})
|
||||
},
|
||||
|
||||
getCustomerTank(userid: any) {
|
||||
let path = import.meta.env.VITE_BASE_URL + '/customer/tank/' + userid;
|
||||
axios({
|
||||
method: 'get',
|
||||
url: path,
|
||||
headers: authHeader(),
|
||||
}).then((response: any) => {
|
||||
this.customer_tank = response.data
|
||||
})
|
||||
},
|
||||
|
||||
getCreditCards(user_id: any) {
|
||||
let path = import.meta.env.VITE_BASE_URL + '/payment/cards/' + user_id;
|
||||
@@ -634,14 +710,14 @@ export default defineComponent({
|
||||
if (response.data.ok) {
|
||||
notify({
|
||||
title: "Success",
|
||||
text: "deleted oil order",
|
||||
text: "deleted delivery",
|
||||
type: "success",
|
||||
});
|
||||
this.getPage(1)
|
||||
} else {
|
||||
notify({
|
||||
title: "Failure",
|
||||
text: "error deleting oil order",
|
||||
text: "error deleting delivery",
|
||||
type: "success",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import CustomerHome from '../customer/home.vue';
|
||||
import CustomerCreate from '../customer/create.vue';
|
||||
import CustomerEdit from "../customer/edit.vue";
|
||||
import CustomerProfile from "./profile/home.vue"
|
||||
import TankEdit from "./tank/edit.vue"
|
||||
|
||||
|
||||
const customerRoutes = [
|
||||
{
|
||||
@@ -22,11 +24,16 @@ const customerRoutes = [
|
||||
name: 'customerEdit',
|
||||
component: CustomerEdit,
|
||||
},
|
||||
{
|
||||
{
|
||||
path: '/customer/:id',
|
||||
name: 'customerProfile',
|
||||
component: CustomerProfile,
|
||||
},
|
||||
{
|
||||
path: '/tank/edit/:id',
|
||||
name: 'TankEdit',
|
||||
component: TankEdit,
|
||||
},
|
||||
]
|
||||
|
||||
export default customerRoutes
|
||||
|
||||
283
src/pages/customer/tank/edit.vue
Normal file
283
src/pages/customer/tank/edit.vue
Normal file
@@ -0,0 +1,283 @@
|
||||
<template>
|
||||
<Header />
|
||||
<div class="flex">
|
||||
<div class="">
|
||||
<SideBar />
|
||||
</div>
|
||||
<div class=" w-full px-10">
|
||||
<div class="text-sm breadcrumbs">
|
||||
<ul>
|
||||
<li>
|
||||
<router-link :to="{ name: 'home' }">
|
||||
Home
|
||||
</router-link>
|
||||
</li>
|
||||
<li>
|
||||
<router-link :to="{ name: 'customer' }">
|
||||
Customers
|
||||
</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="grid grid-cols-1 rounded-md p-6 ">
|
||||
<div class="text-[24px]">
|
||||
Customer: {{ customer.customer_first_name }} {{ customer.customer_last_name }} | {{ customer.account_number }}
|
||||
</div>
|
||||
|
||||
<form class="rounded-md px-8 pt-6 pb-8 mb-4 w-full" enctype="multipart/form-data"
|
||||
@submit.prevent="onSubmit">
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block text-white text-sm font-bold mb-2">Inspection Date </label>
|
||||
<input v-model="CreateTankForm.basicInfo.last_tank_inspection"
|
||||
class="input input-bordered input-sm w-full max-w-xs" id="title" type="date"
|
||||
min="2023-01-01" max="2030-01-01" />
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block text-white text-sm font-bold mb-2">Good Or bad Tank</label>
|
||||
<label>
|
||||
<input type="radio" name="goodtank1" value="true" class="radio"
|
||||
v-model="CreateTankForm.basicInfo.tank_status" />
|
||||
Good
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="goodtank2" value="false" class="radio"
|
||||
v-model="CreateTankForm.basicInfo.tank_status" />
|
||||
Bad
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block text-white text-sm font-bold mb-2">Tank Size</label>
|
||||
<input v-model="CreateTankForm.basicInfo.tank_size"
|
||||
class="input input-bordered input-sm w-full max-w-xs" id="title" type="text"
|
||||
placeholder="Gallon size of tank" />
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block text-white text-sm font-bold mb-2">Inside or Outside</label>
|
||||
<label>
|
||||
<input type="radio" name="insideoutside1" value="true" class="radio"
|
||||
v-model="CreateTankForm.basicInfo.outside_or_inside" />
|
||||
Inside
|
||||
</label>
|
||||
<label>
|
||||
|
||||
<input type="radio" name="insideoutside2" value="false" class="radio"
|
||||
v-model="CreateTankForm.basicInfo.outside_or_inside" />
|
||||
Outside
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block text-white text-sm font-bold mb-2">Fill Location</label>
|
||||
<input v-model="CreateTankForm.basicInfo.fill_location"
|
||||
class="input input-bordered input-sm w-full max-w-xs" id="title" type="text"
|
||||
placeholder="Fill Location" />
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-span-12 md:col-span-12 flex mt-5 mb-5">
|
||||
<button class="btn btn-accent btn-sm">
|
||||
Edit Customer Tank
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Footer />
|
||||
</template>
|
||||
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue'
|
||||
import axios from 'axios'
|
||||
import authHeader from '../../../services/auth.header'
|
||||
import Header from '../../../layouts/headers/headerauth.vue'
|
||||
import SideBar from '../../../layouts/sidebar/sidebar.vue'
|
||||
import Footer from '../../../layouts/footers/footer.vue'
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
name: 'TankEdit',
|
||||
|
||||
components: {
|
||||
Header,
|
||||
SideBar,
|
||||
Footer,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
user: {
|
||||
id: '',
|
||||
},
|
||||
customer: {
|
||||
id: 0,
|
||||
user_id: 0,
|
||||
customer_first_name: '',
|
||||
customer_last_name: '',
|
||||
customer_town: '',
|
||||
customer_address: '',
|
||||
customer_state: 0,
|
||||
customer_zip: '',
|
||||
customer_apt: '',
|
||||
customer_home_type: 0,
|
||||
customer_phone_number: '',
|
||||
account_number: '',
|
||||
},
|
||||
tank: {
|
||||
customer_id: 0,
|
||||
last_tank_inspection: true,
|
||||
tank_status: true,
|
||||
outside_or_inside: true,
|
||||
tank_size: 0,
|
||||
|
||||
},
|
||||
|
||||
CreateTankForm: {
|
||||
basicInfo: {
|
||||
last_tank_inspection: null,
|
||||
tank_status: true,
|
||||
outside_or_inside: true,
|
||||
tank_size: 0,
|
||||
fill_location: 0,
|
||||
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.userStatus()
|
||||
},
|
||||
watch: {
|
||||
$route() {
|
||||
this.getCustomer(this.$route.params.id);
|
||||
this.getCustomerDescription(this.$route.params.id);
|
||||
this.getTank(this.$route.params.id);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getCustomer(this.$route.params.id);
|
||||
this.getCustomerDescription(this.$route.params.id);
|
||||
this.getTank(this.$route.params.id);
|
||||
},
|
||||
methods: {
|
||||
userStatus() {
|
||||
let path = import.meta.env.VITE_BASE_URL + '/auth/whoami';
|
||||
axios({
|
||||
method: 'get',
|
||||
url: path,
|
||||
withCredentials: true,
|
||||
headers: authHeader(),
|
||||
})
|
||||
.then((response: any) => {
|
||||
if (response.data.ok) {
|
||||
this.user = response.data.user;
|
||||
this.user.id = response.data.user.id;
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.user.id = '';
|
||||
})
|
||||
},
|
||||
getCustomer(userid: any) {
|
||||
let path = import.meta.env.VITE_BASE_URL + '/customer/' + userid;
|
||||
axios({
|
||||
method: 'get',
|
||||
url: path,
|
||||
headers: authHeader(),
|
||||
}).then((response: any) => {
|
||||
this.customer = response.data
|
||||
})
|
||||
},
|
||||
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.CreateTankForm.basicInfo.fill_location = response.data.fill_location;
|
||||
})
|
||||
},
|
||||
getTank(customer_id: any) {
|
||||
let path = import.meta.env.VITE_BASE_URL + "/customer/tank/" + customer_id;
|
||||
axios({
|
||||
method: "get",
|
||||
url: path,
|
||||
withCredentials: true,
|
||||
headers: authHeader(),
|
||||
})
|
||||
.then((response: any) => {
|
||||
this.tank = response.data
|
||||
|
||||
this.CreateTankForm.basicInfo.last_tank_inspection = response.data.last_tank_inspection;
|
||||
this.CreateTankForm.basicInfo.tank_status = response.data.tank_status;
|
||||
this.CreateTankForm.basicInfo.outside_or_inside = response.data.outside_or_inside;
|
||||
this.CreateTankForm.basicInfo.tank_size = response.data.tank_size;
|
||||
|
||||
console.log(this.CreateTankForm.basicInfo.outside_or_inside)
|
||||
console.log(this.CreateTankForm.basicInfo.tank_status)
|
||||
})
|
||||
},
|
||||
editTank(payload: {
|
||||
|
||||
last_tank_inspection: any;
|
||||
tank_status: boolean;
|
||||
outside_or_inside: boolean;
|
||||
tank_size: number;
|
||||
fill_location: number;
|
||||
}) {
|
||||
|
||||
let path = import.meta.env.VITE_BASE_URL + "/customer/edit/tank/" + this.$route.params.id;
|
||||
axios({
|
||||
method: "put",
|
||||
url: path,
|
||||
data: payload,
|
||||
withCredentials: true,
|
||||
headers: authHeader(),
|
||||
})
|
||||
.then((response: any) => {
|
||||
if (response.data.ok) {
|
||||
this.$router.push({ name: "customerProfile", params: { id: this.tank.customer_id } });
|
||||
}
|
||||
if (response.data.error) {
|
||||
this.$router.push("/");
|
||||
}
|
||||
})
|
||||
},
|
||||
onSubmit() {
|
||||
console.log(this.CreateTankForm.basicInfo.outside_or_inside)
|
||||
console.log(this.CreateTankForm.basicInfo.tank_status)
|
||||
let payload = {
|
||||
last_tank_inspection: this.CreateTankForm.basicInfo.last_tank_inspection,
|
||||
tank_status: this.CreateTankForm.basicInfo.tank_status,
|
||||
outside_or_inside: this.CreateTankForm.basicInfo.outside_or_inside,
|
||||
tank_size: this.CreateTankForm.basicInfo.tank_size,
|
||||
fill_location: this.CreateTankForm.basicInfo.fill_location,
|
||||
};
|
||||
this.editTank(payload);
|
||||
},
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -33,8 +33,8 @@
|
||||
</div>
|
||||
<div class="col-span-12 py-5">
|
||||
<router-link :to="{ name: 'customerProfile', params: { id: customer['id'] } }"
|
||||
class=" btn btn-accent btn-sm">
|
||||
View Customer Profile
|
||||
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 w-full" enctype="multipart/form-data"
|
||||
@@ -80,15 +80,30 @@
|
||||
<input v-model="CreateOilOrderForm.basicInfo.same_day" class="checkbox checkbox-xs" id="same_day"
|
||||
type="checkbox" />
|
||||
</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="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 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 class="flex-1 mb-4">
|
||||
<label class="block text-white text-sm font-bold mb-2">Delivery Driver </label>
|
||||
<select class="select select-bordered select-sm w-full max-w-xs" aria-label="Default select example"
|
||||
@@ -107,17 +122,20 @@
|
||||
<input v-model="CreateOilOrderForm.basicInfo.cash" class="checkbox checkbox-xs" id="cash"
|
||||
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>
|
||||
<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>
|
||||
<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"
|
||||
@@ -135,8 +153,8 @@
|
||||
|
||||
|
||||
<div class="col-span-12 md:col-span-12 flex mt-5 mb-5">
|
||||
<button class="btn btn-sm btn-accent">
|
||||
Create Oil Order
|
||||
<button class="btn-sm btn bg-orange-600 text-white">
|
||||
Create Delivery
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
@@ -224,7 +242,7 @@
|
||||
</td>
|
||||
<td class="flex gap-5">
|
||||
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
|
||||
<button class="btn btn-sm btn-accent">Edit</button>
|
||||
<button class="btn btn-sm btn-secondary">Edit</button>
|
||||
</router-link>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -26,12 +26,12 @@
|
||||
Delivery id: {{ deliveryOrder.id }}
|
||||
</div>
|
||||
<div class="grid grid-cols-12">
|
||||
<div class="col-span-12 py-5">
|
||||
<router-link :to="{ name: 'customerProfile', params: { id: customer['id'] } }"
|
||||
class=" btn btn-accent btn-sm">
|
||||
View Customer Profile
|
||||
</router-link>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
<div class="col-span-6 p-5">
|
||||
<div class="grid grid-cols-12">
|
||||
<div class="col-span-12 flex">
|
||||
@@ -81,7 +81,7 @@
|
||||
<div class="grid grid-cols-1" v-if="deliveryOrder.payment_type == 1">
|
||||
<div class="flex ">
|
||||
<div class="basis-1/3 p-2 ">
|
||||
<div class="rounded-md border-2 bg-accent">
|
||||
<div class="rounded-md border-2 bg-neutral">
|
||||
<div class="flex p-3">
|
||||
{{ userCard.type_of_card }}
|
||||
</div>
|
||||
@@ -122,30 +122,47 @@
|
||||
{{ deliveryOrder.customer_price }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<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="CreateOilOrderForm.basicInfo.cash" class="checkbox checkbox-xs" id="cash" 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.card" 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" />
|
||||
<input v-model="CreateOilOrderForm.basicInfo.check" class="checkbox checkbox-xs" id="check"
|
||||
type="checkbox" />
|
||||
</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="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 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.user_id } }">
|
||||
<button class="btn btn-sm bg-blue-700 text-white">Add CreditCard</button>
|
||||
</router-link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-1 mb-4">
|
||||
@@ -175,6 +192,13 @@
|
||||
{{ v$.CreateOilOrderForm.basicInfo.gallons_ordered.$errors[0].$message }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<label class="block text-white text-sm font-bold mb-2">Delivery Created </label>
|
||||
<input v-model="CreateOilOrderForm.basicInfo.created_delivery_date"
|
||||
class="input input-bordered input-sm w-full max-w-xs" id="title" type="date" min="2023-01-01"
|
||||
max="2030-01-01" />
|
||||
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<label class="block text-white text-sm font-bold mb-2">Expected </label>
|
||||
<input v-model="CreateOilOrderForm.basicInfo.expected_delivery_date"
|
||||
@@ -184,6 +208,8 @@
|
||||
{{ v$.CreateOilOrderForm.basicInfo.expected_delivery_date.$errors[0].$message }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block text-white text-sm font-bold cursor-pointer label">Delivery Notes</label>
|
||||
<textarea class="textarea textarea-bordered h-24 w-full"
|
||||
@@ -217,19 +243,19 @@
|
||||
</div>
|
||||
|
||||
<div class="flex-1 mb-4">
|
||||
<label class="block text-white text-sm font-bold mb-2">Select a Promo</label>
|
||||
<select class="select select-bordered select-sm w-full max-w-xs" aria-label="Default select example"
|
||||
id="promos" v-model="CreateOilOrderForm.basicInfo.promo_id">
|
||||
<option class="text-white" v-for="(promo, index) in promos" :key="index" :value="promo['id']">
|
||||
{{ promo['name_of_promotion'] }} {{ promo['money_off_delivery'] }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="block text-white text-sm font-bold mb-2">Select a Promo</label>
|
||||
<select class="select select-bordered select-sm w-full max-w-xs" aria-label="Default select example"
|
||||
id="promos" v-model="CreateOilOrderForm.basicInfo.promo_id">
|
||||
<option class="text-white" v-for="(promo, index) in promos" :key="index" :value="promo['id']">
|
||||
{{ promo['name_of_promotion'] }} {{ promo['money_off_delivery'] }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-span-12 md:col-span-12 flex mt-5 mb-5">
|
||||
<button class="btn btn-accent btn-sm">
|
||||
Edit Oil Delivery
|
||||
Submit Edit Oil Delivery
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
@@ -310,6 +336,7 @@ export default defineComponent({
|
||||
when_ordered: '',
|
||||
when_delivered: '',
|
||||
expected_delivery_date: '',
|
||||
created_delivery_date: '',
|
||||
automatic: 0,
|
||||
oil_id: 0,
|
||||
supplier_price: '',
|
||||
@@ -335,6 +362,7 @@ export default defineComponent({
|
||||
gallons_ordered: '',
|
||||
customer_asked_for_fill: false,
|
||||
expected_delivery_date: '',
|
||||
created_delivery_date: '',
|
||||
dispatcher_notes_taken: '',
|
||||
prime: false,
|
||||
same_day: false,
|
||||
@@ -399,7 +427,7 @@ export default defineComponent({
|
||||
})
|
||||
},
|
||||
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,
|
||||
@@ -412,7 +440,7 @@ export default defineComponent({
|
||||
});
|
||||
},
|
||||
getDeliveryOrder(delivery_id: any) {
|
||||
let path = import.meta.env.VITE_BASE_URL +"/delivery/" + delivery_id;
|
||||
let path = import.meta.env.VITE_BASE_URL + "/delivery/" + delivery_id;
|
||||
axios({
|
||||
method: "get",
|
||||
url: path,
|
||||
@@ -424,6 +452,7 @@ export default defineComponent({
|
||||
this.CreateOilOrderForm.basicInfo.gallons_ordered = response.data.delivery.delivery_gallons_ordered;
|
||||
this.CreateOilOrderForm.basicInfo.customer_asked_for_fill = response.data.delivery.delivery_asked_for_fill;
|
||||
this.CreateOilOrderForm.basicInfo.expected_delivery_date = response.data.delivery.delivery_expected_delivery_date;
|
||||
this.CreateOilOrderForm.basicInfo.created_delivery_date = response.data.delivery.when_ordered;
|
||||
this.CreateOilOrderForm.basicInfo.dispatcher_notes_taken = response.data.delivery.delivery_dispatcher_notes;
|
||||
this.CreateOilOrderForm.basicInfo.prime = response.data.delivery.delivery_prime;
|
||||
this.CreateOilOrderForm.basicInfo.emergency = response.data.delivery.delivery_emergency;
|
||||
@@ -434,7 +463,6 @@ export default defineComponent({
|
||||
if (response.data.delivery.delivery_asked_for_fill == 1) {
|
||||
this.CreateOilOrderForm.basicInfo.customer_asked_for_fill = true
|
||||
}
|
||||
console.log(response.data.delivery.delivery_asked_for_fill)
|
||||
if (response.data.delivery.payment_type == 1) {
|
||||
this.CreateOilOrderForm.basicInfo.userCards = response.data.delivery.payment_card_id;
|
||||
}
|
||||
@@ -475,10 +503,10 @@ export default defineComponent({
|
||||
this.CreateOilOrderForm.basicInfo.other = true
|
||||
}
|
||||
if (response.data.delivery.promo_id !== 0) {
|
||||
|
||||
|
||||
this.CreateOilOrderForm.basicInfo.promo_id = response.data.delivery.promo_id;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -557,6 +585,7 @@ export default defineComponent({
|
||||
emergency: boolean;
|
||||
delivery_status: string;
|
||||
expected_delivery_date: string;
|
||||
created_delivery_date: string;
|
||||
dispatcher_notes_taken: string;
|
||||
cash: boolean;
|
||||
credit: boolean;
|
||||
@@ -575,7 +604,7 @@ export default defineComponent({
|
||||
})
|
||||
.then((response: any) => {
|
||||
if (response.data.ok) {
|
||||
this.$router.push({ name: "deliveryOrder", params: { id: this.deliveryOrder.id } });
|
||||
this.$router.push({ name: "deliveryOrder", params: { id: this.deliveryOrder.id } });
|
||||
}
|
||||
if (response.data.error) {
|
||||
this.$router.push("/");
|
||||
@@ -588,6 +617,7 @@ export default defineComponent({
|
||||
gallons_ordered: this.CreateOilOrderForm.basicInfo.gallons_ordered,
|
||||
customer_asked_for_fill: this.CreateOilOrderForm.basicInfo.customer_asked_for_fill,
|
||||
expected_delivery_date: this.CreateOilOrderForm.basicInfo.expected_delivery_date,
|
||||
created_delivery_date: this.CreateOilOrderForm.basicInfo.created_delivery_date,
|
||||
dispatcher_notes_taken: this.CreateOilOrderForm.basicInfo.dispatcher_notes_taken,
|
||||
prime: this.CreateOilOrderForm.basicInfo.prime,
|
||||
emergency: this.CreateOilOrderForm.basicInfo.emergency,
|
||||
|
||||
@@ -105,7 +105,6 @@
|
||||
<div v-else-if="oil['payment_type'] == 2">Cash/CC</div>
|
||||
<div v-else-if="oil['payment_type'] == 3">Check</div>
|
||||
<div v-else-if="oil['payment_type'] == 4">Other</div>
|
||||
|
||||
<div v-else></div>
|
||||
|
||||
</td>
|
||||
@@ -114,19 +113,21 @@
|
||||
|
||||
|
||||
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
|
||||
<button class="btn btn-accent btn-sm">View</button>
|
||||
<button class="btn btn-secondary btn-sm">View Delivery</button>
|
||||
</router-link>
|
||||
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
|
||||
<button class="btn btn-accent btn-sm">Edit</button>
|
||||
<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-accent btn-sm">
|
||||
Print
|
||||
<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-success btn-sm">Finalize</button>
|
||||
<button class="btn btn-secondary btn-sm">Finalize</button>
|
||||
</router-link>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -235,14 +236,14 @@ export default defineComponent({
|
||||
if (response.data.ok) {
|
||||
notify({
|
||||
title: "Success",
|
||||
text: "deleted oil order",
|
||||
text: "deleted delivery",
|
||||
type: "success",
|
||||
});
|
||||
this.getPage(this.page)
|
||||
} else {
|
||||
notify({
|
||||
title: "Failure",
|
||||
text: "error deleting oil order",
|
||||
text: "error deleting delivery",
|
||||
type: "success",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
<div class="grid grid-cols-1 rounded-md pb-5" v-if="total_amount">
|
||||
|
||||
<div class="text-2xl border-b border-gray-500">
|
||||
Finalize Oil Order # {{ deliveryOrder.id }}
|
||||
finalize delivery # {{ deliveryOrder.id }}
|
||||
</div>
|
||||
<div class="flex justify-end" v-if="deliveryOrder.id">
|
||||
<router-link :to="{ name: 'deliveryEdit', params: { id: deliveryOrder.id } }">
|
||||
<button class="btn btn-sm btn-accent">Edit Order</button>
|
||||
<button class="btn btn-sm btn-secondary">Edit Order</button>
|
||||
</router-link>
|
||||
</div>
|
||||
<div class="grid grid-cols-12 ">
|
||||
@@ -412,7 +412,7 @@
|
||||
</div>
|
||||
|
||||
<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-secondary btn-sm">
|
||||
Finalize Delivery
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
<td class="flex gap-5" v-if="oil['delivery_status'] == 1">
|
||||
<router-link :to="{ name: 'finalizeTicket', params: { id: oil['id'] } }">
|
||||
<button class="btn">Finalize</button>
|
||||
<button class="btn btn-success btn-sm ">Finalize</button>
|
||||
</router-link>
|
||||
|
||||
</td>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
<div class="grid grid-cols-1 rounded-md pb-5">
|
||||
<div class="text-2xl border-b-2 border-gray-500 mb-10">
|
||||
View Oil Order # {{ deliveryOrder.id }}
|
||||
View Delivery # {{ deliveryOrder.id }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid grid-cols-12">
|
||||
@@ -125,14 +125,14 @@
|
||||
When Called
|
||||
</div>
|
||||
<div class="col-span-12 mb-5 text-sm text-gray-500">
|
||||
{{ format_date(deliveryOrder.when_ordered) }}
|
||||
{{ (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">
|
||||
{{ format_date(deliveryOrder.when_delivered) }}
|
||||
{{ (deliveryOrder.when_delivered) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -332,8 +332,8 @@
|
||||
</div>
|
||||
|
||||
<div class="col-span-12 flex justify-center" v-if="deliveryOrder.id">
|
||||
<router-link :to="{ name: 'deliveryEdit', params: { id: deliveryOrder.id } }">
|
||||
<button class="btn btn-accent btn-sm">Edit Oil Order</button>
|
||||
<router-link :to="{ name: 'customerProfile', params: { id: deliveryOrder['customer_id'] } }">
|
||||
<button class="btn btn-neutral btn-sm">View Customer</button>
|
||||
</router-link>
|
||||
</div>
|
||||
|
||||
@@ -501,14 +501,14 @@ export default defineComponent({
|
||||
if (response.data.ok) {
|
||||
notify({
|
||||
title: "Success",
|
||||
text: "deleted oil order",
|
||||
text: "deleted delivery",
|
||||
type: "success",
|
||||
});
|
||||
this.$router.push({ name: "customerProfile", params: { id: this.customer.id } });
|
||||
} else {
|
||||
notify({
|
||||
title: "Failure",
|
||||
text: "error deleting oil order",
|
||||
text: "error deleting delivery",
|
||||
type: "success",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -76,12 +76,12 @@
|
||||
|
||||
<td class="flex gap-5">
|
||||
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
|
||||
<button class="btn btn-accent">View</button>
|
||||
<button class="btn btn-secondary">View delivery</button>
|
||||
</router-link>
|
||||
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
|
||||
<button class="btn btn-accent">Edit</button>
|
||||
<button class="btn btn-secondary">Edit Delivery</button>
|
||||
</router-link>
|
||||
<button @click.prevent="deleteCall(oil['id'])" class="btn btn-accent">Delete</button>
|
||||
<!-- <button @click.prevent="deleteCall(oil['id'])" class="btn bg-red-600 text-black">DELETE</button> -->
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -183,14 +183,14 @@ export default defineComponent({
|
||||
if (response.data.ok) {
|
||||
notify({
|
||||
title: "Success",
|
||||
text: "deleted oil order",
|
||||
text: "deleted delivery",
|
||||
type: "success",
|
||||
});
|
||||
this.getPage(this.page)
|
||||
} else {
|
||||
notify({
|
||||
title: "Failure",
|
||||
text: "error deleting oil order",
|
||||
text: "error deleting delivery",
|
||||
type: "success",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
|
||||
<td class="flex gap-5">
|
||||
<router-link :to="{ name: 'finalizeTicket', params: { id: oil['id'] } }">
|
||||
<button class="btn btn-accent">Finalize</button>
|
||||
<button class="btn btn-success btn-sm">Finalize</button>
|
||||
</router-link>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -179,14 +179,14 @@ export default defineComponent({
|
||||
if (response.data.ok) {
|
||||
notify({
|
||||
title: "Success",
|
||||
text: "deleted oil order",
|
||||
text: "deleted delivery",
|
||||
type: "success",
|
||||
});
|
||||
this.getPage(this.page)
|
||||
} else {
|
||||
notify({
|
||||
title: "Failure",
|
||||
text: "error deleting oil order",
|
||||
text: "error deleting delivery",
|
||||
type: "success",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -77,17 +77,17 @@
|
||||
|
||||
<td class="flex gap-5">
|
||||
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
|
||||
<button class="btn btn-accent btn-sm">View</button>
|
||||
<button class="btn btn-secondary btn-sm">View Delivery</button>
|
||||
</router-link>
|
||||
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
|
||||
<button class="btn btn-accent btn-sm">Edit</button>
|
||||
<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-accent btn-sm">
|
||||
Print
|
||||
<button class="btn btn-secondary btn-sm">
|
||||
Print Ticket
|
||||
</button>
|
||||
</router-link>
|
||||
<button @click.prevent="deleteCall(oil['id'])" class="btn btn-accent btn-sm">Delete</button>
|
||||
<!-- <button @click.prevent="deleteCall(oil['id'])" class="btn bg-red-600 text-black">Delete</button> -->
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -191,14 +191,14 @@
|
||||
if (response.data.ok) {
|
||||
notify({
|
||||
title: "Success",
|
||||
text: "deleted oil order",
|
||||
text: "deleted delivery",
|
||||
type: "success",
|
||||
});
|
||||
this.getPage(this.page)
|
||||
} else {
|
||||
notify({
|
||||
title: "Failure",
|
||||
text: "error deleting oil order",
|
||||
text: "error deleting delivery",
|
||||
type: "success",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -77,18 +77,18 @@
|
||||
|
||||
<td class="flex gap-5">
|
||||
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
|
||||
<button class="btn btn-accent">View</button>
|
||||
<button class="btn btn-secondary">View</button>
|
||||
</router-link>
|
||||
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
|
||||
<button class="btn btn-accent ">Edit</button>
|
||||
<button class="btn btn-secondary ">Edit</button>
|
||||
</router-link>
|
||||
<router-link :to="{ name: 'Ticket', params: { id: oil['id'] } }">
|
||||
<button class="btn btn-accent btn-sm">
|
||||
Print
|
||||
<button class="btn btn-secondary btn-sm">
|
||||
Print Ticket
|
||||
</button>
|
||||
</router-link>
|
||||
|
||||
<button @click.prevent="deleteCall(oil['id'])" class="btn btn-accent">Delete</button>
|
||||
<!-- <button @click.prevent="deleteCall(oil['id'])" class="btn bg-red-600 text-black">Delete</button> -->
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -190,14 +190,14 @@ export default defineComponent({
|
||||
if (response.data.ok) {
|
||||
notify({
|
||||
title: "Success",
|
||||
text: "deleted oil order",
|
||||
text: "deleted delivery",
|
||||
type: "success",
|
||||
});
|
||||
this.getPage(this.page)
|
||||
} else {
|
||||
notify({
|
||||
title: "Failure",
|
||||
text: "error deleting oil order",
|
||||
text: "error deleting delivery",
|
||||
type: "success",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -97,20 +97,22 @@
|
||||
|
||||
</td>
|
||||
<td class="flex gap-2">
|
||||
<router-link :to="{ name: 'finalizeTicket', params: { id: oil['id'] } }">
|
||||
<button class="btn btn-accent btn-sm">Finalize</button>
|
||||
</router-link>
|
||||
|
||||
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
|
||||
<button class="btn btn-accent btn-sm">View</button>
|
||||
<button class="btn btn-secondary btn-sm">View Delivery</button>
|
||||
</router-link>
|
||||
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
|
||||
<button class="btn btn-accent btn-sm">Edit</button>
|
||||
<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-accent btn-sm">
|
||||
Print
|
||||
<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>
|
||||
|
||||
<!-- <button @click.prevent="deleteCall(oil['id'])" class="btn btn-error btn-sm">
|
||||
Delete
|
||||
</button> -->
|
||||
@@ -204,7 +206,7 @@ export default defineComponent({
|
||||
if (response.data.update)
|
||||
notify({
|
||||
title: "Success",
|
||||
text: "Updated Oil Orders",
|
||||
text: "Updated delivery",
|
||||
type: "success",
|
||||
});
|
||||
else { }
|
||||
@@ -232,14 +234,14 @@ export default defineComponent({
|
||||
if (response.data.ok) {
|
||||
notify({
|
||||
title: "Success",
|
||||
text: "deleted oil order",
|
||||
text: "deleted delivery",
|
||||
type: "success",
|
||||
});
|
||||
this.getPage(this.page)
|
||||
} else {
|
||||
notify({
|
||||
title: "Failure",
|
||||
text: "error deleting oil order",
|
||||
text: "error deleting delivery",
|
||||
type: "success",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -81,16 +81,17 @@
|
||||
|
||||
<td class="flex gap-5">
|
||||
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
|
||||
<button class="btn btn-accent btn-sm">View</button>
|
||||
<button class="btn btn-secondary btn-sm">View Delivery</button>
|
||||
</router-link>
|
||||
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
|
||||
<button class="btn btn-accent btn-sm">Edit</button>
|
||||
<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-accent btn-sm">
|
||||
Print
|
||||
<button class="btn btn-secondary btn-sm ">
|
||||
Print Ticket
|
||||
</button>
|
||||
</router-link>
|
||||
|
||||
<!-- <button @click.prevent="deleteCall(oil['id'])" class="btn btn-error btn-sm">
|
||||
Delete
|
||||
</button> -->
|
||||
@@ -193,14 +194,14 @@ export default defineComponent({
|
||||
if (response.data.ok) {
|
||||
notify({
|
||||
title: "Success",
|
||||
text: "deleted oil order",
|
||||
text: "deleted delivery",
|
||||
type: "success",
|
||||
});
|
||||
this.getPage(this.page)
|
||||
} else {
|
||||
notify({
|
||||
title: "Failure",
|
||||
text: "error deleting oil order",
|
||||
text: "error deleting delivery",
|
||||
type: "success",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -77,19 +77,22 @@
|
||||
<div v-else>Yes</div>
|
||||
</td>
|
||||
|
||||
<td class="flex gap-5">
|
||||
<td class="flex gap-2">
|
||||
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
|
||||
<button class="btn btn-accent btn-sm">View</button>
|
||||
<button class="btn btn-secondary btn-sm">View Delivery</button>
|
||||
</router-link>
|
||||
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
|
||||
<button class="btn btn-accent btn-sm">Edit</button>
|
||||
<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-accent btn-sm">
|
||||
Print
|
||||
<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>
|
||||
|
||||
<!-- <button @click.prevent="deleteCall(oil['id'])" class="btn btn-error btn-sm">
|
||||
Delete
|
||||
</button> -->
|
||||
@@ -193,14 +196,14 @@ export default defineComponent({
|
||||
if (response.data.ok) {
|
||||
notify({
|
||||
title: "Success",
|
||||
text: "deleted oil order",
|
||||
text: "deleted delivery",
|
||||
type: "success",
|
||||
});
|
||||
this.getPage(this.page)
|
||||
} else {
|
||||
notify({
|
||||
title: "Failure",
|
||||
text: "error deleting oil order",
|
||||
text: "error deleting delivery",
|
||||
type: "success",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
</div>
|
||||
|
||||
<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-secondary">
|
||||
Edit Employee
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<div class="flex start pb-10 text-2xl">Employees </div>
|
||||
<div class="flex justify-end mb-10">
|
||||
<router-link :to="{ name: 'employeeCreate' }">
|
||||
<button class="btn btn-accent btn-sm">Create Employee</button>
|
||||
<button class="btn btn-secondary btn-sm">Create Employee</button>
|
||||
</router-link>
|
||||
</div>
|
||||
|
||||
@@ -63,10 +63,10 @@
|
||||
<td>{{ person['employee_phone_number'] }}</td>
|
||||
<td class="flex gap-5">
|
||||
<router-link :to="{ name: 'employeeEdit', params: { id: person['id'] } }">
|
||||
<button class="btn btn-accent btn-sm">Edit</button>
|
||||
<button class="btn btn-secondary btn-sm">Edit</button>
|
||||
</router-link>
|
||||
<router-link :to="{ name: 'employeeProfile', params: { id: person['id'] } }">
|
||||
<button class="btn btn-accent btn-sm">View</button>
|
||||
<button class="btn btn-secondary btn-sm">View</button>
|
||||
</router-link>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<div class="col-span-9">
|
||||
<div class="grid grid-cols-12">
|
||||
<div class="col-span-12 font-bold flex justify-end">
|
||||
<div class="btn btn-sm btn-accent">
|
||||
<div class="btn btn-sm btn-secondary">
|
||||
<router-link :to="{ name: 'employeeEdit', params: { id: employee.id } }">
|
||||
Edit Employee
|
||||
</router-link>
|
||||
|
||||
106
src/pages/money/profit_year.vue
Normal file
106
src/pages/money/profit_year.vue
Normal file
@@ -0,0 +1,106 @@
|
||||
<template>
|
||||
<Header />
|
||||
<div class="flex">
|
||||
<div class="">
|
||||
<SideBar />
|
||||
</div>
|
||||
<div class=" w-full px-10 ">
|
||||
<div class="text-sm breadcrumbs mb-10">
|
||||
<ul>
|
||||
<li>
|
||||
<router-link :to="{ name: 'home' }">
|
||||
Home
|
||||
</router-link>
|
||||
</li>
|
||||
<li>
|
||||
<router-link :to="{ name: 'employee' }">
|
||||
employees
|
||||
</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="flex start pb-10 text-2xl">Profit for Year </div>
|
||||
|
||||
<div class="col-span-12 font-bold ">
|
||||
Profit Year
|
||||
</div>
|
||||
<div class="col-span-12 mb-5 text-sm text-gray-500">
|
||||
{{ profit_year }}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<Footer />
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue'
|
||||
import axios from 'axios'
|
||||
import authHeader from '../../services/auth.header'
|
||||
import Header from '../../layouts/headers/headerauth.vue'
|
||||
import SideBar from '../../layouts/sidebar/sidebar.vue'
|
||||
import Footer from '../../layouts/footers/footer.vue'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'MoneyYear',
|
||||
|
||||
components: {
|
||||
Header,
|
||||
SideBar,
|
||||
Footer,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
token: null,
|
||||
user: null,
|
||||
employees: [],
|
||||
profit_year: 0,
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.userStatus()
|
||||
},
|
||||
mounted() {
|
||||
this.get_profit_year()
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
userStatus() {
|
||||
let path = import.meta.env.VITE_BASE_URL + '/auth/whoami';
|
||||
axios({
|
||||
method: 'get',
|
||||
url: path,
|
||||
withCredentials: true,
|
||||
headers: authHeader(),
|
||||
})
|
||||
.then((response: any) => {
|
||||
if (response.data.ok) {
|
||||
this.user = response.data.user;
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.user = null
|
||||
})
|
||||
},
|
||||
get_profit_year() {
|
||||
let path = import.meta.env.VITE_BASE_URL + '/money/profit/year';
|
||||
axios({
|
||||
method: 'get',
|
||||
url: path,
|
||||
headers: authHeader(),
|
||||
}).then((response: any) => {
|
||||
this.profit_year = response.data.total
|
||||
})
|
||||
},
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
20
src/pages/money/routes.ts
Normal file
20
src/pages/money/routes.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
|
||||
import MoneyYear from '../money/profit_year.vue';
|
||||
|
||||
|
||||
|
||||
|
||||
const moneyRoutes = [
|
||||
|
||||
{
|
||||
path: '/money/year',
|
||||
name: 'MoneyYear',
|
||||
component: MoneyYear,
|
||||
},
|
||||
|
||||
|
||||
]
|
||||
|
||||
export default moneyRoutes
|
||||
//sourceMappingURL=index.ts.map
|
||||
@@ -210,10 +210,13 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-span-12 py-3" v-if="delivery.promo_id != 0">
|
||||
<div class="col-span-12 font-bold py-5 " v-if="delivery.payment_type == 0">
|
||||
<div class="">
|
||||
CASH Total: ${{ total_amount_after_discount }}
|
||||
<div class="col-span-12 py-3" v-if="delivery.promo_id != null">
|
||||
<div class="col-span-12 " v-if="delivery.payment_type == 0">
|
||||
<div class="font-bold py-5">
|
||||
CASH Total:
|
||||
</div>
|
||||
<div class="col-span-12 text-gray-500">
|
||||
${{ total_amount_after_discount }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-span-12 font-bold py-5 text-accent" v-if="delivery.payment_type == 1">
|
||||
@@ -233,10 +236,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-span-12 py-3" v-else>
|
||||
<div class="col-span-12 font-bold py-5 " v-if="delivery.payment_type == 0">
|
||||
<div class="">
|
||||
CASH Total: ${{ total_amount }}
|
||||
<div class="col-span-12 " v-if="delivery.payment_type == 0">
|
||||
<div class="font-bold py-5">
|
||||
CASH Total:
|
||||
</div>
|
||||
<div class="col-span-12 text-gray-500">
|
||||
${{ total_amount }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-span-12 font-bold py-5 text-accent" v-if="delivery.payment_type == 1">
|
||||
<div class="">
|
||||
@@ -260,32 +266,39 @@
|
||||
<div class="flex justify-between">
|
||||
|
||||
<div class="" v-if="delivery.payment_type == 0">
|
||||
<button class="btn btn-accent btn-sm" @click="checkoutOilUpdatePayment(0)">
|
||||
Confirm Cash Payment
|
||||
<button class="btn bg-green-800 btn-sm" @click="checkoutOilUpdatePayment(0)">
|
||||
Confirm Delivery
|
||||
</button>
|
||||
</div>
|
||||
<div class="" v-if="delivery.payment_type == 1">
|
||||
<button class="btn btn-accent btn-sm" @click="checkoutOilUpdatePayment(1)">
|
||||
Pay Credit Terminal
|
||||
<button class="btn bg-green-800 btn-sm" @click="checkoutOilUpdatePayment(1)">
|
||||
Confirm Delivery
|
||||
</button>
|
||||
</div>
|
||||
<div class="" v-if="delivery.payment_type == 2">
|
||||
<button class="btn btn-accent btn-sm" @click="checkoutOilUpdatePayment(2)">
|
||||
Cash + Pay Credit Terminal
|
||||
<button class="btn bg-green-800 btn-sm" @click="checkoutOilUpdatePayment(2)">
|
||||
Confirm Delivery
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="" v-if="delivery.payment_type == 3">
|
||||
<button class="btn btn-accent btn-sm" @click="checkoutOilUpdatePayment(3)">
|
||||
Check + Pay Credit Terminal
|
||||
<button class="btn bg-green-800 btn-sm" @click="checkoutOilUpdatePayment(3)">
|
||||
Confirm Delivery
|
||||
</button>
|
||||
</div>
|
||||
<div class="" v-if="delivery.payment_type == 4">
|
||||
<button class="btn btn-accent btn-sm" @click="checkoutOilUpdatePayment(3)">
|
||||
Other
|
||||
<button class="btn bg-green-800 btn-sm" @click="checkoutOilUpdatePayment(3)">
|
||||
Confirm Delivery
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-span-12 py-10">
|
||||
|
||||
<router-link :to="{ name: 'deliveryEdit', params: { id: delivery.id } }">
|
||||
<button class="btn btn-sm btn-secondary">Edit Delivery</button>
|
||||
</router-link>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -447,6 +460,7 @@ export default defineComponent({
|
||||
})
|
||||
.then((response: any) => {
|
||||
if (response.data.ok) {
|
||||
console.log(response.data)
|
||||
this.priceprime = response.data.priceprime;
|
||||
this.pricesameday = response.data.pricesameday;
|
||||
this.priceemergency = response.data.priceemergency;
|
||||
@@ -530,7 +544,7 @@ export default defineComponent({
|
||||
.catch(() => {
|
||||
notify({
|
||||
title: "Error",
|
||||
text: "Could not get oil order",
|
||||
text: "Could not get delivery",
|
||||
type: "error",
|
||||
});
|
||||
});
|
||||
|
||||
@@ -43,6 +43,9 @@
|
||||
<div class="col-span-12 text-lg" v-else-if="delivery.payment_type == 3">Check</div>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -88,8 +91,8 @@
|
||||
<div class="col-span-12 h-7 pl-4 pt-2">{{ delivery.when_ordered }}</div>
|
||||
<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>
|
||||
<div class="col-span-12 h-7 pl-4 pt-2" v-if="delivery.customer_asked_for_fill == 0">
|
||||
{{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">
|
||||
@@ -267,7 +270,7 @@ export default defineComponent({
|
||||
.catch(() => {
|
||||
notify({
|
||||
title: "Error",
|
||||
text: "Could not get oil order",
|
||||
text: "Could not get delivery",
|
||||
type: "error",
|
||||
});
|
||||
});
|
||||
|
||||
@@ -159,7 +159,7 @@ export default defineComponent({
|
||||
.catch(() => {
|
||||
notify({
|
||||
title: "Error",
|
||||
text: "Could not get oil order",
|
||||
text: "Could not get delivery",
|
||||
type: "error",
|
||||
});
|
||||
});
|
||||
|
||||
@@ -11,9 +11,10 @@ import autoRoutes from '../pages/automatic/routes.ts'
|
||||
import Error404 from '../pages/error/Error404.vue'
|
||||
import adminRoutes from "../pages/admin/routes.ts";
|
||||
import tickerRoutes from "../pages/ticket/routes.ts";
|
||||
|
||||
import moneyRoutes from "../pages/money/routes.ts";
|
||||
|
||||
const routes = [
|
||||
...moneyRoutes,
|
||||
...cardRoutes,
|
||||
...authRoutes,
|
||||
...payRoutes,
|
||||
|
||||
@@ -8,7 +8,7 @@ module.exports = {
|
||||
mytheme: {
|
||||
"primary": "#010409",
|
||||
"secondary": "#161B22",
|
||||
"accent": "#0256bf",
|
||||
"accent": "#ff6600",
|
||||
"neutral": "#21262C",
|
||||
"base-100": "#0D1117",
|
||||
"info": "#74a0d5",
|
||||
|
||||
Reference in New Issue
Block a user