added print button and finalize
This commit is contained in:
@@ -1,28 +1,26 @@
|
|||||||
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<footer class="footer p-10 bg-neutral text-neutral-content mt-20">
|
<footer class="footer p-10 bg-neutral text-neutral-content mt-20 bg-secondary">
|
||||||
<nav>
|
<nav>
|
||||||
<h6 class="footer-title">Services</h6>
|
<h6 class="footer-title">Services</h6>
|
||||||
<a class="link link-hover">Branding</a>
|
<a class="link link-hover">Branding</a>
|
||||||
<a class="link link-hover">Design</a>
|
<a class="link link-hover">Design</a>
|
||||||
<a class="link link-hover">Marketing</a>
|
<a class="link link-hover">Marketing</a>
|
||||||
<a class="link link-hover">Advertisement</a>
|
<a class="link link-hover">Advertisement</a>
|
||||||
</nav>
|
</nav>
|
||||||
<nav>
|
<nav>
|
||||||
<h6 class="footer-title">Company</h6>
|
<h6 class="footer-title">Company</h6>
|
||||||
<a class="link link-hover">About us</a>
|
<a class="link link-hover">About us</a>
|
||||||
<a class="link link-hover">Contact</a>
|
<a class="link link-hover">Contact</a>
|
||||||
<a class="link link-hover">Jobs</a>
|
<a class="link link-hover">Jobs</a>
|
||||||
<a class="link link-hover">Press kit</a>
|
<a class="link link-hover">Press kit</a>
|
||||||
</nav>
|
</nav>
|
||||||
<nav>
|
<nav>
|
||||||
<h6 class="footer-title">Legal</h6>
|
<h6 class="footer-title">Legal</h6>
|
||||||
<a class="link link-hover">Terms of use</a>
|
<a class="link link-hover">Terms of use</a>
|
||||||
<a class="link link-hover">Privacy policy</a>
|
<a class="link link-hover">Privacy policy</a>
|
||||||
<a class="link link-hover">Cookie policy</a>
|
<a class="link link-hover">Cookie policy</a>
|
||||||
</nav>
|
</nav>
|
||||||
</footer>
|
</footer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
@@ -37,10 +35,8 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {},
|
mounted() { },
|
||||||
methods: {},
|
methods: {},
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style></style>
|
||||||
|
|
||||||
</style>
|
|
||||||
@@ -55,6 +55,14 @@ export default defineComponent({
|
|||||||
user_id: 0,
|
user_id: 0,
|
||||||
user_name: '',
|
user_name: '',
|
||||||
},
|
},
|
||||||
|
company: {
|
||||||
|
company_dba_name: '',
|
||||||
|
company_llc_name: '',
|
||||||
|
company_town: '',
|
||||||
|
company_stat: 0,
|
||||||
|
company_zip: '0',
|
||||||
|
|
||||||
|
},
|
||||||
employee: {
|
employee: {
|
||||||
id: '',
|
id: '',
|
||||||
user_id: '',
|
user_id: '',
|
||||||
@@ -180,7 +188,21 @@ export default defineComponent({
|
|||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
getCompany() {
|
||||||
|
let path = import.meta.env.VITE_BASE_URL + '/admin/company/' + import.meta.env.COMPANY_ID;
|
||||||
|
|
||||||
|
axios({
|
||||||
|
method: "get",
|
||||||
|
url: path,
|
||||||
|
withCredentials: true,
|
||||||
|
headers: authHeader(),
|
||||||
|
})
|
||||||
|
.then((response: any) => {
|
||||||
|
this.company = response.data;
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -29,6 +29,9 @@
|
|||||||
</li>
|
</li>
|
||||||
<div class="font-bold text-lg text-gray-500 pt-5">Delivery</div>
|
<div class="font-bold text-lg text-gray-500 pt-5">Delivery</div>
|
||||||
<li>
|
<li>
|
||||||
|
<router-link :to="{ name: 'delivery' }">
|
||||||
|
<div class=" hover:underline py-1">Home</div>
|
||||||
|
</router-link>
|
||||||
<router-link :to="{ name: 'deliveryOutForDelivery' }">
|
<router-link :to="{ name: 'deliveryOutForDelivery' }">
|
||||||
<div class=" hover:underline py-1">Todays Deliveries</div>
|
<div class=" hover:underline py-1">Todays Deliveries</div>
|
||||||
</router-link>
|
</router-link>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<Header/>
|
<Header />
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="">
|
<div class="">
|
||||||
<SideBar/>
|
<SideBar />
|
||||||
</div>
|
</div>
|
||||||
<div class=" w-full px-10 ">
|
<div class=" w-full px-10 ">
|
||||||
<div class="text-sm breadcrumbs">
|
<div class="text-sm breadcrumbs">
|
||||||
@@ -17,34 +17,42 @@
|
|||||||
<div class="flex text-2xl mb-5">
|
<div class="flex text-2xl mb-5">
|
||||||
Welcome {{ employee.employee_first_name }} {{ employee.employee_last_name }}!
|
Welcome {{ employee.employee_first_name }} {{ employee.employee_last_name }}!
|
||||||
</div>
|
</div>
|
||||||
<div class="grid grid-cols-12 gap-5">
|
|
||||||
<div class="col-span-12 bg-neutral ">
|
<div class="grid grid-cols-12 gap-5 ">
|
||||||
|
<div class="col-span-12 bg-secondary ">
|
||||||
<div class="grid grid-cols-12 p-5">
|
<div class="grid grid-cols-12 p-5">
|
||||||
<div class="col-span-12 font-bold text-xl">Todays stats</div>
|
<div class="col-span-12 font-bold text-xl">Todays stats</div>
|
||||||
<div class="col-span-6 py-2"> Total Deliveries: {{delivery_count}}</div>
|
<div class="col-span-6 py-2"> Total Deliveries: {{ delivery_count }}</div>
|
||||||
|
<div class="col-span-6 py-2"> Completed: {{ delivery_count_delivered }} / {{ delivery_count }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-span-6 bg-neutral" >
|
|
||||||
<div class="grid grid-cols-12 p-5 ">
|
<div class="col-span-6 bg-neutral">
|
||||||
|
<div class="grid grid-cols-12 p-5 bg-secondary">
|
||||||
<div class="col-span-12 font-bold text-xl">Todays Oil Price</div>
|
<div class="col-span-12 font-bold text-xl">Todays Oil Price</div>
|
||||||
<div class="col-span-12 py-2"> Price / Gallon: {{today_oil_price}}</div>
|
<div class="col-span-12 py-2"> Price / Gallon: {{ today_oil_price }}</div>
|
||||||
<div class="col-span-12 py-2"> Same Day: ${{same_day}}</div>
|
<div class="col-span-12 py-2"> Same Day: ${{ price_same_day }}</div>
|
||||||
<div class="col-span-12 py-2"> Prime: ${{prime}}</div>
|
<div class="col-span-12 py-2"> Prime: ${{ price_prime }}</div>
|
||||||
|
<div class="col-span-12 py-2"> Price / Employee: ${{ price_for_employee }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-span-6 bg-neutral" >
|
<div class="col-span-6 bg-neutral">
|
||||||
|
<div class="grid grid-cols-12 p-5 bg-secondary">
|
||||||
|
<div class="col-span-12 font-bold text-xl">Quick Tips</div>
|
||||||
|
<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>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Footer/>
|
<Footer />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {defineComponent} from 'vue'
|
import { defineComponent } from 'vue'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import authHeader from '../services/auth.header'
|
import authHeader from '../services/auth.header'
|
||||||
import Header from '../layouts/headers/headerauth.vue'
|
import Header from '../layouts/headers/headerauth.vue'
|
||||||
@@ -64,10 +72,12 @@ export default defineComponent({
|
|||||||
return {
|
return {
|
||||||
token: null,
|
token: null,
|
||||||
delivery_count: 0,
|
delivery_count: 0,
|
||||||
today_oil_price: '',
|
delivery_count_delivered: 0,
|
||||||
same_day: '',
|
price_from_supplier: 0,
|
||||||
prime: '',
|
today_oil_price: 0,
|
||||||
out_of_oil: '',
|
price_for_employee: 0,
|
||||||
|
price_same_day: 0,
|
||||||
|
price_prime: 0,
|
||||||
user: {
|
user: {
|
||||||
user_id: 0,
|
user_id: 0,
|
||||||
user_name: '',
|
user_name: '',
|
||||||
@@ -108,16 +118,16 @@ export default defineComponent({
|
|||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
headers: authHeader(),
|
headers: authHeader(),
|
||||||
})
|
})
|
||||||
.then((response: any) => {
|
.then((response: any) => {
|
||||||
if (response.data.ok) {
|
if (response.data.ok) {
|
||||||
this.user = response.data.user;
|
this.user = response.data.user;
|
||||||
this.employeeStatus()
|
this.employeeStatus()
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
localStorage.removeItem('user');
|
localStorage.removeItem('user');
|
||||||
this.$router.push('/login');
|
this.$router.push('/login');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -129,11 +139,11 @@ export default defineComponent({
|
|||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
headers: authHeader(),
|
headers: authHeader(),
|
||||||
})
|
})
|
||||||
.then((response: any) => {
|
.then((response: any) => {
|
||||||
this.employee = response.data;
|
this.employee = response.data;
|
||||||
this.loaded = true;
|
this.loaded = true;
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
today_delivery_count() {
|
today_delivery_count() {
|
||||||
@@ -144,11 +154,22 @@ export default defineComponent({
|
|||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
headers: authHeader(),
|
headers: authHeader(),
|
||||||
})
|
})
|
||||||
.then((response: any) => {
|
.then((response: any) => {
|
||||||
this.delivery_count = response.data.data;
|
this.delivery_count = response.data.data;
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
today_delivery_delivered() {
|
||||||
|
let path = import.meta.env.VITE_BASE_URL + '/stats/delivery/count/delivered/today'
|
||||||
|
axios({
|
||||||
|
method: "get",
|
||||||
|
url: path,
|
||||||
|
withCredentials: true,
|
||||||
|
headers: authHeader(),
|
||||||
|
})
|
||||||
|
.then((response: any) => {
|
||||||
|
this.delivery_count_delivered = response.data.data;
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
today_price_oil() {
|
today_price_oil() {
|
||||||
let path = import.meta.env.VITE_BASE_URL + '/info/price/oil'
|
let path = import.meta.env.VITE_BASE_URL + '/info/price/oil'
|
||||||
axios({
|
axios({
|
||||||
@@ -157,17 +178,20 @@ export default defineComponent({
|
|||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
headers: authHeader(),
|
headers: authHeader(),
|
||||||
})
|
})
|
||||||
.then((response: any) => {
|
.then((response: any) => {
|
||||||
this.today_oil_price = response.data.price;
|
this.price_from_supplier = response.data.price_from_supplier;
|
||||||
})
|
this.today_oil_price = response.data.price_for_customer;
|
||||||
|
this.price_for_employee = response.data.price_for_employee;
|
||||||
|
this.price_same_day = response.data.price_same_day;
|
||||||
|
this.price_prime = response.data.price_prime;
|
||||||
|
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped></style>
|
||||||
|
|
||||||
</style>
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
</script>
|
</script>
|
||||||
@@ -29,6 +29,7 @@
|
|||||||
<!-- head -->
|
<!-- head -->
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th>Ticket ID</th>
|
||||||
<th>Due Date</th>
|
<th>Due Date</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>Town</th>
|
<th>Town</th>
|
||||||
@@ -41,6 +42,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<!-- row 1 -->
|
<!-- row 1 -->
|
||||||
<tr v-for="oil in deliveries" :key="oil['id']">
|
<tr v-for="oil in deliveries" :key="oil['id']">
|
||||||
|
<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">delivered</div>
|
||||||
@@ -61,16 +63,13 @@
|
|||||||
<td>
|
<td>
|
||||||
{{ oil['expected_delivery_date'] }}
|
{{ oil['expected_delivery_date'] }}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<div v-if="oil['automatic'] == 0">No</div>
|
<div v-if="oil['automatic'] == 0">No</div>
|
||||||
<div v-else>Yes</div>
|
<div v-else>Yes</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
|
||||||
<td class="flex gap-5">
|
<td class="flex gap-5">
|
||||||
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
|
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
|
||||||
<button class="btn">Edit</button>
|
<button class="btn btn-accent">Edit</button>
|
||||||
</router-link>
|
</router-link>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<Header/>
|
<Header />
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="">
|
<div class="">
|
||||||
<SideBar/>
|
<SideBar />
|
||||||
</div>
|
</div>
|
||||||
<div class=" w-full px-10 ">
|
<div class=" w-full px-10 ">
|
||||||
<div class="text-sm breadcrumbs">
|
<div class="text-sm breadcrumbs">
|
||||||
@@ -27,52 +27,55 @@
|
|||||||
<table class="table">
|
<table class="table">
|
||||||
<!-- head -->
|
<!-- head -->
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Account Number</th>
|
||||||
<th>Town</th>
|
<th>Name</th>
|
||||||
<th>Automatic</th>
|
<th>Town</th>
|
||||||
<th>Phone Number</th>
|
<th>Automatic</th>
|
||||||
<th></th>
|
<th>Phone Number</th>
|
||||||
</tr>
|
<th></th>
|
||||||
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<!-- row 1 -->
|
<!-- row 1 -->
|
||||||
<tr v-for="person in customers" :key="person['id']">
|
<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['customer_first_name'] }} {{ person['customer_last_name'] }}
|
||||||
|
</router-link>
|
||||||
|
</td>
|
||||||
|
<td>{{ person['customer_town'] }}</td>
|
||||||
|
<td>
|
||||||
|
<div v-if="person['customer_automatic'] == 0">No</div>
|
||||||
|
<div v-else>Yes</div>
|
||||||
|
</td>
|
||||||
|
<td>{{ person['customer_phone_number'] }}</td>
|
||||||
|
|
||||||
<td>
|
<td class="flex gap-5">
|
||||||
<router-link :to="{ name: 'customerProfile', params: { id: person['id'] } }">
|
<router-link :to="{ name: 'deliveryCreate', params: { id: person['id'] } }"
|
||||||
{{ person['customer_first_name'] }} {{ person['customer_last_name'] }}
|
class="cursor-pointer underline hover:text-blue-300">
|
||||||
</router-link>
|
Oil
|
||||||
</td>
|
</router-link>
|
||||||
<td>{{ person['customer_town'] }}</td>
|
|
||||||
<td>
|
|
||||||
<div v-if="person['customer_automatic'] == 0">No</div>
|
|
||||||
<div v-else>Yes</div>
|
|
||||||
</td>
|
|
||||||
<td>{{ person['customer_phone_number'] }}</td>
|
|
||||||
|
|
||||||
<td class="flex gap-5">
|
<router-link :to="{ name: 'customerEdit', params: { id: person['id'] } }"
|
||||||
<router-link :to="{ name: 'deliveryCreate', params: { id: person['id'] } }" class="cursor-pointer underline hover:text-blue-300">
|
class="cursor-pointer underline hover:text-blue-300">
|
||||||
Oil
|
Edit
|
||||||
</router-link>
|
</router-link>
|
||||||
|
<router-link :to="{ name: 'customerProfile', params: { id: person['id'] } }"
|
||||||
<router-link :to="{ name: 'customerEdit', params: { id: person['id'] } }" class="cursor-pointer underline hover:text-blue-300">
|
class="cursor-pointer underline hover:text-blue-300">
|
||||||
Edit
|
View
|
||||||
</router-link>
|
</router-link>
|
||||||
<router-link :to="{ name: 'customerProfile', params: { id: person['id'] } }" class="cursor-pointer underline hover:text-blue-300">
|
<a @click.prevent="deleteCustomer(person['id'])" class="cursor-pointer underline hover:text-blue-300">
|
||||||
View
|
Delete
|
||||||
</router-link>
|
</a>
|
||||||
<a @click.prevent="deleteCustomer(person['id'])" class="cursor-pointer underline hover:text-blue-300">
|
</td>
|
||||||
Delete
|
</tr>
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-center" v-if="recordsLength > 9">
|
<div class="flex justify-center" v-if="recordsLength > 9">
|
||||||
<pagination @paginate="getPage" :records="recordsLength" v-model="page" :per-page="perPage"
|
<pagination @paginate="getPage" :records="recordsLength" v-model="page" :per-page="perPage" :options="options">
|
||||||
:options="options">
|
|
||||||
</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>
|
||||||
@@ -80,11 +83,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Footer/>
|
<Footer />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {defineComponent} from 'vue'
|
import { defineComponent } from 'vue'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
import authHeader from '../../services/auth.header'
|
import authHeader from '../../services/auth.header'
|
||||||
@@ -140,15 +143,15 @@ export default defineComponent({
|
|||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
headers: authHeader(),
|
headers: authHeader(),
|
||||||
})
|
})
|
||||||
.then((response: any) => {
|
.then((response: any) => {
|
||||||
if (response.data.ok) {
|
if (response.data.ok) {
|
||||||
this.user = response.data.user;
|
this.user = response.data.user;
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
this.user = null
|
this.user = null
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
get_customers(page: any) {
|
get_customers(page: any) {
|
||||||
let path = import.meta.env.VITE_BASE_URL + '/customer/all/' + page;
|
let path = import.meta.env.VITE_BASE_URL + '/customer/all/' + page;
|
||||||
@@ -160,7 +163,7 @@ export default defineComponent({
|
|||||||
this.customers = response.data
|
this.customers = response.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
deleteCustomer(user_id: any) {
|
deleteCustomer(user_id: any) {
|
||||||
let path = import.meta.env.VITE_BASE_URL + '/customer/delete/' + user_id;
|
let path = import.meta.env.VITE_BASE_URL + '/customer/delete/' + user_id;
|
||||||
axios({
|
axios({
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
@@ -168,13 +171,11 @@ export default defineComponent({
|
|||||||
headers: authHeader(),
|
headers: authHeader(),
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
|
||||||
this.get_customers(1)
|
this.get_customers(1)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped></style>
|
||||||
|
|
||||||
</style>
|
|
||||||
@@ -210,6 +210,7 @@
|
|||||||
<!-- head -->
|
<!-- head -->
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th>id</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>Town</th>
|
<th>Town</th>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
@@ -224,6 +225,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<!-- row 1 -->
|
<!-- row 1 -->
|
||||||
<tr v-for="oil in deliveries" :key="oil['id']">
|
<tr v-for="oil in deliveries" :key="oil['id']">
|
||||||
|
<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">delivered</div>
|
||||||
|
|||||||
@@ -325,6 +325,21 @@ export default defineComponent({
|
|||||||
.catch(() => {
|
.catch(() => {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getDriversList() {
|
||||||
|
let path = import.meta.env.VITE_BASE_URL + "/employee/drivers";
|
||||||
|
axios({
|
||||||
|
method: "get",
|
||||||
|
url: path,
|
||||||
|
withCredentials: true,
|
||||||
|
headers: authHeader(),
|
||||||
|
})
|
||||||
|
.then((response: any) => {
|
||||||
|
this.truckDriversList = response.data;
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
CreateOilOrder(payload: {
|
CreateOilOrder(payload: {
|
||||||
gallons_ordered: string;
|
gallons_ordered: string;
|
||||||
customer_asked_for_fill: boolean;
|
customer_asked_for_fill: boolean;
|
||||||
@@ -369,25 +384,16 @@ export default defineComponent({
|
|||||||
credit_card_id: this.CreateOilOrderForm.basicInfo.userCards,
|
credit_card_id: this.CreateOilOrderForm.basicInfo.userCards,
|
||||||
driver_employee_id: this.CreateOilOrderForm.basicInfo.driver_driver,
|
driver_employee_id: this.CreateOilOrderForm.basicInfo.driver_driver,
|
||||||
};
|
};
|
||||||
|
if (this.CreateOilOrderForm.basicInfo.driver_driver == ''){
|
||||||
|
notify({
|
||||||
|
title: "Error",
|
||||||
|
text: "Did not add a driver",
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
this.CreateOilOrder(payload);
|
this.CreateOilOrder(payload);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
getDriversList() {
|
|
||||||
let path = import.meta.env.VITE_BASE_URL + "/employee/drivers";
|
|
||||||
axios({
|
|
||||||
method: "get",
|
|
||||||
url: path,
|
|
||||||
withCredentials: true,
|
|
||||||
headers: authHeader(),
|
|
||||||
})
|
|
||||||
.then((response: any) => {
|
|
||||||
this.truckDriversList = response.data;
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
<!-- head -->
|
<!-- head -->
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th>Ticket id</th>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>Town</th>
|
<th>Town</th>
|
||||||
@@ -39,6 +40,8 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<!-- row 1 -->
|
<!-- row 1 -->
|
||||||
<tr v-for="oil in deliveries" :key="oil['id']"> <router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
|
<tr v-for="oil in deliveries" :key="oil['id']"> <router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
|
||||||
|
|
||||||
|
<td>{{ oil['id'] }}</td>
|
||||||
<td>{{ oil['customer_name'] }} </td>
|
<td>{{ oil['customer_name'] }} </td>
|
||||||
</router-link>
|
</router-link>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<Header/>
|
<Header />
|
||||||
|
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="">
|
<div class="">
|
||||||
<SideBar/>
|
<SideBar />
|
||||||
</div>
|
</div>
|
||||||
<div class=" w-full px-10 ">
|
<div class=" w-full px-10 ">
|
||||||
<div class="text-sm breadcrumbs mb-10">
|
<div class="text-sm breadcrumbs mb-10">
|
||||||
@@ -21,7 +21,8 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="grid grid-cols-1 rounded-md pb-5">
|
<div class="grid grid-cols-1 rounded-md pb-5" v-if="total_amount">
|
||||||
|
|
||||||
<div class="text-[24px]">
|
<div class="text-[24px]">
|
||||||
Finalize Oil Order # {{ deliveryOrder.id }}
|
Finalize Oil Order # {{ deliveryOrder.id }}
|
||||||
</div>
|
</div>
|
||||||
@@ -75,7 +76,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-span-6 ">
|
<div class="col-span-6 ">
|
||||||
<div class="flex justify-end" v-if="deliveryOrder.id ">
|
<div class="flex justify-end" v-if="deliveryOrder.id">
|
||||||
<router-link :to="{ name: 'deliveryEdit', params: { id: deliveryOrder.id } }">
|
<router-link :to="{ name: 'deliveryEdit', params: { id: deliveryOrder.id } }">
|
||||||
<button class="btn">Edit Order</button>
|
<button class="btn">Edit Order</button>
|
||||||
</router-link>
|
</router-link>
|
||||||
@@ -96,12 +97,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-span-12">
|
<div class="col-span-12">
|
||||||
<div v-if="deliveryOrder.delivery_status == 0">waiting</div>
|
<div v-if="deliveryOrder.delivery_status == 0">waiting</div>
|
||||||
<div v-else-if="deliveryOrder.delivery_status == 1">delivered</div>
|
<div v-else-if="deliveryOrder.delivery_status == 1">delivered</div>
|
||||||
<div v-else-if="deliveryOrder.delivery_status == 2">Out for Delivery</div>
|
<div v-else-if="deliveryOrder.delivery_status == 2">Out for Delivery</div>
|
||||||
<div v-else-if="deliveryOrder.delivery_status == 3">Cancelled</div>
|
<div v-else-if="deliveryOrder.delivery_status == 3">Cancelled</div>
|
||||||
<div v-else-if="deliveryOrder.delivery_status == 4">Partial Delivery</div>
|
<div v-else-if="deliveryOrder.delivery_status == 4">Partial Delivery</div>
|
||||||
<div v-else-if="deliveryOrder.delivery_status == 5">misdelivery</div>
|
<div v-else-if="deliveryOrder.delivery_status == 5">misdelivery</div>
|
||||||
<div v-else-if="deliveryOrder.delivery_status == 6">unknown</div>
|
<div v-else-if="deliveryOrder.delivery_status == 6">unknown</div>
|
||||||
<div v-else></div>
|
<div v-else></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-span-12 font-bold mt-5">
|
<div class="col-span-12 font-bold mt-5">
|
||||||
@@ -132,22 +133,22 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="grid grid-cols-12 bg-neutral p-5">
|
<div class="grid grid-cols-12 bg-neutral p-5">
|
||||||
<div class="col-span-12 font-bold">
|
<div class="col-span-12 font-bold">
|
||||||
<div v-if="deliveryOrder.customer_asked_for_fill==1">Fill</div>
|
<div v-if="deliveryOrder.customer_asked_for_fill == 1">Fill</div>
|
||||||
<div v-else>Gallons delivered: {{ deliveryOrder.gallons_delivered }}</div>
|
<div v-else>Gallons delivered: {{ deliveryOrder.gallons_delivered }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-span-12 font-bold">
|
<div class="col-span-12 font-bold">
|
||||||
<div v-if="deliveryOrder.prime==1">
|
<div v-if="deliveryOrder.prime == 1">
|
||||||
Prime Required: Yes
|
Prime Required: Yes
|
||||||
</div>
|
</div>
|
||||||
<div v-if="deliveryOrder.prime==0">
|
<div v-if="deliveryOrder.prime == 0">
|
||||||
Prime Required: No
|
Prime Required: No
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-span-12 font-bold">
|
<div class="col-span-12 font-bold">
|
||||||
<div v-if="deliveryOrder.same_day==1">
|
<div v-if="deliveryOrder.same_day == 1">
|
||||||
Same Day: Yes
|
Same Day: Yes
|
||||||
</div>
|
</div>
|
||||||
<div v-if="deliveryOrder.same_day==0">
|
<div v-if="deliveryOrder.same_day == 0">
|
||||||
Same Day: No
|
Same Day: No
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -160,12 +161,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="grid grid-cols-12 bg-neutral p-2">
|
<div class="grid grid-cols-12 bg-neutral p-2">
|
||||||
<div class="col-span-12 font-bold">
|
<div class="col-span-12 font-bold">
|
||||||
<div v-if="deliveryOrder.payment_type==0">Cash</div>
|
<div v-if="deliveryOrder.payment_type == 0">Cash</div>
|
||||||
<div v-else-if="deliveryOrder.payment_type==1">Credit Card</div>
|
<div v-else-if="deliveryOrder.payment_type == 1">Credit Card</div>
|
||||||
<div v-else-if="deliveryOrder.payment_type==2">Credit Card & cash</div>
|
<div v-else-if="deliveryOrder.payment_type == 2">Credit Card & cash</div>
|
||||||
<div v-else>No Payment Type Added</div>
|
<div v-else>No Payment Type Added</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-span-12" v-if="deliveryOrder.payment_type==1">
|
<div class="col-span-12" v-if="deliveryOrder.payment_type == 1">
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="basis-1/3 p-2">
|
<div class="basis-1/3 p-2">
|
||||||
<div class="bg-neutral rounded-md border-2 ">
|
<div class="bg-neutral rounded-md border-2 ">
|
||||||
@@ -176,7 +177,7 @@
|
|||||||
{{ userCard.name_on_card }}
|
{{ userCard.name_on_card }}
|
||||||
</div>
|
</div>
|
||||||
<div class="flex p-1 pl-4">
|
<div class="flex p-1 pl-4">
|
||||||
****-****-****-{{ userCard.last_four_digits }}
|
{{ userCard.card_number }}
|
||||||
</div>
|
</div>
|
||||||
<div class="flex p-1 pl-4">
|
<div class="flex p-1 pl-4">
|
||||||
{{ userCard.expiration_month }}/ {{ userCard.expiration_year }}
|
{{ userCard.expiration_month }}/ {{ userCard.expiration_year }}
|
||||||
@@ -186,18 +187,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-span-12" v-if="deliveryOrder.payment_type==2">
|
<div class="col-span-12" v-if="deliveryOrder.payment_type == 2">
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="basis-1/3 p-2">
|
<div class="basis-1/3 p-2">
|
||||||
<div class="bg-neutral rounded-md border-2 ">
|
<div class="bg-neutral rounded-md border-2 ">
|
||||||
<div class="flex p-3">
|
<div class="flex p-3">
|
||||||
{{ userCard.type_of_card }}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="flex p-1 pl-4">
|
<div class="flex p-1 pl-4">
|
||||||
{{ userCard.name_on_card }}
|
{{ userCard.name_on_card }}
|
||||||
</div>
|
</div>
|
||||||
<div class="flex p-1 pl-4">
|
<div class="flex p-1 pl-4">
|
||||||
****-****-****-{{ userCard.last_four_digits }}
|
{{ userCard.card_number }}
|
||||||
</div>
|
</div>
|
||||||
<div class="flex p-1 pl-4">
|
<div class="flex p-1 pl-4">
|
||||||
{{ userCard.expiration_month }}/ {{ userCard.expiration_year }}
|
{{ userCard.expiration_month }}/ {{ userCard.expiration_year }}
|
||||||
@@ -206,68 +207,69 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-span-12 ">Total {{deliveryMoney.total_amount}}</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-span-6 mt-5">
|
<div class="col-span-6 mt-5">
|
||||||
<div class="col-span-12 font-bold">
|
<div class="col-span-12 font-bold">
|
||||||
Change Details
|
<div class="grid grid-cols-12 mb-5 bg-neutral">
|
||||||
</div>
|
<div class="col-span-12 py-3">Price / Gallon: {{ deliveryOrder.customer_price }}</div>
|
||||||
<form class="rounded-md bg-neutral " enctype="multipart/form-data" @submit.prevent="onSubmit">
|
<div class="col-span-12 py-3">
|
||||||
<div class="grid grid-cols-12 p-5">
|
<div v-if="deliveryOrder.customer_asked_for_fill == 1"> Gallons Ordered: FILL (250)</div>
|
||||||
|
<div v-else> Gallons Ordered: {{ deliveryOrder.gallons_ordered }}</div>
|
||||||
<div class="col-span-12 mb-5 md:mb-0 gap-10 ">
|
|
||||||
|
|
||||||
<label class="block text-white text-sm font-bold mb-2">Gallons Ordered</label>
|
|
||||||
<input v-model="CreateOilOrderForm.basicInfo.gallons_delivered"
|
|
||||||
class="input input-bordered w-full max-w-xs"
|
|
||||||
id="title" type="text" placeholder="# gallons"/>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-span-12mb-5 md:mb-0 gap-10">
|
<div class="col-span-12 py-3" v-if="deliveryOrder.prime == 1">
|
||||||
<label class="block text-white text-sm font-bold cursor-pointer label">Prime</label>
|
Prime Fee: {{ pricing.price_prime }}
|
||||||
<input v-model="CreateOilOrderForm.basicInfo.prime"
|
|
||||||
class="checkbox"
|
|
||||||
id="prime"
|
|
||||||
type="checkbox"/>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-span-12 py-3" v-if="deliveryOrder.same_day == 1">
|
||||||
|
Same Day: {{ pricing.price_same_day }}
|
||||||
<div class="col-span-12 mb-5 md:mb-0 gap-10">
|
|
||||||
<label class="block text-white text-sm font-bold cursor-pointer label">Same Day </label>
|
|
||||||
<input v-model="CreateOilOrderForm.basicInfo.same_day"
|
|
||||||
class="checkbox"
|
|
||||||
id="same_day"
|
|
||||||
type="checkbox"/>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-span-12 font-bold py-5 text-lg" v-if="deliveryOrder.payment_type == 0">
|
||||||
<div class="col-span-12 md:col-span-12 flex mt-5 mb-5">
|
<div class="">
|
||||||
<button
|
CASH Total: ${{ total_amount }}
|
||||||
class="btn">
|
</div>
|
||||||
Finalize Delivery
|
</div>
|
||||||
</button>
|
<div class="col-span-12 font-bold py-5 text-lg text-primary" v-if="deliveryOrder.payment_type == 1">
|
||||||
|
<div class="">
|
||||||
|
Pre Charge Credit Card Total: ${{ total_amount }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-span-12 font-bold py-5 text-lg text-primary" v-if="deliveryOrder.payment_type == 2">
|
||||||
|
<div class="">
|
||||||
|
Pre Charge Credit Card Total: ${{ total_amount }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<form class="rounded-md bg-neutral" enctype="multipart/form-data" @submit.prevent="onSubmit">
|
||||||
|
<div class="grid grid-cols-12 p-5">
|
||||||
|
|
||||||
|
<div class="col-span-12 md:col-span-12 flex mt-5 mb-5">
|
||||||
|
<button class="btn">
|
||||||
|
Finalize Delivery
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Footer/>
|
<Footer />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {defineComponent} from 'vue'
|
import { defineComponent } from 'vue'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import authHeader from '../../../services/auth.header'
|
import authHeader from '../../../services/auth.header'
|
||||||
import Header from '../../../layouts/headers/headerauth.vue'
|
import Header from '../../../layouts/headers/headerauth.vue'
|
||||||
import SideBar from '../../../layouts/sidebar/sidebar.vue'
|
import SideBar from '../../../layouts/sidebar/sidebar.vue'
|
||||||
import Footer from '../../../layouts/footers/footer.vue'
|
import Footer from '../../../layouts/footers/footer.vue'
|
||||||
import useValidate from "@vuelidate/core";
|
import useValidate from "@vuelidate/core";
|
||||||
import {notify} from "@kyvg/vue3-notification"
|
import { notify } from "@kyvg/vue3-notification"
|
||||||
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
@@ -282,6 +284,7 @@ export default defineComponent({
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
v$: useValidate(),
|
v$: useValidate(),
|
||||||
|
loaded: false,
|
||||||
user: {
|
user: {
|
||||||
id: 0
|
id: 0
|
||||||
},
|
},
|
||||||
@@ -364,7 +367,19 @@ export default defineComponent({
|
|||||||
driver_employee_id: 0,
|
driver_employee_id: 0,
|
||||||
driver_first_name: '',
|
driver_first_name: '',
|
||||||
driver_last_name: '',
|
driver_last_name: '',
|
||||||
|
total_price: 0,
|
||||||
},
|
},
|
||||||
|
pricing: {
|
||||||
|
price_from_supplier: 0,
|
||||||
|
price_for_customer: 0,
|
||||||
|
price_for_employee: 0,
|
||||||
|
price_same_day: 0,
|
||||||
|
price_prime: 0,
|
||||||
|
date: "",
|
||||||
|
},
|
||||||
|
priceprime: 0,
|
||||||
|
pricesameday: 0,
|
||||||
|
total_amount: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -373,14 +388,16 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
$route() {
|
$route() {
|
||||||
|
this.sumdelivery(this.$route.params.id);
|
||||||
this.getOilOrder(this.$route.params.id);
|
this.getOilOrder(this.$route.params.id);
|
||||||
this.getOilOrderMoney(this.$route.params.id);
|
this.getOilPricing();
|
||||||
this.get_delivery_amount(this.$route.params.id);
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.sumdelivery(this.$route.params.id);
|
||||||
this.getOilOrder(this.$route.params.id);
|
this.getOilOrder(this.$route.params.id);
|
||||||
this.getOilOrderMoney(this.$route.params.id);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@@ -392,14 +409,14 @@ export default defineComponent({
|
|||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
headers: authHeader(),
|
headers: authHeader(),
|
||||||
})
|
})
|
||||||
.then((response: any) => {
|
.then((response: any) => {
|
||||||
if (response.data.ok) {
|
if (response.data.ok) {
|
||||||
this.user = response.data.user;
|
this.user = response.data.user;
|
||||||
this.user.id = response.data.user_id;
|
this.user.id = response.data.user_id;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getOilOrder(delivery_id: any) {
|
getOilOrder(delivery_id: any) {
|
||||||
let path = import.meta.env.VITE_BASE_URL + "/delivery/order/" + delivery_id;
|
let path = import.meta.env.VITE_BASE_URL + "/delivery/order/" + delivery_id;
|
||||||
axios({
|
axios({
|
||||||
method: "get",
|
method: "get",
|
||||||
@@ -407,41 +424,28 @@ export default defineComponent({
|
|||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
headers: authHeader(),
|
headers: authHeader(),
|
||||||
})
|
})
|
||||||
.then((response: any) => {
|
.then((response: any) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.deliveryOrder = response.data
|
this.deliveryOrder = response.data
|
||||||
this.getCustomer(this.deliveryOrder.customer_id)
|
this.getCustomer(this.deliveryOrder.customer_id)
|
||||||
|
|
||||||
if (this.deliveryOrder.payment_type == 1) {
|
|
||||||
this.getPaymentCard(this.deliveryOrder.payment_card_id);
|
|
||||||
}
|
|
||||||
if (response.data.prime == 1) {
|
|
||||||
this.CreateOilOrderForm.basicInfo.prime = true
|
|
||||||
}
|
|
||||||
if (response.data.same_day == 1) {
|
|
||||||
this.CreateOilOrderForm.basicInfo.same_day = true
|
|
||||||
}
|
|
||||||
|
|
||||||
this.CreateOilOrderForm.basicInfo.gallons_delivered = response.data.gallons_delivered;
|
|
||||||
|
|
||||||
|
if (this.deliveryOrder.payment_type == 1) {
|
||||||
|
this.getPaymentCard(this.deliveryOrder.payment_card_id);
|
||||||
}
|
}
|
||||||
})
|
if (response.data.prime == 1) {
|
||||||
|
this.CreateOilOrderForm.basicInfo.prime = true
|
||||||
|
}
|
||||||
|
if (response.data.same_day == 1) {
|
||||||
|
this.CreateOilOrderForm.basicInfo.same_day = true
|
||||||
|
}
|
||||||
|
|
||||||
|
this.CreateOilOrderForm.basicInfo.gallons_delivered = response.data.gallons_delivered;
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
get_delivery_amount(delivery_id: any) {
|
|
||||||
let path = import.meta.env.VITE_BASE_URL + "/delivery/amount/" + delivery_id;
|
|
||||||
axios({
|
|
||||||
method: "get",
|
|
||||||
url: path,
|
|
||||||
withCredentials: true,
|
|
||||||
headers: authHeader(),
|
|
||||||
})
|
|
||||||
.then((response: any) => {
|
|
||||||
if (response.data) {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getCustomer(user_id: any) {
|
getCustomer(user_id: any) {
|
||||||
let path = import.meta.env.VITE_BASE_URL + "/customer/" + user_id;
|
let path = import.meta.env.VITE_BASE_URL + "/customer/" + user_id;
|
||||||
axios({
|
axios({
|
||||||
@@ -449,16 +453,16 @@ export default defineComponent({
|
|||||||
url: path,
|
url: path,
|
||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
})
|
})
|
||||||
.then((response: any) => {
|
.then((response: any) => {
|
||||||
this.customer = response.data;
|
this.customer = response.data;
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
notify({
|
notify({
|
||||||
title: "Error",
|
title: "Error",
|
||||||
text: "Could not find customer",
|
text: "Could not find customer",
|
||||||
type: "error",
|
type: "error",
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
getPaymentCard(card_id: any) {
|
getPaymentCard(card_id: any) {
|
||||||
let path = import.meta.env.VITE_BASE_URL + "/payment/card/" + card_id;
|
let path = import.meta.env.VITE_BASE_URL + "/payment/card/" + card_id;
|
||||||
@@ -467,27 +471,57 @@ export default defineComponent({
|
|||||||
url: path,
|
url: path,
|
||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
})
|
})
|
||||||
.then((response: any) => {
|
.then((response: any) => {
|
||||||
this.userCard = response.data;
|
this.userCard = response.data;
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getOilPricing() {
|
||||||
getOilOrderMoney(delivery_id: any) {
|
let path = import.meta.env.VITE_BASE_URL + "/info/price/oil/table";
|
||||||
let path = import.meta.env.VITE_BASE_URL + "/delivery/order/money/" + delivery_id;
|
|
||||||
axios({
|
axios({
|
||||||
method: "get",
|
method: "get",
|
||||||
url: path,
|
url: path,
|
||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
headers: authHeader(),
|
|
||||||
})
|
})
|
||||||
.then((response: any) => {
|
.then((response: any) => {
|
||||||
if (response.data) {
|
this.pricing = response.data;
|
||||||
this.deliveryMoney = response.data
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
.catch(() => {
|
||||||
|
notify({
|
||||||
|
title: "Error",
|
||||||
|
text: "Could not get oil pricing",
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
sumdelivery(delivery_id: any) {
|
||||||
|
let path = import.meta.env.VITE_BASE_URL + "/delivery/total/" + delivery_id;
|
||||||
|
axios({
|
||||||
|
method: "get",
|
||||||
|
url: path,
|
||||||
|
withCredentials: true,
|
||||||
|
})
|
||||||
|
.then((response: any) => {
|
||||||
|
if (response.data.ok){
|
||||||
|
this.priceprime = response.data.priceprime;
|
||||||
|
this.pricesameday = response.data.pricesameday;
|
||||||
|
this.total_amount = response.data.total_amount;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
notify({
|
||||||
|
title: "Error",
|
||||||
|
text: "Could not get oil pricing",
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
editOilOrder(payload: {
|
editOilOrder(payload: {
|
||||||
@@ -506,24 +540,24 @@ export default defineComponent({
|
|||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
headers: authHeader(),
|
headers: authHeader(),
|
||||||
})
|
})
|
||||||
.then((response: any) => {
|
.then((response: any) => {
|
||||||
if (response.data.ok) {
|
if (response.data.ok) {
|
||||||
notify({
|
notify({
|
||||||
title: "Success",
|
title: "Success",
|
||||||
text: "Ticket is finalized",
|
text: "Ticket is finalized",
|
||||||
type: "success",
|
type: "success",
|
||||||
});
|
});
|
||||||
this.$router.push({name: "deliveryTicketsMissing"});
|
this.$router.push({ name: "deliveryTicketsMissing" });
|
||||||
}
|
}
|
||||||
if (response.data.error) {
|
if (response.data.error) {
|
||||||
notify({
|
notify({
|
||||||
title: "Error",
|
title: "Error",
|
||||||
text: "Could not finalize ticket",
|
text: "Could not finalize ticket",
|
||||||
type: "error",
|
type: "error",
|
||||||
});
|
});
|
||||||
this.$router.push("deliveryTicketsMissing");
|
this.$router.push("deliveryTicketsMissing");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
|
|||||||
@@ -80,7 +80,7 @@
|
|||||||
<div class="col-span-6 ">
|
<div class="col-span-6 ">
|
||||||
<div class="flex justify-end" v-if="deliveryOrder.id ">
|
<div class="flex justify-end" v-if="deliveryOrder.id ">
|
||||||
<router-link :to="{ name: 'deliveryEdit', params: { id: deliveryOrder.id } }">
|
<router-link :to="{ name: 'deliveryEdit', params: { id: deliveryOrder.id } }">
|
||||||
<button class="btn">Edit Order</button>
|
<button class="btn btn-accent">Edit Order</button>
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,26 +1,27 @@
|
|||||||
<template>
|
<template>
|
||||||
<Header/>
|
<Header />
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="">
|
<div class="">
|
||||||
<SideBar/>
|
<SideBar />
|
||||||
</div>
|
</div>
|
||||||
<div class=" w-full px-10 ">
|
<div class=" w-full px-10 ">
|
||||||
<div class="text-sm breadcrumbs">
|
<div class="text-sm breadcrumbs pb-10">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<router-link :to="{ name: 'home' }">
|
<router-link :to="{ name: 'home' }">
|
||||||
Home
|
Home
|
||||||
</router-link>
|
</router-link>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-end">
|
|
||||||
|
<div class="flex start pb-10">Cancelled Deliveries </div>
|
||||||
|
<div class="flex justify-start pb-5">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="overflow-x-auto">
|
<div class="overflow-x-auto">
|
||||||
<div class="flex start">Cancelled Deliveries</div>
|
<div class="flex start"> </div>
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<!-- head -->
|
<!-- head -->
|
||||||
<thead>
|
<thead>
|
||||||
@@ -75,12 +76,12 @@
|
|||||||
|
|
||||||
<td class="flex gap-5">
|
<td class="flex gap-5">
|
||||||
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
|
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
|
||||||
<button class="btn">View</button>
|
<button class="btn btn-accent">View</button>
|
||||||
</router-link>
|
</router-link>
|
||||||
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
|
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
|
||||||
<button class="btn">Edit</button>
|
<button class="btn btn-accent">Edit</button>
|
||||||
</router-link>
|
</router-link>
|
||||||
<button @click.prevent="deleteCall(oil['id'])" class="btn">Delete</button>
|
<button @click.prevent="deleteCall(oil['id'])" class="btn btn-accent">Delete</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -1,26 +1,27 @@
|
|||||||
<template>
|
<template>
|
||||||
<Header/>
|
<Header />
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="">
|
<div class="">
|
||||||
<SideBar/>
|
<SideBar />
|
||||||
</div>
|
</div>
|
||||||
<div class=" w-full px-10 ">
|
<div class=" w-full px-10 ">
|
||||||
<div class="text-sm breadcrumbs">
|
<div class="text-sm breadcrumbs pb-10">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<router-link :to="{ name: 'home' }">
|
<router-link :to="{ name: 'home' }">
|
||||||
Home
|
Home
|
||||||
</router-link>
|
</router-link>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-end">
|
|
||||||
|
<div class="flex start pb-10">Delivered Deliveries </div>
|
||||||
|
<div class="flex justify-start pb-5">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="overflow-x-auto">
|
<div class="overflow-x-auto">
|
||||||
<div class="flex start">Delivered Deliveries</div>
|
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<!-- head -->
|
<!-- head -->
|
||||||
<thead>
|
<thead>
|
||||||
@@ -38,7 +39,8 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<!-- row 1 -->
|
<!-- row 1 -->
|
||||||
<tr v-for="oil in deliveries" :key="oil['id']"> <router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
|
<tr v-for="oil in deliveries" :key="oil['id']">
|
||||||
|
<router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
|
||||||
<td>{{ oil['customer_name'] }} </td>
|
<td>{{ oil['customer_name'] }} </td>
|
||||||
</router-link>
|
</router-link>
|
||||||
<td>
|
<td>
|
||||||
@@ -72,13 +74,9 @@
|
|||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="flex gap-5">
|
<td class="flex gap-5">
|
||||||
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
|
<router-link :to="{ name: 'finalizeTicket', params: { id: oil['id'] } }">
|
||||||
<button class="btn">View</button>
|
<button class="btn btn-accent">Finalize</button>
|
||||||
</router-link>
|
</router-link>
|
||||||
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
|
|
||||||
<button class="btn">Edit</button>
|
|
||||||
</router-link>
|
|
||||||
<button @click.prevent="deleteCall(oil['id'])" class="btn">Delete</button>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -160,6 +158,7 @@ export default defineComponent({
|
|||||||
this.user = null
|
this.user = null
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
get_oil_orders(page: any) {
|
get_oil_orders(page: any) {
|
||||||
let path = import.meta.env.VITE_BASE_URL + '/delivery/delivered/' + page;
|
let path = import.meta.env.VITE_BASE_URL + '/delivery/delivered/' + page;
|
||||||
axios({
|
axios({
|
||||||
|
|||||||
@@ -1,30 +1,32 @@
|
|||||||
<template>
|
<template>
|
||||||
<Header/>
|
<Header />
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="">
|
<div class="">
|
||||||
<SideBar/>
|
<SideBar />
|
||||||
|
</div>
|
||||||
|
<div class=" w-full px-10 ">
|
||||||
|
<div class="text-sm breadcrumbs pb-10">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<router-link :to="{ name: 'home' }">
|
||||||
|
Home
|
||||||
|
</router-link>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class=" w-full px-10 ">
|
|
||||||
<div class="text-sm breadcrumbs">
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<router-link :to="{ name: 'home' }">
|
|
||||||
Home
|
|
||||||
</router-link>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
<div class="flex start pb-10">Finalized Delivery </div>
|
||||||
</div>
|
<div class="flex justify-start pb-5">
|
||||||
<div class="flex justify-end">
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="overflow-x-auto">
|
||||||
|
|
||||||
<div class="overflow-x-auto">
|
|
||||||
<div class="flex start">Finalized Deliveries</div>
|
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<!-- head -->
|
<!-- head -->
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th>Ticket Id</th>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>Town</th>
|
<th>Town</th>
|
||||||
@@ -38,9 +40,11 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<!-- row 1 -->
|
<!-- row 1 -->
|
||||||
<tr v-for="oil in deliveries" :key="oil['id']"> <router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
|
<tr v-for="oil in deliveries" :key="oil['id']">
|
||||||
<td>{{ oil['customer_name'] }} </td>
|
<td>{{ oil['id'] }} </td>
|
||||||
</router-link>
|
<router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
|
||||||
|
<td>{{ oil['customer_name'] }} </td>
|
||||||
|
</router-link>
|
||||||
<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">delivered</div>
|
||||||
@@ -73,12 +77,12 @@
|
|||||||
|
|
||||||
<td class="flex gap-5">
|
<td class="flex gap-5">
|
||||||
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
|
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
|
||||||
<button class="btn">View</button>
|
<button class="btn btn-accent">View</button>
|
||||||
</router-link>
|
</router-link>
|
||||||
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
|
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
|
||||||
<button class="btn">Edit</button>
|
<button class="btn btn-accent">Edit</button>
|
||||||
</router-link>
|
</router-link>
|
||||||
<button @click.prevent="deleteCall(oil['id'])" class="btn">Delete</button>
|
<button @click.prevent="deleteCall(oil['id'])" class="btn btn-accent">Delete</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -1,34 +1,35 @@
|
|||||||
<template>
|
<template>
|
||||||
<Header/>
|
<Header />
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="">
|
<div class="">
|
||||||
<SideBar/>
|
<SideBar />
|
||||||
</div>
|
</div>
|
||||||
<div class=" w-full px-10 ">
|
<div class=" w-full px-10 ">
|
||||||
<div class="text-sm breadcrumbs">
|
<div class="text-sm breadcrumbs pb-10">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<router-link :to="{ name: 'home' }">
|
<router-link :to="{ name: 'home' }">
|
||||||
Home
|
Home
|
||||||
</router-link>
|
</router-link>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-end">
|
|
||||||
|
<div class="flex start pb-10">Issue with Delivery </div>
|
||||||
|
<div class="flex justify-start pb-5">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="overflow-x-auto">
|
<div class="overflow-x-auto">
|
||||||
<div class="flex start">Issue with Delivery</div>
|
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<!-- head -->
|
<!-- head -->
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th>Ticket Id</th>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>Town</th>
|
<th>Town</th>
|
||||||
|
|
||||||
<th>Address</th>
|
<th>Address</th>
|
||||||
<th>Gallons</th>
|
<th>Gallons</th>
|
||||||
<th>Date</th>
|
<th>Date</th>
|
||||||
@@ -39,8 +40,10 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<!-- row 1 -->
|
<!-- row 1 -->
|
||||||
<tr v-for="oil in deliveries" :key="oil['id']"> <router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
|
<tr v-for="oil in deliveries" :key="oil['id']">
|
||||||
<td>{{ oil['customer_name'] }} </td>
|
<td>{{ oil['id'] }} </td>
|
||||||
|
<router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
|
||||||
|
<td>{{ oil['customer_name'] }} </td>
|
||||||
</router-link>
|
</router-link>
|
||||||
<td>
|
<td>
|
||||||
<div v-if="oil['delivery_status'] == 0">Waiting</div>
|
<div v-if="oil['delivery_status'] == 0">Waiting</div>
|
||||||
@@ -75,12 +78,12 @@
|
|||||||
|
|
||||||
<td class="flex gap-5">
|
<td class="flex gap-5">
|
||||||
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
|
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
|
||||||
<button class="btn">View</button>
|
<button class="btn btn-accent">View</button>
|
||||||
</router-link>
|
</router-link>
|
||||||
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
|
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
|
||||||
<button class="btn">Edit</button>
|
<button class="btn btn-accent btn-accent">Edit</button>
|
||||||
</router-link>
|
</router-link>
|
||||||
<button @click.prevent="deleteCall(oil['id'])" class="btn">Delete</button>
|
<button @click.prevent="deleteCall(oil['id'])" class="btn btn-accent">Delete</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -1,111 +1,126 @@
|
|||||||
<template>
|
<template>
|
||||||
<Header/>
|
<Header />
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="">
|
<div class="">
|
||||||
<SideBar/>
|
<SideBar />
|
||||||
</div>
|
</div>
|
||||||
<div class=" w-full px-10 ">
|
<div class=" w-full px-10 ">
|
||||||
<div class="text-sm breadcrumbs">
|
<div class="text-sm breadcrumbs pb-10">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<router-link :to="{ name: 'home' }">
|
<router-link :to="{ name: 'home' }">
|
||||||
Home
|
Home
|
||||||
</router-link>
|
</router-link>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-end">
|
|
||||||
|
|
||||||
|
<div class="flex start pb-10">Out for Delivery </div>
|
||||||
|
<div class="flex justify-start pb-5">
|
||||||
|
<button @click.prevent="printtTicketAll" class="btn btn-accent">
|
||||||
|
Print All
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="overflow-x-auto">
|
<div class="overflow-x-auto">
|
||||||
<div class="flex start">Out for Delivery </div>
|
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<!-- head -->
|
<!-- head -->
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
|
||||||
<th>Status</th>
|
<th>Delivery Id</th>
|
||||||
<th>Town</th>
|
<th>Name</th>
|
||||||
<th>Address</th>
|
<th>Status</th>
|
||||||
<th>Gallons</th>
|
<th>Town</th>
|
||||||
<th>Date</th>
|
<th>Address</th>
|
||||||
<th>Automatic</th>
|
<th>Gallons</th>
|
||||||
<th>Prime</th>
|
<th>Date</th>
|
||||||
<th>Same Day</th>
|
<th>Automatic</th>
|
||||||
</tr>
|
<th>Prime</th>
|
||||||
|
<th>Same Day</th>
|
||||||
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<!-- row 1 -->
|
<!-- row 1 -->
|
||||||
<tr v-for="oil in deliveries" :key="oil['id']"> <router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
|
|
||||||
<td>{{ oil['customer_name'] }} </td>
|
|
||||||
</router-link>
|
|
||||||
<td>
|
|
||||||
<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'] == 2">Out for Delivery</div>
|
|
||||||
<div v-else-if="oil['delivery_status'] == 3">Cancelled</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'] == 10">Finalized</div>
|
|
||||||
<div v-else></div>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<td>{{ oil['customer_town'] }}</td>
|
<tr v-for="oil in deliveries" :key="oil['id']">
|
||||||
<td>{{ oil['customer_address'] }}</td>
|
|
||||||
<td>
|
|
||||||
<div v-if="oil['customer_asked_for_fill'] == 1">Fill</div>
|
|
||||||
<div v-else> {{ oil['gallons_ordered'] }}</div>
|
|
||||||
</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">
|
<td>{{ oil['id'] }} </td>
|
||||||
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
|
<router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
|
||||||
<button class="btn">View</button>
|
|
||||||
|
<td>{{ oil['customer_name'] }} </td>
|
||||||
</router-link>
|
</router-link>
|
||||||
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
|
<td>
|
||||||
<button class="btn">Edit</button>
|
<div v-if="oil['delivery_status'] == 0">Waiting</div>
|
||||||
</router-link>
|
<div v-else-if="oil['delivery_status'] == 1">delivered</div>
|
||||||
<button @click.prevent="deleteCall(oil['id'])" class="btn">Delete</button>
|
<div v-else-if="oil['delivery_status'] == 2">Out for Delivery</div>
|
||||||
</td>
|
<div v-else-if="oil['delivery_status'] == 3">Cancelled</div>
|
||||||
</tr>
|
<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'] == 10">Finalized</div>
|
||||||
|
<div v-else></div>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>{{ oil['customer_town'] }}</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>
|
||||||
|
</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">View</button>
|
||||||
|
</router-link>
|
||||||
|
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
|
||||||
|
<button class="btn btn-accent">Edit</button>
|
||||||
|
</router-link>
|
||||||
|
<button @click.prevent="deleteCall(oil['id'])" class="btn btn-accent">
|
||||||
|
Delete
|
||||||
|
</button>
|
||||||
|
<button @click.prevent="printTicket(oil['id'])" class="btn btn-accent">
|
||||||
|
Print
|
||||||
|
</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-center" v-if="recordsLength > 9">
|
<div class="flex justify-center" v-if="recordsLength > 9">
|
||||||
<pagination @paginate="getPage" :records="recordsLength" v-model="page" :per-page="perPage"
|
<pagination @paginate="getPage" :records="recordsLength" v-model="page" :per-page="perPage" :options="options">
|
||||||
:options="options">
|
|
||||||
</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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Footer/>
|
<Footer />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {defineComponent} from 'vue'
|
import { defineComponent } from 'vue'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import authHeader from '../../../services/auth.header'
|
import authHeader from '../../../services/auth.header'
|
||||||
import Header from '../../../layouts/headers/headerauth.vue'
|
import Header from '../../../layouts/headers/headerauth.vue'
|
||||||
import PaginationComp from '../../../components/pagination.vue'
|
import PaginationComp from '../../../components/pagination.vue'
|
||||||
import SideBar from '../../../layouts/sidebar/sidebar.vue'
|
import SideBar from '../../../layouts/sidebar/sidebar.vue'
|
||||||
import Footer from '../../../layouts/footers/footer.vue'
|
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: 'deliveryOutForDelivery',
|
name: 'deliveryOutForDelivery',
|
||||||
@@ -131,16 +146,15 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.userStatus()
|
this.userStatus()
|
||||||
|
this.updatestatus();
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getPage(this.page)
|
this.getPage(this.page)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getPage: function (page: any) {
|
getPage: function (page: any) {
|
||||||
// we simulate an api call that fetch the records from a backend
|
|
||||||
this.deliveries = [];
|
this.deliveries = [];
|
||||||
this.get_oil_orders(page)
|
this.get_oil_orders(page)
|
||||||
},
|
},
|
||||||
@@ -152,15 +166,32 @@ export default defineComponent({
|
|||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
headers: authHeader(),
|
headers: authHeader(),
|
||||||
})
|
})
|
||||||
.then((response: any) => {
|
.then((response: any) => {
|
||||||
if (response.data.ok) {
|
if (response.data.ok) {
|
||||||
this.user = response.data.user;
|
this.user = response.data.user;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
this.user = null
|
this.user = null
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
updatestatus() {
|
||||||
|
let path = import.meta.env.VITE_BASE_URL + '/delivery/updatestatus/outfordelivery';
|
||||||
|
axios({
|
||||||
|
method: 'get',
|
||||||
|
url: path,
|
||||||
|
headers: authHeader(),
|
||||||
|
}).then((response: any) => {
|
||||||
|
if (response.data.update)
|
||||||
|
notify({
|
||||||
|
title: "Success",
|
||||||
|
text: "Updated Oil Orders",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
else { }
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
get_oil_orders(page: any) {
|
get_oil_orders(page: any) {
|
||||||
let path = import.meta.env.VITE_BASE_URL + '/delivery/outfordelivery/' + page;
|
let path = import.meta.env.VITE_BASE_URL + '/delivery/outfordelivery/' + page;
|
||||||
axios({
|
axios({
|
||||||
@@ -171,6 +202,7 @@ export default defineComponent({
|
|||||||
this.deliveries = response.data
|
this.deliveries = response.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
deleteCall(delivery_id: any) {
|
deleteCall(delivery_id: any) {
|
||||||
let path = import.meta.env.VITE_BASE_URL + '/delivery/delete/' + delivery_id;
|
let path = import.meta.env.VITE_BASE_URL + '/delivery/delete/' + delivery_id;
|
||||||
axios({
|
axios({
|
||||||
@@ -194,10 +226,55 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
printtTicketAll() {
|
||||||
|
let path = import.meta.env.VITE_PRINT_URL + '/command/printticket/all/print_today';
|
||||||
|
axios({
|
||||||
|
method: 'delete',
|
||||||
|
url: path,
|
||||||
|
headers: authHeader(),
|
||||||
|
}).then((response: any) => {
|
||||||
|
if (response.data.ok) {
|
||||||
|
notify({
|
||||||
|
title: "Success",
|
||||||
|
text: "Sent to Printer",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.getPage(this.page)
|
||||||
|
} else {
|
||||||
|
notify({
|
||||||
|
title: "Failure",
|
||||||
|
text: "error printing",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
printTicket(delivery_id: number) {
|
||||||
|
let path = import.meta.env.VITE_PRINT_URL + '/command/printticket/' + delivery_id;
|
||||||
|
axios({
|
||||||
|
method: 'delete',
|
||||||
|
url: path,
|
||||||
|
headers: authHeader(),
|
||||||
|
}).then((response: any) => {
|
||||||
|
if (response.data.ok) {
|
||||||
|
notify({
|
||||||
|
title: "Success",
|
||||||
|
text: "Sent to Printer",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.getPage(this.page)
|
||||||
|
} else {
|
||||||
|
notify({
|
||||||
|
title: "Failure",
|
||||||
|
text: "error printing",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped></style>
|
||||||
|
|
||||||
</style>
|
|
||||||
@@ -1,30 +1,34 @@
|
|||||||
<template>
|
<template>
|
||||||
<Header/>
|
<Header />
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="">
|
<div class="">
|
||||||
<SideBar/>
|
<SideBar />
|
||||||
|
</div>
|
||||||
|
<div class=" w-full px-10 ">
|
||||||
|
<div class="text-sm breadcrumbs pb-10">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<router-link :to="{ name: 'home' }">
|
||||||
|
Home
|
||||||
|
</router-link>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class=" w-full px-10 ">
|
|
||||||
<div class="text-sm breadcrumbs">
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<router-link :to="{ name: 'home' }">
|
|
||||||
Home
|
|
||||||
</router-link>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
<div class="flex start pb-10">Tommorrows Deliveries </div>
|
||||||
</div>
|
<div class="flex justify-start pb-5">
|
||||||
<div class="flex justify-end">
|
<button @click.prevent="printtTicketAll" class="btn btn-accent">
|
||||||
|
Print All
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
<div class="overflow-x-auto">
|
||||||
|
<div class="flex start"> </div>
|
||||||
<div class="overflow-x-auto">
|
<table class="table">
|
||||||
<div class="flex start">Tommorrows Deliveries </div>
|
<!-- head -->
|
||||||
<table class="table">
|
<thead>
|
||||||
<!-- head -->
|
|
||||||
<thead>
|
|
||||||
<tr>
|
<tr>
|
||||||
|
<th>Ticket Id</th>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>Town</th>
|
<th>Town</th>
|
||||||
@@ -35,13 +39,15 @@
|
|||||||
<th>Prime</th>
|
<th>Prime</th>
|
||||||
<th>Same Day</th>
|
<th>Same Day</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>{{ oil['id'] }} </td>
|
||||||
<td>{{ oil['customer_name'] }} </td>
|
<router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
|
||||||
</router-link>
|
|
||||||
|
<td>{{ oil['customer_name'] }} </td>
|
||||||
|
</router-link>
|
||||||
<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">delivered</div>
|
||||||
@@ -49,7 +55,7 @@
|
|||||||
<div v-else-if="oil['delivery_status'] == 3">Cancelled</div>
|
<div v-else-if="oil['delivery_status'] == 3">Cancelled</div>
|
||||||
<div v-else-if="oil['delivery_status'] == 4">Partial Delivery</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>
|
||||||
|
|
||||||
@@ -75,130 +81,180 @@
|
|||||||
|
|
||||||
<td class="flex gap-5">
|
<td class="flex gap-5">
|
||||||
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
|
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
|
||||||
<button class="btn">View</button>
|
<button class="btn btn-accent">View</button>
|
||||||
</router-link>
|
</router-link>
|
||||||
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
|
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
|
||||||
<button class="btn">Edit</button>
|
<button class="btn btn-accent">Edit</button>
|
||||||
</router-link>
|
</router-link>
|
||||||
<button @click.prevent="deleteCall(oil['id'])" class="btn">Delete</button>
|
<button @click.prevent="deleteCall(oil['id'])" class="btn btn-accent">
|
||||||
|
Delete
|
||||||
|
</button>
|
||||||
|
<button @click.prevent="printTicket(oil['id'])" class="btn btn-accent">
|
||||||
|
Print
|
||||||
|
</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-center" v-if="recordsLength > 9">
|
<div class="flex justify-center" v-if="recordsLength > 9">
|
||||||
<pagination @paginate="getPage" :records="recordsLength" v-model="page" :per-page="perPage"
|
<pagination @paginate="getPage" :records="recordsLength" v-model="page" :per-page="perPage" :options="options">
|
||||||
:options="options">
|
</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>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<Footer/>
|
<Footer />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {defineComponent} from 'vue'
|
import { defineComponent } from 'vue'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import authHeader from '../../../services/auth.header'
|
import authHeader from '../../../services/auth.header'
|
||||||
import Header from '../../../layouts/headers/headerauth.vue'
|
import Header from '../../../layouts/headers/headerauth.vue'
|
||||||
import PaginationComp from '../../../components/pagination.vue'
|
import PaginationComp from '../../../components/pagination.vue'
|
||||||
import SideBar from '../../../layouts/sidebar/sidebar.vue'
|
import SideBar from '../../../layouts/sidebar/sidebar.vue'
|
||||||
import Footer from '../../../layouts/footers/footer.vue'
|
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: 'deliveryOutForDelivery',
|
name: 'deliveryOutForDelivery',
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
Header,
|
Header,
|
||||||
SideBar,
|
SideBar,
|
||||||
Footer,
|
Footer,
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
token: null,
|
token: null,
|
||||||
user: null,
|
user: null,
|
||||||
deliveries: [],
|
deliveries: [],
|
||||||
page: 1,
|
page: 1,
|
||||||
perPage: 50,
|
perPage: 50,
|
||||||
recordsLength: 0,
|
recordsLength: 0,
|
||||||
options: {
|
options: {
|
||||||
edgeNavigation: false,
|
edgeNavigation: false,
|
||||||
format: false,
|
format: false,
|
||||||
template: PaginationComp
|
template: PaginationComp
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.userStatus()
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getPage(this.page)
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getPage: function (page: any) {
|
||||||
|
this.deliveries = [];
|
||||||
|
this.get_oil_orders(page)
|
||||||
},
|
},
|
||||||
|
userStatus() {
|
||||||
created() {
|
let path = import.meta.env.VITE_BASE_URL + '/auth/whoami';
|
||||||
this.userStatus()
|
axios({
|
||||||
},
|
method: 'get',
|
||||||
mounted() {
|
url: path,
|
||||||
this.getPage(this.page)
|
withCredentials: true,
|
||||||
},
|
headers: authHeader(),
|
||||||
methods: {
|
})
|
||||||
getPage: function (page: any) {
|
.then((response: any) => {
|
||||||
// we simulate an api call that fetch the records from a backend
|
|
||||||
this.deliveries = [];
|
|
||||||
this.get_oil_orders(page)
|
|
||||||
},
|
|
||||||
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_oil_orders(page: any) {
|
|
||||||
let path = import.meta.env.VITE_BASE_URL + '/delivery/outfordelivery/' + page;
|
|
||||||
axios({
|
|
||||||
method: 'get',
|
|
||||||
url: path,
|
|
||||||
headers: authHeader(),
|
|
||||||
}).then((response: any) => {
|
|
||||||
this.deliveries = response.data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
deleteCall(delivery_id: any) {
|
|
||||||
let path = import.meta.env.VITE_BASE_URL + '/delivery/delete/' + delivery_id;
|
|
||||||
axios({
|
|
||||||
method: 'delete',
|
|
||||||
url: path,
|
|
||||||
headers: authHeader(),
|
|
||||||
}).then((response: any) => {
|
|
||||||
if (response.data.ok) {
|
if (response.data.ok) {
|
||||||
notify({
|
this.user = response.data.user;
|
||||||
title: "Success",
|
|
||||||
text: "deleted oil order",
|
|
||||||
type: "success",
|
|
||||||
});
|
|
||||||
this.getPage(this.page)
|
|
||||||
} else {
|
|
||||||
notify({
|
|
||||||
title: "Failure",
|
|
||||||
text: "error deleting oil order",
|
|
||||||
type: "success",
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
.catch(() => {
|
||||||
|
this.user = null
|
||||||
|
})
|
||||||
|
},
|
||||||
|
get_oil_orders(page: any) {
|
||||||
|
let path = import.meta.env.VITE_BASE_URL + '/delivery/outfordelivery/' + page;
|
||||||
|
axios({
|
||||||
|
method: 'get',
|
||||||
|
url: path,
|
||||||
|
headers: authHeader(),
|
||||||
|
}).then((response: any) => {
|
||||||
|
this.deliveries = response.data
|
||||||
|
})
|
||||||
},
|
},
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
deleteCall(delivery_id: any) {
|
||||||
|
let path = import.meta.env.VITE_BASE_URL + '/delivery/delete/' + delivery_id;
|
||||||
|
axios({
|
||||||
|
method: 'delete',
|
||||||
|
url: path,
|
||||||
|
headers: authHeader(),
|
||||||
|
}).then((response: any) => {
|
||||||
|
if (response.data.ok) {
|
||||||
|
notify({
|
||||||
|
title: "Success",
|
||||||
|
text: "deleted oil order",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.getPage(this.page)
|
||||||
|
} else {
|
||||||
|
notify({
|
||||||
|
title: "Failure",
|
||||||
|
text: "error deleting oil order",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
</style>
|
|
||||||
|
printtTicketAll() {
|
||||||
|
let path = import.meta.env.VITE_PRINT_URL + '/command/printticket/all/print_tommorrow';
|
||||||
|
axios({
|
||||||
|
method: 'delete',
|
||||||
|
url: path,
|
||||||
|
headers: authHeader(),
|
||||||
|
}).then((response: any) => {
|
||||||
|
if (response.data.ok) {
|
||||||
|
notify({
|
||||||
|
title: "Success",
|
||||||
|
text: "Sent to Printer",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.getPage(this.page)
|
||||||
|
} else {
|
||||||
|
notify({
|
||||||
|
title: "Failure",
|
||||||
|
text: "error printing",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
printTicket(delivery_id: number) {
|
||||||
|
let path = import.meta.env.VITE_PRINT_URL + '/command/printticket/' + delivery_id;
|
||||||
|
axios({
|
||||||
|
method: 'delete',
|
||||||
|
url: path,
|
||||||
|
headers: authHeader(),
|
||||||
|
}).then((response: any) => {
|
||||||
|
if (response.data.ok) {
|
||||||
|
notify({
|
||||||
|
title: "Success",
|
||||||
|
text: "Sent to Printer",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.getPage(this.page)
|
||||||
|
} else {
|
||||||
|
notify({
|
||||||
|
title: "Failure",
|
||||||
|
text: "error printing",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|||||||
@@ -1,34 +1,36 @@
|
|||||||
<template>
|
<template>
|
||||||
<Header/>
|
<Header />
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="">
|
<div class="">
|
||||||
<SideBar/>
|
<SideBar />
|
||||||
</div>
|
</div>
|
||||||
<div class=" w-full px-10 ">
|
<div class=" w-full px-10 ">
|
||||||
<div class="text-sm breadcrumbs">
|
<div class="text-sm breadcrumbs pb-10">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<router-link :to="{ name: 'home' }">
|
<router-link :to="{ name: 'home' }">
|
||||||
Home
|
Home
|
||||||
</router-link>
|
</router-link>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-end">
|
|
||||||
|
|
||||||
|
<div class="flex start pb-10">Waiting Deliveries </div>
|
||||||
|
<div class="flex justify-start pb-5">
|
||||||
|
<button @click.prevent="printtTicketAll" class="btn btn-accent">
|
||||||
|
Print All
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="overflow-x-auto">
|
<div class="overflow-x-auto">
|
||||||
<div class="flex start">Waiting Deliveries</div>
|
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<!-- head -->
|
<!-- head -->
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th>Ticket Id</th>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>Town</th>
|
<th>Town</th>
|
||||||
|
|
||||||
<th>Address</th>
|
<th>Address</th>
|
||||||
<th>Gallons</th>
|
<th>Gallons</th>
|
||||||
<th>Date</th>
|
<th>Date</th>
|
||||||
@@ -39,8 +41,10 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<!-- row 1 -->
|
<!-- row 1 -->
|
||||||
<tr v-for="oil in deliveries" :key="oil['id']"> <router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
|
<tr v-for="oil in deliveries" :key="oil['id']">
|
||||||
<td>{{ oil['customer_name'] }} </td>
|
<td>{{ oil['id'] }} </td>
|
||||||
|
<router-link :to="{ name: 'customerProfile', params: { id: oil['customer_id'] } }">
|
||||||
|
<td>{{ oil['customer_name'] }} </td>
|
||||||
</router-link>
|
</router-link>
|
||||||
<td>
|
<td>
|
||||||
<div v-if="oil['delivery_status'] == 0">Waiting</div>
|
<div v-if="oil['delivery_status'] == 0">Waiting</div>
|
||||||
@@ -75,12 +79,13 @@
|
|||||||
|
|
||||||
<td class="flex gap-5">
|
<td class="flex gap-5">
|
||||||
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
|
<router-link :to="{ name: 'deliveryOrder', params: { id: oil['id'] } }">
|
||||||
<button class="btn">View</button>
|
<button class="btn btn-accent">View</button>
|
||||||
</router-link>
|
</router-link>
|
||||||
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
|
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
|
||||||
<button class="btn">Edit</button>
|
<button class="btn btn-accent">Edit</button>
|
||||||
</router-link>
|
</router-link>
|
||||||
<button @click.prevent="deleteCall(oil['id'])" class="btn">Delete</button>
|
<button @click.prevent="deleteCall(oil['id'])" class="btn btn-accent">Delete</button>
|
||||||
|
<button @click.prevent="printTicket(oil['id'])" class="btn btn-accent">Print</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -195,6 +200,53 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
printtTicketAll() {
|
||||||
|
let path = import.meta.env.VITE_PRINT_URL + '/command/printticket/all/print_waiting';
|
||||||
|
axios({
|
||||||
|
method: 'delete',
|
||||||
|
url: path,
|
||||||
|
headers: authHeader(),
|
||||||
|
}).then((response: any) => {
|
||||||
|
if (response.data.ok) {
|
||||||
|
notify({
|
||||||
|
title: "Success",
|
||||||
|
text: "Sent to Printer",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.getPage(this.page)
|
||||||
|
} else {
|
||||||
|
notify({
|
||||||
|
title: "Failure",
|
||||||
|
text: "error printing",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
printTicket(delivery_id: number) {
|
||||||
|
let path = import.meta.env.VITE_PRINT_URL + '/command/printticket/' + delivery_id;
|
||||||
|
axios({
|
||||||
|
method: 'delete',
|
||||||
|
url: path,
|
||||||
|
headers: authHeader(),
|
||||||
|
}).then((response: any) => {
|
||||||
|
if (response.data.ok) {
|
||||||
|
notify({
|
||||||
|
title: "Success",
|
||||||
|
text: "Sent to Printer",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.getPage(this.page)
|
||||||
|
} else {
|
||||||
|
notify({
|
||||||
|
title: "Failure",
|
||||||
|
text: "error printing",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex justify-end">
|
<div class="flex justify-end">
|
||||||
<router-link :to="{ name: 'employeeCreate' }">
|
<router-link :to="{ name: 'employeeCreate' }">
|
||||||
<button class="btn">Create Employee</button>
|
<button class="btn btn-accent">Create Employee</button>
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -30,6 +30,7 @@
|
|||||||
<!-- head -->
|
<!-- head -->
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Type</th>
|
<th>Type</th>
|
||||||
<th>Town</th>
|
<th>Town</th>
|
||||||
@@ -42,7 +43,6 @@
|
|||||||
<tr v-for="person in employees" :key="person['id']">
|
<tr v-for="person in employees" :key="person['id']">
|
||||||
|
|
||||||
<td>{{ person['employee_first_name'] }} {{ person['employee_last_name'] }}</td>
|
<td>{{ person['employee_first_name'] }} {{ person['employee_last_name'] }}</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<div v-if="person['employee_type'] == 0">Owner</div>
|
<div v-if="person['employee_type'] == 0">Owner</div>
|
||||||
<div v-else-if="person['employee_type'] == 1">Manager</div>
|
<div v-else-if="person['employee_type'] == 1">Manager</div>
|
||||||
@@ -54,7 +54,6 @@
|
|||||||
<div v-else-if="person['employee_type'] == 7">Cash</div>
|
<div v-else-if="person['employee_type'] == 7">Cash</div>
|
||||||
<div v-else-if="person['employee_type'] == 8">Driver/Tech</div>
|
<div v-else-if="person['employee_type'] == 8">Driver/Tech</div>
|
||||||
<div v-else></div>
|
<div v-else></div>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>{{ person['employee_town'] }}</td>
|
<td>{{ person['employee_town'] }}</td>
|
||||||
@@ -62,10 +61,10 @@
|
|||||||
<td>{{ person['employee_phone_number'] }}</td>
|
<td>{{ person['employee_phone_number'] }}</td>
|
||||||
<td class="flex gap-5">
|
<td class="flex gap-5">
|
||||||
<router-link :to="{ name: 'employeeEdit', params: { id: person['id'] } }">
|
<router-link :to="{ name: 'employeeEdit', params: { id: person['id'] } }">
|
||||||
<button class="btn">Edit</button>
|
<button class="btn btn-accent">Edit</button>
|
||||||
</router-link>
|
</router-link>
|
||||||
<router-link :to="{ name: 'employeeProfile', params: { id: person['id'] } }">
|
<router-link :to="{ name: 'employeeProfile', params: { id: person['id'] } }">
|
||||||
<button class="btn">View</button>
|
<button class="btn btn-accent">View</button>
|
||||||
</router-link>
|
</router-link>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<Header/>
|
<Header />
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="">
|
<div class="">
|
||||||
<SideBar/>
|
<SideBar />
|
||||||
</div>
|
</div>
|
||||||
<div class=" w-full px-10">
|
<div class=" w-full px-10">
|
||||||
<div class="text-sm breadcrumbs">
|
<div class="text-sm breadcrumbs">
|
||||||
@@ -18,15 +18,15 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="grid grid-cols-1 rounded-md p-6 mb-5">
|
<div class="grid grid-cols-1 rounded-md p-6 mb-5" v-if="loaded">
|
||||||
<div class=" col-span-12 text-[24px]">
|
<div class=" col-span-12 text-[24px]">
|
||||||
Confirm Payment Oil Delivery {{ delivery.id }}
|
Confirm Payment Oil Delivery {{ delivery.id }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="grid grid-cols-12 bg-neutral mb-5">
|
<div class="grid grid-cols-12 bg-neutral mb-5">
|
||||||
|
<div class="col-span-12 font-bold flex pb-5 text-lg">
|
||||||
<div class="col-span-12 font-bold flex pb-5 text-lg">{{ customer.account_number }}</div>
|
{{ customer.account_number }}
|
||||||
|
</div>
|
||||||
<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 }}
|
||||||
@@ -75,12 +75,12 @@
|
|||||||
<div class="col-span-12 ">
|
<div class="col-span-12 ">
|
||||||
<div class="grid grid-cols-12 mb-5 bg-neutral">
|
<div class="grid grid-cols-12 mb-5 bg-neutral">
|
||||||
<div class="col-span-12 py-3">
|
<div class="col-span-12 py-3">
|
||||||
<div v-if="delivery.delivery_status == 0"> Delivery Status: Waiting</div>
|
<div v-if="delivery.delivery_status == 0"> Delivery Status: Waiting</div>
|
||||||
<div v-else-if="delivery.delivery_status == 1">Delivery Status: delivered</div>
|
<div v-else-if="delivery.delivery_status == 1">Delivery Status: delivered</div>
|
||||||
<div v-else-if="delivery.delivery_status == 2">Delivery Status: Out for Delivery</div>
|
<div v-else-if="delivery.delivery_status == 2">Delivery Status: Out for Delivery</div>
|
||||||
<div v-else-if="delivery.delivery_status == 3">Delivery Status: Cancelled</div>
|
<div v-else-if="delivery.delivery_status == 3">Delivery Status: Cancelled</div>
|
||||||
<div v-else-if="delivery.delivery_status == 4">Delivery Status: Partial Delivery</div>
|
<div v-else-if="delivery.delivery_status == 4">Delivery Status: Partial Delivery</div>
|
||||||
<div v-else-if="delivery.delivery_status == 5">Delivery Status: Issue</div>
|
<div v-else-if="delivery.delivery_status == 5">Delivery Status: Issue</div>
|
||||||
<div v-else></div>
|
<div v-else></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -141,43 +141,66 @@
|
|||||||
<div v-else> Gallons Ordered: {{ delivery.gallons_ordered }}</div>
|
<div v-else> Gallons Ordered: {{ delivery.gallons_ordered }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-span-12 py-3" v-if="delivery.prime == 1">
|
<div class="col-span-12 py-3" v-if="delivery.prime == 1">
|
||||||
Prime Fee: {{ delivery.prime }}
|
Prime Fee: {{ pricing.price_prime }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-span-12 py-3" v-if="delivery.same_day == 1">
|
<div class="col-span-12 py-3" v-if="delivery.same_day == 1">
|
||||||
Same Day: {{ delivery.same_day }}
|
Same Day: {{ pricing.price_same_day }}
|
||||||
|
</div>
|
||||||
|
<div class="col-span-12 font-bold py-5 text-lg" v-if="delivery.payment_type == 0">
|
||||||
|
<div class="">
|
||||||
|
CASH Total: ${{ total_amount }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-span-12 font-bold py-5 text-lg text-primary" v-if="delivery.payment_type == 1">
|
||||||
|
<div class="">
|
||||||
|
Pre Charge Credit Card Total: ${{ total_amount }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-span-12 font-bold py-5 text-lg text-primary" v-if="delivery.payment_type == 2">
|
||||||
|
<div class="">
|
||||||
|
Pre Charge Credit Card Total: ${{ total_amount }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-span-12 font-bold py-5 text-lg">Total: {{ delivery.total_price }}</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-between">
|
<div class="flex justify-between">
|
||||||
<!-- <button class="btn" @click="checkoutOilCreditStripe()">-->
|
<!-- <button class="btn" @click="checkoutOilCreditStripe()">-->
|
||||||
<!-- Pay Credit Card (Stripe)-->
|
<!-- Pay Credit Card (Stripe)-->
|
||||||
<!-- </button>-->
|
<!-- </button>-->
|
||||||
<button class="btn" @click="checkoutOilUpdatePayment(0)">
|
<div class="" v-if="delivery.payment_type == 0">
|
||||||
Cash Payment
|
<button class="btn btn-primary" @click="checkoutOilUpdatePayment(0)">
|
||||||
</button>
|
Cash Payment
|
||||||
<button class="btn" @click="checkoutOilUpdatePayment(1)">
|
</button>
|
||||||
Pay Credit Terminal
|
</div>
|
||||||
</button>
|
<div class="" v-if="delivery.payment_type == 1">
|
||||||
|
<button class="btn btn-accent" @click="checkoutOilUpdatePayment(1)">
|
||||||
|
Pay Credit Terminal
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="" v-if="delivery.payment_type == 2">
|
||||||
|
Cash +
|
||||||
|
<button class="btn btn-accent" @click="checkoutOilUpdatePayment(3)">
|
||||||
|
Pay Credit Terminal
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Footer/>
|
<Footer />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {defineComponent} from 'vue'
|
import { defineComponent } from 'vue'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import authHeader from '../../services/auth.header'
|
import authHeader from '../../services/auth.header'
|
||||||
import Header from '../../layouts/headers/headerauth.vue'
|
import Header from '../../layouts/headers/headerauth.vue'
|
||||||
import SideBar from '../../layouts/sidebar/sidebar.vue'
|
import SideBar from '../../layouts/sidebar/sidebar.vue'
|
||||||
import Footer from '../../layouts/footers/footer.vue'
|
import Footer from '../../layouts/footers/footer.vue'
|
||||||
import useValidate from "@vuelidate/core";
|
import useValidate from "@vuelidate/core";
|
||||||
import {notify} from "@kyvg/vue3-notification"
|
import { notify } from "@kyvg/vue3-notification"
|
||||||
import {minLength, required} from "@vuelidate/validators";
|
import { minLength, required } from "@vuelidate/validators";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'PayOil',
|
name: 'PayOil',
|
||||||
@@ -191,6 +214,7 @@ export default defineComponent({
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
v$: useValidate(),
|
v$: useValidate(),
|
||||||
|
loaded: false,
|
||||||
user: {
|
user: {
|
||||||
user_id: 0,
|
user_id: 0,
|
||||||
},
|
},
|
||||||
@@ -241,6 +265,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
stripe: null,
|
stripe: null,
|
||||||
customer: {
|
customer: {
|
||||||
id: 0,
|
id: 0,
|
||||||
@@ -256,14 +281,25 @@ export default defineComponent({
|
|||||||
customer_phone_number: '',
|
customer_phone_number: '',
|
||||||
account_number: '',
|
account_number: '',
|
||||||
},
|
},
|
||||||
|
pricing: {
|
||||||
|
price_from_supplier: 0,
|
||||||
|
price_for_customer: 0,
|
||||||
|
price_for_employee: 0,
|
||||||
|
price_same_day: 0,
|
||||||
|
price_prime: 0,
|
||||||
|
date: "",
|
||||||
|
},
|
||||||
|
priceprime: 0,
|
||||||
|
pricesameday: 0,
|
||||||
|
total_amount: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
validations() {
|
validations() {
|
||||||
return {
|
return {
|
||||||
CreateOilOrderForm: {
|
CreateOilOrderForm: {
|
||||||
basicInfo: {
|
basicInfo: {
|
||||||
gallons_ordered: {required, minLength: minLength(1)},
|
gallons_ordered: { required, minLength: minLength(1) },
|
||||||
expected_delivery_date: {required},
|
expected_delivery_date: { required },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -279,10 +315,28 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getOilOrder(this.$route.params.id)
|
this.getOilOrder(this.$route.params.id)
|
||||||
|
this.getOilPricing()
|
||||||
// this.getStripePublishableKey();
|
// this.getStripePublishableKey();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
sumdelivery() {
|
||||||
|
if (this.delivery.same_day == 1)
|
||||||
|
this.pricesameday = this.pricing.price_same_day
|
||||||
|
else { this.pricesameday = 0 };
|
||||||
|
|
||||||
|
if (this.delivery.prime == 1)
|
||||||
|
this.priceprime = this.pricing.price_prime
|
||||||
|
else { this.priceprime = 0 };
|
||||||
|
|
||||||
|
this.total_amount = Number(this.delivery.total_price) + Number(this.priceprime) + Number(this.pricesameday)
|
||||||
|
|
||||||
|
this.loaded = true
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
userStatus() {
|
userStatus() {
|
||||||
let path = import.meta.env.VITE_BASE_URL + '/auth/whoami';
|
let path = import.meta.env.VITE_BASE_URL + '/auth/whoami';
|
||||||
axios({
|
axios({
|
||||||
@@ -291,13 +345,34 @@ export default defineComponent({
|
|||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
headers: authHeader(),
|
headers: authHeader(),
|
||||||
})
|
})
|
||||||
.then((response: any) => {
|
.then((response: any) => {
|
||||||
if (response.data.ok) {
|
if (response.data.ok) {
|
||||||
this.user = response.data.user;
|
this.user = response.data.user;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
|
getOilPricing() {
|
||||||
|
let path = import.meta.env.VITE_BASE_URL + "/info/price/oil/table";
|
||||||
|
axios({
|
||||||
|
method: "get",
|
||||||
|
url: path,
|
||||||
|
withCredentials: true,
|
||||||
|
})
|
||||||
|
.then((response: any) => {
|
||||||
|
this.pricing = response.data;
|
||||||
|
|
||||||
|
this.sumdelivery();
|
||||||
|
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
notify({
|
||||||
|
title: "Error",
|
||||||
|
text: "Could not get oil pricing",
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
getOilOrder(delivery_id: any) {
|
getOilOrder(delivery_id: any) {
|
||||||
let path = import.meta.env.VITE_BASE_URL + "/delivery/order/" + delivery_id;
|
let path = import.meta.env.VITE_BASE_URL + "/delivery/order/" + delivery_id;
|
||||||
axios({
|
axios({
|
||||||
@@ -305,19 +380,19 @@ export default defineComponent({
|
|||||||
url: path,
|
url: path,
|
||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
})
|
})
|
||||||
.then((response: any) => {
|
.then((response: any) => {
|
||||||
this.delivery = response.data;
|
this.delivery = response.data;
|
||||||
this.getCustomer(this.delivery.customer_id)
|
this.getCustomer(this.delivery.customer_id)
|
||||||
this.getCreditCards(this.delivery.customer_id)
|
this.getCreditCards(this.delivery.customer_id)
|
||||||
|
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
notify({
|
notify({
|
||||||
title: "Error",
|
title: "Error",
|
||||||
text: "Could not get oil order",
|
text: "Could not get oil order",
|
||||||
type: "error",
|
type: "error",
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
getCreditCards(user_id: any) {
|
getCreditCards(user_id: any) {
|
||||||
let path = import.meta.env.VITE_BASE_URL + '/payment/cards/' + user_id;
|
let path = import.meta.env.VITE_BASE_URL + '/payment/cards/' + user_id;
|
||||||
@@ -347,22 +422,22 @@ export default defineComponent({
|
|||||||
method: "PUT",
|
method: "PUT",
|
||||||
url: path,
|
url: path,
|
||||||
})
|
})
|
||||||
.then((response: any) => {
|
.then((response: any) => {
|
||||||
if (response.data.ok) {
|
if (response.data.ok) {
|
||||||
notify({
|
|
||||||
title: "Success",
|
|
||||||
text: "marked payment as STRIPE credit card",
|
|
||||||
type: "error",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
notify({
|
notify({
|
||||||
title: "Error",
|
title: "Success",
|
||||||
text: "Could not update with credit card",
|
text: "marked payment as STRIPE credit card",
|
||||||
type: "error",
|
type: "error",
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
notify({
|
||||||
|
title: "Error",
|
||||||
|
text: "Could not update with credit card",
|
||||||
|
type: "error",
|
||||||
});
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
checkoutOilUpdatePayment(payment_type: number) {
|
checkoutOilUpdatePayment(payment_type: number) {
|
||||||
@@ -371,32 +446,32 @@ export default defineComponent({
|
|||||||
method: "PUT",
|
method: "PUT",
|
||||||
url: path,
|
url: path,
|
||||||
})
|
})
|
||||||
.then((response: any) => {
|
.then((response: any) => {
|
||||||
if (response.data.ok) {
|
if (response.data.ok) {
|
||||||
if (payment_type == 1) {
|
if (payment_type == 1) {
|
||||||
notify({
|
notify({
|
||||||
title: "Success",
|
title: "Success",
|
||||||
text: "marked payment as credit (bank terminal)",
|
text: "marked payment as credit (bank terminal)",
|
||||||
type: "success",
|
type: "success",
|
||||||
});
|
});
|
||||||
}
|
|
||||||
if (payment_type == 0) {
|
|
||||||
notify({
|
|
||||||
title: "Success",
|
|
||||||
text: "marked payment as cash (COD)",
|
|
||||||
type: "success",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.$router.push({name: "customerProfile", params: {id: this.customer.id}});
|
|
||||||
}
|
}
|
||||||
})
|
if (payment_type == 0) {
|
||||||
.catch(() => {
|
notify({
|
||||||
notify({
|
title: "Success",
|
||||||
title: "Error",
|
text: "marked payment as cash (COD)",
|
||||||
text: "Could not update wth cash",
|
type: "success",
|
||||||
type: "error",
|
});
|
||||||
});
|
}
|
||||||
|
this.$router.push({ name: "customerProfile", params: { id: this.customer.id } });
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
notify({
|
||||||
|
title: "Error",
|
||||||
|
text: "Could not update wth cash",
|
||||||
|
type: "error",
|
||||||
});
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// checkoutOilCreditStripe() {
|
// checkoutOilCreditStripe() {
|
||||||
@@ -420,24 +495,24 @@ export default defineComponent({
|
|||||||
// });
|
// });
|
||||||
// },
|
// },
|
||||||
|
|
||||||
// getStripePublishableKey() {
|
// getStripePublishableKey() {
|
||||||
// let path = import.meta.env.VITE_PAY_URL + "/pay/config";
|
// let path = import.meta.env.VITE_PAY_URL + "/pay/config";
|
||||||
// axios({
|
// axios({
|
||||||
// method: "get",
|
// method: "get",
|
||||||
// url: path,
|
// url: path,
|
||||||
// })
|
// })
|
||||||
// .then((response: any) => {
|
// .then((response: any) => {
|
||||||
// this.stripe = Stripe(response.data.publicKey);
|
// this.stripe = Stripe(response.data.publicKey);
|
||||||
// })
|
// })
|
||||||
// .catch(() => {
|
// .catch(() => {
|
||||||
// notify({
|
// notify({
|
||||||
// title: "Error",
|
// title: "Error",
|
||||||
// text: "Could not find customer",
|
// text: "Could not find customer",
|
||||||
// type: "error",
|
// type: "error",
|
||||||
// });
|
// });
|
||||||
// });
|
// });
|
||||||
// },
|
// },
|
||||||
//
|
//
|
||||||
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ module.exports = {
|
|||||||
themes: [{
|
themes: [{
|
||||||
mytheme: {
|
mytheme: {
|
||||||
"primary": "#0256bf",
|
"primary": "#0256bf",
|
||||||
"secondary": "#1e1d24",
|
"secondary": "#262732",
|
||||||
"accent": "#7F00FF",
|
"accent": "#161fac",
|
||||||
"neutral": "#1e1d24",
|
"neutral": "#1e1d24",
|
||||||
"base-100": "#1e1d24",
|
"base-100": "#1e1d24",
|
||||||
"info": "#74a0d5",
|
"info": "#74a0d5",
|
||||||
|
|||||||
Reference in New Issue
Block a user