changes untested

This commit is contained in:
2024-03-28 10:33:56 -04:00
parent 06dcc6ab93
commit 5b13032cd6
86 changed files with 1434 additions and 2647 deletions

123
src/pages/customer/profile/home.vue Normal file → Executable file
View File

@@ -19,7 +19,7 @@
</router-link>
</li>
</ul>
<div class=" w-full mt-10" v-if="customer !== null">
<div class="w-full mt-10" v-if="customer !== null">
<div class="grid grid-cols-12 gap-5">
<div class="col-span-4 bg-neutral p-5 ">
@@ -37,12 +37,7 @@
Create Delivery
</router-link>
</div>
<div class="btn">
<router-link :to="{ name: 'serviceCreate', params: { id: customer.id } }"
class="cursor-pointer underline hover:text-blue-300">
Create Service
</router-link>
</div>
<div class="btn">
<router-link :to="{ name: 'customerEdit', params: { id: customer.id } }" class="">
Edit Customer
@@ -100,7 +95,6 @@
</div>
</div>
<div class="col-span-12 bg-neutral p-5">
<div class="grid grid-cols-12">
<div class="col-span-12 font-bold flex text-2xl">
@@ -117,21 +111,9 @@
<div class="col-span-12 py-2">
Last Delivery: 0
</div>
</div>
<div class="col-span-6">
<div class="col-span-12 py-2 font-bold">Service</div>
<div class="col-span-12 py-2">
Total Service Calls: 0
</div>
<div class="col-span-12 py-2">
Last Service Call: 0
</div>
</div>
</div>
</div>
<div class="col-span-12 bg-neutral p-5">
<div class="grid grid-cols-12">
<div class="col-span-6 font-bold flex text-2xl">
@@ -170,10 +152,14 @@
</div>
<div class="flex justify-between">
<a @click.prevent="editCard(card.id)" class="cursor-pointer underline hover:text-blue-300">Edit
Card</a>
<a @click.prevent="removeCard(card.id)" class="cursor-pointer underline hover:text-blue-300">Remove
Card</a>
<a @click.prevent="editCard(card.id)"
class="cursor-pointer underline hover:text-blue-300">
Edit Card
</a>
<a @click.prevent="removeCard(card.id)"
class="cursor-pointer underline hover:text-blue-300">
RemoveCard
</a>
</div>
</div>
</div>
@@ -251,13 +237,10 @@
<td>{{ oil['customer_town'] }}</td>
<td>{{ oil['customer_name'] }}</td>
<td>{{ oil['customer_address'] }}</td>
<td>
<div v-if="oil['customer_asked_for_fill'] == 1">Fill</div>
<div v-else> {{ oil['gallons_ordered'] }}</div>
</td>
<td>{{ oil['expected_delivery_date'] }}</td>
<td>
<div v-if="oil['automatic'] == 0">No</div>
@@ -271,7 +254,6 @@
<div v-if="oil['same_day'] == 0">No</div>
<div v-else>Yes</div>
</td>
<td class="flex gap-5">
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
<button class="btn">Edit</button>
@@ -281,67 +263,6 @@
</tbody>
</table>
</div>
<input type="radio" name="my_tabs_1" role="tab" class="tab" aria-label="Service"/>
<div role="tabpanel" class="tab-content pt-10">
<table class="table">
<!-- head -->
<thead>
<tr>
<th>Customer Name</th>
<th>Status</th>
<th>Service Type</th>
<th>Scheduled Date</th>
<th>Tech Name</th>
</tr>
</thead>
<tbody>
<!-- row 1 -->
<tr v-for="service in service_orders" :key="service['id']">
<td>
{{ service['customer_first_name'] }} {{ service['customer_last_name'] }}
</td>
<td>
<div v-if="service['status'] == 0">Waiting/not paid</div>
<div v-else-if="service['status'] == 1">Paid /waiting</div>
<div v-else-if="service['status'] == 2">Scheduled Today</div>
<div v-else-if="service['status'] == 3">Completed/Unpaid</div>
<div v-else-if="service['status'] == 4">Completed/Paid</div>
<div v-else></div>
</td>
<td>
<div v-if="service['service_type'] == 0">General</div>
<div v-else-if="service['service_type'] == 1">Cleaning / Tuneup</div>
<div v-else-if="service['service_type'] == 2">No Heat</div>
<div v-else-if="service['service_type'] == 3">Install</div>
<div v-else-if="service['service_type'] == 4">Call Back</div>
<div v-else-if="service['service_type'] == 5">Quote</div>
<div v-else-if="service['service_type'] == 6">Emergency</div>
<div v-else></div>
</td>
<td>{{ service['scheduled_date'] }}</td>
<td>
<div v-if="service['payment_type'] == 0">Cash C.O.D</div>
<div v-else-if="service['payment_type'] == 1">Credit</div>
<div v-else-if="service['payment_type'] == 2">Stripe</div>
<div v-else-if="service['payment_type'] == 3">Cash/Credit</div>
<div v-else></div>
</td>
<td>
{{ service['tech_first_name'] }} {{ service['tech_last_name'] }}
</td>
<td class="flex gap-5">
<router-link :to="{ name: 'serviceEdit', params: { id: service['id'] } }">
<button class="btn">Edit</button>
</router-link>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
@@ -405,7 +326,6 @@ export default defineComponent({
account_number: '',
},
deliveries: [],
service_orders: [],
delivery_page: 1,
delivery_perPage: 50,
delivery_recordsLength: 0,
@@ -414,16 +334,6 @@ export default defineComponent({
delivery_format: false,
delivery_template: PaginationComp
},
service_page: 1,
service_perPage: 50,
service_recordsLength: 0,
service_options: {
service_edgeNavigation: false,
service_format: false,
service_template: PaginationComp
}
}
},
created() {
@@ -433,7 +343,6 @@ export default defineComponent({
},
mounted() {
this.getCustomer(this.$route.params.id)
this.getCustomerService(this.$route.params.id, this.service_page)
this.getCustomerDelivery(this.$route.params.id, this.delivery_page)
},
@@ -502,17 +411,6 @@ export default defineComponent({
})
},
getCustomerService(userid: any, service_page: any) {
let path = import.meta.env.VITE_BASE_URL + '/service/customer/' + userid + '/' + service_page;
axios({
method: 'get',
url: path,
headers: authHeader(),
}).then((response: any) => {
this.service_orders = response.data
})
},
getCustomerDelivery(userid: any, delivery_page: any) {
let path = import.meta.env.VITE_BASE_URL + '/delivery/customer/' + userid + '/' + delivery_page;
axios({
@@ -528,7 +426,6 @@ export default defineComponent({
this.$router.push({name: "cardedit", params: {id: card_id}});
},
removeCard(card_id: any) {
let path = import.meta.env.VITE_BASE_URL + '/payment/card/remove/' + card_id;
axios({