refactor: quotation

This commit is contained in:
puriphatt 2024-09-30 16:36:18 +07:00
parent 66b30b9e3f
commit e4b9e186a8
3 changed files with 86 additions and 7 deletions

View file

@ -26,6 +26,10 @@ defineProps<{
prefixId: string;
}>();
defineEmits<{
(e: 'addCustomer'): void;
}>();
async function filter(
val: string,
update: (...args: unknown[]) => void,
@ -123,7 +127,11 @@ async function filter(
@filter="(val, update) => filter(val, update, 'customer')"
>
<template #option="{ scope }">
<q-item clickable v-if="scope.index === 0">
<q-item
clickable
v-if="scope.index === 0"
@click.stop="$emit('addCustomer')"
>
<q-item-section>
{{ $t('general.add', { text: $t('quotation.newCustomer') }) }}
</q-item-section>
@ -136,6 +144,14 @@ async function filter(
</q-item-section>
</q-item>
</template>
<template #noOption>
<q-item clickable @click.stop="$emit('addCustomer')">
<q-item-section>
{{ $t('general.add', { text: $t('quotation.newCustomer') }) }}
</q-item-section>
</q-item>
</template>
</SelectInput>
</div>
</div>