Changes
This commit is contained in:
@@ -269,7 +269,6 @@ const downloadSelected = async () => {
|
||||
|
||||
|
||||
<div v-if="!loadingDocs">
|
||||
|
||||
<DocumentList
|
||||
v-if="filteredDocuments.length > 0"
|
||||
:documents="filteredDocuments"
|
||||
|
||||
@@ -20,37 +20,46 @@ const emailAccounts = ref([])
|
||||
const preloadedContent = ref("")
|
||||
const loadedDocuments = ref([])
|
||||
const loaded = ref(false)
|
||||
const noAccountsPresent = ref(false)
|
||||
const setupPage = async () => {
|
||||
emailAccounts.value = await useSupabaseSelect("emailAccounts")
|
||||
emailData.value.account = emailAccounts.value[0].id
|
||||
|
||||
preloadedContent.value = `<p></p><p></p><p></p>${dataStore.activeProfile.emailSignature}`
|
||||
if(emailAccounts.value.length === 0) {
|
||||
noAccountsPresent.value = true
|
||||
} else {
|
||||
emailData.value.account = emailAccounts.value[0].id
|
||||
|
||||
//Check Query
|
||||
if(route.query.to) emailData.value.to = route.query.to
|
||||
if(route.query.cc) emailData.value.cc = route.query.cc
|
||||
if(route.query.bcc) emailData.value.bcc = route.query.bcc
|
||||
if(route.query.subject) emailData.value.to = route.query.subject
|
||||
preloadedContent.value = `<p></p><p></p><p></p>${dataStore.activeProfile.emailSignature}`
|
||||
|
||||
//Check Query
|
||||
if(route.query.to) emailData.value.to = route.query.to
|
||||
if(route.query.cc) emailData.value.cc = route.query.cc
|
||||
if(route.query.bcc) emailData.value.bcc = route.query.bcc
|
||||
if(route.query.subject) emailData.value.to = route.query.subject
|
||||
|
||||
|
||||
if(route.query.loadDocuments) {
|
||||
//console.log(JSON.parse(route.query.loadDocuments))
|
||||
const {data,error} = await supabase.from("documents").select('*, createdDocument(id,documentNumber,title,contact(email))').in('id',JSON.parse(route.query.loadDocuments))
|
||||
if(route.query.loadDocuments) {
|
||||
//console.log(JSON.parse(route.query.loadDocuments))
|
||||
const {data,error} = await supabase.from("documents").select('*, createdDocument(id,documentNumber,title,contact(email))').in('id',JSON.parse(route.query.loadDocuments))
|
||||
|
||||
if(error) console.log(error)
|
||||
if(data) loadedDocuments.value = data
|
||||
if(error) console.log(error)
|
||||
if(data) loadedDocuments.value = data
|
||||
|
||||
//console.log(loadedDocuments.value)
|
||||
//console.log(loadedDocuments.value)
|
||||
|
||||
if(loadedDocuments.value.length > 0) {
|
||||
emailData.value.subject = loadedDocuments.value[0].createdDocument.title
|
||||
emailData.value.to = loadedDocuments.value[0].createdDocument.contact ? loadedDocuments.value[0].createdDocument.contact.email : ""
|
||||
if(loadedDocuments.value.length > 0) {
|
||||
emailData.value.subject = loadedDocuments.value[0].createdDocument.title
|
||||
emailData.value.to = loadedDocuments.value[0].createdDocument.contact ? loadedDocuments.value[0].createdDocument.contact.email : ""
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
loaded.value = true
|
||||
}
|
||||
|
||||
loaded.value = true
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -142,98 +151,112 @@ const sendEmail = async () => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UProgress animation="carousel" v-if="!loaded" class="mt-5 w-2/3 mx-auto"/>
|
||||
|
||||
<div v-else>
|
||||
<UDashboardNavbar
|
||||
title="Neue E-Mail"
|
||||
<div v-if="noAccountsPresent" class="mx-auto mt-5 flex flex-col justify-center">
|
||||
<span class="font-bold text-2xl">Keine E-Mail Konten vorhanden</span>
|
||||
<UButton
|
||||
@click="router.push(`/settings/emailAccounts`)"
|
||||
class="mx-auto mt-5"
|
||||
>
|
||||
<template #right>
|
||||
<UButton
|
||||
@click="sendEmail"
|
||||
:disabled="!emailData.to || !emailData.subject"
|
||||
>
|
||||
Senden
|
||||
</UButton>
|
||||
</template>
|
||||
|
||||
</UDashboardNavbar>
|
||||
<UDashboardToolbar>
|
||||
<div class="flex-col flex w-full">
|
||||
<UFormGroup
|
||||
label="Absender"
|
||||
>
|
||||
<USelectMenu
|
||||
:options="emailAccounts"
|
||||
option-attribute="emailAddress"
|
||||
value-attribute="id"
|
||||
v-model="emailData.account"
|
||||
/>
|
||||
</UFormGroup>
|
||||
|
||||
<UInput
|
||||
class="w-full my-1"
|
||||
placeholder="Empfänger"
|
||||
variant="ghost"
|
||||
v-model="emailData.to"
|
||||
/>
|
||||
<UInput
|
||||
class="w-full my-1"
|
||||
placeholder="Kopie"
|
||||
variant="ghost"
|
||||
v-model="emailData.cc"
|
||||
/>
|
||||
<UInput
|
||||
class="w-full my-1"
|
||||
placeholder="Blindkopie"
|
||||
variant="ghost"
|
||||
v-model="emailData.bcc"
|
||||
/>
|
||||
<UInput
|
||||
placeholder="Betreff"
|
||||
class="w-full my-1"
|
||||
variant="ghost"
|
||||
v-model="emailData.subject"
|
||||
/>
|
||||
</div>
|
||||
|
||||
</UDashboardToolbar>
|
||||
|
||||
<UDashboardPanelContent>
|
||||
<div id="parentAttachments" class="flex flex-col justify-center">
|
||||
<span class="font-medium mb-2 text-xl">Anhänge</span>
|
||||
<!-- <UIcon
|
||||
name="i-heroicons-paper-clip"
|
||||
class="mx-auto w-10 h-10"
|
||||
/>
|
||||
<span class="text-center text-2xl">Anhänge hochladen</span>-->
|
||||
<input
|
||||
id="inputAttachments"
|
||||
type="file"
|
||||
multiple
|
||||
@change="renderAttachments"
|
||||
/>
|
||||
<ul class="mx-5 mt-3">
|
||||
<li
|
||||
class="list-disc"
|
||||
v-for="file in selectedAttachments"
|
||||
> Datei - {{file.filename}}</li>
|
||||
<li
|
||||
class="list-disc"
|
||||
v-for="doc in loadedDocuments"
|
||||
>
|
||||
<span v-if="doc.createdDocument">Dokument - {{doc.createdDocument.documentNumber}}</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<Tiptap
|
||||
@updateContent="contentChanged"
|
||||
:preloadedContent="preloadedContent"
|
||||
/>
|
||||
</UDashboardPanelContent>
|
||||
+ E-Mail Konto
|
||||
</UButton>
|
||||
</div>
|
||||
<div v-else>
|
||||
<UProgress animation="carousel" v-if="!loaded" class="mt-5 w-2/3 mx-auto"/>
|
||||
|
||||
<div v-else>
|
||||
<UDashboardNavbar
|
||||
title="Neue E-Mail"
|
||||
>
|
||||
<template #right>
|
||||
<UButton
|
||||
@click="sendEmail"
|
||||
:disabled="!emailData.to || !emailData.subject"
|
||||
>
|
||||
Senden
|
||||
</UButton>
|
||||
</template>
|
||||
|
||||
</UDashboardNavbar>
|
||||
<UDashboardToolbar>
|
||||
<div class="flex-col flex w-full">
|
||||
<UFormGroup
|
||||
label="Absender"
|
||||
>
|
||||
<USelectMenu
|
||||
:options="emailAccounts"
|
||||
option-attribute="emailAddress"
|
||||
value-attribute="id"
|
||||
v-model="emailData.account"
|
||||
/>
|
||||
</UFormGroup>
|
||||
<UDivider class="my-3"/>
|
||||
<UInput
|
||||
class="w-full my-1"
|
||||
placeholder="Empfänger"
|
||||
variant="ghost"
|
||||
v-model="emailData.to"
|
||||
/>
|
||||
<UInput
|
||||
class="w-full my-1"
|
||||
placeholder="Kopie"
|
||||
variant="ghost"
|
||||
v-model="emailData.cc"
|
||||
/>
|
||||
<UInput
|
||||
class="w-full my-1"
|
||||
placeholder="Blindkopie"
|
||||
variant="ghost"
|
||||
v-model="emailData.bcc"
|
||||
/>
|
||||
<UInput
|
||||
placeholder="Betreff"
|
||||
class="w-full my-1"
|
||||
variant="ghost"
|
||||
v-model="emailData.subject"
|
||||
/>
|
||||
</div>
|
||||
|
||||
</UDashboardToolbar>
|
||||
|
||||
<UDashboardPanelContent>
|
||||
<div id="parentAttachments" class="flex flex-col justify-center">
|
||||
<span class="font-medium mb-2 text-xl">Anhänge</span>
|
||||
<!-- <UIcon
|
||||
name="i-heroicons-paper-clip"
|
||||
class="mx-auto w-10 h-10"
|
||||
/>
|
||||
<span class="text-center text-2xl">Anhänge hochladen</span>-->
|
||||
<input
|
||||
id="inputAttachments"
|
||||
type="file"
|
||||
multiple
|
||||
@change="renderAttachments"
|
||||
/>
|
||||
<ul class="mx-5 mt-3">
|
||||
<li
|
||||
class="list-disc"
|
||||
v-for="file in selectedAttachments"
|
||||
> Datei - {{file.filename}}</li>
|
||||
<li
|
||||
class="list-disc"
|
||||
v-for="doc in loadedDocuments"
|
||||
>
|
||||
<span v-if="doc.createdDocument">Dokument - {{doc.createdDocument.documentNumber}}</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<Tiptap
|
||||
@updateContent="contentChanged"
|
||||
:preloadedContent="preloadedContent"
|
||||
/>
|
||||
</UDashboardPanelContent>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
@@ -303,7 +303,6 @@ const setState = async (newState) => {
|
||||
<template #header>
|
||||
Zeiteintrag {{configTimeMode === 'create' ? "erstellen" : "bearbeiten"}}
|
||||
</template>
|
||||
{{itemInfo}}
|
||||
<UFormGroup
|
||||
label="Start:"
|
||||
>
|
||||
|
||||
@@ -53,6 +53,9 @@
|
||||
<template #project-data="{row}">
|
||||
{{row.project ? dataStore.getProjectById(row.project).name: ""}}
|
||||
</template>
|
||||
<template #resources-data="{row}">
|
||||
{{row.resources ? row.resources.map(i => i.title).join(", ") : ""}}
|
||||
</template>
|
||||
</UTable>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -57,15 +57,13 @@
|
||||
>
|
||||
<display-open-balances/>
|
||||
</UDashboardCard>
|
||||
|
||||
|
||||
|
||||
</UDashboardPanelContent>
|
||||
</UDashboardPanel>
|
||||
</UDashboardPage>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
definePageMeta({
|
||||
middleware: "auth"
|
||||
})
|
||||
|
||||
@@ -99,9 +99,16 @@ const tags = dataStore.getDocumentTags
|
||||
const phasesTemplates = ref([])
|
||||
const phasesTemplateSelected = ref(null)
|
||||
|
||||
const plants = ref([])
|
||||
const contracts = ref([])
|
||||
|
||||
|
||||
|
||||
//Functions
|
||||
const setupPage = async() => {
|
||||
plants.value = await useSupabaseSelect("plants")
|
||||
contracts.value = await useSupabaseSelect("contracts")
|
||||
|
||||
if(mode.value === "show" ){
|
||||
itemInfo.value = await useSupabaseSelectSingle("projects",route.params.id,"*, customer(*), plant(*)")
|
||||
} else if (mode.value === "edit") {
|
||||
@@ -562,14 +569,30 @@ const loadPhases = async () => {
|
||||
>
|
||||
<USelectMenu
|
||||
v-model="itemInfo.plant"
|
||||
:options="dataStore.plants"
|
||||
:options="plants"
|
||||
option-attribute="name"
|
||||
value-attribute="id"
|
||||
searchable
|
||||
:search-attributes="['name']"
|
||||
>
|
||||
<template #label>
|
||||
{{dataStore.getPlantById(itemInfo.plant) ? dataStore.getPlantById(itemInfo.plant).name : "Objekt auswählen"}}
|
||||
{{plants.find(i => i.id === itemInfo.plant) ? plants.find(i => i.id === itemInfo.plant).name : "Objekt auswählen"}}
|
||||
</template>
|
||||
</USelectMenu>
|
||||
</UFormGroup>
|
||||
<UFormGroup
|
||||
label="Vertrag:"
|
||||
>
|
||||
<USelectMenu
|
||||
v-model="itemInfo.contract"
|
||||
:options="contracts"
|
||||
option-attribute="name"
|
||||
value-attribute="id"
|
||||
searchable
|
||||
:search-attributes="['name']"
|
||||
>
|
||||
<template #label>
|
||||
{{contracts.find(i => i.id === itemInfo.contract) ? contracts.find(i => i.id === itemInfo.contract).name : "Vertrag auswählen"}}
|
||||
</template>
|
||||
</USelectMenu>
|
||||
</UFormGroup>
|
||||
|
||||
@@ -93,12 +93,12 @@ const columns = computed(() => templateColumns.filter((column) => selectedColumn
|
||||
</UCard>
|
||||
|
||||
</UModal>
|
||||
<UDashboardNavbar title="E-Mail Accounts">
|
||||
<UDashboardNavbar title="E-Mail Konten">
|
||||
<template #right>
|
||||
<UButton
|
||||
@click="showEmailAddressModal = true"
|
||||
>
|
||||
+ Account
|
||||
+ E-Mail Konto
|
||||
</UButton>
|
||||
</template>
|
||||
</UDashboardNavbar>
|
||||
@@ -107,7 +107,7 @@ const columns = computed(() => templateColumns.filter((column) => selectedColumn
|
||||
:columns="columns"
|
||||
class="w-full"
|
||||
:ui="{ divide: 'divide-gray-200 dark:divide-gray-800' }"
|
||||
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine Projekte anzuzeigen' }"
|
||||
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine E-Mail Konten anzuzeigen' }"
|
||||
>
|
||||
<template #profiles-data="{row}">
|
||||
{{row.profiles.map(i => profiles.find(x => x.id === i).fullName).join(", ")}}
|
||||
|
||||
Reference in New Issue
Block a user