From bf49bf5711a0afe96ac7bc1c36016ad2fee70628 Mon Sep 17 00:00:00 2001 From: Edwin Eames Date: Wed, 20 Nov 2024 18:00:17 -0500 Subject: [PATCH] updated customer profile. added maps --- package-lock.json | 26 + package.json | 2 + src/layouts/sidebar/sidebar.vue | 60 +- src/pages/automatic/home.vue | 174 +++--- src/pages/customer/edit.vue | 2 + src/pages/customer/profile/home.vue | 279 +++++---- src/pages/delivery/routes.ts | 20 +- .../update_tickets/finalize_ticket_auto.vue | 530 ++++++++++++++++++ src/pages/delivery/viewstatus/cancelled.vue | 8 +- src/pages/delivery/viewstatus/delivered.vue | 6 +- src/pages/delivery/viewstatus/finalized.vue | 6 +- src/pages/delivery/viewstatus/issue.vue | 6 +- src/pages/delivery/viewstatus/pending.vue | 6 +- .../delivery/viewstatus/todaysdeliveries.vue | 24 +- src/pages/delivery/viewstatus/tommorrow.vue | 10 +- src/pages/delivery/viewstatus/waiting.vue | 8 +- src/pages/pay/pay_oil.vue | 2 +- src/pages/ticket/ticket.vue | 57 +- src/pages/ticket/ticketauto.vue | 244 ++++++-- 19 files changed, 1157 insertions(+), 313 deletions(-) create mode 100644 src/pages/delivery/update_tickets/finalize_ticket_auto.vue diff --git a/package-lock.json b/package-lock.json index 9d96cd8..ae4df77 100755 --- a/package-lock.json +++ b/package-lock.json @@ -26,8 +26,10 @@ }, "devDependencies": { "@vitejs/plugin-vue": "^4.5.2", + "@vue-leaflet/vue-leaflet": "^0.10.1", "autoprefixer": "^10.4.16", "daisyui": "^4.4.19", + "leaflet": "^1.9.4", "postcss": "^8.4.32", "sass": "^1.72.0", "tailwindcss": "^3.3.6", @@ -805,6 +807,24 @@ "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": { "version": "3.4.21", "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.21.tgz", @@ -2139,6 +2159,12 @@ "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": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", diff --git a/package.json b/package.json index cd9be8a..f30ea75 100755 --- a/package.json +++ b/package.json @@ -27,8 +27,10 @@ }, "devDependencies": { "@vitejs/plugin-vue": "^4.5.2", + "@vue-leaflet/vue-leaflet": "^0.10.1", "autoprefixer": "^10.4.16", "daisyui": "^4.4.19", + "leaflet": "^1.9.4", "postcss": "^8.4.32", "sass": "^1.72.0", "tailwindcss": "^3.3.6", diff --git a/src/layouts/sidebar/sidebar.vue b/src/layouts/sidebar/sidebar.vue index 0a1be9f..075bf73 100755 --- a/src/layouts/sidebar/sidebar.vue +++ b/src/layouts/sidebar/sidebar.vue @@ -23,7 +23,7 @@
All Customers
- +
Delivery
  • @@ -64,11 +64,11 @@
    -
    Pending Payment
    +
    Pending Payment
    ({{ pending_count }})
    -
    Pending Payment
    +
    Pending Payment
    @@ -76,12 +76,26 @@
    Finalized Tickets
  • + + + + + +
    Automatics
  • -
    Automatics
    +
    +
    +
    Automatics
    +
    ({{ automatic_count }})
    +
    +
    +
    Automatics
  • + +
    Employees
  • @@ -119,7 +133,10 @@ export default defineComponent({ this.getTommorrowCount(); this.getWaitingCount(); this.getPendingCount(); + this.getAutoCount(); this.updatestatus(); + this.updateautos(); + this.updatetemp(); }, data() { return { @@ -127,6 +144,7 @@ export default defineComponent({ today_count: 0, tommorrow_count: 0, pending_count: 0, + automatic_count: 0, }; }, @@ -139,7 +157,39 @@ export default defineComponent({ headers: authHeader(), }).then((response: any) => { 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() { diff --git a/src/pages/automatic/home.vue b/src/pages/automatic/home.vue index 5a59c2a..5dfc542 100755 --- a/src/pages/automatic/home.vue +++ b/src/pages/automatic/home.vue @@ -1,112 +1,119 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/pages/customer/edit.vue b/src/pages/customer/edit.vue index 70af363..11e01d2 100755 --- a/src/pages/customer/edit.vue +++ b/src/pages/customer/edit.vue @@ -350,6 +350,7 @@ export default defineComponent({ editItem(payload: { customer_last_name: string; customer_first_name: string; + customer_apt: string; customer_town: string; customer_zip: string; customer_email: string; @@ -388,6 +389,7 @@ export default defineComponent({ customer_email: this.CreateCustomerForm.basicInfo.customer_email, customer_phone_number: this.CreateCustomerForm.basicInfo.customer_phone_number, customer_home_type: this.CreateCustomerForm.basicInfo.customer_home_type, + customer_apt: this.CreateCustomerForm.basicInfo.customer_apt, customer_state: this.CreateCustomerForm.basicInfo.customer_state, customer_address: this.CreateCustomerForm.basicInfo.customer_address, customer_fill_location: this.CreateCustomerForm.basicInfo.customer_fill_location, diff --git a/src/pages/customer/profile/home.vue b/src/pages/customer/profile/home.vue index b958a33..43b446d 100755 --- a/src/pages/customer/profile/home.vue +++ b/src/pages/customer/profile/home.vue @@ -22,17 +22,23 @@
    -
    +
    {{ customer.account_number }}
    - Drone Image +
    + + + +
    -
    +
    @@ -59,67 +65,126 @@
    -
    -
    Automatic +
    +
    + Possible Incorrect Address!! +
    +
    + Automatic
    -
    Will Call
    - -
    - {{ customer.customer_first_name }} - {{ customer.customer_last_name }} +
    + Will Call
    -
    - {{ customer.customer_address }} -
    +
    +
    + {{ customer.customer_first_name }} + {{ customer.customer_last_name }} +
    +
    + {{ customer.customer_address }} +
    + +
    +
    + {{ customer.customer_town }}, +
    +
    + +
    Massachusetts
    +
    Rhode Island
    +
    New Hampshire
    +
    Maine
    +
    Vermont
    +
    Maine
    +
    New York
    +
    Unknown state
    +
    +
    + {{ customer.customer_zip }} +
    +
    + +
    {{ customer.customer_apt }}
    -
    - -
    -
    - {{ customer.customer_town }}, +
    +
    Residential
    +
    apartment
    +
    condo
    +
    commercial
    +
    business
    +
    construction
    +
    container
    -
    - -
    Massachusetts
    -
    Rhode Island
    -
    New Hampshire
    -
    Maine
    -
    Vermont
    -
    Maine
    -
    New York
    -
    Unknown state
    -
    -
    - {{ customer.customer_zip }} +
    + {{ customer.customer_phone_number }}
    +
    +
    + {{ customer.customer_first_name }} + {{ customer.customer_last_name }} +
    +
    + {{ customer.customer_address }} +
    -
    - {{ customer.customer_apt }} -
    -
    -
    Residential
    -
    apartment
    -
    condo
    -
    commercial
    -
    business
    -
    construction
    -
    container
    -
    -
    - {{ customer.customer_phone_number }} -
    +
    +
    + {{ customer.customer_town }}, +
    +
    +
    Massachusetts
    +
    Rhode Island
    +
    New Hampshire
    +
    Maine
    +
    Vermont
    +
    Maine
    +
    New York
    +
    Unknown state
    +
    +
    + {{ customer.customer_zip }} +
    +
    + +
    + {{ customer.customer_apt }} +
    +
    +
    Residential
    +
    apartment
    +
    condo
    +
    commercial
    +
    business
    +
    construction
    +
    container
    +
    +
    + {{ customer.customer_phone_number }} +
    +
    +
    + +
    +
    + OUTSIDE TANK - {{ customer_tank.tank_size }} +
    +
    +
    + {{ customer_tank.tank_size }} +
    Home Description
    {{ customer_description.description }}
    -
    @@ -139,7 +204,6 @@
    Total Calls: {{ customer_stats.total_calls }}
    -
    @@ -198,6 +262,16 @@
    Inspected
    + + +
    Inside/Outside
    +
    + Inside +
    +
    + Outside +
    +
    @@ -211,12 +285,12 @@
    {{ customer_tank.tank_size }}
    +
    -

    @@ -227,7 +301,7 @@
    - +
    @@ -252,27 +326,31 @@ {{ card.card_number }}
    -
    01
    -
    02
    -
    03
    -
    04
    -
    05
    -
    06
    -
    07
    -
    08
    -
    09
    -
    10
    -
    11
    -
    12
    - +
    01
    +
    02
    +
    03
    +
    04
    +
    05
    +
    06
    +
    07
    +
    08
    +
    09
    +
    10
    +
    11
    +
    12
    +
    /
    - +
    {{ card.expiration_year }}
    - +
    +
    {{ card.zip_code }}
    +
    + {{ card.security_number }} +
    -
    01
    -
    02
    -
    03
    -
    04
    -
    05
    -
    06
    -
    07
    -
    08
    -
    09
    -
    10
    -
    11
    -
    12
    - +
    01
    +
    02
    +
    03
    +
    04
    +
    05
    +
    06
    +
    07
    +
    08
    +
    09
    +
    10
    +
    11
    +
    12
    +
    /
    - +
    {{ card.expiration_year }}
    - +
    {{ card.zip_code }} @@ -335,7 +413,7 @@ - +
    @@ -345,8 +423,7 @@
    -
    +
    @@ -407,9 +484,11 @@ id Status - Town Name + + Address + Town Gallons Date @@ -422,23 +501,22 @@ {{ oil['id'] }}
    Waiting
    -
    delivered
    +
    cancelled
    Out for Delivery
    -
    Cancelled
    -
    Partial Delivery
    +
    Tommorrow
    Issue
    Finalized
    - {{ oil['customer_town'] }} {{ oil['customer_name'] }} {{ oil['customer_address'] }} + {{ oil['customer_town'] }}
    Fill
    {{ oil['gallons_ordered'] }}
    - {{oil['gallons_delivered']}} + {{ oil['gallons_delivered'] }} {{ oil['expected_delivery_date'] }} @@ -491,6 +569,9 @@ import SideBar from '../../../layouts/sidebar/sidebar.vue' import Footer from '../../../layouts/footers/footer.vue' import PaginationComp from "../../../components/pagination.vue"; import { notify } from "@kyvg/vue3-notification"; +import "leaflet/dist/leaflet.css"; +import { LMap, LTileLayer } from "@vue-leaflet/vue-leaflet"; + export default defineComponent({ name: 'CustomerProfile', @@ -499,10 +580,13 @@ export default defineComponent({ Header, SideBar, Footer, + LMap, + LTileLayer, }, data() { return { + zoom: 14, token: null, user: { user_id: 0, @@ -518,8 +602,8 @@ export default defineComponent({ { id: 0, created: '', - customer_id: '', - poster_employee_id: '', + customer_id: 0, + poster_employee_id: 0, comment: '', } ], @@ -557,6 +641,9 @@ export default defineComponent({ customer_apt: '', customer_home_type: 0, customer_phone_number: '', + customer_latitude: 0, + customer_longitude: 0, + correct_address: true, account_number: '', }, customer_description: { @@ -581,7 +668,6 @@ export default defineComponent({ service_calls_total: 0, service_calls_total_spent: 0, service_calls_total_profit: 0, - oil_deliveries: 0, oil_total_gallons: 0, oil_total_spent: 0, @@ -632,7 +718,6 @@ export default defineComponent({ .then((response: any) => { if (response.data.ok) { this.user = response.data.user; - console.log(this.user) } }) .catch(() => { @@ -721,7 +806,7 @@ export default defineComponent({ }).then((response: any) => { this.customer_last_delivery = response.data.date - console.log(response.data) + }) }, getCustomerStats(userid: any) { @@ -742,11 +827,8 @@ export default defineComponent({ method: 'get', url: path, headers: authHeader(), - }).then((response: any) => { - console.log(response) - console.log("updated gallons") - }) + }, getCustomerDescription(userid: any) { let path = import.meta.env.VITE_BASE_URL + '/customer/description/' + userid; @@ -767,6 +849,7 @@ export default defineComponent({ headers: authHeader(), }).then((response: any) => { this.customer_tank = response.data + }) }, diff --git a/src/pages/delivery/routes.ts b/src/pages/delivery/routes.ts index a9ff80d..dcdca5e 100755 --- a/src/pages/delivery/routes.ts +++ b/src/pages/delivery/routes.ts @@ -3,7 +3,7 @@ import DeliveryCreate from "./create.vue"; import DeliveryEdit from './edit.vue'; import DeliveryOrder from './view.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 deliveryCancelled from './viewstatus/cancelled.vue'; import deliveryIssue from './viewstatus/issue.vue'; @@ -12,6 +12,8 @@ import deliveryOutForDelivery from './viewstatus/todaysdeliveries.vue'; import deliveryWaiting from './viewstatus/waiting.vue'; import deliveryFinalized from './viewstatus/finalized.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 = [ { @@ -44,11 +46,7 @@ const deliveryRoutes = [ name: 'deliveryTicketsMissing', component: deliveryTicketsMissing, }, - { - path: '/delivery/tickets/finalize/:id', - name: 'finalizeTicket', - component: finalizeTicket, - }, + { path: '/delivery/cancelled', name: 'deliveryCancelled', @@ -84,6 +82,16 @@ const deliveryRoutes = [ name: '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 diff --git a/src/pages/delivery/update_tickets/finalize_ticket_auto.vue b/src/pages/delivery/update_tickets/finalize_ticket_auto.vue new file mode 100644 index 0000000..ae3643d --- /dev/null +++ b/src/pages/delivery/update_tickets/finalize_ticket_auto.vue @@ -0,0 +1,530 @@ + + + + + + \ No newline at end of file diff --git a/src/pages/delivery/viewstatus/cancelled.vue b/src/pages/delivery/viewstatus/cancelled.vue index 81b986d..09374c8 100755 --- a/src/pages/delivery/viewstatus/cancelled.vue +++ b/src/pages/delivery/viewstatus/cancelled.vue @@ -26,9 +26,9 @@ Name Status - Town - Address + Town + Gallons Date Automatic @@ -55,9 +55,9 @@ - + {{ oil['customer_address'] }} {{ oil['customer_town'] }} - {{ oil['customer_address'] }} +
    Fill
    {{ oil['gallons_ordered'] }}
    diff --git a/src/pages/delivery/viewstatus/delivered.vue b/src/pages/delivery/viewstatus/delivered.vue index eac57b5..52d26b2 100755 --- a/src/pages/delivery/viewstatus/delivered.vue +++ b/src/pages/delivery/viewstatus/delivered.vue @@ -26,8 +26,9 @@ Name Status - Town Address + Town + Gallons Date Automatic @@ -55,8 +56,9 @@ + {{ oil['customer_address'] }} {{ oil['customer_town'] }} - {{ oil['customer_address'] }} +
    Fill
    {{ oil['gallons_ordered'] }}
    diff --git a/src/pages/delivery/viewstatus/finalized.vue b/src/pages/delivery/viewstatus/finalized.vue index 688ee94..efd6034 100644 --- a/src/pages/delivery/viewstatus/finalized.vue +++ b/src/pages/delivery/viewstatus/finalized.vue @@ -27,8 +27,9 @@ Ticket Id Name Status - Town + Address + Town Gallons Date Automatic @@ -57,8 +58,9 @@ - {{ oil['customer_town'] }} + {{ oil['customer_address'] }} + {{ oil['customer_town'] }}
    Fill
    {{ oil['gallons_ordered'] }}
    diff --git a/src/pages/delivery/viewstatus/issue.vue b/src/pages/delivery/viewstatus/issue.vue index 04f3970..c081603 100755 --- a/src/pages/delivery/viewstatus/issue.vue +++ b/src/pages/delivery/viewstatus/issue.vue @@ -26,8 +26,9 @@ Ticket Id Name Status - Town + Address + Town Gallons Date Automatic @@ -57,8 +58,9 @@ - {{ oil['customer_town'] }} + {{ oil['customer_address'] }} + {{ oil['customer_town'] }}
    Fill
    {{ oil['gallons_ordered'] }}
    diff --git a/src/pages/delivery/viewstatus/pending.vue b/src/pages/delivery/viewstatus/pending.vue index 04629ca..957f3b5 100644 --- a/src/pages/delivery/viewstatus/pending.vue +++ b/src/pages/delivery/viewstatus/pending.vue @@ -28,8 +28,9 @@ Id Name Status - Town + Address + Town Gallons Date Auto @@ -64,8 +65,9 @@ - {{ oil['customer_town'] }} + {{ oil['customer_address'] }} + {{ oil['customer_town'] }}
    Fill
    {{ oil['gallons_ordered'] }}
    diff --git a/src/pages/delivery/viewstatus/todaysdeliveries.vue b/src/pages/delivery/viewstatus/todaysdeliveries.vue index 058bfa2..9d48df6 100755 --- a/src/pages/delivery/viewstatus/todaysdeliveries.vue +++ b/src/pages/delivery/viewstatus/todaysdeliveries.vue @@ -44,13 +44,13 @@ - + {{ oil['id'] }}
    {{ oil['customer_name'] }}
    -
    +
    Waiting
    cancelled
    @@ -61,7 +61,7 @@
    Finalized
    - + {{ oil['customer_town'] }} @@ -88,7 +88,7 @@
    Yes
    - +
    Cash
    CC
    Cash/CC
    @@ -106,11 +106,10 @@ - - - - - + + + + @@ -124,9 +123,10 @@
    - - -
    {{ recordsLength }} items Found
    + + +
    {{ recordsLength }} items Found
    diff --git a/src/pages/delivery/viewstatus/tommorrow.vue b/src/pages/delivery/viewstatus/tommorrow.vue index a4cfd38..a704883 100644 --- a/src/pages/delivery/viewstatus/tommorrow.vue +++ b/src/pages/delivery/viewstatus/tommorrow.vue @@ -26,11 +26,12 @@ - Ticket Id + Account Id Name Status - Town + Address + Town Gallons Date Automatic @@ -59,8 +60,9 @@
    - {{ oil['customer_town'] }} + {{ oil['customer_address'] }} + {{ oil['customer_town'] }}
    Fill
    {{ oil['gallons_ordered'] }}
    @@ -101,7 +103,7 @@
    -
    {{ recordsLength }} items Found
    +
    diff --git a/src/pages/delivery/viewstatus/waiting.vue b/src/pages/delivery/viewstatus/waiting.vue index b5741b5..8497e52 100755 --- a/src/pages/delivery/viewstatus/waiting.vue +++ b/src/pages/delivery/viewstatus/waiting.vue @@ -25,11 +25,12 @@ - Ticket Id + Account Id Name Status - Town + Address + Town Gallons Date Automatic @@ -57,8 +58,9 @@
    - {{ oil['customer_town'] }} + {{ oil['customer_address'] }} + {{ oil['customer_town'] }}
    Fill
    {{ oil['gallons_ordered'] }}
    diff --git a/src/pages/pay/pay_oil.vue b/src/pages/pay/pay_oil.vue index c924e7e..0fce359 100755 --- a/src/pages/pay/pay_oil.vue +++ b/src/pages/pay/pay_oil.vue @@ -380,7 +380,7 @@ export default defineComponent({ type_of_card: '', last_four_digits: '', expiration_year: '', - security_number: 0, + security_number: '', } ], diff --git a/src/pages/ticket/ticket.vue b/src/pages/ticket/ticket.vue index 132e785..0373a4d 100644 --- a/src/pages/ticket/ticket.vue +++ b/src/pages/ticket/ticket.vue @@ -13,10 +13,12 @@
    -
    {{ customer.customer_first_name }} {{ customer.customer_last_name }} +
    + {{ customer.customer_first_name }} {{ customer.customer_last_name }}
    {{ customer.account_number }}
    {{ customer.customer_address }}
    +
    {{ customer.customer_apt }}
    {{ customer.customer_town }}
    @@ -28,34 +30,35 @@
    -
    - -
    +
    + +
    -
    {{ customer_description.description }}
    -
    Promo: {{ promo.text_on_ticket }}
    -
    -
    PRIME
    -
    SAME DAY
    -
    EMERGENCY
    +
    {{ customer_description.description }}
    +
    Promo: {{ promo.text_on_ticket + }}
    +
    +
    PRIME
    +
    SAME DAY
    +
    EMERGENCY
    -
    CASH
    -
    Credit Card
    -
    Credit Card/Cash
    -
    Check
    -
    Other
    -
    -
    - {{ delivery.gallons_ordered }}
    -
    Fill
    +
    CASH
    +
    Credit Card
    +
    Credit Card/Cash +
    +
    Check
    +
    Other
    +
    +
    + {{ delivery.gallons_ordered }}
    +
    Fill
    +
    -
    -
    -
    -
    {{ delivery.dispatcher_notes }}
    +
    +
    +
    {{ delivery.dispatcher_notes }}
    +
    - -
    @@ -118,8 +121,8 @@
    {{ total_amount_after_discount }}
    -
    {{ total_amount }}
    - +
    {{ total_amount }}
    +
    diff --git a/src/pages/ticket/ticketauto.vue b/src/pages/ticket/ticketauto.vue index f808c34..c55eeb4 100644 --- a/src/pages/ticket/ticketauto.vue +++ b/src/pages/ticket/ticketauto.vue @@ -1,55 +1,113 @@