fix: 03 table & employee form
This commit is contained in:
parent
4695b7c8a0
commit
eaa1cfdeec
1 changed files with 31 additions and 7 deletions
|
|
@ -58,7 +58,7 @@ import FormEmployeeOther from 'src/components/03_customer-management/FormEmploye
|
||||||
import FormEmployeePassport from 'src/components/03_customer-management/FormEmployeePassport.vue';
|
import FormEmployeePassport from 'src/components/03_customer-management/FormEmployeePassport.vue';
|
||||||
import FormEmployeeVisa from 'src/components/03_customer-management/FormEmployeeVisa.vue';
|
import FormEmployeeVisa from 'src/components/03_customer-management/FormEmployeeVisa.vue';
|
||||||
import useUtilsStore, { dialog } from 'src/stores/utils';
|
import useUtilsStore, { dialog } from 'src/stores/utils';
|
||||||
import { calculateAge } from 'src/utils/datetime';
|
import { calculateAge, dateFormat } from 'src/utils/datetime';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import useFlowStore from 'src/stores/flow';
|
import useFlowStore from 'src/stores/flow';
|
||||||
|
|
||||||
|
|
@ -1336,6 +1336,28 @@ async function checkEmployeeForm() {
|
||||||
if (key === 'workerStatus') continue;
|
if (key === 'workerStatus') continue;
|
||||||
if (key === 'image') continue;
|
if (key === 'image') continue;
|
||||||
|
|
||||||
|
const validPersonalInfoKeys = [
|
||||||
|
'customerBranchId',
|
||||||
|
'firstName',
|
||||||
|
'firstNameEN',
|
||||||
|
'lastName',
|
||||||
|
'lastNameEN',
|
||||||
|
'dateOfBirth',
|
||||||
|
'gender',
|
||||||
|
'nationality',
|
||||||
|
'passportType',
|
||||||
|
'passportNumber',
|
||||||
|
'passportIssueDate',
|
||||||
|
'passportExpiryDate',
|
||||||
|
'passportIssuingCountry',
|
||||||
|
'passportIssuingPlace',
|
||||||
|
];
|
||||||
|
|
||||||
|
if (validPersonalInfoKeys.includes(key) && (val === '' || val === null)) {
|
||||||
|
formDataEmployeeTab.value = 'personalInfo';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (val === '' || val === null) {
|
if (val === '' || val === null) {
|
||||||
forget = true;
|
forget = true;
|
||||||
}
|
}
|
||||||
|
|
@ -1835,7 +1857,7 @@ watch(
|
||||||
<q-splitter
|
<q-splitter
|
||||||
v-model="splitterModel"
|
v-model="splitterModel"
|
||||||
:limits="[0, 100]"
|
:limits="[0, 100]"
|
||||||
class="col"
|
class="col full-width"
|
||||||
before-class="overflow-hidden"
|
before-class="overflow-hidden"
|
||||||
after-class="overflow-hidden"
|
after-class="overflow-hidden"
|
||||||
>
|
>
|
||||||
|
|
@ -1906,6 +1928,7 @@ watch(
|
||||||
:grid="modeView"
|
:grid="modeView"
|
||||||
:rows="listCustomer"
|
:rows="listCustomer"
|
||||||
:columns="columnsCustomer"
|
:columns="columnsCustomer"
|
||||||
|
class="full-width"
|
||||||
card-container-class="q-col-gutter-md"
|
card-container-class="q-col-gutter-md"
|
||||||
row-key="name"
|
row-key="name"
|
||||||
:rows-per-page-options="[0]"
|
:rows-per-page-options="[0]"
|
||||||
|
|
@ -2327,15 +2350,15 @@ watch(
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-if="listEmployee.length === 0"
|
v-if="listEmployee.length === 0"
|
||||||
class="row full-width items-center justify-center col"
|
class="row col full-width items-center justify-center"
|
||||||
style="min-height: 250px; flex-wrap: nowrap"
|
style="min-height: 250px"
|
||||||
>
|
>
|
||||||
<NoData :not-found="!!inputSearch" />
|
<NoData :not-found="!!inputSearch" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="col full-width q-pa-md scroll"
|
|
||||||
v-if="listEmployee.length !== 0"
|
v-if="listEmployee.length !== 0"
|
||||||
|
class="surface-2 q-pa-md scroll col full-width"
|
||||||
>
|
>
|
||||||
<q-table
|
<q-table
|
||||||
flat
|
flat
|
||||||
|
|
@ -2343,7 +2366,8 @@ watch(
|
||||||
:grid="modeView"
|
:grid="modeView"
|
||||||
:rows="listEmployee"
|
:rows="listEmployee"
|
||||||
:columns="columnsEmployee"
|
:columns="columnsEmployee"
|
||||||
card-container-class=" q-col-gutter-md"
|
class="full-width"
|
||||||
|
card-container-class="q-col-gutter-md"
|
||||||
row-key="name"
|
row-key="name"
|
||||||
:rows-per-page-options="[0]"
|
:rows-per-page-options="[0]"
|
||||||
hide-pagination
|
hide-pagination
|
||||||
|
|
@ -2465,7 +2489,7 @@ watch(
|
||||||
<q-td
|
<q-td
|
||||||
v-if="fieldSelected.includes('passportExpiryDate')"
|
v-if="fieldSelected.includes('passportExpiryDate')"
|
||||||
>
|
>
|
||||||
{{ calculateAge(props.row.passportExpiryDate) }}
|
{{ dateFormat(props.row.passportExpiryDate) }}
|
||||||
</q-td>
|
</q-td>
|
||||||
|
|
||||||
<q-td
|
<q-td
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue