diff --git a/src/pages/03_customer-management/MainPage.vue b/src/pages/03_customer-management/MainPage.vue index 36e7b9c0..3021c1ce 100644 --- a/src/pages/03_customer-management/MainPage.vue +++ b/src/pages/03_customer-management/MainPage.vue @@ -12,7 +12,12 @@ import useOcrStore from 'stores/ocr'; import useCustomerStore from 'stores/customer'; import useEmployeeStore from 'stores/employee'; import useMyBranchStore from 'stores/my-branch'; -import { dialog, notify, resetScrollBar } from 'stores/utils'; +import { + dialog, + notify, + resetScrollBar, + capitalizeFirstLetter, +} from 'stores/utils'; import { useNavigator } from 'src/stores/navigator'; import useFlowStore from 'stores/flow'; import { Status } from 'stores/types'; @@ -21,6 +26,7 @@ import { Customer, CustomerBranch, CustomerBranchCreate, + CustomerType, } from 'stores/customer/types'; import { Employee, EmployeeHistory } from 'stores/employee/types'; import { @@ -627,7 +633,8 @@ function customerFormUndo(close = true) { async function createCustomerForm(customerType: 'CORP' | 'PERS') { customerFormState.value.dialogModal = true; customerFormState.value.dialogType = 'create'; - customerFormData.value.customerType = customerType; + customerFormData.value.customerType = + customerType === 'CORP' ? CustomerType.Corporate : CustomerType.Person; } function createEmployeeForm() { @@ -705,7 +712,7 @@ watch( const isEdit = employeeFormState.value.drawerModal && employeeFormState.value.isEmployeeEdit; - let currentFormDate = toISOStringWithTimezone(new Date(v)); + let currentFormDate = v && toISOStringWithTimezone(new Date(v)); let currentDate: string = ''; if (isEdit && employeeFormState.value.currentEmployee) { @@ -1268,7 +1275,11 @@ const emptyCreateDialog = ref(false); {{ props.row.customerType === 'CORP' ? props.row.branch[0]?.registerNameEN || '-' - : props.row.branch[0]?.firstNameEN + + : capitalizeFirstLetter( + props.row.branch[0].namePrefix, + ) + + ' ' + + props.row.branch[0]?.firstNameEN + ' ' + props.row.branch[0]?.lastNameEN || '-' }} @@ -1513,7 +1524,7 @@ const emptyCreateDialog = ref(false);