From 3f414b156a1220f3f3f203f6f8fecc529ca457e4 Mon Sep 17 00:00:00 2001 From: Thanaphon Frappet Date: Mon, 4 Nov 2024 15:38:04 +0700 Subject: [PATCH] refactor: handle name prefix --- src/components/05_quotation/FormAbout.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/05_quotation/FormAbout.vue b/src/components/05_quotation/FormAbout.vue index 5b203cff..e0624e15 100644 --- a/src/components/05_quotation/FormAbout.vue +++ b/src/components/05_quotation/FormAbout.vue @@ -7,11 +7,13 @@ import SelectInput from '../shared/SelectInput.vue'; import { QSelect } from 'quasar'; import { Branch } from 'src/stores/branch/types'; import { CustomerBranch } from 'src/stores/customer/types'; +import useOptionStore from 'stores/options'; const { locale } = useI18n({ useScope: 'global' }); const branchStore = useBranchStore(); const customerStore = useCustomerStore(); +const optionStore = useOptionStore(); const branchId = defineModel('branchId'); const customerBranchId = defineModel('customerBranchId'); const agentPrice = defineModel('agentPrice'); @@ -81,6 +83,7 @@ async function init(val: string, type: 'branch' | 'customer') { label: v.registerName || `${v.firstName} ${v.lastName}` || '-', labelEN: v.registerNameEN || `${v.firstNameEN} ${v.lastNameEN}` || '-', + namePrefix: v.namePrefix, }), ); } @@ -163,6 +166,10 @@ onMounted(async () => { + {{ + optionStore.mapOption(scope.opt.namePrefix) || + $t('general.company') + }} {{ locale === 'eng' ? scope.opt.labelEN : scope.opt.label }}