diff --git a/public/option/option.json b/public/option/option.json index e7231a66..b74ca61c 100644 --- a/public/option/option.json +++ b/public/option/option.json @@ -1747,7 +1747,7 @@ "value": "fee" }, { - "label": "ค่าดำเนินการ", + "label": "ค่าดำเนินงาน", "value": "processingFee" } ] diff --git a/src/components/03_customer-management/employee/BasicInformation.vue b/src/components/03_customer-management/employee/BasicInformation.vue index 82eeff62..f00585af 100644 --- a/src/components/03_customer-management/employee/BasicInformation.vue +++ b/src/components/03_customer-management/employee/BasicInformation.vue @@ -9,6 +9,9 @@ import { SaveButton, UndoButton, } from 'components/button'; +import { useI18n } from 'vue-i18n'; + +const { locale } = useI18n(); const optionsBranch = defineModel<{ id: string; name: string }[]>( 'optionsBranch', @@ -29,7 +32,7 @@ const customerBranch = defineModel<{ const nrcNo = defineModel('nrcNo'); const code = defineModel('code'); -defineProps<{ +const props = defineProps<{ noAction?: boolean; title?: string; dense?: boolean; @@ -56,6 +59,31 @@ let branchFilter: ( update: (callbackFn: () => void, afterFn?: (ref: QSelect) => void) => void, ) => void; +function listBranch(customerCode: string) { + if (!props.employeeOwnerOption) return ''; + const groupedLists: { [key: string]: CustomerBranch } = + props.employeeOwnerOption.reduce((acc, item) => { + const code = item.codeCustomer; + if (!acc[code]) { + acc[code] = []; + } + acc[code].push(item); + return acc; + }, {}); + const list: CustomerBranch[] = groupedLists[customerCode]; + const names = list.map((v) => { + return v.customer.customerType === 'CORP' + ? locale.value === 'eng' + ? v.registerNameEN + : v.registerName + : locale.value === 'eng' + ? `${v.firstNameEN} ${v.lastNameEN}` + : `${v.firstName} ${v.lastName}`; + }); + + return names.join(' / '); +} + watch( () => optionsBranch.value, () => { @@ -160,8 +188,6 @@ onMounted(() => { ]" >