feat: i18n register name en
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 5s

This commit is contained in:
Aif 2025-10-14 15:17:13 +07:00
parent 72b0e89642
commit db5262da42
2 changed files with 20 additions and 6 deletions

View file

@ -83,11 +83,16 @@ defineEmits<{
<!-- NOTE: custom column will starts with # --> <!-- NOTE: custom column will starts with # -->
<template v-if="!col.name.startsWith('#')"> <template v-if="!col.name.startsWith('#')">
<span> <span>
<template v-if="typeof col.field === 'function'">
{{ {{
typeof col.field === 'string' typeof col.field(props.row) === 'object'
? props.row[col.field as keyof Invoice] ? col.field(props.row)[$i18n.locale]
: col.field(props.row) : col.field(props.row)
}} }}
</template>
<template v-else>
{{ props.row[col.field as keyof Invoice] }}
</template>
</span> </span>
</template> </template>
<template v-if="col.name === '#order'"> <template v-if="col.name === '#order'">

View file

@ -29,7 +29,16 @@ export const columns = [
name: 'customer', name: 'customer',
align: 'center', align: 'center',
label: 'general.customer', label: 'general.customer',
field: (v: Invoice) => v.quotation.customerBranch.registerName, field: (v: Invoice) =>
v.quotation.customerBranch.customer.customerType === 'CORP'
? {
tha: v.quotation.customerBranch.registerName,
eng: v.quotation.customerBranch.registerNameEN,
}
: {
tha: `${v.quotation.customerBranch.firstName || ''} ${v.quotation.customerBranch.lastName || ''}`,
eng: `${v.quotation.customerBranch.firstNameEN || ''} ${v.quotation.customerBranch.lastNameEN || ''}`,
},
}, },
{ {