From 828eab36f266f5e07ff1ad57de17c283fdde76ea Mon Sep 17 00:00:00 2001 From: Net Date: Thu, 26 Sep 2024 14:01:41 +0700 Subject: [PATCH] refactor: change minimum age --- src/i18n/eng/index.ts | 4 ++-- src/i18n/tha/index.ts | 4 ++-- src/pages/03_customer-management/MainPage.vue | 11 ++++------- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/i18n/eng/index.ts b/src/i18n/eng/index.ts index 353e1b9c..b2663f6d 100644 --- a/src/i18n/eng/index.ts +++ b/src/i18n/eng/index.ts @@ -627,7 +627,7 @@ export default { incompleteDataEntry: 'Incomplete Data Entry', confirmChangeStatus: 'Confirm Status Change', confirmDelete: 'Confirm Deletion {msg}', - youngWorker: 'Employee under 18', + youngWorker: 'Employee under 15', confirmLogout: 'Confirm Logout', }, message: { @@ -636,7 +636,7 @@ export default { confirmChangeStatusOn: 'Do you want to open?', confirmChangeStatusOff: 'Do you want to close?', confirmDelete: 'Do you want to delete this item?', - youngWorker: 'Employee is under 18 years old, do you want to confirm?', + youngWorker: 'Employee is under 15 years old, cannot record information.', confirmLogout: 'Do you want to Logout?', headquartersNotEstablished: 'Headoffice not established', warningClose: 'Incomplte edit data, Do you want to close?', diff --git a/src/i18n/tha/index.ts b/src/i18n/tha/index.ts index 9f3618bf..1e6a0536 100644 --- a/src/i18n/tha/index.ts +++ b/src/i18n/tha/index.ts @@ -642,7 +642,7 @@ export default { incompleteDataEntry: 'กรอกข้อมูลไม่ครบ', confirmChangeStatus: 'ยืนยันการเปลี่ยนสถานะ', confirmDelete: 'ยืนยันการลบ {msg}', - youngWorker: 'ลูกจ้างอายุต่ำกว่า 18 ปี', + youngWorker: 'ลูกจ้างอายุต่ำกว่า 15 ปี', confirmLogout: 'ยืนยันการออกจากระบบ', }, message: { @@ -651,7 +651,7 @@ export default { confirmChangeStatusOn: 'คุณต้องการเปิดใช่หรือไม่', confirmChangeStatusOff: 'คุณต้องการปิดใช่หรือไม่', confirmDelete: 'คุณต้องการลบรายการนี้ใช่หรือไม่', - youngWorker: 'ลูกจ้างอายุต่ำกว่า 18 ปี ต้องการยืนยันหรือไม่', + youngWorker: 'ลูกจ้างอายุต่ำกว่า 15 ปี จะไม่สามารถบันทึกข้อมูลได้', confirmLogout: 'คุณต้องการออกจากระบบใช่หรือไม่', headquartersNotEstablished: 'ยังไม่ได้สร้างสำนักงานใหญ่', warningClose: 'มีการแก้ไขที่ยังไม่ได้บันทึก คุณต้องการปิดใช่หรือไม่', diff --git a/src/pages/03_customer-management/MainPage.vue b/src/pages/03_customer-management/MainPage.vue index f5710f20..5b317047 100644 --- a/src/pages/03_customer-management/MainPage.vue +++ b/src/pages/03_customer-management/MainPage.vue @@ -714,17 +714,14 @@ watch( currentFromDataEmployee.value.dateOfBirth, 'year', ); - if (currentFromDataEmployee.value.dateOfBirth && Number(age) < 18) { + if (currentFromDataEmployee.value.dateOfBirth && Number(age) < 15) { dialog({ color: 'warning', icon: 'mdi-alert', title: t('dialog.title.youngWorker'), - actionText: t('dialog.action.ok'), - persistent: true, + cancelText: t('general.edit'), message: t('dialog.message.youngWorker'), - action: async () => { - return; - }, + cancel: async () => { currentFromDataEmployee.value.dateOfBirth = null; return; @@ -2303,7 +2300,7 @@ const emptyCreateDialog = ref(false); employeeFormState.isEmployeeEdit = false; employeeFormState.currentIndex = -1; - await fetchListEmployee(); + await fetchListEmployee(true); } " :show="