2024-04-18 18:27:22 +07:00
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import AppBox from '../app/AppBox.vue';
|
|
|
|
|
import FormAddress from './FormAddress.vue';
|
|
|
|
|
|
|
|
|
|
defineProps<{
|
2024-04-19 09:06:38 +07:00
|
|
|
readonly?: boolean;
|
2024-04-25 10:05:38 +07:00
|
|
|
titleFormAddress?: string;
|
2024-04-18 18:27:22 +07:00
|
|
|
addressTitle?: string;
|
|
|
|
|
addressTitleEN?: string;
|
2024-04-23 11:13:57 +00:00
|
|
|
noAddress?: boolean;
|
2024-06-12 08:40:07 +00:00
|
|
|
noPaddingTab?: boolean;
|
2024-06-12 09:08:43 +00:00
|
|
|
disabledRule?: boolean;
|
2024-06-13 10:07:20 +00:00
|
|
|
employee?: boolean;
|
2024-06-28 02:21:21 +00:00
|
|
|
tabsList?: { name: string; label: string }[];
|
2024-04-18 18:27:22 +07:00
|
|
|
}>();
|
|
|
|
|
|
|
|
|
|
const address = defineModel('address', { default: '' });
|
|
|
|
|
const addressEN = defineModel('addressEN', { default: '' });
|
|
|
|
|
const provinceId = defineModel<string | null | undefined>('provinceId');
|
|
|
|
|
const districtId = defineModel<string | null | undefined>('districtId');
|
|
|
|
|
const subDistrictId = defineModel<string | null | undefined>('subDistrictId');
|
|
|
|
|
const zipCode = defineModel<string>('zipCode', { default: '' });
|
2024-06-12 08:40:07 +00:00
|
|
|
|
2024-06-13 10:07:20 +00:00
|
|
|
const sameWithEmployer = defineModel<boolean>('sameWithEmployer');
|
2024-06-12 08:40:07 +00:00
|
|
|
const employeeTab = defineModel<string>('employeeTab');
|
2024-04-18 18:27:22 +07:00
|
|
|
</script>
|
|
|
|
|
<template>
|
2024-06-12 08:40:07 +00:00
|
|
|
<div class="column absolute-top" style="inset: 0">
|
2024-04-19 10:49:14 +07:00
|
|
|
<div
|
2024-06-12 08:40:07 +00:00
|
|
|
v-if="tabsList && tabsList.length > 0"
|
|
|
|
|
class="row surface-2 q-px-md q-pt-md full-width"
|
|
|
|
|
style="border-bottom: 1px solid var(--brand-1)"
|
2024-04-19 10:49:14 +07:00
|
|
|
>
|
2024-06-12 08:40:07 +00:00
|
|
|
<q-tabs
|
|
|
|
|
dense
|
|
|
|
|
class="app-text-muted cancel-overflow"
|
|
|
|
|
v-model="employeeTab"
|
|
|
|
|
active-class="active-tab"
|
|
|
|
|
indicator-color="transparent"
|
|
|
|
|
>
|
|
|
|
|
<q-tab
|
|
|
|
|
v-for="tab in tabsList"
|
|
|
|
|
v-bind:key="tab.name"
|
|
|
|
|
class="content-tab text-capitalize"
|
|
|
|
|
:name="tab.name"
|
|
|
|
|
:label="$t(tab.label)"
|
|
|
|
|
style="z-index: 999"
|
|
|
|
|
/>
|
|
|
|
|
</q-tabs>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="row full-width" style="flex: 1">
|
|
|
|
|
<div class="col-3" v-if="$slots['person-card']">
|
|
|
|
|
<slot name="person-card"></slot>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
2024-04-19 10:49:14 +07:00
|
|
|
:class="{
|
2024-06-12 08:40:07 +00:00
|
|
|
'col-9': $slots['person-card'],
|
|
|
|
|
'col-12': !$slots['person-card'],
|
2024-04-19 10:49:14 +07:00
|
|
|
}"
|
2024-06-12 08:40:07 +00:00
|
|
|
class="relative-position"
|
2024-04-18 18:27:22 +07:00
|
|
|
>
|
2024-06-12 08:40:07 +00:00
|
|
|
<AppBox
|
|
|
|
|
bordered
|
|
|
|
|
:noPadding="noPaddingTab"
|
|
|
|
|
:class="{
|
|
|
|
|
'q-my-md q-mr-md': $slots['person-card'],
|
|
|
|
|
'q-ma-md': !$slots['person-card'],
|
|
|
|
|
}"
|
|
|
|
|
style="position: absolute; overflow-y: auto; inset: 0"
|
|
|
|
|
>
|
|
|
|
|
<div class="row q-col-gutter-y-md">
|
|
|
|
|
<slot name="information"></slot>
|
|
|
|
|
<slot name="person"></slot>
|
|
|
|
|
<slot name="address" v-if="!noAddress">
|
|
|
|
|
<FormAddress
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
separator
|
2024-06-25 10:38:37 +00:00
|
|
|
:employee="employee"
|
2024-06-12 08:40:07 +00:00
|
|
|
:readonly="readonly"
|
2024-06-12 09:08:43 +00:00
|
|
|
:disabledRule="disabledRule"
|
2024-06-12 08:40:07 +00:00
|
|
|
v-model:address="address"
|
|
|
|
|
v-model:addressEN="addressEN"
|
|
|
|
|
v-model:provinceId="provinceId"
|
|
|
|
|
v-model:districtId="districtId"
|
|
|
|
|
v-model:subDistrictId="subDistrictId"
|
|
|
|
|
v-model:zipCode="zipCode"
|
2024-06-13 10:07:20 +00:00
|
|
|
v-model:same-with-employer="sameWithEmployer"
|
2024-06-12 08:40:07 +00:00
|
|
|
:title="titleFormAddress"
|
|
|
|
|
:addressTitle="addressTitle || ''"
|
|
|
|
|
:addressTitleEN="addressTitleEN || ''"
|
|
|
|
|
v-if="!$slots.address"
|
|
|
|
|
/>
|
|
|
|
|
</slot>
|
|
|
|
|
<slot name="qr-code"></slot>
|
|
|
|
|
<slot name="location"></slot>
|
|
|
|
|
<slot name="by-type"></slot>
|
|
|
|
|
</div>
|
|
|
|
|
</AppBox>
|
|
|
|
|
</div>
|
2024-04-18 18:27:22 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
2024-06-12 08:40:07 +00:00
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.active-tab {
|
|
|
|
|
color: var(--brand-1);
|
2024-06-13 10:07:20 +00:00
|
|
|
background-color: var(--surface-tab);
|
2024-06-12 08:40:07 +00:00
|
|
|
border-top: 1px solid var(--brand-1);
|
|
|
|
|
border-left: 1px solid var(--brand-1);
|
|
|
|
|
border-right: 1px solid var(--brand-1);
|
|
|
|
|
border-top-left-radius: var(--radius-2);
|
|
|
|
|
border-top-right-radius: var(--radius-2);
|
|
|
|
|
margin-bottom: -1.5px;
|
2024-06-13 10:07:20 +00:00
|
|
|
border-bottom: 3px solid var(--surface-tab);
|
2024-06-12 08:40:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.content-tab {
|
|
|
|
|
border-top-left-radius: var(--radius-2);
|
|
|
|
|
border-top-right-radius: var(--radius-2);
|
|
|
|
|
position: relative;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:deep(.q-tabs__content) {
|
|
|
|
|
overflow: visible;
|
|
|
|
|
}
|
|
|
|
|
</style>
|