From d0e563297fb91a393f217024864c0c8145253e02 Mon Sep 17 00:00:00 2001 From: Luca Haid Date: Mon, 8 Sep 2025 08:37:36 +0000 Subject: [PATCH] Rml workorder/add oaid fcp filter --- .../default/VueViews/WorkorderCompanyPWA.php | 85 +++++++++++++++---- 1 file changed, 67 insertions(+), 18 deletions(-) diff --git a/Layout/default/VueViews/WorkorderCompanyPWA.php b/Layout/default/VueViews/WorkorderCompanyPWA.php index b21111438..9d4b5b8f5 100644 --- a/Layout/default/VueViews/WorkorderCompanyPWA.php +++ b/Layout/default/VueViews/WorkorderCompanyPWA.php @@ -7,6 +7,7 @@ Workorders + @@ -78,6 +79,7 @@ const workorders = ref([]); const selectedWorkorder = ref(null); const isLoading = ref(true); + const isDetailsLoading = ref(false); const isDetailsPanelOpen = ref(false); const searchTerm = ref(''); const documentation = reactive({ docs: [], journals: [] }); @@ -94,6 +96,7 @@ const isStandalone = ref(false); const selectedFcp = ref('all'); const isFcpSelectOpen = ref(false); + const fcpSearchTerm = ref(''); const API_BASE_URL = window.TT_CONFIG.BASE_PATH || '/WorkorderCompany'; @@ -109,6 +112,16 @@ return [{ value: 'all', text: 'Alle FCPs' }, ...options]; }); + const filteredFcpOptions = computed(() => { + if (!fcpSearchTerm.value) { + return fcpOptions.value; + } + const lowerCaseSearch = fcpSearchTerm.value.toLowerCase(); + return fcpOptions.value.filter(option => + option.text.toLowerCase().includes(lowerCaseSearch) + ); + }); + const selectedFcpText = computed(() => { const selectedOption = fcpOptions.value.find(opt => opt.value === selectedFcp.value); return selectedOption ? selectedOption.text : 'Alle FCPs'; @@ -201,6 +214,7 @@ }; const fetchDetails = async (workorderId) => { + isDetailsLoading.value = true; try { const [docRes, configRes] = await Promise.all([ api.get(`/getDocumentation?workorderId=${workorderId}`), @@ -212,6 +226,7 @@ tenantConfig.value = configRes.data; } } catch (e) { console.error("Could not load details", e); } + finally { isDetailsLoading.value = false; } }; const openDetails = (workorder) => { @@ -342,17 +357,26 @@ isFcpSelectOpen.value = false; }; - onMounted(() => { fetchWorkorders(); isStandalone.value = window.matchMedia('(display-mode: standalone)').matches; }); + // Lock body scroll when any modal is open + watch([isDetailsPanelOpen, isFcpSelectOpen, uploadModal, problemModal, fullscreenViewer, installModal], ([details, fcp, upload, problem, viewer, install]) => { + const isAnyModalOpen = details || fcp || upload.show || problem.show || viewer.show || install.show; + if (isAnyModalOpen) { + document.body.style.overflow = 'hidden'; + } else { + document.body.style.overflow = ''; + } + }, { deep: true }); + return { - isLoading, filteredWorkorders, searchTerm, isDetailsPanelOpen, selectedWorkorder, documentation, tenantConfig, + isLoading, isDetailsLoading, filteredWorkorders, searchTerm, isDetailsPanelOpen, selectedWorkorder, documentation, tenantConfig, tempAdditionalInfo, isEditingInfo, newJournalEntry, uploadModal, problemModal, isUploading, isChecklistComplete, checklist, fullscreenViewer, missingTasksPopover, translatedDocs, filteredJournals, installModal, isStandalone, - selectedFcp, isFcpSelectOpen, fcpOptions, selectedFcpText, fetchWorkorders, fetchDetails, + selectedFcp, isFcpSelectOpen, fcpOptions, selectedFcpText, fcpSearchTerm, filteredFcpOptions, openDetails, closeDetails, getStatusInfo, formatDate, googleMapsLink, startEditInfo, saveAdditionalInfo, handleFileSelect, executeUpload, addJournalEntry, submitProblem, handleCompleteClick, selectFcp }; @@ -397,9 +421,10 @@

#{{ wo.id }} | {{ wo.customerName || 'N/A' }}

{{ wo.street }} {{ wo.hausnummer }}, {{ wo.plz }} {{ wo.city }}

-
- FCP: {{ wo.rimo_fcp_name || 'N/A' }}
+
+ ID: {{ wo.id }} OAID: {{ wo.oaid || 'N/A' }} + FCP: {{ wo.rimo_fcp_name || 'N/A' }}
@@ -465,14 +490,22 @@

Checkliste

-
    -
  • - - - {{ item.text }} -
  • -
-

Keine Checklisten-Einträge vorhanden.

+
+
+
+
+
+
+
+
    +
  • + + + {{ item.text }} +
  • +
+

Keine Checklisten-Einträge vorhanden.

+
@@ -502,7 +535,16 @@

Journal

-
+
+
+
+
+
+
+
+
+
+

Keine Einträge.

@@ -539,14 +581,20 @@ -
-
-
+
+
+

FCP auswählen

+
+ + + + +
    -
  • {{ option.text }} @@ -652,3 +700,4 @@ +