diff --git a/src/pages/automatic/home.vue b/src/pages/automatic/home.vue index 9fd110e..c927c1b 100755 --- a/src/pages/automatic/home.vue +++ b/src/pages/automatic/home.vue @@ -44,6 +44,10 @@ Usage Factor {{ sortAsc ? '▲' : '▼' }} + + Hot Water Tank + {{ sortAsc ? '▲' : '▼' }} + Address Actions @@ -73,6 +77,7 @@ {{ oil.house_factor }} + {{ oil.hot_water_summer ? 'Yes' : 'No' }} {{ oil.customer_address }}, {{ oil.customer_town }}
@@ -111,19 +116,31 @@
- -
New Auto Customer
-
- -
{{ oil.estimated_gallons_left }} / {{ oil.tank_size }} gal estimated
+
+
+ +
{{ oil.house_factor }}
+
+
+ +
{{ oil.hot_water_summer ? 'Yes' : 'No' }}
+
+
+
+ +
New Auto Customer
+
+ +
{{ oil.estimated_gallons_left }} / {{ oil.tank_size }} gal estimated
+
@@ -169,6 +186,7 @@ interface AutoDelivery { house_factor: number; tank_size: number; auto_status: number; + hot_water_summer: number; open_ticket_id?: number | null; } @@ -182,7 +200,7 @@ export default defineComponent({ user: null, deliveries: [] as AutoDelivery[], // --- NEW: Data properties for sorting --- - sortKey: 'tank_level_percent' as keyof AutoDelivery | 'tank_level_percent', + sortKey: 'tank_level_percent' as keyof AutoDelivery | 'tank_level_percent' | 'hot_water_summer', sortAsc: true, } }, @@ -212,6 +230,11 @@ export default defineComponent({ } else { valA = a[this.sortKey as keyof AutoDelivery]; valB = b[this.sortKey as keyof AutoDelivery]; + // Special handling for hot_water_summer to ensure it's number + if (this.sortKey === 'hot_water_summer') { + valA = valA || 0; + valB = valB || 0; + } } // Handle nulls or different types if necessary @@ -237,7 +260,7 @@ export default defineComponent({ }, methods: { // --- NEW: Method to handle sorting --- - sortBy(key: keyof AutoDelivery | 'tank_level_percent') { + sortBy(key: keyof AutoDelivery | 'tank_level_percent' | 'hot_water_summer') { if (this.sortKey === key) { // If clicking the same key, reverse the direction this.sortAsc = !this.sortAsc; @@ -267,7 +290,7 @@ export default defineComponent({ }); }, get_oil_orders() { - const path = import.meta.env.VITE_AUTO_URL + '/delivery/all/customers'; + const path = import.meta.env.VITE_BASE_URL + '/customer/automatic/deliveries'; axios.get(path, { withCredentials: true, headers: authHeader() }) .then((response: any) => { this.deliveries = response.data; diff --git a/src/pages/customer/create.vue b/src/pages/customer/create.vue index 4592480..edfdf9c 100755 --- a/src/pages/customer/create.vue +++ b/src/pages/customer/create.vue @@ -220,6 +220,17 @@ export default defineComponent({ }) .catch(() => { this.user = null; }); }, + + getCustomerTypeList() { + const path = import.meta.env.VITE_BASE_URL + "/query/customertype"; + axios.get(path, { withCredentials: true }) + .then((response: any) => { this.custList = response.data; }); + }, + getStatesList() { + const path = import.meta.env.VITE_BASE_URL + "/query/states"; + axios.get(path, { withCredentials: true }) + .then((response: any) => { this.stateList = response.data; }); + }, CreateCustomer(payload: any) { const path = import.meta.env.VITE_BASE_URL + "/customer/create"; axios.post(path, payload, { withCredentials: true, headers: authHeader() }) @@ -232,7 +243,7 @@ export default defineComponent({ } }); }, - onSubmit() { + onSubmit() { this.v$.$validate(); // Trigger validation if (!this.v$.$error) { // If validation passes, submit the form @@ -243,16 +254,6 @@ export default defineComponent({ console.log("Form validation failed."); } }, - getCustomerTypeList() { - const path = import.meta.env.VITE_BASE_URL + "/query/customertype"; - axios.get(path, { withCredentials: true }) - .then((response: any) => { this.custList = response.data; }); - }, - getStatesList() { - const path = import.meta.env.VITE_BASE_URL + "/query/states"; - axios.get(path, { withCredentials: true }) - .then((response: any) => { this.stateList = response.data; }); - }, }, }); \ No newline at end of file diff --git a/src/pages/customer/profile/profile.vue b/src/pages/customer/profile/profile.vue index 5e09ea4..8f019b2 100755 --- a/src/pages/customer/profile/profile.vue +++ b/src/pages/customer/profile/profile.vue @@ -339,6 +339,7 @@ interface ServiceParts { oil_filter_2: string; oil_nozzle: string; oil_nozzle_2: string; + hot_water_tank: number; } interface ServicePlan { diff --git a/src/pages/customer/profile/profile/EquipmentParts.vue b/src/pages/customer/profile/profile/EquipmentParts.vue index 7474759..4bd245f 100644 --- a/src/pages/customer/profile/profile/EquipmentParts.vue +++ b/src/pages/customer/profile/profile/EquipmentParts.vue @@ -28,6 +28,10 @@
Oil Nozzle 2:
{{ parts.oil_nozzle_2 }}
+
+
Hot Water Tank:
+
{{ parts.hot_water_tank ? 'Yes' : 'No' }}
+

No equipment parts information available.

@@ -51,6 +55,7 @@ interface ServiceParts { oil_filter_2: string; oil_nozzle: string; oil_nozzle_2: string; + hot_water_tank: number; } // 2. Define the Props interface, explicitly allowing 'null'. @@ -65,7 +70,7 @@ defineEmits(['open-parts-modal']); const hasPartsData = computed(() => { if (!props.parts) return false; - return !!(props.parts.oil_filter || props.parts.oil_filter_2 || props.parts.oil_nozzle || props.parts.oil_nozzle_2); + return !!(props.parts.oil_filter || props.parts.oil_filter_2 || props.parts.oil_nozzle || props.parts.oil_nozzle_2 || (props.parts.hot_water_tank !== undefined && props.parts.hot_water_tank !== null)); }); const getNozzleColor = (nozzleString: string): string => { @@ -78,4 +83,4 @@ const getNozzleColor = (nozzleString: string): string => { default: return 'inherit'; } }; - \ No newline at end of file + diff --git a/src/pages/customer/service/PartsEditModal.vue b/src/pages/customer/service/PartsEditModal.vue index f498e5f..9eebbaa 100644 --- a/src/pages/customer/service/PartsEditModal.vue +++ b/src/pages/customer/service/PartsEditModal.vue @@ -7,7 +7,7 @@
-

Edit Oil Filters & Nozzles

+

Edit Equipment Parts

@@ -32,6 +32,21 @@
+ +
+ +
+ + +
+
+
@@ -92,6 +107,7 @@ interface ServiceParts { oil_filter_2: string; oil_nozzle: string; oil_nozzle_2: string; + hot_water_tank: number; } interface NozzleParts { @@ -188,4 +204,4 @@ export default defineComponent({ }, }, }); -``` \ No newline at end of file +``` diff --git a/src/pages/delivery/update_tickets/finalize_ticket_auto_nocc.vue b/src/pages/delivery/update_tickets/finalize_ticket_auto_nocc.vue new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/ticket/ticketauto.vue b/src/pages/ticket/ticketauto.vue index 46b7414..9b1f5ea 100644 --- a/src/pages/ticket/ticketauto.vue +++ b/src/pages/ticket/ticketauto.vue @@ -82,18 +82,8 @@
- - - - - - - - - -