Small ui fixes

This commit is contained in:
2025-10-13 10:40:37 -04:00
parent cf7e5299b8
commit 4a40bffbd5
8 changed files with 35 additions and 34 deletions

View File

@@ -13,9 +13,12 @@
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" /> <path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" />
</svg> </svg>
</label> </label>
<router-link :to="{ name: 'home' }" class="btn btn-ghost normal-case text-xl font-bold"> <div class="flex flex-col items-center">
Auburn Oil <span class="text-xs text-base-content/60">{{ dayOfWeek }}</span>
</router-link> <span class="normal-case text-xl font-bold">
{{ currentDate }}
</span>
</div>
</div> </div>
<!-- <!--
@@ -263,6 +266,17 @@ export default defineComponent({
return parts.length > 1 return parts.length > 1
? `${parts[0][0]}${parts[1][0]}`.toUpperCase() ? `${parts[0][0]}${parts[1][0]}`.toUpperCase()
: this.user.user_name.substring(0, 2).toUpperCase(); : this.user.user_name.substring(0, 2).toUpperCase();
},
currentDate(): string {
const now = new Date();
const month = (now.getMonth() + 1).toString().padStart(2, '0');
const day = now.getDate().toString().padStart(2, '0');
const year = now.getFullYear().toString().slice(-2);
return `${month}/${day}/${year}`;
},
dayOfWeek(): string {
const now = new Date();
return now.toLocaleDateString('en-US', { weekday: 'long' });
} }
}, },

View File

@@ -83,7 +83,7 @@
<td>{{ oil.hot_water_summer ? 'Yes' : 'No' }}</td> <td>{{ oil.hot_water_summer ? 'Yes' : 'No' }}</td>
<td>{{ oil.customer_address }}, {{ oil.customer_town }}</td> <td>{{ oil.customer_address }}, {{ oil.customer_town }}</td>
<td class="text-right "> <td class="text-right ">
<div class="flex items-center justify-end gap-2">
<!-- <router-link :to="{ name: 'customerEdit', params: { id: oil.customer_id } }" class="btn btn-sm btn-secondary">Edit Customer</router-link> --> <!-- <router-link :to="{ name: 'customerEdit', params: { id: oil.customer_id } }" class="btn btn-sm btn-secondary">Edit Customer</router-link> -->
<router-link v-if="oil.auto_status != 3" <router-link v-if="oil.auto_status != 3"
:to="{ name: 'payAutoAuthorize', params: { id: oil['id'] } }"> :to="{ name: 'payAutoAuthorize', params: { id: oil['id'] } }">
@@ -101,7 +101,7 @@
Print Ticket Print Ticket
</button> </button>
</router-link> </router-link>
</div>
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@@ -21,9 +21,7 @@
<span class="label-text-alt">{{ customer_count }} customers found</span> <span class="label-text-alt">{{ customer_count }} customers found</span>
</label> </label>
</div> </div>
<router-link to="/customers/create" class="btn btn-primary btn-sm">
Add New Customer
</router-link>
</div> </div>
<div class="divider"></div> <div class="divider"></div>
@@ -38,7 +36,7 @@
<th>Town</th> <th>Town</th>
<th>Automatic</th> <th>Automatic</th>
<th>Phone Number</th> <th>Phone Number</th>
<th class="text-right">Actions</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -52,22 +50,8 @@
<td>{{ person.customer_town }}</td> <td>{{ person.customer_town }}</td>
<td><span :class="person.customer_automatic ? 'text-success' : 'text-gray-500'">{{ person.customer_automatic ? 'Yes' : 'No' }}</span></td> <td><span :class="person.customer_automatic ? 'text-success' : 'text-gray-500'">{{ person.customer_automatic ? 'Yes' : 'No' }}</span></td>
<td>{{ person.customer_phone_number }}</td> <td>{{ person.customer_phone_number }}</td>
<td class="text-right">
<div class="flex items-center justify-end gap-2">
<router-link :to="{ name: 'deliveryCreate', params: { id: person.id } }" class="btn btn-sm btn-primary">
New Delivery
</router-link>
<router-link :to="{ name: 'CalenderCustomer', params: { id: person.id } }" class="btn btn-sm btn-accent">
New Service
</router-link>
<router-link :to="{ name: 'customerEdit', params: { id: person.id } }" class="btn btn-sm btn-secondary">
Edit
</router-link>
<router-link :to="{ name: 'customerProfile', params: { id: person.id } }" class="btn btn-sm btn-ghost">
View
</router-link>
</div>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View File

@@ -772,7 +772,6 @@ onSubmitSocial(commentText: string) {
this.currentParts = response.data; this.currentParts = response.data;
} catch (error) { } catch (error) {
console.error("Failed to fetch customer parts:", error); console.error("Failed to fetch customer parts:", error);
notify({ title: "Error", text: "Could not fetch equipment parts.", type: "error" });
} }
}, },
openPartsModal() { openPartsModal() {

View File

@@ -384,7 +384,6 @@ export default defineComponent({
this.total_amount = response.data.delivery.total_amount || 0; this.total_amount = response.data.delivery.total_amount || 0;
this.preChargeTotal = response.data.delivery.total_amount || 0; this.preChargeTotal = response.data.delivery.total_amount || 0;
this.FinalizeOilOrderForm.gallons_delivered = this.deliveryOrder.gallons_delivered || '';
await this.getCustomer(this.deliveryOrder.customer_id); await this.getCustomer(this.deliveryOrder.customer_id);

View File

@@ -99,7 +99,7 @@
<form class="space-y-4" @submit.prevent="onSubmit"> <form class="space-y-4" @submit.prevent="onSubmit">
<div> <div>
<label class="label"><span class="label-text font-bold">Gallons Delivered</span></label> <label class="label"><span class="label-text font-bold">Gallons Delivered</span></label>
<input v-model="FinalizeOilOrderForm.gallons_delivered" class="input input-bordered input-sm w-full max-w-xs" type="number" placeholder="# gallons" /> <input v-model="FinalizeOilOrderForm.gallons_delivered" class="input input-bordered input-sm w-full max-w-xs" type="number" step="0.01" placeholder="# gallons" />
</div> </div>
<div class="pt-2"> <div class="pt-2">

View File

@@ -101,7 +101,7 @@
<div> <div>
<label class="label"><span class="label-text font-bold">Gallons Delivered</span></label> <label class="label"><span class="label-text font-bold">Gallons Delivered</span></label>
<input v-model="FinalizeOilOrderForm.gallons_delivered" <input v-model="FinalizeOilOrderForm.gallons_delivered"
class="input input-bordered input-sm w-full max-w-xs" type="number" placeholder="# gallons" /> class="input input-bordered input-sm w-full max-w-xs" type="number" step="0.01" placeholder="# gallons" />
</div> </div>
<div class="pt-2"> <div class="pt-2">

View File

@@ -8,7 +8,7 @@
<!-- Modal Header --> <!-- Modal Header -->
<div class="flex justify-between items-center border-b border-gray-700 pb-3 mb-4"> <div class="flex justify-between items-center border-b border-gray-700 pb-3 mb-4">
<h3 class="text-2xl font-bold">Edit Service Call</h3> <h3 class="text-2xl font-bold">Service Call</h3>
<span class="font-bold text-white px-3 py-1 mr-10 rounded" :style="{ backgroundColor: getServiceTypeColor(editableService.type_service_call) }"> <span class="font-bold text-white px-3 py-1 mr-10 rounded" :style="{ backgroundColor: getServiceTypeColor(editableService.type_service_call) }">
{{ getServiceTypeName(editableService.type_service_call) }} {{ getServiceTypeName(editableService.type_service_call) }}
</span> </span>
@@ -24,7 +24,7 @@
<div class="font-bold text-lg">{{ customer.account_number }}</div> <div class="font-bold text-lg">{{ customer.account_number }}</div>
<div class="text-sm">{{ customer.customer_first_name }} {{ customer.customer_last_name }}</div> <div class="text-sm">{{ customer.customer_first_name }} {{ customer.customer_last_name }}</div>
<div class="text-sm">{{ customer.customer_address }}</div> <div class="text-sm">{{ customer.customer_address }}</div>
<div class="text-sm">{{ customer.customer_town }}, {{ customer.customer_state }} {{ customer.customer_zip }}</div> <div class="text-sm">{{ customer.customer_town }}, {{ getStateAbbrev(customer.customer_state) }} {{ customer.customer_zip }}</div>
<div class="text-sm mt-1">{{ customer.customer_phone_number }}</div> <div class="text-sm mt-1">{{ customer.customer_phone_number }}</div>
</div> </div>
<div v-else class="p-4 bg-base-200 rounded-md text-center"><p>Loading customer details...</p></div> <div v-else class="p-4 bg-base-200 rounded-md text-center"><p>Loading customer details...</p></div>
@@ -184,6 +184,11 @@ export default defineComponent({
if (typeId === undefined || typeId === null) return 'gray'; if (typeId === undefined || typeId === null) return 'gray';
const colorMap: { [key: number]: string } = { 0: 'blue', 1: 'red', 2: 'green', 3: '#B58900', 4: 'black' }; const colorMap: { [key: number]: string } = { 0: 'blue', 1: 'red', 2: 'green', 3: '#B58900', 4: 'black' };
return colorMap[typeId] || 'gray'; return colorMap[typeId] || 'gray';
},
getStateAbbrev(stateId: number | undefined | null): string {
if (stateId === undefined || stateId === null) return 'Unknown';
const stateMap: { [key: number]: string } = { 0: 'MA', 1: 'RI', 2: 'NH', 3: 'ME', 4: 'VT', 5: 'CT', 6: 'NY' };
return stateMap[stateId] || 'Unknown';
} }
}, },
}); });