updated customer profile. added maps

This commit is contained in:
2024-11-20 18:00:17 -05:00
parent b62d45da5d
commit bf49bf5711
19 changed files with 1157 additions and 313 deletions

26
package-lock.json generated
View File

@@ -26,8 +26,10 @@
}, },
"devDependencies": { "devDependencies": {
"@vitejs/plugin-vue": "^4.5.2", "@vitejs/plugin-vue": "^4.5.2",
"@vue-leaflet/vue-leaflet": "^0.10.1",
"autoprefixer": "^10.4.16", "autoprefixer": "^10.4.16",
"daisyui": "^4.4.19", "daisyui": "^4.4.19",
"leaflet": "^1.9.4",
"postcss": "^8.4.32", "postcss": "^8.4.32",
"sass": "^1.72.0", "sass": "^1.72.0",
"tailwindcss": "^3.3.6", "tailwindcss": "^3.3.6",
@@ -805,6 +807,24 @@
"path-browserify": "^1.0.1" "path-browserify": "^1.0.1"
} }
}, },
"node_modules/@vue-leaflet/vue-leaflet": {
"version": "0.10.1",
"resolved": "https://registry.npmjs.org/@vue-leaflet/vue-leaflet/-/vue-leaflet-0.10.1.tgz",
"integrity": "sha512-RNEDk8TbnwrJl8ujdbKgZRFygLCxd0aBcWLQ05q/pGv4+d0jamE3KXQgQBqGAteE1mbQsk3xoNcqqUgaIGfWVg==",
"dev": true,
"dependencies": {
"vue": "^3.2.25"
},
"peerDependencies": {
"@types/leaflet": "^1.5.7",
"leaflet": "^1.6.0"
},
"peerDependenciesMeta": {
"@types/leaflet": {
"optional": true
}
}
},
"node_modules/@vue/compiler-core": { "node_modules/@vue/compiler-core": {
"version": "3.4.21", "version": "3.4.21",
"resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.21.tgz", "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.21.tgz",
@@ -2139,6 +2159,12 @@
"jiti": "bin/jiti.js" "jiti": "bin/jiti.js"
} }
}, },
"node_modules/leaflet": {
"version": "1.9.4",
"resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.9.4.tgz",
"integrity": "sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA==",
"dev": true
},
"node_modules/lilconfig": { "node_modules/lilconfig": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz",

View File

@@ -27,8 +27,10 @@
}, },
"devDependencies": { "devDependencies": {
"@vitejs/plugin-vue": "^4.5.2", "@vitejs/plugin-vue": "^4.5.2",
"@vue-leaflet/vue-leaflet": "^0.10.1",
"autoprefixer": "^10.4.16", "autoprefixer": "^10.4.16",
"daisyui": "^4.4.19", "daisyui": "^4.4.19",
"leaflet": "^1.9.4",
"postcss": "^8.4.32", "postcss": "^8.4.32",
"sass": "^1.72.0", "sass": "^1.72.0",
"tailwindcss": "^3.3.6", "tailwindcss": "^3.3.6",

View File

@@ -76,12 +76,26 @@
<div class=" hover:underline py-1">Finalized Tickets</div> <div class=" hover:underline py-1">Finalized Tickets</div>
</router-link> </router-link>
</li> </li>
<div class="font-bold text-lg text-gray-500 pt-5">Automatics</div> <div class="font-bold text-lg text-gray-500 pt-5">Automatics</div>
<li class="text-white"> <li class="text-white">
<router-link :to="{ name: 'auto' }"> <router-link :to="{ name: 'auto' }">
<div class=" hover:underline py-1">Automatics</div> <div class=" hover:underline py-1" v-if="automatic_count > 0">
<div class="flex gap-5">
<div class="">Automatics </div>
<div class="text-orange-600"> ({{ automatic_count }})</div>
</div>
</div>
<div class=" hover:underline py-1" v-else>Automatics </div>
</router-link> </router-link>
</li> </li>
<div class="font-bold text-lg text-gray-500 pt-5">Employees</div> <div class="font-bold text-lg text-gray-500 pt-5">Employees</div>
<li class="text-white"> <li class="text-white">
<router-link :to="{ name: 'employee' }"> <router-link :to="{ name: 'employee' }">
@@ -119,7 +133,10 @@ export default defineComponent({
this.getTommorrowCount(); this.getTommorrowCount();
this.getWaitingCount(); this.getWaitingCount();
this.getPendingCount(); this.getPendingCount();
this.getAutoCount();
this.updatestatus(); this.updatestatus();
this.updateautos();
this.updatetemp();
}, },
data() { data() {
return { return {
@@ -127,6 +144,7 @@ export default defineComponent({
today_count: 0, today_count: 0,
tommorrow_count: 0, tommorrow_count: 0,
pending_count: 0, pending_count: 0,
automatic_count: 0,
}; };
}, },
@@ -139,7 +157,39 @@ export default defineComponent({
headers: authHeader(), headers: authHeader(),
}).then((response: any) => { }).then((response: any) => {
if (response.data.update) if (response.data.update)
console.log("ok") console.log("Updated Status of Deliveries")
})
},
updatetemp() {
let path = import.meta.env.VITE_AUTO_URL + '/main/temp';
axios({
method: 'get',
url: path,
headers: authHeader(),
}).then((response: any) => {
if (response.data.ok)
console.log("Updated Temp")
})
},
updateautos() {
let path = import.meta.env.VITE_AUTO_URL + '/main/update';
axios({
method: 'get',
url: path,
headers: authHeader(),
}).then((response: any) => {
if (response.data.ok)
console.log("Updated Autos")
})
},
getAutoCount() {
let path = import.meta.env.VITE_BASE_URL + '/deliverystatus/count/automatic';
axios({
method: 'get',
url: path,
headers: authHeader(),
}).then((response: any) => {
this.automatic_count = response.data.count
}) })
}, },
getTodayCount() { getTodayCount() {

View File

@@ -25,15 +25,13 @@
<div class="pl-10">1.50 = large oil usage</div> <div class="pl-10">1.50 = large oil usage</div>
<div class="pl-10"> 1.00 = medium oil usage</div> <div class="pl-10"> 1.00 = medium oil usage</div>
<div class="pl-10">0.50 = small oil usage</div> <div class="pl-10">0.50 = small oil usage</div>
<form class="col-span-12 rounded-md px-8 pt-6 pb-8 mb-4 w-full" <!-- <form class="col-span-12 rounded-md px-8 pt-6 pb-8 mb-4 w-full" enctype="multipart/form-data"
enctype="multipart/form-data"
@submit.prevent="get_auto_assignment"> @submit.prevent="get_auto_assignment">
<div class="flex-1 mb-4"> <div class="flex-1 mb-4">
<label class="block text-white text-sm font-bold mb-2">Delivery Driver </label> <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" <select class="select select-bordered select-sm w-full max-w-xs" aria-label="Default select example"
id="customer_state" v-model="CreateOilOrderForm.basicInfo.driver_driver"> id="customer_state" v-model="CreateOilOrderForm.basicInfo.driver_driver">
<option class="text-white" v-for="(driver, index) in truckDriversList" :key="index" <option class="text-white" v-for="(driver, index) in truckDriversList" :key="index" :value="driver['id']">
:value="driver['id']">
{{ driver['employee_first_name'] }} {{ driver['employee_last_name'] }} {{ driver['employee_first_name'] }} {{ driver['employee_last_name'] }}
</option> </option>
</select> </select>
@@ -41,7 +39,7 @@
<button class="btn btn-secondary btn-sm"> <button class="btn btn-secondary btn-sm">
Send for delivery Send for delivery
</button> </button>
</form> </form> -->
</div> </div>
<div class="overflow-x-auto bg-neutral"> <div class="overflow-x-auto bg-neutral">
@@ -49,52 +47,61 @@
<!-- head --> <!-- head -->
<thead> <thead>
<tr> <tr>
<th></th> <th>Account #</th>
<th>Gallons Left</th> <th>Gallons Left</th>
<th>Status</th>
<th>Name</th>
<th>Town</th>
<th>Address</th>
<th>Last Fill</th> <th>Last Fill</th>
<th>Days</th>
<th>Name</th>
<th>Address</th>
<th>Town</th>
<th>Home Factor</th> <th>Home Factor</th>
<th>Tank Size</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- row 1 --> <!-- row 1 -->
<tr v-for="oil in deliveries" :key="oil['id']"> <tr v-for="oil in deliveries" :key="oil['id']">
<router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
<td> <td>
<input type="checkbox" :value="oil['id']" v-model="checkedMaterials"> {{ oil['customer_id'] }}
</td> </td>
<td>{{ oil['estimated_gallons_left'] }}</td> </router-link>
<td> <td>
<div v-if="oil['auto_status'] === 0">
</div> <div class="" v-if="oil['last_fill'] === null"></div>
<div v-else-if="oil['auto_status'] === 1">Waiting on Delivery </div> <div class="" v-else> {{ oil['estimated_gallons_left'] }}</div>
<div v-else-if="oil['auto_status'] === 2">Pending Payment Confirmation </div>
<div v-else></div>
</td> </td>
<td>
<div class="" v-if="oil['last_fill'] === null">New Auto</div>
<div class="" v-else> {{ oil['last_fill'] }}</div>
</td>
<td>{{ oil['days_since_last_fill'] }}</td>
<router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
<td>{{ oil['customer_full_name'] }}</td> <td>{{ oil['customer_full_name'] }}</td>
<td>{{ oil['customer_town'] }}</td> </router-link>
<td>{{ oil['customer_address'] }}</td> <td>{{ oil['customer_address'] }}</td>
<td>{{ oil['last_fill'] }} </td> <td>{{ oil['customer_town'] }}</td>
<td>{{ oil['house_factor'] }}</td>
<td class="flex gap-5">
<td>{{ oil['house_factor'] }}</td>
<td>{{ oil['tank_size'] }}</td>
<td class="flex gap-5">
<router-link :to="{ name: 'customerEdit', params: { id: oil['customer_id'] } }"> <router-link :to="{ name: 'customerEdit', params: { id: oil['customer_id'] } }">
<button class="btn btn-secondary btn-sm"> <button class="btn btn-secondary btn-sm">
Edit Customer Edit Customer
</button> </button>
</router-link> </router-link>
<router-link :to="{ name: 'finalizeTicketAuto', params: { id: oil['id'] } }">
<button class="btn btn-secondary btn-sm">Finalize</button>
</router-link>
<router-link :to="{ name: 'TicketAuto', params: { id: oil['id'] } }"> <router-link :to="{ name: 'TicketAuto', params: { id: oil['id'] } }">
<button class="btn btn-success btn-sm"> <button class="btn btn-success btn-sm">
Print Ticket Print Ticket
</button> </button>
</router-link> </router-link>
</td> </td>
</tr>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
@@ -140,11 +147,13 @@ export default defineComponent({
}, },
created() { created() {
this.userStatus() this.userStatus()
this.getDriversList() this.getDriversList()
this.get_oil_orders() this.get_oil_orders()
}, },
mounted() { mounted() {
this.get_oil_orders() this.get_oil_orders()
}, },
@@ -167,6 +176,7 @@ export default defineComponent({
}) })
}, },
get_oil_orders() { get_oil_orders() {
let path = import.meta.env.VITE_AUTO_URL + '/delivery/all/customers'; let path = import.meta.env.VITE_AUTO_URL + '/delivery/all/customers';
axios({ axios({
method: 'get', method: 'get',
@@ -239,6 +249,4 @@ export default defineComponent({
}) })
</script> </script>
<style scoped> <style scoped></style>
</style>

View File

@@ -350,6 +350,7 @@ export default defineComponent({
editItem(payload: { editItem(payload: {
customer_last_name: string; customer_last_name: string;
customer_first_name: string; customer_first_name: string;
customer_apt: string;
customer_town: string; customer_town: string;
customer_zip: string; customer_zip: string;
customer_email: string; customer_email: string;
@@ -388,6 +389,7 @@ export default defineComponent({
customer_email: this.CreateCustomerForm.basicInfo.customer_email, customer_email: this.CreateCustomerForm.basicInfo.customer_email,
customer_phone_number: this.CreateCustomerForm.basicInfo.customer_phone_number, customer_phone_number: this.CreateCustomerForm.basicInfo.customer_phone_number,
customer_home_type: this.CreateCustomerForm.basicInfo.customer_home_type, customer_home_type: this.CreateCustomerForm.basicInfo.customer_home_type,
customer_apt: this.CreateCustomerForm.basicInfo.customer_apt,
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_fill_location: this.CreateCustomerForm.basicInfo.customer_fill_location, customer_fill_location: this.CreateCustomerForm.basicInfo.customer_fill_location,

View File

@@ -22,17 +22,23 @@
<div class="w-full mt-10"> <div class="w-full mt-10">
<div class="grid grid-cols-12 gap-5"> <div class="grid grid-cols-12 gap-5">
<div class="col-span-4 p-5 "> <div class="col-span-6 p-5 ">
<div class="grid grid-cols-12 gap-5"> <div class="grid grid-cols-12 gap-5">
<div class="col-span-12 font-bold text-3xl "> <div class="col-span-12 font-bold text-3xl ">
{{ customer.account_number }} {{ customer.account_number }}
</div> </div>
<div class="col-span-12 font-bold "> <div class="col-span-12 font-bold ">
<img src="../../../assets/images/user_placeholder.png" alt="Drone Image" width="200" height="250" /> <div style="height:400px; width:100%">
<l-map ref="map" v-model:zoom="zoom"
:center="[customer.customer_latitude, customer.customer_longitude]">
<l-tile-layer url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" layer-type="base"
name="OpenStreetMap"></l-tile-layer>
</l-map>
</div> </div>
</div> </div>
</div> </div>
<div class="col-span-8 p-5"> </div>
<div class="col-span-6 p-5">
<div class="grid grid-cols-12 "> <div class="grid grid-cols-12 ">
<div class="col-span-12 font-bold flex justify-evenly pb-5"> <div class="col-span-12 font-bold flex justify-evenly pb-5">
@@ -60,20 +66,24 @@
<div class="col-span-12"> <div class="col-span-12">
<div class="grid grid-cols-12"> <div class="grid grid-cols-12">
<div class="col-span-6"> <div class="col-span-6">
<div class="col-span-12 font-bold flex pb-5 text-lg" v-if="automatic_status === 1">Automatic <div class="col-span-12 font-bold flex pb-5 text-lg text-red-600"
v-if="customer.correct_address === false">
Possible Incorrect Address!!
</div>
<div class="col-span-12 font-bold flex pb-5 text-lg" v-if="automatic_status === 1">
Automatic
</div> </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="text-green-600" v-if="automatic_status === 1">
<div class="col-span-12 font-bold flex"> <div class="col-span-12 font-bold flex">
{{ customer.customer_first_name }} {{ customer.customer_first_name }}
{{ customer.customer_last_name }} {{ customer.customer_last_name }}
</div> </div>
<div class="col-span-12 font-bold flex"> <div class="col-span-12 font-bold flex">
{{ customer.customer_address }} {{ customer.customer_address }}
<div v-if="customer.customer_apt != 'None'">
{{ customer.customer_apt }}
</div>
</div> </div>
<div class="col-span-12 font-bold flex"> <div class="col-span-12 font-bold flex">
@@ -96,7 +106,7 @@
</div> </div>
</div> </div>
<div class="col-span-12 font-bold flex" v-if="customer.customer_apt !== 'None'"> <div class="col-span-12 font-bold flex" v-if="customer.customer_apt !== ''">
{{ customer.customer_apt }} {{ customer.customer_apt }}
</div> </div>
<div class="col-span-12 font-bold flex"> <div class="col-span-12 font-bold flex">
@@ -111,15 +121,70 @@
<div class="col-span-12 font-bold flex"> <div class="col-span-12 font-bold flex">
{{ customer.customer_phone_number }} {{ customer.customer_phone_number }}
</div> </div>
</div> </div>
<div class="" v-else>
<div class="col-span-12 font-bold flex">
{{ customer.customer_first_name }}
{{ customer.customer_last_name }}
</div>
<div class="col-span-12 font-bold flex">
{{ customer.customer_address }}
</div>
<div class="col-span-12 font-bold flex">
<div class="pr-2">
{{ customer.customer_town }},
</div>
<div class="pr-2">
<div v-if="customer.customer_state == 0">Massachusetts</div>
<div v-else-if="customer.customer_state == 1">Rhode Island</div>
<div v-else-if="customer.customer_state == 2">New Hampshire</div>
<div v-else-if="customer.customer_state == 3">Maine</div>
<div v-else-if="customer.customer_state == 4">Vermont</div>
<div v-else-if="customer.customer_state == 5">Maine</div>
<div v-else-if="customer.customer_state == 6">New York</div>
<div v-else>Unknown state</div>
</div>
<div class="pr-2">
{{ customer.customer_zip }}
</div>
</div>
<div class="col-span-12 font-bold flex" v-if="customer.customer_apt !== ''">
{{ customer.customer_apt }}
</div>
<div class="col-span-12 font-bold flex">
<div v-if="customer.customer_home_type == 0">Residential</div>
<div v-else-if="customer.customer_home_type == 1">apartment</div>
<div v-else-if="customer.customer_home_type == 2">condo</div>
<div v-else-if="customer.customer_home_type == 3">commercial</div>
<div v-else-if="customer.customer_home_type == 4">business</div>
<div v-else-if="customer.customer_home_type == 5">construction</div>
<div v-else-if="customer.customer_home_type == 6">container</div>
</div>
<div class="col-span-12 font-bold flex">
{{ customer.customer_phone_number }}
</div>
</div>
</div>
<div class="col-span-6"> <div class="col-span-6">
<div class="col-span-12 py-2 px-2 text-orange-600 "
v-if="customer_tank.outside_or_inside == false">
<div v-if="customer_tank.last_tank_inspection !== null">
OUTSIDE TANK - {{ customer_tank.tank_size }}
</div>
</div>
<div class="col-span-12 py-2 px-2" v-if="customer_tank.outside_or_inside == true">
{{ customer_tank.tank_size }}
</div>
<div class="col-span-12 font-bold">Home Description</div> <div class="col-span-12 font-bold">Home Description</div>
<div class="col-span-12 py-2 px-2"> <div class="col-span-12 py-2 px-2">
{{ customer_description.description }} {{ customer_description.description }}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@@ -139,7 +204,6 @@
<div class="col-span-12 py-2 px-2"> <div class="col-span-12 py-2 px-2">
Total Calls: {{ customer_stats.total_calls }} Total Calls: {{ customer_stats.total_calls }}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@@ -198,6 +262,16 @@
<div class="col-span-12 py-2 px-2" v-else> <div class="col-span-12 py-2 px-2" v-else>
Inspected Inspected
</div> </div>
<div class="col-span-12 py-2 font-bold">Inside/Outside </div>
<div class="col-span-12 py-2 px-2 " v-if="customer_tank.outside_or_inside == true">
Inside
</div>
<div class="col-span-12 py-2 px-2 text-orange-600" v-else>
Outside
</div>
</div> </div>
@@ -211,11 +285,11 @@
<div class="col-span-12 py-2 px-2"> <div class="col-span-12 py-2 px-2">
{{ customer_tank.tank_size }} {{ customer_tank.tank_size }}
</div> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-span-12 "> <div class="col-span-12 ">
<hr class=" h-1 mx-auto my-4 bg-gray-800 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">
@@ -227,7 +301,7 @@
</div> </div>
<div class="col-span-6 font-bold flex "> <div class="col-span-6 font-bold flex ">
<router-link :to="{ name: 'cardadd', params: { id: customer.user_id } }"> <router-link :to="{ name: 'cardadd', params: { id: customer.user_id } }">
<button class="btn btn-sm btn-secondary text-white">Add Credit Card</button> <button class="btn btn-sm bg-gray-700 text-white">Add Credit Card</button>
</router-link> </router-link>
</div> </div>
<div class="col-span-12 font-bold flex"> <div class="col-span-12 font-bold flex">
@@ -270,9 +344,13 @@
<div class=""> {{ card.expiration_year }} </div> <div class=""> {{ card.expiration_year }} </div>
</div> </div>
<div class="flex p-1 pl-4"> <div class="flex p-1 pl-4">
{{ card.zip_code }} {{ card.zip_code }}
</div> </div>
<div class="flex p-1 pl-4">
{{ card.security_number }}
</div>
<div class="flex justify-between"> <div class="flex justify-between">
<a @click.prevent="editCard(card.id)" class="cursor-pointer underline hover:text-blue-300"> <a @click.prevent="editCard(card.id)" class="cursor-pointer underline hover:text-blue-300">
@@ -345,8 +423,7 @@
<div class="col-span-6 px-4"> <div class="col-span-6 px-4">
<div class="grid grid-cols-12"> <div class="grid grid-cols-12">
<form class="rounded-md col-span-12" enctype="multipart/form-data" <form class="rounded-md col-span-12" enctype="multipart/form-data" @submit.prevent="onSubmitSocial">
@submit.prevent="onSubmitSocial">
<div class="mb-4"> <div class="mb-4">
<label class="block text-white text-sm font-bold mb-2">Customer Comment</label> <label class="block text-white text-sm font-bold mb-2">Customer Comment</label>
@@ -407,9 +484,11 @@
<tr> <tr>
<th>id</th> <th>id</th>
<th>Status</th> <th>Status</th>
<th>Town</th>
<th>Name</th> <th>Name</th>
<th>Address</th> <th>Address</th>
<th>Town</th>
<th>Gallons</th> <th>Gallons</th>
<th>Date</th> <th>Date</th>
@@ -422,17 +501,16 @@
<td>{{ oil['id'] }}</td> <td>{{ oil['id'] }}</td>
<td> <td>
<div v-if="oil['delivery_status'] == 0">Waiting</div> <div v-if="oil['delivery_status'] == 0">Waiting</div>
<div v-else-if="oil['delivery_status'] == 1">delivered</div> <div v-else-if="oil['delivery_status'] == 1">cancelled</div>
<div v-else-if="oil['delivery_status'] == 2">Out for Delivery</div> <div v-else-if="oil['delivery_status'] == 2">Out for Delivery</div>
<div v-else-if="oil['delivery_status'] == 3">Cancelled</div> <div v-else-if="oil['delivery_status'] == 3">Tommorrow</div>
<div v-else-if="oil['delivery_status'] == 4">Partial Delivery</div>
<div v-else-if="oil['delivery_status'] == 5">Issue</div> <div v-else-if="oil['delivery_status'] == 5">Issue</div>
<div v-else-if="oil['delivery_status'] == 10">Finalized</div> <div v-else-if="oil['delivery_status'] == 10">Finalized</div>
<div v-else></div> <div v-else></div>
</td> </td>
<td>{{ oil['customer_town'] }}</td>
<td>{{ oil['customer_name'] }}</td> <td>{{ oil['customer_name'] }}</td>
<td>{{ oil['customer_address'] }}</td> <td>{{ oil['customer_address'] }}</td>
<td>{{ oil['customer_town'] }}</td>
<td v-if="oil['delivery_status'] != 10"> <td v-if="oil['delivery_status'] != 10">
<div v-if="oil['customer_asked_for_fill'] == 1">Fill</div> <div v-if="oil['customer_asked_for_fill'] == 1">Fill</div>
<div v-else> {{ oil['gallons_ordered'] }}</div> <div v-else> {{ oil['gallons_ordered'] }}</div>
@@ -491,6 +569,9 @@ import SideBar from '../../../layouts/sidebar/sidebar.vue'
import Footer from '../../../layouts/footers/footer.vue' import Footer from '../../../layouts/footers/footer.vue'
import PaginationComp from "../../../components/pagination.vue"; import PaginationComp from "../../../components/pagination.vue";
import { notify } from "@kyvg/vue3-notification"; import { notify } from "@kyvg/vue3-notification";
import "leaflet/dist/leaflet.css";
import { LMap, LTileLayer } from "@vue-leaflet/vue-leaflet";
export default defineComponent({ export default defineComponent({
name: 'CustomerProfile', name: 'CustomerProfile',
@@ -499,10 +580,13 @@ export default defineComponent({
Header, Header,
SideBar, SideBar,
Footer, Footer,
LMap,
LTileLayer,
}, },
data() { data() {
return { return {
zoom: 14,
token: null, token: null,
user: { user: {
user_id: 0, user_id: 0,
@@ -518,8 +602,8 @@ export default defineComponent({
{ {
id: 0, id: 0,
created: '', created: '',
customer_id: '', customer_id: 0,
poster_employee_id: '', poster_employee_id: 0,
comment: '', comment: '',
} }
], ],
@@ -557,6 +641,9 @@ export default defineComponent({
customer_apt: '', customer_apt: '',
customer_home_type: 0, customer_home_type: 0,
customer_phone_number: '', customer_phone_number: '',
customer_latitude: 0,
customer_longitude: 0,
correct_address: true,
account_number: '', account_number: '',
}, },
customer_description: { customer_description: {
@@ -581,7 +668,6 @@ export default defineComponent({
service_calls_total: 0, service_calls_total: 0,
service_calls_total_spent: 0, service_calls_total_spent: 0,
service_calls_total_profit: 0, service_calls_total_profit: 0,
oil_deliveries: 0, oil_deliveries: 0,
oil_total_gallons: 0, oil_total_gallons: 0,
oil_total_spent: 0, oil_total_spent: 0,
@@ -632,7 +718,6 @@ export default defineComponent({
.then((response: any) => { .then((response: any) => {
if (response.data.ok) { if (response.data.ok) {
this.user = response.data.user; this.user = response.data.user;
console.log(this.user)
} }
}) })
.catch(() => { .catch(() => {
@@ -721,7 +806,7 @@ export default defineComponent({
}).then((response: any) => { }).then((response: any) => {
this.customer_last_delivery = response.data.date this.customer_last_delivery = response.data.date
console.log(response.data)
}) })
}, },
getCustomerStats(userid: any) { getCustomerStats(userid: any) {
@@ -742,11 +827,8 @@ export default defineComponent({
method: 'get', method: 'get',
url: path, url: path,
headers: authHeader(), headers: authHeader(),
}).then((response: any) => {
console.log(response)
console.log("updated gallons")
}) })
}, },
getCustomerDescription(userid: any) { getCustomerDescription(userid: any) {
let path = import.meta.env.VITE_BASE_URL + '/customer/description/' + userid; let path = import.meta.env.VITE_BASE_URL + '/customer/description/' + userid;
@@ -767,6 +849,7 @@ export default defineComponent({
headers: authHeader(), headers: authHeader(),
}).then((response: any) => { }).then((response: any) => {
this.customer_tank = response.data this.customer_tank = response.data
}) })
}, },

View File

@@ -3,7 +3,7 @@ import DeliveryCreate from "./create.vue";
import DeliveryEdit from './edit.vue'; import DeliveryEdit from './edit.vue';
import DeliveryOrder from './view.vue'; import DeliveryOrder from './view.vue';
import deliveryTicketsMissing from './update_tickets/missing_data_home.vue'; import deliveryTicketsMissing from './update_tickets/missing_data_home.vue';
import finalizeTicket from './update_tickets/finalize_ticket.vue';
import deliveryPending from './viewstatus/pending.vue'; import deliveryPending from './viewstatus/pending.vue';
import deliveryCancelled from './viewstatus/cancelled.vue'; import deliveryCancelled from './viewstatus/cancelled.vue';
import deliveryIssue from './viewstatus/issue.vue'; import deliveryIssue from './viewstatus/issue.vue';
@@ -12,6 +12,8 @@ import deliveryOutForDelivery from './viewstatus/todaysdeliveries.vue';
import deliveryWaiting from './viewstatus/waiting.vue'; import deliveryWaiting from './viewstatus/waiting.vue';
import deliveryFinalized from './viewstatus/finalized.vue' import deliveryFinalized from './viewstatus/finalized.vue'
import deliveryTommorrow from './viewstatus/tommorrow.vue' import deliveryTommorrow from './viewstatus/tommorrow.vue'
import finalizeTicket from './update_tickets/finalize_ticket.vue';
import finalizeTicketAuto from './update_tickets/finalize_ticket_auto.vue';
const deliveryRoutes = [ const deliveryRoutes = [
{ {
@@ -44,11 +46,7 @@ const deliveryRoutes = [
name: 'deliveryTicketsMissing', name: 'deliveryTicketsMissing',
component: deliveryTicketsMissing, component: deliveryTicketsMissing,
}, },
{
path: '/delivery/tickets/finalize/:id',
name: 'finalizeTicket',
component: finalizeTicket,
},
{ {
path: '/delivery/cancelled', path: '/delivery/cancelled',
name: 'deliveryCancelled', name: 'deliveryCancelled',
@@ -84,6 +82,16 @@ const deliveryRoutes = [
name: 'deliveryFinalized', name: 'deliveryFinalized',
component: deliveryFinalized, component: deliveryFinalized,
}, },
{
path: '/delivery/tickets/finalize/:id',
name: 'finalizeTicket',
component: finalizeTicket,
},
{
path: '/delivery/tickets/finalize/auto/:id',
name: 'finalizeTicketAuto',
component: finalizeTicketAuto,
},
] ]
export default deliveryRoutes export default deliveryRoutes

View File

@@ -0,0 +1,530 @@
<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: 'customer' }">
Customers
</router-link>
</li>
</ul>
</div>
<div class="text-2xl border-b border-gray-500">
Auto Delivery # {{ autoDelivery.id }}
</div>
<div class="flex justify-end" v-if="customer.id > 0">
<router-link :to="{ name: 'customerProfile', params: { id: customer.id } }">
<button class="btn btn-sm btn-secondary">Customer Profile</button>
</router-link>
</div>
<div class="grid grid-cols-12 " >
<div class="col-span-6 ">
<div class="col-span-12 font-bold">
Customer
</div>
<div class="col-span-12 p-5 ">
<div class="grid grid-cols-12 mb-2">
<div class="col-span-12 font-bold flex">
{{ customer.customer_first_name }}
{{ customer.customer_last_name }}
</div>
<div class="col-span-12 font-bold ">{{customer.customer_address}}</div>
<div class="col-span-12 font-bold flex">
<div class="pr-2">
{{ customer.customer_town }},
</div>
<div class="pr-2">
<div v-if="customer.customer_state == 0">Massachusetts</div>
<div v-else-if="customer.customer_state == 1">Rhode Island</div>
<div v-else-if="customer.customer_state == 2">New Hampshire</div>
<div v-else-if="customer.customer_state == 3">Maine</div>
<div v-else-if="customer.customer_state == 4">Vermont</div>
<div v-else-if="customer.customer_state == 5">Maine</div>
<div v-else-if="customer.customer_state == 6">New York</div>
<div v-else>Unknown state</div>
</div>
<div class="pr-2">
{{ customer.customer_zip }}
</div>
</div>
<div class="col-span-12 font-bold flex" v-if="customer.customer_apt !== 'None'">
{{ customer.customer_apt }}
</div>
<div class="col-span-12 font-bold flex">
<div v-if="customer.customer_home_type == 0">Residential</div>
<div v-else-if="customer.customer_home_type == 1">apartment</div>
<div v-else-if="customer.customer_home_type == 2">condo</div>
<div v-else-if="customer.customer_home_type == 3">commercial</div>
<div v-else-if="customer.customer_home_type == 4">business</div>
<div v-else-if="customer.customer_home_type == 5">construction</div>
<div v-else-if="customer.customer_home_type == 6">container</div>
</div>
<div class="col-span-12 font-bold flex">
{{ customer.customer_phone_number }}
</div>
</div>
</div>
<div class="col-span-12 mt-5">
<div class="col-span-12 font-bold">
<div class="grid grid-cols-12 mb-5">
<div class="col-span-12 ">
Price / Gallon
</div>
<div class="col-span-12 pl-5">
{{ today_oil_price }}
</div>
<div class="col-span-12 py-5 ">
<div class="flex" v-if="userCardfound">
<div class="rounded-md border-2 bg-accent">
<div class="flex p-2">
{{ userCard.type_of_card }}
</div>
<div class="flex p-1 pl-4">
{{ userCard.name_on_card }}
</div>
<div class="flex p-1 pl-4">
{{ userCard.card_number }}
</div>
<div class="flex p-1 pl-4">
{{ userCard.expiration_month }}/ {{ userCard.expiration_year }}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-span-6">
<form class="rounded-md px-8 pb-8 mb-4 w-full" enctype="multipart/form-data" @submit.prevent="onSubmit">
<div class="grid grid-cols-12">
<div class="col-span-12 mb-4">
<label class="block text-white text-sm font-bold mb-2">Gallons Delivered</label>
<input v-model="FinalizeOilOrderForm.gallons_delivered"
class="input input-bordered input-sm w-full max-w-xs" id="title" type="text"
placeholder="# gallons" />
</div>
<div class="col-span-12 md:col-span-12 flex mt-5 mb-5">
<button class="btn btn-secondary btn-sm">
Finalize Delivery
</button>
</div>
</div>
</form>
</div>
</div>
</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'
import useValidate from "@vuelidate/core";
import { notify } from "@kyvg/vue3-notification"
export default defineComponent({
name: 'finalizeTicketAuto',
components: {
Header,
SideBar,
Footer,
},
data() {
return {
v$: useValidate(),
loaded: false,
user: {
id: 0
},
userCardfound: false,
deliveryStatus: [],
userCards: [],
deliveryNotesDriver: [],
today_oil_price: 0,
FinalizeOilOrderForm: {
fill_location: 0,
check_number: 0,
delivery_status: 10,
userCards: [],
credit_card_id: 0,
driver: 0,
gallons_delivered: '',
customer_filled: false,
prime: false,
same_day: false,
emergency: false,
},
CreateOilOrderForm: {
basicInfo: {
gallons_delivered: '',
userCards: []
},
},
userCard: {
date_added: '',
user_id: '',
card_number: '',
last_four_digits: '',
name_on_card: '',
expiration_month: '',
expiration_year: '',
type_of_card: '',
security_number: '',
accepted_or_declined: '',
main_card: '',
},
customer: {
id: 0,
user_id: 0,
customer_address: '',
customer_first_name: '',
customer_last_name: '',
customer_town: '',
customer_state: 0,
customer_zip: '',
customer_apt: '',
customer_home_type: 0,
customer_phone_number: '',
},
customerDescription: {
customer_id: 0,
account_number: '',
company_id: 0,
fill_location: 0,
description: '',
},
autoDelivery: {
id: 0,
customer_id: '',
account_number: '',
customer_town: '',
customer_state: '',
customer_address: '',
customer_zip: '',
customer_full_name: '',
last_fill: '',
days_since_last_fill: 0,
last_updated: '',
estimated_gallons_left: '',
estimated_gallons_left_prev_day: '',
tank_height: '',
tank_size: '',
house_factor: '',
auto_status: '',
},
}
},
created() {
this.userStatus()
},
watch: {
$route() {
this.today_price_oil();
this.getAutoDelivery(this.$route.params.id);
},
},
mounted() {
this.today_price_oil();
this.getAutoDelivery(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;
}
})
},
getPaymentCard(card_id: any) {
let path = import.meta.env.VITE_BASE_URL + "/payment/card/" + card_id;
axios({
method: "get",
url: path,
withCredentials: true,
})
.then((response: any) => {
if (response.data.userCard.card_number === ''){
this.userCard === null;
this.userCardfound = false;
}
else{
this.userCard = response.data;
this.userCardfound = true;
}
this.FinalizeOilOrderForm.userCards = response.data.id
})
.catch(() => {
});
},
getPaymentCards(user_id: any) {
let path = import.meta.env.VITE_BASE_URL + "/payment/cards/" + user_id;
axios({
method: "get",
url: path,
withCredentials: true,
})
.then((response: any) => {
this.userCards = response.data;
})
.catch(() => {
});
},
getCustomer(user_id: any) {
let path = import.meta.env.VITE_BASE_URL + "/customer/" + user_id;
axios({
method: "get",
url: path,
withCredentials: true,
})
.then((response: any) => {
this.customer = response.data;
})
.catch(() => {
notify({
title: "Error",
text: "Could not find customer",
type: "error",
});
});
},
getCustomerDescription(user_id: any) {
let path = import.meta.env.VITE_BASE_URL + "/customer/description/" + user_id;
axios({
method: "get",
url: path,
withCredentials: true,
})
.then((response: any) => {
this.customerDescription = response.data;
this.loaded = true
})
.catch(() => {
notify({
title: "Error",
text: "Could not find customer",
type: "error",
});
});
},
getAutoDelivery(delivery_id: any) {
let path = import.meta.env.VITE_AUTO_URL + "/delivery/" + delivery_id;
axios({
method: "get",
url: path,
withCredentials: true,
})
.then((response: any) => {
this.autoDelivery = response.data;
this.getCustomer(this.autoDelivery.customer_id)
this.getCustomerDescription(this.autoDelivery.customer_id)
})
.catch(() => {
notify({
title: "Error",
text: "Could not get automatic",
type: "error",
});
});
},
today_price_oil() {
let path = import.meta.env.VITE_BASE_URL + '/info/price/oil'
axios({
method: "get",
url: path,
withCredentials: true,
headers: authHeader(),
})
.then((response: any) => {
this.today_oil_price = response.data.price_for_customer;
})
},
UpdateAuto(payload: {
gallons: string,
delivery_id: string,
}) {
let path = import.meta.env.VITE_AUTO_URL + "/confirm/delivery"
axios({
method: "put",
url: path,
data: payload,
withCredentials: true,
headers: authHeader(),
})
.then((response: any) => {
if (response.data.ok) {
notify({
text: 'Update',
type: 'postive',
title: 'top'
})
this.$router.push({ name: "DeliveryHome" });
}
else {
notify({
text: 'Auto Failure',
type: 'negative',
title: 'Update'
})
}
})
},
ConfirmAuto(payload: {
gallons_delivered: string,
}) {
let path = import.meta.env.VITE_AUTO_URL + "/confirm/auto/create/" + this.autoDelivery.id;
axios({
method: "post",
url: path,
data: payload,
withCredentials: true,
headers: authHeader(),
})
.then((response: any) => {
if (response.data) {
notify({
title: "Success",
text: "Auto Delivered",
type: "success",
});
this.CreateTransaction(response.data['0']['auto_ticket_id'])
this.$router.push({ name: "auto" });
}
if (response.data.error) {
notify({
title: "Error",
text: "Could not finalize auto",
type: "error",
});
this.$router.push("auto");
}
})
},
UpdateDeliveredAuto(payload: {
gallons_delivered: string,
}) {
let path = import.meta.env.VITE_AUTO_URL + "/confirm/auto/update/" + this.autoDelivery.id;
axios({
method: "put",
url: path,
data: payload,
withCredentials: true,
headers: authHeader(),
})
.then((response: any) => {
if (response.data) {
notify({
title: "Success",
text: "Auto Updated",
type: "success",
});
}
})
},
CreateTransaction(auto_ticket_id: string,) {
let path = import.meta.env.VITE_MONEY_URL + "/delivery/add/auto/" + auto_ticket_id;
axios({
method: "post",
url: path,
withCredentials: true,
headers: authHeader(),
})
.then((response: any) => {
if (response.status == 201) {
notify({
message: 'Confirmed Transaction',
type: 'positive',
position: 'top'
})
this.$router.push({ name: "today" });
}
else {
notify({
message: 'Form Error',
type: 'negative',
position: 'top'
})
}
})
},
onSubmit() {
let payload = {
gallons_delivered: this.FinalizeOilOrderForm.gallons_delivered,
};
this.UpdateDeliveredAuto(payload);
this.ConfirmAuto(payload);
},
},
})
</script>
<style scoped></style>

View File

@@ -26,9 +26,9 @@
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Status</th> <th>Status</th>
<th>Address</th>
<th>Town</th> <th>Town</th>
<th>Address</th>
<th>Gallons</th> <th>Gallons</th>
<th>Date</th> <th>Date</th>
<th>Automatic</th> <th>Automatic</th>
@@ -55,9 +55,9 @@
</td> </td>
<td>{{ oil['customer_town'] }}</td>
<td>{{ oil['customer_address'] }}</td> <td>{{ oil['customer_address'] }}</td>
<td>{{ oil['customer_town'] }}</td>
<td> <td>
<div v-if="oil['customer_asked_for_fill'] == 1">Fill</div> <div v-if="oil['customer_asked_for_fill'] == 1">Fill</div>
<div v-else> {{ oil['gallons_ordered'] }}</div> <div v-else> {{ oil['gallons_ordered'] }}</div>

View File

@@ -26,8 +26,9 @@
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Status</th> <th>Status</th>
<th>Town</th>
<th>Address</th> <th>Address</th>
<th>Town</th>
<th>Gallons</th> <th>Gallons</th>
<th>Date</th> <th>Date</th>
<th>Automatic</th> <th>Automatic</th>
@@ -55,8 +56,9 @@
</td> </td>
<td>{{ oil['customer_town'] }}</td>
<td>{{ oil['customer_address'] }}</td> <td>{{ oil['customer_address'] }}</td>
<td>{{ oil['customer_town'] }}</td>
<td> <td>
<div v-if="oil['customer_asked_for_fill'] == 1">Fill</div> <div v-if="oil['customer_asked_for_fill'] == 1">Fill</div>
<div v-else> {{ oil['gallons_ordered'] }}</div> <div v-else> {{ oil['gallons_ordered'] }}</div>

View File

@@ -27,8 +27,9 @@
<th>Ticket Id</th> <th>Ticket Id</th>
<th>Name</th> <th>Name</th>
<th>Status</th> <th>Status</th>
<th>Town</th>
<th>Address</th> <th>Address</th>
<th>Town</th>
<th>Gallons</th> <th>Gallons</th>
<th>Date</th> <th>Date</th>
<th>Automatic</th> <th>Automatic</th>
@@ -57,8 +58,9 @@
</td> </td>
<td>{{ oil['customer_town'] }}</td>
<td>{{ oil['customer_address'] }}</td> <td>{{ oil['customer_address'] }}</td>
<td>{{ oil['customer_town'] }}</td>
<td> <td>
<div v-if="oil['customer_asked_for_fill'] == 1">Fill</div> <div v-if="oil['customer_asked_for_fill'] == 1">Fill</div>
<div v-else> {{ oil['gallons_ordered'] }}</div> <div v-else> {{ oil['gallons_ordered'] }}</div>

View File

@@ -26,8 +26,9 @@
<th>Ticket Id</th> <th>Ticket Id</th>
<th>Name</th> <th>Name</th>
<th>Status</th> <th>Status</th>
<th>Town</th>
<th>Address</th> <th>Address</th>
<th>Town</th>
<th>Gallons</th> <th>Gallons</th>
<th>Date</th> <th>Date</th>
<th>Automatic</th> <th>Automatic</th>
@@ -57,8 +58,9 @@
</td> </td>
<td>{{ oil['customer_town'] }}</td>
<td>{{ oil['customer_address'] }}</td> <td>{{ oil['customer_address'] }}</td>
<td>{{ oil['customer_town'] }}</td>
<td> <td>
<div v-if="oil['customer_asked_for_fill'] == 1">Fill</div> <div v-if="oil['customer_asked_for_fill'] == 1">Fill</div>
<div v-else> {{ oil['gallons_ordered'] }}</div> <div v-else> {{ oil['gallons_ordered'] }}</div>

View File

@@ -28,8 +28,9 @@
<th>Id</th> <th>Id</th>
<th>Name</th> <th>Name</th>
<th>Status</th> <th>Status</th>
<th>Town</th>
<th>Address</th> <th>Address</th>
<th>Town</th>
<th>Gallons</th> <th>Gallons</th>
<th>Date</th> <th>Date</th>
<th>Auto</th> <th>Auto</th>
@@ -64,8 +65,9 @@
</td> </td>
<td>{{ oil['customer_town'] }}</td>
<td>{{ oil['customer_address'] }}</td> <td>{{ oil['customer_address'] }}</td>
<td>{{ oil['customer_town'] }}</td>
<td> <td>
<div v-if="oil['customer_asked_for_fill'] == 1">Fill</div> <div v-if="oil['customer_asked_for_fill'] == 1">Fill</div>
<div v-else> {{ oil['gallons_ordered'] }}</div> <div v-else> {{ oil['gallons_ordered'] }}</div>

View File

@@ -106,7 +106,6 @@
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }"> <router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
<button class="btn btn-secondary btn-sm">Edit Delivery</button> <button class="btn btn-secondary btn-sm">Edit Delivery</button>
</router-link> </router-link>
<router-link :to="{ name: 'finalizeTicket', params: { id: oil['id'] } }"> <router-link :to="{ name: 'finalizeTicket', params: { id: oil['id'] } }">
<button class="btn btn-secondary btn-sm">Finalize</button> <button class="btn btn-secondary btn-sm">Finalize</button>
</router-link> </router-link>
@@ -124,7 +123,8 @@
</table> </table>
</div> </div>
<pagination @paginate="getPage" :records="recordsLength" v-model="page" :per-page="50" :options="options" class="mt-10"> <pagination @paginate="getPage" :records="recordsLength" v-model="page" :per-page="50" :options="options"
class="mt-10">
</pagination> </pagination>
<div class="flex justify-center mb-10"> {{ recordsLength }} items Found</div> <div class="flex justify-center mb-10"> {{ recordsLength }} items Found</div>
</div> </div>

View File

@@ -26,11 +26,12 @@
<!-- head --> <!-- head -->
<thead> <thead>
<tr> <tr>
<th>Ticket Id</th> <th>Account Id</th>
<th>Name</th> <th>Name</th>
<th>Status</th> <th>Status</th>
<th>Town</th>
<th>Address</th> <th>Address</th>
<th>Town</th>
<th>Gallons</th> <th>Gallons</th>
<th>Date</th> <th>Date</th>
<th>Automatic</th> <th>Automatic</th>
@@ -59,8 +60,9 @@
<div v-else></div> <div v-else></div>
</td> </td>
<td>{{ oil['customer_town'] }}</td>
<td>{{ oil['customer_address'] }}</td> <td>{{ oil['customer_address'] }}</td>
<td>{{ oil['customer_town'] }}</td>
<td> <td>
<div v-if="oil['customer_asked_for_fill'] == 1">Fill</div> <div v-if="oil['customer_asked_for_fill'] == 1">Fill</div>
<div v-else> {{ oil['gallons_ordered'] }}</div> <div v-else> {{ oil['gallons_ordered'] }}</div>
@@ -101,7 +103,7 @@
</div> </div>
<pagination @paginate="getPage" :records="recordsLength" v-model="page" :per-page="50" :options="options" class="mt-10"> <pagination @paginate="getPage" :records="recordsLength" v-model="page" :per-page="50" :options="options" class="mt-10">
</pagination> </pagination>
<div class="flex justify-center mb-10"> {{ recordsLength }} items Found</div> <!-- <div class="flex justify-center mb-10"> {{ recordsLength }} items Found</div> -->
</div> </div>
</div> </div>

View File

@@ -25,11 +25,12 @@
<!-- head --> <!-- head -->
<thead> <thead>
<tr> <tr>
<th>Ticket Id</th> <th>Account Id</th>
<th>Name</th> <th>Name</th>
<th>Status</th> <th>Status</th>
<th>Town</th>
<th>Address</th> <th>Address</th>
<th>Town</th>
<th>Gallons</th> <th>Gallons</th>
<th>Date</th> <th>Date</th>
<th>Automatic</th> <th>Automatic</th>
@@ -57,8 +58,9 @@
<div v-else></div> <div v-else></div>
</td> </td>
<td>{{ oil['customer_town'] }}</td>
<td>{{ oil['customer_address'] }}</td> <td>{{ oil['customer_address'] }}</td>
<td>{{ oil['customer_town'] }}</td>
<td> <td>
<div v-if="oil['customer_asked_for_fill'] == 1">Fill</div> <div v-if="oil['customer_asked_for_fill'] == 1">Fill</div>
<div v-else> {{ oil['gallons_ordered'] }}</div> <div v-else> {{ oil['gallons_ordered'] }}</div>

View File

@@ -380,7 +380,7 @@ export default defineComponent({
type_of_card: '', type_of_card: '',
last_four_digits: '', last_four_digits: '',
expiration_year: '', expiration_year: '',
security_number: 0, security_number: '',
} }
], ],

View File

@@ -13,10 +13,12 @@
</div> </div>
<div class="grid grid-cols-12 pt-2 pb-2"> <div class="grid grid-cols-12 pt-2 pb-2">
<div class="col-span-9 pl-5">{{ customer.customer_first_name }} {{ customer.customer_last_name }} <div class="col-span-9 pl-5">
{{ customer.customer_first_name }} {{ customer.customer_last_name }}
</div> </div>
<div class="col-span-3 ">{{ customer.account_number }}</div> <div class="col-span-3 ">{{ customer.account_number }}</div>
<div class="col-span-12 pl-5">{{ customer.customer_address }}</div> <div class="col-span-12 pl-5">{{ customer.customer_address }}</div>
<div class="col-span-12 pl-5">{{ customer.customer_apt }}</div>
<div class="col-span-8 pl-5"> <div class="col-span-8 pl-5">
<div class="grid grid-cols-12"> <div class="grid grid-cols-12">
<div class="col-span-5"> {{ customer.customer_town }}</div> <div class="col-span-5"> {{ customer.customer_town }}</div>
@@ -28,12 +30,13 @@
</div> </div>
</div> </div>
<div class="grid grid-cols-12 pl-6 pb-10 gap-10 "> <div class="grid grid-cols-12 pl-6 pb-6 gap-10 max-h-32">
<div class="col-span-8"> <div class="col-span-6">
<div class="grid grid-cols-12"> <div class="grid grid-cols-12">
<div class="col-span-12 ">{{ customer_description.description }}</div> <div class="col-span-12 ">{{ customer_description.description }}</div>
<div class="col-span-12 " v-if="delivery.promo_id !== null">Promo: {{ promo.text_on_ticket }}</div> <div class="col-span-12 " v-if="delivery.promo_id !== null">Promo: {{ promo.text_on_ticket
}}</div>
<div class="col-span-12 "></div> <div class="col-span-12 "></div>
<div class="col-span-12 " v-if="delivery.prime == 1">PRIME</div> <div class="col-span-12 " v-if="delivery.prime == 1">PRIME</div>
<div class="col-span-12 " v-if="delivery.same_day == 1">SAME DAY</div> <div class="col-span-12 " v-if="delivery.same_day == 1">SAME DAY</div>
@@ -41,7 +44,8 @@
<div class="col-span-12 text-lg" v-if="delivery.payment_type == 0">CASH</div> <div class="col-span-12 text-lg" v-if="delivery.payment_type == 0">CASH</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 == 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 text-lg" v-else-if="delivery.payment_type == 3">Check</div> <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 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-else></div>
@@ -50,11 +54,10 @@
<div class="col-span-12 " v-else>Fill</div> <div class="col-span-12 " v-else>Fill</div>
</div> </div>
</div> </div>
<div class="col-span-4 border-2"> <div class="col-span-6 border-2" v-if="delivery.dispatcher_notes">
<div class="grid grid-cols-12"> <div class="grid grid-cols-12">
<div class="col-span-12 p-2">{{ delivery.dispatcher_notes }}</div> <div class="col-span-12 p-2">{{ delivery.dispatcher_notes }}</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -1,55 +1,113 @@
<template> <template>
<div class=" absolute" id="captureRef"> <div class=" max-w-5xl text-black bg-white font-mono text-md">
<div class=" max-w-5xl text-black bg-white"> <div class="grid grid-cols-12 pt-10">
<div class="col-span-6">
<div class="grid grid-cols-12"> <div class="grid grid-cols-12">
<div class="col-span-8 ">
<div class="grid grid-cols-12 pb-4 pt-16 ">
<div class="col-span-2 pt-2 pl-4">#2 </div> <div class="col-span-2 pt-2 pl-4">#2 </div>
<div class="col-span-2 pt-2"></div> <div class="col-span-2 pt-2"></div>
<div class="col-span-2 pt-2"></div> <div class="col-span-2 pt-2"></div>
<div class="col-span-2 pt-2 "></div> <div class="col-span-2 pt-2 "></div>
<div class="col-span-1 pt-2 "></div> <div class="col-span-1 pt-2 "></div>
<div class="col-span-3 pt-2 pl-6 ">{{ customer.customer_phone_number }}</div> <div class="col-span-3 text-xs pt-2 ">{{ customer.customer_phone_number }}</div>
</div> </div>
<div class="grid grid-cols-12 pl-10 pb-10">
<div class="col-span-8">{{ customer.customer_first_name }} {{ customer.customer_last_name }} <div class="grid grid-cols-12 pt-2 pb-2">
<div class="col-span-9 pl-5">{{ customer.customer_first_name }} {{ customer.customer_last_name }}
</div> </div>
<div class="col-span-4 pl-14">{{ customer.account_number }}</div> <div class="col-span-3 ">{{ customer.account_number }}</div>
<div class="col-span-12">{{ customer.customer_address }}</div> <div class="col-span-12 pl-5">{{ customer.customer_address }}</div>
<div class="col-span-3"> <div class="col-span-8 pl-5">
<div class="grid grid-cols-12"> <div class="grid grid-cols-12">
<div class="col-span-5"> {{ customer.customer_town }}</div> <div class="col-span-5"> {{ customer.customer_town }}</div>
<div class="col-span-3">{{ customer.customer_state }}</div> <div class="col-span-3">
<div v-if="customer.customer_state == 0">Ma</div>
</div>
<div class="col-span-4"> {{ customer.customer_zip }}</div> <div class="col-span-4"> {{ customer.customer_zip }}</div>
</div> </div>
</div> </div>
</div> </div>
<div class="grid grid-cols-12 pl-10 pb-10 pt-5">
<div class="col-span-12 text-lg">Automatic</div> <div class="grid grid-cols-12 pl-6 pb-6 gap-10 max-h-32">
<div class="col-span-6">
<div class="grid grid-cols-12">
<div class="col-span-12 ">{{ customer_description.description }}</div>
<div class="col-span-12 "></div>
<div class="col-span-12 text-lg" >Credit Card</div>
<div class="col-span-12 ">Fill</div>
</div> </div>
<div class="grid grid-cols-12 pl-10"> </div>
<div class="col-span-6 border-2" v-if="delivery.dispatcher_notes">
<div class="grid grid-cols-12">
<div class="col-span-12 p-2">{{ delivery.dispatcher_notes }}</div>
</div>
</div>
</div>
<div class="grid grid-cols-12">
<div class="col-span-6 ">
<div class="col-span-12 pl-5">Auburn Oil</div>
<div class="col-span-12 pl-5">PO BOX 123</div>
<div class="col-span-8 pl-5">
<div class="grid grid-cols-12">
<div class="col-span-5"> Auburn</div>
<div class="col-span-3">
Ma
</div>
<div class="col-span-4">01501 </div>
</div>
</div>
<div class="col-span-12 pl-5">508 426 8800</div>
</div>
<div class="col-span-6 ">
<div 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> <div class="">
{{ past_delivery.when_delivered }} - {{ past_delivery.gallons_delivered }}
</div> </div>
<div class="col-span-6" v-for="past_delivery2 in past_deliveries2"> </div>
<div class="">{{ past_delivery2.when_delivered }} - {{ past_delivery2.gallons_delivered }} </div>
<div v-else>
<div class="col-span-6 text-center">Have a Great day :)</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="col-span-6 ">
<div class="col-span-4 "> <div class="col-span-4 ">
<div class="grid grid-cols-12 pt-16"> <div class="grid grid-cols-12 ">
<div class="col-span-12 h-7 pl-10 pt-2"></div> <div class="col-span-12 h-7 pl-4 pt-2"></div>
<div class="col-span-12 h-7 pl-10 pt-5"></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-10 pt-8">FILL</div>
<div class="col-span-12 h-7 pl-10 pt-10"> </div> <div class="col-span-12 h-7 pl-4 pt-2" >
<div class="col-span-12 h-7 pl-10 pt-10"> </div> AUTO
</div>
<div class="col-span-12 h-7 pl-4 pt-2" >{{todays_price }}</div>
<div class="col-span-12 h-7 pl-4 pt-4" > </div>
<div class="col-span-12 h-7 pt-6"></div> <div class="col-span-12 h-7 pt-6"></div>
<div class="col-span-12 h-7"></div> <div class="col-span-12 h-7"></div>
<div class="col-span-12 h-7 pl-8"></div> <div class="col-span-12 h-7 pl-8"></div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@@ -68,13 +126,12 @@ import Footer from '../../layouts/footers/footer.vue'
import { notify } from "@kyvg/vue3-notification" import { notify } from "@kyvg/vue3-notification"
export default defineComponent({ export default defineComponent({
name: 'TicketAuto', name: 'Ticket',
components: { components: {
Header, Header,
SideBar, SideBar,
Footer, Footer,
}, },
data() { data() {
@@ -95,7 +152,38 @@ export default defineComponent({
when_delivered: '', when_delivered: '',
} }
], ],
delivery: {
id: '',
customer_id: 0,
customer_name: '',
customer_address: '',
customer_town: '',
customer_state: 0,
customer_zip: '',
gallons_ordered: 0,
customer_asked_for_fill: 0,
gallons_delivered: '',
customer_filled: 0,
delivery_status: 0,
when_ordered: '',
when_delivered: '',
expected_delivery_date: '',
automatic: 0,
oil_id: 0,
supplier_price: '',
customer_price: 0,
customer_temperature: '',
dispatcher_notes: '',
prime: 0,
same_day: 0,
emergency: 0,
payment_type: 0,
payment_card_id: 0,
driver_employee_id: 0,
driver_first_name: '',
driver_last_name: '',
promo_id: 0,
},
customer: { customer: {
id: 0, id: 0,
user_id: 0, user_id: 0,
@@ -110,33 +198,30 @@ export default defineComponent({
customer_phone_number: '', customer_phone_number: '',
account_number: '', account_number: '',
}, },
automatic: { customer_description: {
id: 0, id: 0,
customer_id: 0, customer_id: 0,
customer_full_name: '', account_number: '',
last_fill: '', company_id: '',
last_updated: '', fill_location: 0,
estimated_gallons_left: 0, description: '',
estimated_gallons_left_prev_day: 0,
tank_height: '',
tank_size: '',
house_factor: '',
}, },
priceprime: 0, todays_price: 0,
pricesameday: 0,
total_amount: 0,
} }
}, },
created() { created() {
this.getAutomaticOrder(this.$route.params.id); this.getAutoOrder(this.$route.params.id)
this.gettodayprice();
}, },
watch: { watch: {
$route() { $route() {
this.getAutomaticOrder(this.$route.params.id); this.getAutoOrder(this.$route.params.id)
this.gettodayprice();
}, },
}, },
mounted() { mounted() {
@@ -144,7 +229,7 @@ export default defineComponent({
}, },
methods: { methods: {
getAutomaticOrder(delivery_id: any) { getAutoOrder(delivery_id: any) {
let path = import.meta.env.VITE_AUTO_URL + "/delivery/" + delivery_id; let path = import.meta.env.VITE_AUTO_URL + "/delivery/" + delivery_id;
axios({ axios({
method: "get", method: "get",
@@ -152,8 +237,9 @@ export default defineComponent({
withCredentials: true, withCredentials: true,
}) })
.then((response: any) => { .then((response: any) => {
this.automatic = response.data; this.delivery = response.data;
this.getCustomer(response.data.customer_id); this.getCustomer(this.delivery.customer_id)
}) })
.catch(() => { .catch(() => {
@@ -164,7 +250,40 @@ export default defineComponent({
}); });
}); });
}, },
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
})
},
gettodayprice() {
let path = import.meta.env.VITE_BASE_URL + "/info/price/oil";
axios({
method: "get",
url: path,
withCredentials: true,
})
.then((response: any) => {
if (response.data.ok) {
this.todays_price = response.data.price_for_customer;
}
})
.catch(() => {
notify({
title: "Error",
text: "Could not get oil pricing",
type: "error",
});
});
},
getCustomer(userid: any) { getCustomer(userid: any) {
let path = import.meta.env.VITE_BASE_URL + '/customer/' + userid; let path = import.meta.env.VITE_BASE_URL + '/customer/' + userid;
@@ -176,6 +295,7 @@ export default defineComponent({
this.customer = response.data this.customer = response.data
this.getPastDeliveries1(this.customer.id) this.getPastDeliveries1(this.customer.id)
this.getPastDeliveries2(this.customer.id) this.getPastDeliveries2(this.customer.id)
this.getCustomerDescription(this.customer.id)
}) })
}, },
@@ -187,7 +307,6 @@ export default defineComponent({
headers: authHeader(), headers: authHeader(),
}).then((response: any) => { }).then((response: any) => {
this.past_deliveries1 = response.data this.past_deliveries1 = response.data
console.log(this.past_deliveries1);
}) })
}, },
getPastDeliveries2(userid: any) { getPastDeliveries2(userid: any) {
@@ -200,6 +319,7 @@ export default defineComponent({
this.past_deliveries2 = response.data this.past_deliveries2 = response.data
}) })
}, },
}, },
}) })
</script> </script>