refactor: handle young worker 18
This commit is contained in:
parent
f54ca1bd68
commit
c6c0b6e78e
3 changed files with 33 additions and 7 deletions
|
|
@ -846,7 +846,8 @@ export default {
|
|||
incompleteDataEntry: 'Incomplete Data Entry',
|
||||
confirmChangeStatus: 'Confirm Status Change',
|
||||
confirmDelete: 'Confirm Deletion {msg}',
|
||||
youngWorker: 'Employee under 15',
|
||||
youngWorker15: 'Employee under 15',
|
||||
youngWorker18: 'Employee under 18',
|
||||
importWorker: 'Import Worker',
|
||||
confirmLogout: 'Confirm Logout',
|
||||
confirmQuotationAccept: 'Confirm acceptance of the quotation.',
|
||||
|
|
@ -858,7 +859,9 @@ 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 15 years old, cannot record information.',
|
||||
youngWorker15:
|
||||
'Employee is under 15 years old, cannot record information.',
|
||||
youngWorker18: 'Employees under the age of 18, do you wish to proceed?',
|
||||
confirmLogout: 'Do you want to Logout?',
|
||||
headquartersNotEstablished: 'Headoffice not established',
|
||||
warningClose: 'Incomplte edit data, Do you want to close?',
|
||||
|
|
|
|||
|
|
@ -838,7 +838,8 @@ export default {
|
|||
incompleteDataEntry: 'กรอกข้อมูลไม่ครบ',
|
||||
confirmChangeStatus: 'ยืนยันการเปลี่ยนสถานะ',
|
||||
confirmDelete: 'ยืนยันการลบ {msg}',
|
||||
youngWorker: 'ลูกจ้างอายุต่ำกว่า 15 ปี',
|
||||
youngWorker15: 'ลูกจ้างอายุต่ำกว่า 15 ปี',
|
||||
youngWorker18: 'ลูกจ้างอายุต่ำกว่า 18 ปี',
|
||||
importWorker: 'นำเข้าคนงาน',
|
||||
confirmLogout: 'ยืนยันการออกจากระบบ',
|
||||
confirmQuotationAccept: 'ยืนยันการตอบรับใบเสนอราคา',
|
||||
|
|
@ -850,7 +851,8 @@ export default {
|
|||
confirmChangeStatusOn: 'คุณต้องการเปิดใช่หรือไม่',
|
||||
confirmChangeStatusOff: 'คุณต้องการปิดใช่หรือไม่',
|
||||
confirmDelete: 'คุณต้องการลบรายการนี้ใช่หรือไม่',
|
||||
youngWorker: 'ลูกจ้างอายุต่ำกว่า 15 ปี จะไม่สามารถบันทึกข้อมูลได้',
|
||||
youngWorker15: 'ลูกจ้างอายุต่ำกว่า 15 ปี จะไม่สามารถบันทึกข้อมูลได้',
|
||||
youngWorker18: 'ลูกจ้างอายุต่ำกว่า 18 ปี คุณต้องการจะดำเนินการต่อหรือไม่',
|
||||
confirmLogout: 'คุณต้องการออกจากระบบใช่หรือไม่',
|
||||
headquartersNotEstablished: 'ยังไม่ได้สร้างสำนักงานใหญ่',
|
||||
warningClose: 'มีการแก้ไขที่ยังไม่ได้บันทึก คุณต้องการปิดใช่หรือไม่',
|
||||
|
|
|
|||
|
|
@ -708,7 +708,7 @@ watch(
|
|||
let currentFormDate = toISOStringWithTimezone(new Date(v));
|
||||
let currentDate: string = '';
|
||||
|
||||
if (isEdit) {
|
||||
if (isEdit && employeeFormState.value.currentEmployee) {
|
||||
currentDate = toISOStringWithTimezone(
|
||||
new Date(employeeFormState.value.currentEmployee.dateOfBirth),
|
||||
);
|
||||
|
|
@ -726,10 +726,10 @@ watch(
|
|||
dialog({
|
||||
color: 'warning',
|
||||
icon: 'mdi-alert',
|
||||
title: t('dialog.title.youngWorker'),
|
||||
title: t('dialog.title.youngWorker15'),
|
||||
cancelText: t('general.edit'),
|
||||
persistent: true,
|
||||
message: t('dialog.message.youngWorker'),
|
||||
message: t('dialog.message.youngWorker15'),
|
||||
|
||||
cancel: async () => {
|
||||
currentFromDataEmployee.value.dateOfBirth = null;
|
||||
|
|
@ -737,6 +737,27 @@ watch(
|
|||
},
|
||||
});
|
||||
}
|
||||
|
||||
if (
|
||||
currentFromDataEmployee.value.dateOfBirth &&
|
||||
Number(age) > 15 &&
|
||||
Number(age) <= 18
|
||||
) {
|
||||
dialog({
|
||||
color: 'warning',
|
||||
icon: 'mdi-alert',
|
||||
title: t('dialog.title.youngWorker18'),
|
||||
cancelText: t('general.cancel'),
|
||||
actionText: t('general.confirm'),
|
||||
persistent: true,
|
||||
message: t('dialog.message.youngWorker18'),
|
||||
action: () => {},
|
||||
cancel: async () => {
|
||||
currentFromDataEmployee.value.dateOfBirth = null;
|
||||
return;
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue