updated customer profile. added maps
This commit is contained in:
@@ -1,112 +1,119 @@
|
||||
<template>
|
||||
<Header/>
|
||||
<div class="flex">
|
||||
<div class="">
|
||||
<SideBar/>
|
||||
<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: 'delivery' }">
|
||||
Delivery
|
||||
</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
</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: 'delivery' }">
|
||||
Delivery
|
||||
</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="flex start text-2xl mb-10">Automatics </div>
|
||||
<div class="mb-10">
|
||||
<div class="flex start text-2xl mb-10">Automatics </div>
|
||||
<div class="mb-10">
|
||||
<div class="">Home Factor</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">0.50 = small oil usage</div>
|
||||
<form class="col-span-12 rounded-md px-8 pt-6 pb-8 mb-4 w-full"
|
||||
enctype="multipart/form-data"
|
||||
@submit.prevent="get_auto_assignment">
|
||||
<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"
|
||||
id="customer_state" v-model="CreateOilOrderForm.basicInfo.driver_driver">
|
||||
<option class="text-white" v-for="(driver, index) in truckDriversList" :key="index"
|
||||
:value="driver['id']">
|
||||
{{ driver['employee_first_name'] }} {{ driver['employee_last_name'] }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<button class="btn btn-secondary btn-sm">
|
||||
Send for delivery
|
||||
</button>
|
||||
</form>
|
||||
<!-- <form class="col-span-12 rounded-md px-8 pt-6 pb-8 mb-4 w-full" enctype="multipart/form-data"
|
||||
@submit.prevent="get_auto_assignment">
|
||||
<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"
|
||||
id="customer_state" v-model="CreateOilOrderForm.basicInfo.driver_driver">
|
||||
<option class="text-white" v-for="(driver, index) in truckDriversList" :key="index" :value="driver['id']">
|
||||
{{ driver['employee_first_name'] }} {{ driver['employee_last_name'] }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<button class="btn btn-secondary btn-sm">
|
||||
Send for delivery
|
||||
</button>
|
||||
</form> -->
|
||||
</div>
|
||||
<div class="overflow-x-auto bg-neutral">
|
||||
|
||||
<table class="table">
|
||||
<!-- head -->
|
||||
<thead>
|
||||
<div class="overflow-x-auto bg-neutral">
|
||||
|
||||
<table class="table">
|
||||
<!-- head -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Account #</th>
|
||||
<th>Gallons Left</th>
|
||||
<th>Status</th>
|
||||
<th>Name</th>
|
||||
<th>Town</th>
|
||||
<th>Address</th>
|
||||
<th>Last Fill</th>
|
||||
<th>Days</th>
|
||||
<th>Name</th>
|
||||
<th>Address</th>
|
||||
<th>Town</th>
|
||||
<th>Home Factor</th>
|
||||
<th>Tank Size</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- row 1 -->
|
||||
<tr v-for="oil in deliveries" :key="oil['id']">
|
||||
|
||||
<router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
|
||||
<td>
|
||||
<input type="checkbox" :value="oil['id']" v-model="checkedMaterials">
|
||||
{{ oil['customer_id'] }}
|
||||
</td>
|
||||
<td>{{ oil['estimated_gallons_left'] }}</td>
|
||||
</router-link>
|
||||
<td>
|
||||
<div v-if="oil['auto_status'] === 0">
|
||||
|
||||
</div>
|
||||
<div v-else-if="oil['auto_status'] === 1">Waiting on Delivery </div>
|
||||
<div v-else-if="oil['auto_status'] === 2">Pending Payment Confirmation </div>
|
||||
<div v-else></div>
|
||||
|
||||
<div class="" v-if="oil['last_fill'] === null"></div>
|
||||
<div class="" v-else> {{ oil['estimated_gallons_left'] }}</div>
|
||||
</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_town'] }}</td>
|
||||
</router-link>
|
||||
<td>{{ oil['customer_address'] }}</td>
|
||||
<td>{{ oil['last_fill'] }} </td>
|
||||
<td>{{ oil['customer_town'] }}</td>
|
||||
|
||||
<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'] } }">
|
||||
<button class="btn btn-secondary btn-sm">
|
||||
Edit Customer
|
||||
</button>
|
||||
</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'] } }">
|
||||
<button class="btn btn-success btn-sm">
|
||||
Print Ticket
|
||||
</button>
|
||||
</router-link>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<Footer/>
|
||||
</div>
|
||||
<Footer />
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
<script lang="ts">
|
||||
import {defineComponent} from 'vue'
|
||||
import { defineComponent } from 'vue'
|
||||
import axios from 'axios'
|
||||
import authHeader from '../../services/auth.header'
|
||||
import Header from '../../layouts/headers/headerauth.vue'
|
||||
@@ -140,11 +147,13 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
created() {
|
||||
|
||||
this.userStatus()
|
||||
this.getDriversList()
|
||||
this.get_oil_orders()
|
||||
},
|
||||
mounted() {
|
||||
|
||||
this.get_oil_orders()
|
||||
|
||||
},
|
||||
@@ -157,16 +166,17 @@ export default defineComponent({
|
||||
withCredentials: true,
|
||||
headers: authHeader(),
|
||||
})
|
||||
.then((response: any) => {
|
||||
if (response.data.ok) {
|
||||
this.user = response.data.user;
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.user = null
|
||||
})
|
||||
.then((response: any) => {
|
||||
if (response.data.ok) {
|
||||
this.user = response.data.user;
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.user = null
|
||||
})
|
||||
},
|
||||
get_oil_orders() {
|
||||
|
||||
let path = import.meta.env.VITE_AUTO_URL + '/delivery/all/customers';
|
||||
axios({
|
||||
method: 'get',
|
||||
@@ -196,8 +206,8 @@ export default defineComponent({
|
||||
|
||||
get_auto_assignment() {
|
||||
let path = import.meta.env.VITE_AUTO_URL + '/delivery/create';
|
||||
|
||||
const selectedValues : any[] = [];
|
||||
|
||||
const selectedValues: any[] = [];
|
||||
for (const id in this.checkedMaterials) {
|
||||
if (this.checkedMaterials[id]) {
|
||||
selectedValues.push(this.checkedMaterials[id]);
|
||||
@@ -221,7 +231,7 @@ export default defineComponent({
|
||||
text: "Added automatics to delivery",
|
||||
type: "success",
|
||||
});
|
||||
|
||||
|
||||
} else {
|
||||
notify({
|
||||
title: "Failure",
|
||||
@@ -234,11 +244,9 @@ export default defineComponent({
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
<style scoped></style>
|
||||
Reference in New Issue
Block a user