refacot: Event of FormEmployeeOther and FormEmployeeHealthCheck

This commit is contained in:
Net 2024-08-09 15:28:48 +07:00
parent a016ad49f7
commit aed271da3d

View file

@ -2056,13 +2056,15 @@ watch(
if (employeeFormState.currentTab === 'healthCheck') { if (employeeFormState.currentTab === 'healthCheck') {
await employeeFormStore.submitHealthCheck(); await employeeFormStore.submitHealthCheck();
} }
{
if (employeeFormState.currentTab === 'workHistory') {
console.log('ทำงาน');
await employeeFormStore.submitWorkHistory(); if (employeeFormState.currentTab === 'workHistory') {
} await employeeFormStore.submitWorkHistory();
} }
if (employeeFormState.currentTab === 'other') {
await employeeFormStore.submitOther();
}
await fetchListEmployee(); await fetchListEmployee();
} }
" "
@ -2314,6 +2316,17 @@ watch(
employeeFormState.currentIndex = index; employeeFormState.currentIndex = index;
} }
" "
@undo="
(index) => {
if (
currentFromDataEmployee.employeeCheckup?.[index].statusSave ===
false
) {
currentFromDataEmployee.employeeCheckup[index].statusSave =
true;
}
}
"
@edit=" @edit="
(index) => { (index) => {
if (currentFromDataEmployee.employeeCheckup?.[index].statusSave) { if (currentFromDataEmployee.employeeCheckup?.[index].statusSave) {
@ -2338,6 +2351,16 @@ watch(
employeeFormState.currentIndex = index; employeeFormState.currentIndex = index;
} }
" "
@undo="
(index) => {
if (
currentFromDataEmployee.employeeWork?.[index].statusSave ===
false
) {
currentFromDataEmployee.employeeWork[index].statusSave = true;
}
}
"
@edit=" @edit="
(index) => { (index) => {
if (currentFromDataEmployee.employeeWork?.[index].statusSave) { if (currentFromDataEmployee.employeeWork?.[index].statusSave) {
@ -2353,6 +2376,22 @@ watch(
dense dense
outlined outlined
v-model:employee-other="currentFromDataEmployee.employeeOtherInfo" v-model:employee-other="currentFromDataEmployee.employeeOtherInfo"
@undo="
() => {
if (
currentFromDataEmployee.employeeOtherInfo?.statusSave === false
) {
currentFromDataEmployee.employeeOtherInfo.statusSave = true;
}
}
"
@edit="
() => {
if (currentFromDataEmployee.employeeOtherInfo?.statusSave) {
currentFromDataEmployee.employeeOtherInfo.statusSave = false;
}
}
"
/> />
</div> </div>
</div> </div>