added tiefbau flag
This commit is contained in:
@@ -247,6 +247,14 @@
|
||||
return documentation.journals.filter(j => !j.text.toLowerCase().includes('wurde zugewiesen.'));
|
||||
});
|
||||
|
||||
const isCivilEngineering = computed(() => {
|
||||
return selectedWorkorder.value?.status === 'civil_engineering_required';
|
||||
});
|
||||
|
||||
const showNormalDocsForCivilEng = computed(() => {
|
||||
return isCivilEngineering.value && tenantConfig.value?.tiefbauSeesNormalDocs;
|
||||
});
|
||||
|
||||
|
||||
// --- METHODS ---
|
||||
const applyTheme = () => {
|
||||
@@ -485,6 +493,22 @@
|
||||
}
|
||||
};
|
||||
|
||||
const completeCivilEngineering = async () => {
|
||||
if (!confirm("Möchten Sie den Tiefbau wirklich abschließen?")) return;
|
||||
try {
|
||||
const response = await api.post('/completeCivilEngineering', { workorderId: selectedWorkorder.value.id });
|
||||
if (response.data.success) {
|
||||
await fetchWorkorders();
|
||||
closeDetails();
|
||||
} else {
|
||||
alert(response.data.message);
|
||||
}
|
||||
} catch(e) {
|
||||
console.error("Failed to complete civil engineering", e);
|
||||
alert(e.response?.data?.message || 'Fehler beim Abschließen des Tiefbaus.');
|
||||
}
|
||||
};
|
||||
|
||||
const selectFcp = (fcpValue) => {
|
||||
selectedFcp.value = fcpValue;
|
||||
isFcpSelectOpen.value = false;
|
||||
@@ -520,10 +544,11 @@
|
||||
checklist, fullscreenViewer, missingTasksPopover, translatedDocs, filteredJournals, installModal, isStandalone,
|
||||
selectedFcp, isFcpSelectOpen, fcpOptions, selectedFcpText, fcpSearchTerm, filteredFcpOptions, fcpInputRef,
|
||||
isSettingsOpen, theme, showThemePicker,
|
||||
savingData, // <-- ADDED
|
||||
savingData,
|
||||
isCivilEngineering, showNormalDocsForCivilEng,
|
||||
fetchWorkorders, openDetails, closeDetails, getStatusInfo, formatDate, googleMapsLink, startEditInfo, saveAdditionalInfo,
|
||||
handleFileSelect, executeUpload, addJournalEntry, submitProblem, handleCompleteClick, selectFcp, setTheme,
|
||||
saveWorkorderData // <-- ADDED
|
||||
saveWorkorderData, completeCivilEngineering
|
||||
};
|
||||
},
|
||||
template: `
|
||||
@@ -673,7 +698,7 @@
|
||||
{{ savingData ? 'Speichert...' : 'Daten speichern' }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="bg-white dark:bg-slate-900 p-4 rounded-lg border border-slate-200 dark:border-slate-800">
|
||||
<div v-if="!isCivilEngineering || showNormalDocsForCivilEng" class="bg-white dark:bg-slate-900 p-4 rounded-lg border border-slate-200 dark:border-slate-800">
|
||||
<h3 class="font-bold text-slate-700 dark:text-secondary mb-3">Checkliste</h3>
|
||||
<div v-if="isDetailsLoading" class="space-y-3 animate-pulse">
|
||||
<div v-for="i in 4" :key="i" class="flex items-center">
|
||||
@@ -693,7 +718,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white dark:bg-slate-900 p-4 rounded-lg border border-slate-200 dark:border-slate-800">
|
||||
<div v-if="!isCivilEngineering || showNormalDocsForCivilEng" class="bg-white dark:bg-slate-900 p-4 rounded-lg border border-slate-200 dark:border-slate-800">
|
||||
<h3 class="font-bold text-slate-700 dark:text-secondary mb-2">Dokumentation</h3>
|
||||
<label for="file-upload" class="w-full inline-flex items-center justify-center px-4 py-2 border border-dashed border-slate-300 dark:border-slate-700 text-sm font-medium rounded-md text-slate-700 dark:text-slate-200 bg-slate-50 dark:bg-slate-800 hover:bg-slate-100 dark:hover:bg-slate-700 cursor-pointer">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12" /></svg>
|
||||
@@ -718,7 +743,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white dark:bg-slate-900 p-4 rounded-lg border border-slate-200 dark:border-slate-800">
|
||||
<div v-if="!isCivilEngineering || showNormalDocsForCivilEng" class="bg-white dark:bg-slate-900 p-4 rounded-lg border border-slate-200 dark:border-slate-800">
|
||||
<h3 class="font-bold text-slate-700 dark:text-secondary mb-4">Journal</h3>
|
||||
<div v-if="isDetailsLoading" class="animate-pulse">
|
||||
<div class="flex items-start">
|
||||
@@ -748,18 +773,23 @@
|
||||
|
||||
<footer class="bg-white dark:bg-slate-900 p-2 border-t border-slate-200 dark:border-slate-800 flex-shrink-0 grid grid-cols-2 gap-2 pt-2 px-2 pb-[calc(0.5rem+env(safe-area-inset-bottom))]">
|
||||
<button @click="problemModal.show = true" class="w-full px-4 py-3 bg-red-600 text-white font-bold rounded-md text-center">Problem melden</button>
|
||||
<div class="relative">
|
||||
<button @click="handleCompleteClick" class="w-full px-4 py-3 bg-green-600 text-white font-bold rounded-md text-center disabled:bg-slate-300">Abschließen</button>
|
||||
<transition name="fade">
|
||||
<div v-if="missingTasksPopover.show" class="absolute bottom-full right-0 mb-2 w-72 bg-red-700 text-white text-sm rounded-lg shadow-lg p-3">
|
||||
<h4 class="font-bold mb-1">Fehlende Punkte:</h4>
|
||||
<ul class="list-disc list-inside space-y-1">
|
||||
<li v-for="task in missingTasksPopover.tasks" :key="task">{{ task }}</li>
|
||||
</ul>
|
||||
<div class="absolute bottom-[-5px] right-[calc(6rem-8px)] w-0 h-0 border-x-8 border-x-transparent border-t-8 border-t-red-700"></div>
|
||||
</div>
|
||||
</transition>
|
||||
</div>
|
||||
<template v-if="isCivilEngineering">
|
||||
<button @click="completeCivilEngineering" class="w-full px-4 py-3 bg-green-600 text-white font-bold rounded-md text-center">Tiefbau abschließen</button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="relative">
|
||||
<button @click="handleCompleteClick" class="w-full px-4 py-3 bg-green-600 text-white font-bold rounded-md text-center disabled:bg-slate-300">Abschließen</button>
|
||||
<transition name="fade">
|
||||
<div v-if="missingTasksPopover.show" class="absolute bottom-full right-0 mb-2 w-72 bg-red-700 text-white text-sm rounded-lg shadow-lg p-3">
|
||||
<h4 class="font-bold mb-1">Fehlende Punkte:</h4>
|
||||
<ul class="list-disc list-inside space-y-1">
|
||||
<li v-for="task in missingTasksPopover.tasks" :key="task">{{ task }}</li>
|
||||
</ul>
|
||||
<div class="absolute bottom-[-5px] right-[calc(6rem-8px)] w-0 h-0 border-x-8 border-x-transparent border-t-8 border-t-red-700"></div>
|
||||
</div>
|
||||
</transition>
|
||||
</div>
|
||||
</template>
|
||||
</footer>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
Reference in New Issue
Block a user