refactor: handle show data readonly
This commit is contained in:
parent
4515f93933
commit
6fa930ff29
1 changed files with 691 additions and 426 deletions
|
|
@ -646,7 +646,6 @@ watch(
|
||||||
currentFromDataEmployee.value.provinceId = e.provinceId;
|
currentFromDataEmployee.value.provinceId = e.provinceId;
|
||||||
currentFromDataEmployee.value.districtId = e.districtId;
|
currentFromDataEmployee.value.districtId = e.districtId;
|
||||||
currentFromDataEmployee.value.subDistrictId = e.subDistrictId;
|
currentFromDataEmployee.value.subDistrictId = e.subDistrictId;
|
||||||
currentFromDataEmployee.value.zipCode = e.zipCode;
|
|
||||||
}
|
}
|
||||||
currentFromDataEmployee.value.customerBranchId = e.id;
|
currentFromDataEmployee.value.customerBranchId = e.id;
|
||||||
},
|
},
|
||||||
|
|
@ -667,8 +666,6 @@ watch(
|
||||||
employeeFormState.value.formDataEmployeeOwner.districtId;
|
employeeFormState.value.formDataEmployeeOwner.districtId;
|
||||||
currentFromDataEmployee.value.subDistrictId =
|
currentFromDataEmployee.value.subDistrictId =
|
||||||
employeeFormState.value.formDataEmployeeOwner.subDistrictId;
|
employeeFormState.value.formDataEmployeeOwner.subDistrictId;
|
||||||
currentFromDataEmployee.value.zipCode =
|
|
||||||
employeeFormState.value.formDataEmployeeOwner.zipCode;
|
|
||||||
}
|
}
|
||||||
currentFromDataEmployee.value.customerBranchId =
|
currentFromDataEmployee.value.customerBranchId =
|
||||||
employeeFormState.value.formDataEmployeeOwner.id;
|
employeeFormState.value.formDataEmployeeOwner.id;
|
||||||
|
|
@ -1581,6 +1578,7 @@ const emptyCreateDialog = ref(false);
|
||||||
v !== 'contactName'
|
v !== 'contactName'
|
||||||
);
|
);
|
||||||
})"
|
})"
|
||||||
|
!
|
||||||
:key="key"
|
:key="key"
|
||||||
>
|
>
|
||||||
<span class="col-4 app-text-muted">
|
<span class="col-4 app-text-muted">
|
||||||
|
|
@ -2300,7 +2298,6 @@ const emptyCreateDialog = ref(false);
|
||||||
}
|
}
|
||||||
statusEmployeeCreate = true;
|
statusEmployeeCreate = true;
|
||||||
employeeFormState.isEmployeeEdit = false;
|
employeeFormState.isEmployeeEdit = false;
|
||||||
employeeFormState.currentIndex = -1;
|
|
||||||
|
|
||||||
await fetchListEmployee(true);
|
await fetchListEmployee(true);
|
||||||
}
|
}
|
||||||
|
|
@ -2496,12 +2493,46 @@ const emptyCreateDialog = ref(false);
|
||||||
sub: true,
|
sub: true,
|
||||||
})) || []),
|
})) || []),
|
||||||
|
|
||||||
|
{
|
||||||
|
name: $t('customerEmployee.form.group.visa'),
|
||||||
|
anchor: 'form-employee-checkup',
|
||||||
|
tab: 'healthCheck',
|
||||||
|
useBtn:
|
||||||
|
currentFromDataEmployee.employeeCheckup?.filter(
|
||||||
|
(item) => {
|
||||||
|
if (item.id === undefined) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
).length === 0 &&
|
||||||
|
employeeFormState.currentIndexCheckup === -1
|
||||||
|
? true
|
||||||
|
: false,
|
||||||
|
},
|
||||||
|
|
||||||
...(currentFromDataEmployee.employeeCheckup?.map((v, i) => ({
|
...(currentFromDataEmployee.employeeCheckup?.map((v, i) => ({
|
||||||
name: $t('general.times', { number: i + 1 }),
|
name: $t('general.times', { number: i + 1 }),
|
||||||
anchor: `form-employee-checkup-${i}`,
|
anchor: `form-employee-checkup-${i}`,
|
||||||
tab: 'healthCheck',
|
tab: 'healthCheck',
|
||||||
})) || []),
|
})) || []),
|
||||||
|
|
||||||
|
{
|
||||||
|
name: $t('customerEmployee.form.group.workHistory'),
|
||||||
|
anchor: 'form-employee-work-history',
|
||||||
|
tab: 'workHistory',
|
||||||
|
useBtn:
|
||||||
|
currentFromDataEmployee.employeeWork?.filter((item) => {
|
||||||
|
if (item.id === undefined) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}).length === 0 &&
|
||||||
|
employeeFormState.currentIndexWorkHistory === -1
|
||||||
|
? true
|
||||||
|
: false,
|
||||||
|
},
|
||||||
|
|
||||||
...(currentFromDataEmployee.employeeWork?.map((v, i) => ({
|
...(currentFromDataEmployee.employeeWork?.map((v, i) => ({
|
||||||
name: $t('general.times', { number: i + 1 }),
|
name: $t('general.times', { number: i + 1 }),
|
||||||
anchor: `form-employee-work-history-${i}`,
|
anchor: `form-employee-work-history-${i}`,
|
||||||
|
|
@ -2524,6 +2555,7 @@ const emptyCreateDialog = ref(false);
|
||||||
>
|
>
|
||||||
<template v-slot:btn-form-passport>
|
<template v-slot:btn-form-passport>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
id="form-add-passport"
|
||||||
dense
|
dense
|
||||||
flat
|
flat
|
||||||
icon="mdi-plus"
|
icon="mdi-plus"
|
||||||
|
|
@ -2537,6 +2569,7 @@ const emptyCreateDialog = ref(false);
|
||||||
|
|
||||||
<template v-slot:btn-drawer-visa>
|
<template v-slot:btn-drawer-visa>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
id="form-add-visa"
|
||||||
dense
|
dense
|
||||||
flat
|
flat
|
||||||
icon="mdi-plus"
|
icon="mdi-plus"
|
||||||
|
|
@ -2546,6 +2579,32 @@ const emptyCreateDialog = ref(false);
|
||||||
@click.stop="employeeFormStore.addVisa()"
|
@click.stop="employeeFormStore.addVisa()"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template v-slot:btn-drawer-employee-checkup>
|
||||||
|
<q-btn
|
||||||
|
id="form-add-checkup"
|
||||||
|
dense
|
||||||
|
flat
|
||||||
|
icon="mdi-plus"
|
||||||
|
size="sm"
|
||||||
|
rounded
|
||||||
|
style="color: var(--stone-9)"
|
||||||
|
@click.stop="employeeFormStore.addCheckup()"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template v-slot:btn-drawer-employee-work-history>
|
||||||
|
<q-btn
|
||||||
|
id="form-add-work-history"
|
||||||
|
dense
|
||||||
|
flat
|
||||||
|
icon="mdi-plus"
|
||||||
|
size="sm"
|
||||||
|
rounded
|
||||||
|
style="color: var(--stone-9)"
|
||||||
|
@click.stop="employeeFormStore.addWorkHistory()"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
</SideMenu>
|
</SideMenu>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -3175,13 +3234,13 @@ const emptyCreateDialog = ref(false);
|
||||||
@click.stop="
|
@click.stop="
|
||||||
() => {
|
() => {
|
||||||
employeeFormState.currentIndexPassport = index;
|
employeeFormState.currentIndexPassport = index;
|
||||||
deleteEmployeeById({ type: 'passport' });
|
deleteEmployeeById({ type: 'passport', index });
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
type="button"
|
type="button"
|
||||||
:disabled="
|
:disabled="
|
||||||
!(employeeFormState.currentIndex === -1) &&
|
!(employeeFormState.currentIndexPassport === -1) &&
|
||||||
!(employeeFormState.currentIndex === index)
|
!(employeeFormState.currentIndexPassport === index)
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -3191,6 +3250,19 @@ const emptyCreateDialog = ref(false);
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="employeeFormState.currentTab === 'visa'">
|
<template v-if="employeeFormState.currentTab === 'visa'">
|
||||||
|
<div class="q-gutter-sm">
|
||||||
|
<div class="col-12 q-pb-sm text-weight-bold text-body1">
|
||||||
|
<q-icon
|
||||||
|
flat
|
||||||
|
size="xs"
|
||||||
|
class="q-pa-sm rounded q-mr-xs"
|
||||||
|
color="info"
|
||||||
|
name="mdi-passport"
|
||||||
|
style="background-color: var(--surface-3)"
|
||||||
|
/>
|
||||||
|
{{ $t('customerEmployee.form.group.visa') }}
|
||||||
|
</div>
|
||||||
|
|
||||||
<FormEmployeeVisa
|
<FormEmployeeVisa
|
||||||
v-for="(value, index) in currentFromDataEmployee.employeeVisa"
|
v-for="(value, index) in currentFromDataEmployee.employeeVisa"
|
||||||
prefix-id="drawer-info-employee"
|
prefix-id="drawer-info-employee"
|
||||||
|
|
@ -3199,13 +3271,22 @@ const emptyCreateDialog = ref(false);
|
||||||
outlined
|
outlined
|
||||||
title="customerEmployee.form.group.visa"
|
title="customerEmployee.form.group.visa"
|
||||||
:readonly="employeeFormState.currentIndexVisa !== index"
|
:readonly="employeeFormState.currentIndexVisa !== index"
|
||||||
v-model:visa-type="value.type"
|
hide-title
|
||||||
v-model:visa-number="value.number"
|
v-model:arrival-at="value.arrivalAt"
|
||||||
|
v-model:arrival-tm-no="value.arrivalTMNo"
|
||||||
|
v-model:arrival-tm="value.arrivalTM"
|
||||||
|
v-model:mrz="value.mrz"
|
||||||
|
v-model:entry-count="value.entryCount"
|
||||||
|
v-model:issue-place="value.issuePlace"
|
||||||
|
v-model:issue-country="value.issueCountry"
|
||||||
|
v-model:issueDate="value.issueDate"
|
||||||
|
v-model:type="value.type"
|
||||||
|
v-model:expire-date="value.expireDate"
|
||||||
v-model:visa-issue-date="value.issueDate"
|
v-model:visa-issue-date="value.issueDate"
|
||||||
v-model:visa-expiry-date="value.expireDate"
|
v-model:visa-expiry-date="value.expireDate"
|
||||||
v-model:visa-issuing-place="value.issuePlace"
|
v-model:remark="value.remark"
|
||||||
v-model:entry-count="value.entryCount"
|
v-model:worker-type="value.workerType"
|
||||||
v-model:issue-country="value.issueCountry"
|
v-model:number="value.number"
|
||||||
>
|
>
|
||||||
<template v-slot:expiryDate>
|
<template v-slot:expiryDate>
|
||||||
{{ $t('general.expirationDate') }} :
|
{{ $t('general.expirationDate') }} :
|
||||||
|
|
@ -3284,29 +3365,48 @@ const emptyCreateDialog = ref(false);
|
||||||
@click.stop="
|
@click.stop="
|
||||||
() => {
|
() => {
|
||||||
employeeFormState.currentIndexVisa = index;
|
employeeFormState.currentIndexVisa = index;
|
||||||
deleteEmployeeById({ type: 'visa' });
|
deleteEmployeeById({ type: 'visa', index });
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
type="button"
|
type="button"
|
||||||
:disabled="
|
:disabled="
|
||||||
!(employeeFormState.currentIndex === -1) &&
|
!(employeeFormState.currentIndexVisa === -1) &&
|
||||||
!(employeeFormState.currentIndex === index)
|
!(employeeFormState.currentIndexVisa === index)
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</FormEmployeeVisa>
|
</FormEmployeeVisa>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="employeeFormState.currentTab === 'healthCheck'">
|
<template v-if="employeeFormState.currentTab === 'healthCheck'">
|
||||||
|
<div class="q-gutter-sm">
|
||||||
|
<div class="q-pb-sm text-weight-bold text-body1 row items-center">
|
||||||
|
<q-icon
|
||||||
|
flat
|
||||||
|
size="xs"
|
||||||
|
class="q-pa-sm rounded q-mr-sm"
|
||||||
|
color="info"
|
||||||
|
name="mdi-hospital-box-outline"
|
||||||
|
style="background-color: var(--surface-3)"
|
||||||
|
/>
|
||||||
|
|
||||||
|
{{ $t(`customerEmployee.formHealthCheck.title`) }}
|
||||||
|
</div>
|
||||||
<FormEmployeeHealthCheck
|
<FormEmployeeHealthCheck
|
||||||
v-if="employeeFormState.currentTab === 'healthCheck'"
|
v-if="employeeFormState.currentTab === 'healthCheck'"
|
||||||
id="form-checkup"
|
id="form-checkup"
|
||||||
prefix-id="form-employee"
|
prefix-id="form-employee"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
v-model:current-index="employeeFormState.currentIndex"
|
v-model:current-index="employeeFormState.currentIndexCheckup"
|
||||||
v-model:employee-checkup="currentFromDataEmployee.employeeCheckup"
|
v-model:employee-checkup="
|
||||||
|
currentFromDataEmployee.employeeCheckup
|
||||||
|
"
|
||||||
|
v-model:checkup-results-option="
|
||||||
|
optionStore.globalOption.checkupResults
|
||||||
|
"
|
||||||
v-model:checkup-type-option="
|
v-model:checkup-type-option="
|
||||||
optionStore.globalOption.insurancePlace
|
optionStore.globalOption.insurancePlace
|
||||||
"
|
"
|
||||||
|
|
@ -3318,13 +3418,13 @@ const emptyCreateDialog = ref(false);
|
||||||
"
|
"
|
||||||
@delete="
|
@delete="
|
||||||
(index) => {
|
(index) => {
|
||||||
employeeFormState.currentIndex = index;
|
employeeFormState.currentIndexCheckup = index;
|
||||||
deleteEmployeeById({ type: 'healthCheck' });
|
deleteEmployeeById({ type: 'healthCheck', index });
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
@save="
|
@save="
|
||||||
(index) => {
|
(index) => {
|
||||||
employeeFormState.currentIndex = index;
|
employeeFormState.currentIndexCheckup = index;
|
||||||
notify('create', $t('general.success'));
|
notify('create', $t('general.success'));
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
|
|
@ -3334,52 +3434,72 @@ const emptyCreateDialog = ref(false);
|
||||||
currentFromDataEmployee.employeeCheckup?.[index]
|
currentFromDataEmployee.employeeCheckup?.[index]
|
||||||
.statusSave === false
|
.statusSave === false
|
||||||
) {
|
) {
|
||||||
currentFromDataEmployee.employeeCheckup[index].statusSave =
|
currentFromDataEmployee.employeeCheckup[
|
||||||
true;
|
index
|
||||||
|
].statusSave = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
@edit="
|
@edit="
|
||||||
(index) => {
|
(index) => {
|
||||||
if (
|
if (
|
||||||
currentFromDataEmployee.employeeCheckup?.[index].statusSave
|
currentFromDataEmployee.employeeCheckup?.[index]
|
||||||
|
.statusSave
|
||||||
) {
|
) {
|
||||||
currentFromDataEmployee.employeeCheckup[index].statusSave =
|
currentFromDataEmployee.employeeCheckup[
|
||||||
false;
|
index
|
||||||
|
].statusSave = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="employeeFormState.currentTab === 'workHistory'">
|
<template v-if="employeeFormState.currentTab === 'workHistory'">
|
||||||
|
<div class="q-gutter-sm">
|
||||||
|
<div
|
||||||
|
class="col-12 q-pb-sm text-weight-bold text-body1 row items-center"
|
||||||
|
>
|
||||||
|
<q-icon
|
||||||
|
flat
|
||||||
|
size="xs"
|
||||||
|
class="q-pa-sm rounded q-mr-xs"
|
||||||
|
color="info"
|
||||||
|
name="mdi-briefcase-outline"
|
||||||
|
style="background-color: var(--surface-3)"
|
||||||
|
/>
|
||||||
|
{{ $t(`customerEmployee.form.group.workHistory`) }}
|
||||||
|
</div>
|
||||||
<FormEmployeeWorkHistory
|
<FormEmployeeWorkHistory
|
||||||
v-if="employeeFormState.currentTab === 'workHistory'"
|
v-if="employeeFormState.currentTab === 'workHistory'"
|
||||||
id="form-work-history"
|
id="form-work-history"
|
||||||
prefix-id="form-employee"
|
prefix-id="form-employee"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
v-model:current-index="employeeFormState.currentIndex"
|
v-model:current-index="
|
||||||
|
employeeFormState.currentIndexWorkHistory
|
||||||
|
"
|
||||||
v-model:employee-work="currentFromDataEmployee.employeeWork"
|
v-model:employee-work="currentFromDataEmployee.employeeWork"
|
||||||
v-model:position-name-option="optionStore.globalOption.position"
|
v-model:position-name-option="optionStore.globalOption.position"
|
||||||
v-model:job-type-option="optionStore.globalOption.businessType"
|
v-model:job-type-option="optionStore.globalOption.businessType"
|
||||||
v-model:workplace-option="optionStore.globalOption.area"
|
v-model:workplace-option="optionStore.globalOption.area"
|
||||||
@delete="
|
@delete="
|
||||||
(index) => {
|
(index) => {
|
||||||
employeeFormState.currentIndex = index;
|
employeeFormState.currentIndexWorkHistory = index;
|
||||||
deleteEmployeeById({ type: 'work' });
|
deleteEmployeeById({ type: 'work', index });
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
@save="
|
@save="
|
||||||
(index) => {
|
(index) => {
|
||||||
employeeFormState.currentIndex = index;
|
employeeFormState.currentIndexWorkHistory = index;
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
@undo="
|
@undo="
|
||||||
(index) => {
|
(index) => {
|
||||||
if (
|
if (
|
||||||
currentFromDataEmployee.employeeWork?.[index].statusSave ===
|
currentFromDataEmployee.employeeWork?.[index]
|
||||||
false
|
.statusSave === false
|
||||||
) {
|
) {
|
||||||
currentFromDataEmployee.employeeWork[index].statusSave =
|
currentFromDataEmployee.employeeWork[index].statusSave =
|
||||||
true;
|
true;
|
||||||
|
|
@ -3397,7 +3517,7 @@ const emptyCreateDialog = ref(false);
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
a
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="employeeFormState.currentTab === 'other'">
|
<template v-if="employeeFormState.currentTab === 'other'">
|
||||||
|
|
@ -4071,7 +4191,6 @@ const emptyCreateDialog = ref(false);
|
||||||
await fetchListEmployee();
|
await fetchListEmployee();
|
||||||
|
|
||||||
employeeFormState.isEmployeeEdit = false;
|
employeeFormState.isEmployeeEdit = false;
|
||||||
employeeFormState.currentIndex = -1;
|
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
:before-close="
|
:before-close="
|
||||||
|
|
@ -4248,6 +4367,24 @@ const emptyCreateDialog = ref(false);
|
||||||
sub: true,
|
sub: true,
|
||||||
})) || []),
|
})) || []),
|
||||||
|
|
||||||
|
{
|
||||||
|
name: $t('customerEmployee.form.group.visa'),
|
||||||
|
anchor: 'drawer-employee-checkup',
|
||||||
|
tab: 'healthCheck',
|
||||||
|
useBtn:
|
||||||
|
currentFromDataEmployee.employeeCheckup?.filter(
|
||||||
|
(item) => {
|
||||||
|
if (item.id === undefined) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
).length === 0 &&
|
||||||
|
employeeFormState.currentIndexCheckup === -1
|
||||||
|
? true
|
||||||
|
: false,
|
||||||
|
},
|
||||||
|
|
||||||
...(currentFromDataEmployee.employeeCheckup?.map(
|
...(currentFromDataEmployee.employeeCheckup?.map(
|
||||||
(_v, i) => ({
|
(_v, i) => ({
|
||||||
name: $t('general.times', { number: i + 1 }),
|
name: $t('general.times', { number: i + 1 }),
|
||||||
|
|
@ -4255,11 +4392,29 @@ const emptyCreateDialog = ref(false);
|
||||||
tab: 'healthCheck',
|
tab: 'healthCheck',
|
||||||
}),
|
}),
|
||||||
) || []),
|
) || []),
|
||||||
|
|
||||||
|
{
|
||||||
|
name: $t('customerEmployee.form.group.workHistory'),
|
||||||
|
anchor: 'drawer-employee-work-history',
|
||||||
|
tab: 'workHistory',
|
||||||
|
useBtn:
|
||||||
|
currentFromDataEmployee.employeeWork?.filter((item) => {
|
||||||
|
if (item.id === undefined) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}).length === 0 &&
|
||||||
|
employeeFormState.currentIndexWorkHistory === -1
|
||||||
|
? true
|
||||||
|
: false,
|
||||||
|
},
|
||||||
|
|
||||||
...(currentFromDataEmployee.employeeWork?.map((_v, i) => ({
|
...(currentFromDataEmployee.employeeWork?.map((_v, i) => ({
|
||||||
name: $t('general.times', { number: i + 1 }),
|
name: $t('general.times', { number: i + 1 }),
|
||||||
anchor: `drawer-employee-work-history-${i}`,
|
anchor: `drawer-employee-work-history-${i}`,
|
||||||
tab: 'workHistory',
|
tab: 'workHistory',
|
||||||
})) || []),
|
})) || []),
|
||||||
|
|
||||||
{
|
{
|
||||||
name: $t('customerEmployee.form.group.family'),
|
name: $t('customerEmployee.form.group.family'),
|
||||||
anchor: 'drawer-other',
|
anchor: 'drawer-other',
|
||||||
|
|
@ -4276,6 +4431,8 @@ const emptyCreateDialog = ref(false);
|
||||||
>
|
>
|
||||||
<template v-slot:btn-drawer-passport>
|
<template v-slot:btn-drawer-passport>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
v-if="currentTab === 'employee'"
|
||||||
|
id="form-add-passport"
|
||||||
dense
|
dense
|
||||||
flat
|
flat
|
||||||
icon="mdi-plus"
|
icon="mdi-plus"
|
||||||
|
|
@ -4289,6 +4446,8 @@ const emptyCreateDialog = ref(false);
|
||||||
|
|
||||||
<template v-slot:btn-drawer-visa>
|
<template v-slot:btn-drawer-visa>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
v-if="currentTab === 'employee'"
|
||||||
|
id="form-add-visa"
|
||||||
dense
|
dense
|
||||||
flat
|
flat
|
||||||
icon="mdi-plus"
|
icon="mdi-plus"
|
||||||
|
|
@ -4298,6 +4457,34 @@ const emptyCreateDialog = ref(false);
|
||||||
@click.stop="employeeFormStore.addVisa()"
|
@click.stop="employeeFormStore.addVisa()"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template v-slot:btn-drawer-employee-checkup>
|
||||||
|
<q-btn
|
||||||
|
v-if="currentTab === 'employee'"
|
||||||
|
id="form-add-checkup"
|
||||||
|
dense
|
||||||
|
flat
|
||||||
|
icon="mdi-plus"
|
||||||
|
size="sm"
|
||||||
|
rounded
|
||||||
|
style="color: var(--stone-9)"
|
||||||
|
@click.stop="employeeFormStore.addCheckup()"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template v-slot:btn-drawer-employee-work-history>
|
||||||
|
<q-btn
|
||||||
|
v-if="currentTab === 'employee'"
|
||||||
|
id="form-add-work-history"
|
||||||
|
dense
|
||||||
|
flat
|
||||||
|
icon="mdi-plus"
|
||||||
|
size="sm"
|
||||||
|
rounded
|
||||||
|
style="color: var(--stone-9)"
|
||||||
|
@click.stop="employeeFormStore.addWorkHistory()"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
</SideMenu>
|
</SideMenu>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -4806,7 +4993,7 @@ const emptyCreateDialog = ref(false);
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="employeeFormState.currentTab === 'passport'">
|
<template v-if="employeeFormState.currentTab === 'passport'">
|
||||||
<div class="q-gutter-sm">
|
<div class="q-gutter-sm full-width">
|
||||||
<div class="col-12 q-pb-sm text-weight-bold text-body1">
|
<div class="col-12 q-pb-sm text-weight-bold text-body1">
|
||||||
<q-icon
|
<q-icon
|
||||||
flat
|
flat
|
||||||
|
|
@ -4943,18 +5130,38 @@ const emptyCreateDialog = ref(false);
|
||||||
"
|
"
|
||||||
type="button"
|
type="button"
|
||||||
:disabled="
|
:disabled="
|
||||||
!(employeeFormState.currentIndex === -1) &&
|
!(employeeFormState.currentIndexPassport === -1) &&
|
||||||
!(employeeFormState.currentIndex === index)
|
!(employeeFormState.currentIndexPassport === index)
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</FormEmployeePassport>
|
</FormEmployeePassport>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<div class="full-width flex flex-center">
|
||||||
|
<NoData
|
||||||
|
v-if="
|
||||||
|
currentFromDataEmployee.employeePassport?.length === 0
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="employeeFormState.currentTab === 'visa'">
|
<template v-if="employeeFormState.currentTab === 'visa'">
|
||||||
|
<div class="q-gutter-sm full-width">
|
||||||
|
<div class="col-12 q-pb-sm text-weight-bold text-body1">
|
||||||
|
<q-icon
|
||||||
|
flat
|
||||||
|
size="xs"
|
||||||
|
class="q-pa-sm rounded q-mr-xs"
|
||||||
|
color="info"
|
||||||
|
name="mdi-passport"
|
||||||
|
style="background-color: var(--surface-3)"
|
||||||
|
/>
|
||||||
|
{{ $t('customerEmployee.form.group.visa') }}
|
||||||
|
</div>
|
||||||
<FormEmployeeVisa
|
<FormEmployeeVisa
|
||||||
v-for="(value, index) in currentFromDataEmployee.employeeVisa"
|
v-for="(value, index) in currentFromDataEmployee.employeeVisa"
|
||||||
prefix-id="drawer-info-employee"
|
prefix-id="drawer-info-employee"
|
||||||
|
|
@ -4963,7 +5170,7 @@ const emptyCreateDialog = ref(false);
|
||||||
outlined
|
outlined
|
||||||
:title="$t('customerEmployee.form.group.visa')"
|
:title="$t('customerEmployee.form.group.visa')"
|
||||||
:readonly="employeeFormState.currentIndexVisa !== index"
|
:readonly="employeeFormState.currentIndexVisa !== index"
|
||||||
:hide-title="index !== 0"
|
hide-title
|
||||||
v-model:arrival-at="value.arrivalAt"
|
v-model:arrival-at="value.arrivalAt"
|
||||||
v-model:arrival-tm-no="value.arrivalTMNo"
|
v-model:arrival-tm-no="value.arrivalTMNo"
|
||||||
v-model:arrival-tm="value.arrivalTM"
|
v-model:arrival-tm="value.arrivalTM"
|
||||||
|
|
@ -5061,16 +5268,39 @@ const emptyCreateDialog = ref(false);
|
||||||
"
|
"
|
||||||
type="button"
|
type="button"
|
||||||
:disabled="
|
:disabled="
|
||||||
!(employeeFormState.currentIndex === -1) &&
|
!(employeeFormState.currentIndexVisa === -1) &&
|
||||||
!(employeeFormState.currentIndex === index)
|
!(employeeFormState.currentIndexVisa === index)
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</FormEmployeeVisa>
|
</FormEmployeeVisa>
|
||||||
|
|
||||||
|
<div class="full-width flex flex-center">
|
||||||
|
<NoData
|
||||||
|
v-if="currentFromDataEmployee.employeeVisa?.length === 0"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="employeeFormState.currentTab === 'healthCheck'">
|
<template v-if="employeeFormState.currentTab === 'healthCheck'">
|
||||||
|
<div class="q-gutter-sm full-width">
|
||||||
|
<div
|
||||||
|
class="q-pb-sm text-weight-bold text-body1 row items-center"
|
||||||
|
>
|
||||||
|
<q-icon
|
||||||
|
flat
|
||||||
|
size="xs"
|
||||||
|
class="q-pa-sm rounded q-mr-sm"
|
||||||
|
color="info"
|
||||||
|
name="mdi-hospital-box-outline"
|
||||||
|
style="background-color: var(--surface-3)"
|
||||||
|
/>
|
||||||
|
|
||||||
|
{{ $t(`customerEmployee.formHealthCheck.title`) }}
|
||||||
|
</div>
|
||||||
|
|
||||||
<FormEmployeeHealthCheck
|
<FormEmployeeHealthCheck
|
||||||
v-if="employeeFormState.currentTab === 'healthCheck'"
|
v-if="employeeFormState.currentTab === 'healthCheck'"
|
||||||
id="drawer-form-checkup"
|
id="drawer-form-checkup"
|
||||||
|
|
@ -5081,7 +5311,7 @@ const emptyCreateDialog = ref(false);
|
||||||
currentTab !== 'employee' ||
|
currentTab !== 'employee' ||
|
||||||
currentFromDataEmployee.status === 'INACTIVE'
|
currentFromDataEmployee.status === 'INACTIVE'
|
||||||
"
|
"
|
||||||
v-model:current-index="employeeFormState.currentIndex"
|
v-model:current-index="employeeFormState.currentIndexCheckup"
|
||||||
v-model:employee-checkup="
|
v-model:employee-checkup="
|
||||||
currentFromDataEmployee.employeeCheckup
|
currentFromDataEmployee.employeeCheckup
|
||||||
"
|
"
|
||||||
|
|
@ -5099,7 +5329,7 @@ const emptyCreateDialog = ref(false);
|
||||||
"
|
"
|
||||||
@save="
|
@save="
|
||||||
(index) => {
|
(index) => {
|
||||||
employeeFormState.currentIndex = index;
|
employeeFormState.currentIndexCheckup = index;
|
||||||
notify('create', $t('general.success'));
|
notify('create', $t('general.success'));
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
|
|
@ -5109,7 +5339,7 @@ const emptyCreateDialog = ref(false);
|
||||||
currentFromDataEmployee.employeeCheckup?.[index]
|
currentFromDataEmployee.employeeCheckup?.[index]
|
||||||
.statusSave
|
.statusSave
|
||||||
) {
|
) {
|
||||||
employeeFormState.currentIndex = index;
|
employeeFormState.currentIndexCheckup = index;
|
||||||
currentFromDataEmployee.employeeCheckup[
|
currentFromDataEmployee.employeeCheckup[
|
||||||
index
|
index
|
||||||
].statusSave = false;
|
].statusSave = false;
|
||||||
|
|
@ -5122,7 +5352,7 @@ const emptyCreateDialog = ref(false);
|
||||||
currentFromDataEmployee.employeeCheckup?.[index]
|
currentFromDataEmployee.employeeCheckup?.[index]
|
||||||
.statusSave === false
|
.statusSave === false
|
||||||
) {
|
) {
|
||||||
employeeFormState.currentIndex = -1;
|
employeeFormState.currentIndexCheckup = -1;
|
||||||
currentFromDataEmployee.employeeCheckup[
|
currentFromDataEmployee.employeeCheckup[
|
||||||
index
|
index
|
||||||
].statusSave = true;
|
].statusSave = true;
|
||||||
|
|
@ -5132,13 +5362,35 @@ const emptyCreateDialog = ref(false);
|
||||||
"
|
"
|
||||||
@delete="
|
@delete="
|
||||||
(index) => {
|
(index) => {
|
||||||
employeeFormState.currentIndex = index;
|
employeeFormState.currentIndexCheckup = index;
|
||||||
deleteEmployeeById({ type: 'healthCheck' });
|
deleteEmployeeById({ type: 'healthCheck', index });
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<div class="full-width flex flex-center">
|
||||||
|
<NoData
|
||||||
|
v-if="currentFromDataEmployee.employeeCheckup?.length === 0"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="employeeFormState.currentTab === 'workHistory'">
|
<template v-if="employeeFormState.currentTab === 'workHistory'">
|
||||||
|
<div class="q-gutter-sm full-width">
|
||||||
|
<div
|
||||||
|
class="col-12 q-pb-sm text-weight-bold text-body1 row items-center"
|
||||||
|
>
|
||||||
|
<q-icon
|
||||||
|
flat
|
||||||
|
size="xs"
|
||||||
|
class="q-pa-sm rounded q-mr-xs"
|
||||||
|
color="info"
|
||||||
|
name="mdi-briefcase-outline"
|
||||||
|
style="background-color: var(--surface-3)"
|
||||||
|
/>
|
||||||
|
{{ $t(`customerEmployee.form.group.workHistory`) }}
|
||||||
|
</div>
|
||||||
|
|
||||||
<FormEmployeeWorkHistory
|
<FormEmployeeWorkHistory
|
||||||
v-if="employeeFormState.currentTab === 'workHistory'"
|
v-if="employeeFormState.currentTab === 'workHistory'"
|
||||||
id="drawer-work-history"
|
id="drawer-work-history"
|
||||||
|
|
@ -5149,20 +5401,26 @@ const emptyCreateDialog = ref(false);
|
||||||
currentFromDataEmployee.status === 'INACTIVE'
|
currentFromDataEmployee.status === 'INACTIVE'
|
||||||
"
|
"
|
||||||
outlined
|
outlined
|
||||||
v-model:current-index="employeeFormState.currentIndex"
|
v-model:current-index="
|
||||||
|
employeeFormState.currentIndexWorkHistory
|
||||||
|
"
|
||||||
v-model:employee-work="currentFromDataEmployee.employeeWork"
|
v-model:employee-work="currentFromDataEmployee.employeeWork"
|
||||||
v-model:position-name-option="optionStore.globalOption.position"
|
v-model:position-name-option="
|
||||||
v-model:job-type-option="optionStore.globalOption.businessType"
|
optionStore.globalOption.position
|
||||||
|
"
|
||||||
|
v-model:job-type-option="
|
||||||
|
optionStore.globalOption.businessType
|
||||||
|
"
|
||||||
v-model:workplace-option="optionStore.globalOption.area"
|
v-model:workplace-option="optionStore.globalOption.area"
|
||||||
@delete="
|
@delete="
|
||||||
(index) => {
|
(index) => {
|
||||||
employeeFormState.currentIndex = index;
|
employeeFormState.currentIndexWorkHistory = index;
|
||||||
deleteEmployeeById({ type: 'work' });
|
deleteEmployeeById({ type: 'work', index });
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
@save="
|
@save="
|
||||||
(index) => {
|
(index) => {
|
||||||
employeeFormState.currentIndex = index;
|
employeeFormState.currentIndexWorkHistory = index;
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
@undo="
|
@undo="
|
||||||
|
|
@ -5171,7 +5429,7 @@ const emptyCreateDialog = ref(false);
|
||||||
currentFromDataEmployee.employeeWork?.[index]
|
currentFromDataEmployee.employeeWork?.[index]
|
||||||
.statusSave === false
|
.statusSave === false
|
||||||
) {
|
) {
|
||||||
employeeFormState.currentIndex = -1;
|
employeeFormState.currentIndexWorkHistory = -1;
|
||||||
currentFromDataEmployee.employeeWork[index].statusSave =
|
currentFromDataEmployee.employeeWork[index].statusSave =
|
||||||
true;
|
true;
|
||||||
}
|
}
|
||||||
|
|
@ -5182,16 +5440,24 @@ const emptyCreateDialog = ref(false);
|
||||||
if (
|
if (
|
||||||
currentFromDataEmployee.employeeWork?.[index].statusSave
|
currentFromDataEmployee.employeeWork?.[index].statusSave
|
||||||
) {
|
) {
|
||||||
employeeFormState.currentIndex = index;
|
employeeFormState.currentIndexWorkHistory = index;
|
||||||
currentFromDataEmployee.employeeWork[index].statusSave =
|
currentFromDataEmployee.employeeWork[index].statusSave =
|
||||||
false;
|
false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="full-width flex flex-center">
|
||||||
|
<NoData
|
||||||
|
v-if="currentFromDataEmployee.employeeWork?.length === 0"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="employeeFormState.currentTab === 'other'">
|
<template v-if="employeeFormState.currentTab === 'other'">
|
||||||
<FormEmployeeOther
|
<FormEmployeeOther
|
||||||
|
:readonly="currentTab !== 'employee'"
|
||||||
:hide-action="
|
:hide-action="
|
||||||
currentTab !== 'employee' ||
|
currentTab !== 'employee' ||
|
||||||
currentFromDataEmployee.status === 'INACTIVE'
|
currentFromDataEmployee.status === 'INACTIVE'
|
||||||
|
|
@ -5228,7 +5494,6 @@ const emptyCreateDialog = ref(false);
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</DrawerInfo>
|
</DrawerInfo>
|
||||||
{{ employeeHistory }}
|
|
||||||
|
|
||||||
<DialogForm
|
<DialogForm
|
||||||
:title="$t('general.historyEdit')"
|
:title="$t('general.historyEdit')"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue