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"
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>