From 0672b67cbf7118c8b369e7e5c0860d53d5671533 Mon Sep 17 00:00:00 2001 From: Thanaphon Frappet Date: Mon, 28 Oct 2024 19:56:41 +0700 Subject: [PATCH] refactor: show namePrefix --- .../employee/BasicInformation.vue | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/03_customer-management/employee/BasicInformation.vue b/src/components/03_customer-management/employee/BasicInformation.vue index 3ee3b2f8..bccc421a 100644 --- a/src/components/03_customer-management/employee/BasicInformation.vue +++ b/src/components/03_customer-management/employee/BasicInformation.vue @@ -10,9 +10,11 @@ import { UndoButton, } from 'components/button'; import { useI18n } from 'vue-i18n'; +import useOptionStore from 'stores/options'; const { locale } = useI18n(); +const optionStore = useOptionStore(); const optionsBranch = defineModel<{ id: string; name: string }[]>( 'optionsBranch', { default: [] }, @@ -166,9 +168,10 @@ defineEmits<{ ? scope.opt.registerNameEN : scope.opt.registerName : $i18n.locale === 'eng' - ? `${scope.opt.firstNameEN} ${scope.opt.lastNameEN}` || + ? `${optionStore.mapOption(scope.opt.namePrefix)} ${scope.opt.firstNameEN} ${scope.opt.lastNameEN}` || + '-' + : `${optionStore.mapOption(scope.opt.namePrefix)} ${scope.opt.firstName} ${scope.opt.lastName}` || '-' - : `${scope.opt.firstName} ${scope.opt.lastName}` || '-' }} ({{ scope.opt.code }}) @@ -223,8 +226,10 @@ defineEmits<{ ? scope.opt.registerNameEN : scope.opt.registerName : $i18n.locale === 'eng' - ? `${scope.opt.firstNameEN} ${scope.opt.lastNameEN}` || '-' - : `${scope.opt.firstName} ${scope.opt.lastName}` || '-' + ? `${optionStore.mapOption(scope.opt.namePrefix)} ${scope.opt.firstNameEN} ${scope.opt.lastNameEN}` || + '-' + : `${optionStore.mapOption(scope.opt.namePrefix)} ${scope.opt.firstName} ${scope.opt.lastName}` || + '-' }} ({{ scope.opt.code }})