feat: request list => PropertiesExpansion display employee name

This commit is contained in:
puriphatt 2025-01-08 12:58:42 +07:00
parent a19e75e17d
commit 187ca4db0f
2 changed files with 20 additions and 1 deletions

View file

@ -17,6 +17,7 @@ import DialogDuplicateData from 'components/DialogDuplicateData.vue';
import useOptionStore from '../options';
import { CustomerBranch } from '../customer/types';
import { CustomerBranchRelation } from '../quotations';
import { Employee } from '../employee/types';
export const baseUrl = import.meta.env.VITE_API_BASE_URL;
@ -571,3 +572,17 @@ export function getCustomerName(
(opts?.noCode ? '' : ' ' + `(${customer.code})`)
);
}
export function getEmployeeName(
record: Employee,
opts?: {
locale?: string;
},
) {
const employee = record;
return {
['eng']: `${useOptionStore().mapOption(employee.namePrefix)} ${employee.firstNameEN} ${employee.lastNameEN}`,
['tha']: `${useOptionStore().mapOption(employee.namePrefix)} ${employee.firstName} ${employee.lastName}`,
}[opts?.locale || 'eng'];
}