refactor: add props branch virtual

This commit is contained in:
Thanaphon Frappet 2024-11-29 10:16:51 +07:00
parent 89f67265b6
commit 3679de69f1
2 changed files with 11 additions and 7 deletions

View file

@ -57,11 +57,12 @@ defineEmits<{
<div class="col-12 row q-col-gutter-sm">
<SelectBranch
v-model:value="branchId"
:label="$t('quotation.branch')"
:label="$t('quotation.branchVirtual')"
class="col-md-6 col-12"
simple
required
:readonly
branch-virtual
/>
<SelectCustomer
v-model:value="customerBranchId"

View file

@ -27,6 +27,7 @@ defineEmits<{
type ExclusiveProps = {
selectFirstValue?: boolean;
branchVirtual?: boolean;
};
const props = defineProps<SelectProps<typeof getList> & ExclusiveProps>();
@ -80,12 +81,14 @@ function setDefaultValue() {
:option="
selectOptions.map((v) => {
const ret = {
label: (
{
['eng']: [v.nameEN, `(${v.code})`].join(' '),
['tha']: [v.name, `(${v.code})`].join(' '),
} as const
)[$i18n.locale],
label:
`${branchVirtual ? $t('branch.card.branchVirtual') : ''}` +
(
{
['eng']: [v.nameEN, `(${v.code})`].join(' '),
['tha']: [v.name, `(${v.code})`].join(' '),
} as const
)[$i18n.locale],
value: v.id,
};
return ret;