Added Remove Button to CostCentre in IncomingInvoices

This commit is contained in:
2025-03-14 17:54:15 +01:00
parent d907f1ca01
commit c3fcb83da2
2 changed files with 45 additions and 26 deletions

View File

@@ -352,20 +352,30 @@ const createIncomingInvoice = async () => {
label="Kostenstelle" label="Kostenstelle"
class=" mb-3" class=" mb-3"
> >
<USelectMenu <InputGroup>
:options="dataStore.getCostCentresComposed" <USelectMenu
option-attribute="label" :options="dataStore.getCostCentresComposed"
value-attribute="id" option-attribute="label"
searchable value-attribute="id"
:search-attributes="['label']" searchable
searchable-placeholder="Suche..." :search-attributes="['label']"
v-model="item.costCentre" 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 #label>
</template> {{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> </UFormGroup>

View File

@@ -324,20 +324,29 @@ const updateIncomingInvoice = async () => {
label="Kostenstelle" label="Kostenstelle"
class=" mb-3" class=" mb-3"
> >
<USelectMenu <InputGroup>
:options="dataStore.getCostCentresComposed" <USelectMenu
option-attribute="label" :options="dataStore.getCostCentresComposed"
value-attribute="id" option-attribute="label"
searchable value-attribute="id"
:search-attributes="['label']" searchable
searchable-placeholder="Suche..." :search-attributes="['label']"
v-model="item.costCentre" 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 #label>
</template> {{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> </UFormGroup>