refactor: by value passport and visa
This commit is contained in:
parent
f1813f4cca
commit
90c8b1732a
3 changed files with 39 additions and 7 deletions
|
|
@ -3,11 +3,17 @@ import { calculateDaysUntilExpire } from 'stores/utils';
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
expirationDate: Date;
|
expirationDate: Date;
|
||||||
|
showAllDay?: boolean;
|
||||||
}>();
|
}>();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<template v-if="calculateDaysUntilExpire(expirationDate) <= 90">
|
<template
|
||||||
|
v-if="
|
||||||
|
calculateDaysUntilExpire(expirationDate) <= 90 ||
|
||||||
|
(expirationDate !== undefined && !!showAllDay)
|
||||||
|
"
|
||||||
|
>
|
||||||
<q-badge
|
<q-badge
|
||||||
:color="calculateDaysUntilExpire(expirationDate) > 0 ? 'orange' : 'red'"
|
:color="calculateDaysUntilExpire(expirationDate) > 0 ? 'orange' : 'red'"
|
||||||
class="text-weight-bold"
|
class="text-weight-bold"
|
||||||
|
|
@ -36,6 +42,7 @@ defineProps<{
|
||||||
</template>
|
</template>
|
||||||
</q-badge>
|
</q-badge>
|
||||||
</template>
|
</template>
|
||||||
|
<template v-else>-</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,11 @@
|
||||||
import { calculateAge, dateFormat } from 'src/utils/datetime';
|
import { calculateAge, dateFormat } from 'src/utils/datetime';
|
||||||
import { calculateDaysUntilExpire } from 'stores/utils';
|
import { calculateDaysUntilExpire } from 'stores/utils';
|
||||||
import { baseUrl } from 'src/stores/utils';
|
import { baseUrl } from 'src/stores/utils';
|
||||||
|
import useOptionStore from 'stores/options';
|
||||||
|
|
||||||
import PersonCard from 'components/shared/PersonCard.vue';
|
import PersonCard from 'components/shared/PersonCard.vue';
|
||||||
import KebabAction from '../shared/KebabAction.vue';
|
import KebabAction from '../shared/KebabAction.vue';
|
||||||
import useOptionStore from 'stores/options';
|
import ExpirationDate from 'components/03_customer-management/ExpirationDate.vue';
|
||||||
|
|
||||||
import { AddButton } from 'components/button';
|
import { AddButton } from 'components/button';
|
||||||
|
|
||||||
const optionStore = useOptionStore();
|
const optionStore = useOptionStore();
|
||||||
|
|
@ -195,16 +195,39 @@ defineEmits<{
|
||||||
</q-td>
|
</q-td>
|
||||||
|
|
||||||
<q-td v-if="fieldSelected.includes('formDialogInputPassportNo')">
|
<q-td v-if="fieldSelected.includes('formDialogInputPassportNo')">
|
||||||
{{ props.row.passportNumber || '-' }}
|
{{
|
||||||
|
props.row.employeePassport[0]
|
||||||
|
? props.row.employeePassport[0].number
|
||||||
|
: '-'
|
||||||
|
}}
|
||||||
</q-td>
|
</q-td>
|
||||||
|
|
||||||
<q-td v-if="fieldSelected.includes('passportExpiryDate')">
|
<q-td v-if="fieldSelected.includes('passportExpiryDate')">
|
||||||
{{ dateFormat(props.row.passportExpiryDate) || '-' }}
|
{{
|
||||||
|
props.row.employeePassport[0]
|
||||||
|
? dateFormat(props.row.employeePassport[0].expireDate) || '-'
|
||||||
|
: '-'
|
||||||
|
}}
|
||||||
</q-td>
|
</q-td>
|
||||||
|
|
||||||
<q-td v-if="fieldSelected.includes('visaExpireDate')">-</q-td>
|
<q-td v-if="fieldSelected.includes('visaExpireDate')">
|
||||||
|
{{
|
||||||
|
props.row.employeeVisa[0]
|
||||||
|
? dateFormat(props.row.employeeVisa[0].expireDate) || '-'
|
||||||
|
: '-'
|
||||||
|
}}
|
||||||
|
</q-td>
|
||||||
|
|
||||||
<q-td v-if="fieldSelected.includes('beDue')">-</q-td>
|
<q-td v-if="fieldSelected.includes('beDue')">
|
||||||
|
<ExpirationDate
|
||||||
|
show-all-day
|
||||||
|
:expiration-date="
|
||||||
|
props.row.employeeVisa[0]
|
||||||
|
? props.row.employeeVisa[0].expireDate || undefined
|
||||||
|
: undefined
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
</q-td>
|
||||||
|
|
||||||
<q-td v-if="fieldSelected.includes('branchLabel')">
|
<q-td v-if="fieldSelected.includes('branchLabel')">
|
||||||
<div class="row items-center" v-if="props.row.customerBranch">
|
<div class="row items-center" v-if="props.row.customerBranch">
|
||||||
|
|
|
||||||
|
|
@ -402,6 +402,8 @@ async function fetchListEmployee(fetchStats = false) {
|
||||||
? 'ACTIVE'
|
? 'ACTIVE'
|
||||||
: 'INACTIVE',
|
: 'INACTIVE',
|
||||||
query: inputSearch.value,
|
query: inputSearch.value,
|
||||||
|
passport: true,
|
||||||
|
visa: true,
|
||||||
});
|
});
|
||||||
if (resultListEmployee) {
|
if (resultListEmployee) {
|
||||||
maxPageEmployee.value = Math.ceil(
|
maxPageEmployee.value = Math.ceil(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue