refactor: add submitWorkHistory and submitHealthCheck
This commit is contained in:
parent
5e525e43da
commit
7a81991c79
4 changed files with 170 additions and 15 deletions
|
|
@ -473,7 +473,8 @@ function createCustomerForm(customerType: 'CORP' | 'PERS') {
|
|||
}
|
||||
|
||||
function createEmployeeForm() {
|
||||
employeeFormStore.resetFormDataEmployee();
|
||||
employeeFormStore.resetFormDataEmployee(true);
|
||||
employeeFormState.value.dialogType = 'create';
|
||||
employeeFormState.value.dialogModal = true;
|
||||
}
|
||||
|
||||
|
|
@ -1947,11 +1948,24 @@ watch(
|
|||
:undo="() => employeeFormUndo(false)"
|
||||
:submit="
|
||||
async () => {
|
||||
await employeeFormStore.submitPersonal();
|
||||
if (employeeFormState.currentTab === 'personalInfo') {
|
||||
await employeeFormStore.submitPersonal();
|
||||
}
|
||||
if (employeeFormState.currentTab === 'healthCheck') {
|
||||
await employeeFormStore.submitHealthCheck();
|
||||
}
|
||||
{
|
||||
if (employeeFormState.currentTab === 'workHistory') {
|
||||
console.log('ทำงาน');
|
||||
|
||||
await employeeFormStore.submitWorkHistory();
|
||||
}
|
||||
}
|
||||
await fetchListEmployee();
|
||||
}
|
||||
"
|
||||
:close="
|
||||
:close="() => {}"
|
||||
:show="
|
||||
() => {
|
||||
employeeFormStore.resetFormDataEmployee(true);
|
||||
}
|
||||
|
|
@ -1967,7 +1981,6 @@ watch(
|
|||
"
|
||||
>
|
||||
<div class="q-mx-lg q-mt-lg">
|
||||
{{ employeeFormState.statusSavePersonal }}
|
||||
<ProfileBanner
|
||||
active
|
||||
useToggle
|
||||
|
|
@ -2186,6 +2199,19 @@ watch(
|
|||
v-model:insuranceCompanyOption="
|
||||
optionStore.globalOption.insurancePlace
|
||||
"
|
||||
@save="
|
||||
(index) => {
|
||||
employeeFormState.currentIndex = index;
|
||||
}
|
||||
"
|
||||
@edit="
|
||||
(index) => {
|
||||
if (currentFromDataEmployee.employeeCheckup?.[index].statusSave) {
|
||||
currentFromDataEmployee.employeeCheckup[index].statusSave =
|
||||
false;
|
||||
}
|
||||
}
|
||||
"
|
||||
/>
|
||||
<FormEmployeeWorkHistory
|
||||
v-if="employeeFormState.currentTab === 'workHistory'"
|
||||
|
|
@ -2197,6 +2223,18 @@ watch(
|
|||
v-model:position-name-option="optionStore.globalOption.position"
|
||||
v-model:job-type-option="optionStore.globalOption.businessType"
|
||||
v-model:workplace-option="optionStore.globalOption.area"
|
||||
@save="
|
||||
(index) => {
|
||||
employeeFormState.currentIndex = index;
|
||||
}
|
||||
"
|
||||
@edit="
|
||||
(index) => {
|
||||
if (currentFromDataEmployee.employeeWork?.[index].statusSave) {
|
||||
currentFromDataEmployee.employeeWork[index].statusSave = false;
|
||||
}
|
||||
}
|
||||
"
|
||||
/>
|
||||
<FormEmployeeOther
|
||||
v-if="employeeFormState.currentTab === 'other'"
|
||||
|
|
@ -2266,7 +2304,7 @@ watch(
|
|||
</template>
|
||||
</ImageUploadDialog>
|
||||
|
||||
<!-- นายจ้างนิติ -->
|
||||
<!-- ลูกจ้าง -->
|
||||
<DrawerInfo
|
||||
v-model:drawer-open="employeeFormState.drawerModal"
|
||||
:is-edit="employeeFormState.isEmployeeEdit"
|
||||
|
|
@ -2287,10 +2325,22 @@ watch(
|
|||
"
|
||||
:submit="
|
||||
async () => {
|
||||
await employeeFormStore.submitPersonal();
|
||||
if (employeeFormState.currentTab === 'personalInfo') {
|
||||
await employeeFormStore.submitPersonal();
|
||||
}
|
||||
if (employeeFormState.currentTab === 'healthCheck') {
|
||||
await employeeFormStore.submitHealthCheck();
|
||||
}
|
||||
await fetchListEmployee();
|
||||
|
||||
employeeFormState.isEmployeeEdit = false;
|
||||
}
|
||||
"
|
||||
:close="
|
||||
() => {
|
||||
employeeFormStore.resetFormDataEmployee(true);
|
||||
}
|
||||
"
|
||||
>
|
||||
<div class="full-height full-width column">
|
||||
<div class="q-mx-lg q-mt-lg">
|
||||
|
|
@ -2472,6 +2522,21 @@ watch(
|
|||
v-model:insuranceCompanyOption="
|
||||
optionStore.globalOption.insurancePlace
|
||||
"
|
||||
@save="
|
||||
(index) => {
|
||||
employeeFormState.currentIndex = index;
|
||||
}
|
||||
"
|
||||
@edit="
|
||||
(index) => {
|
||||
if (
|
||||
currentFromDataEmployee.employeeCheckup?.[index].statusSave
|
||||
) {
|
||||
currentFromDataEmployee.employeeCheckup[index].statusSave =
|
||||
false;
|
||||
}
|
||||
}
|
||||
"
|
||||
/>
|
||||
<FormEmployeeWorkHistory
|
||||
v-if="employeeFormState.currentTab === 'workHistory'"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue