Merge branch 'refs/heads/dev' into beta

This commit is contained in:
2025-03-14 18:32:47 +01:00
5 changed files with 86 additions and 33 deletions

View File

@@ -375,7 +375,7 @@ const selectAll = () => {
</USelectMenu>
<UButton @click="modal.open(DocumentUploadModal,{fileData: {folder: currentFolder.id}})">+ Datei</UButton>
<UButton @click="modal.open(DocumentUploadModal,{fileData: {folder: currentFolder.id, type: currentFolder.standardFiletype, typeEnabled: currentFolder.standardFiletypeIsOptional}})">+ Datei</UButton>
<UButton
@click="createFolderModalOpen = true"
variant="outline"

View File

@@ -352,20 +352,30 @@ const createIncomingInvoice = async () => {
label="Kostenstelle"
class=" mb-3"
>
<USelectMenu
:options="dataStore.getCostCentresComposed"
option-attribute="label"
value-attribute="id"
searchable
:search-attributes="['label']"
searchable-placeholder="Suche..."
v-model="item.costCentre"
>
<template #label>
{{dataStore.getCostCentresComposed.find(account => account.id === item.costCentre) ? dataStore.getCostCentresComposed.find(account => account.id === item.costCentre).label : "Keine Kostenstelle ausgewählt" }}
</template>
<InputGroup>
<USelectMenu
:options="dataStore.getCostCentresComposed"
option-attribute="label"
value-attribute="id"
searchable
:search-attributes="['label']"
searchable-placeholder="Suche..."
v-model="item.costCentre"
>
<template #label>
{{dataStore.getCostCentresComposed.find(account => account.id === item.costCentre) ? dataStore.getCostCentresComposed.find(account => account.id === item.costCentre).label : "Keine Kostenstelle ausgewählt" }}
</template>
</USelectMenu>
<UButton
variant="outline"
color="rose"
v-if="item.costCentre"
icon="i-heroicons-x-mark"
@click="item.costCentre = null"
/>
</InputGroup>
</USelectMenu>
</UFormGroup>

View File

@@ -324,20 +324,29 @@ const updateIncomingInvoice = async () => {
label="Kostenstelle"
class=" mb-3"
>
<USelectMenu
:options="dataStore.getCostCentresComposed"
option-attribute="label"
value-attribute="id"
searchable
:search-attributes="['label']"
searchable-placeholder="Suche..."
v-model="item.costCentre"
>
<template #label>
{{dataStore.getCostCentresComposed.find(account => account.id === item.costCentre) ? dataStore.getCostCentresComposed.find(account => account.id === item.costCentre).label : "Keine Kostenstelle ausgewählt" }}
</template>
<InputGroup>
<USelectMenu
:options="dataStore.getCostCentresComposed"
option-attribute="label"
value-attribute="id"
searchable
:search-attributes="['label']"
searchable-placeholder="Suche..."
v-model="item.costCentre"
>
<template #label>
{{dataStore.getCostCentresComposed.find(account => account.id === item.costCentre) ? dataStore.getCostCentresComposed.find(account => account.id === item.costCentre).label : "Keine Kostenstelle ausgewählt" }}
</template>
</USelectMenu>
</USelectMenu>
<UButton
variant="outline"
color="rose"
v-if="item.costCentre"
icon="i-heroicons-x-mark"
@click="item.costCentre = null"
/>
</InputGroup>
</UFormGroup>

View File

@@ -5,8 +5,10 @@ const profileStore = useProfileStore()
const router = useRouter()
const tickets = ref([])
const tenants = ref([])
const showClosedTickets = ref(false)
const selectedTenant = ref(null)
const setup = async () => {
if(profileStore.currentTenant === 5) {
@@ -14,18 +16,33 @@ const setup = async () => {
} else {
tickets.value = (await supabase.from("tickets").select("*,created_by(*), ticketmessages(*)").eq("tenant",profileStore.currentTenant).order("created_at", {ascending: false})).data
}
if(profileStore.currentTenant === 5) {
tenants.value = (await supabase.from("tenants").select().order("id")).data
}
}
setup()
const filteredRows = computed(() => {
let items = tickets.value
if(showClosedTickets.value) {
return tickets.value
} else {
return tickets.value.filter(i => i.status !== "Geschlossen")
if(!showClosedTickets.value) {
items = items.filter(i => i.status !== "Geschlossen")
}
if(selectedTenant.value) {
console.log(selectedTenant.value)
console.log(items)
console.log(items.filter(i => i.tenant.id === selectedTenant.value))
items = items.filter(i => i.tenant.id === selectedTenant.value)
}
return items
})
</script>
@@ -49,6 +66,18 @@ const filteredRows = computed(() => {
label="Geschlossene Tickets anzeigen"
v-model="showClosedTickets"
/>
<USelectMenu
v-if="profileStore.currentTenant === 5"
:ui-menu="{ width: 'min-w-max' }"
:options="tenants"
option-attribute="name"
value-attribute="id"
v-model="selectedTenant"
>
<template #label>
{{selectedTenant ? tenants.find(i => i.id === selectedTenant).name : "Nicht nach Tenant filtern"}}
</template>
</USelectMenu>
</template>
</UDashboardToolbar>
<UTable