2024-08-09 14:00:57 +07:00
|
|
|
<script setup lang="ts">
|
2024-11-14 15:49:20 +07:00
|
|
|
import { onMounted, watch, reactive, ref, computed, watchEffect } from 'vue';
|
2024-08-09 14:00:57 +07:00
|
|
|
import useAddressStore, {
|
|
|
|
|
District,
|
|
|
|
|
Province,
|
|
|
|
|
SubDistrict,
|
2024-11-14 15:49:20 +07:00
|
|
|
Office,
|
2024-08-09 15:06:41 +07:00
|
|
|
} from 'stores/address';
|
|
|
|
|
import { selectFilterOptionRefMod } from 'stores/utils';
|
2024-08-09 14:00:57 +07:00
|
|
|
import { QSelect } from 'quasar';
|
2024-11-11 11:29:56 +07:00
|
|
|
import { formatAddress } from 'src/utils/address';
|
2024-10-28 19:57:46 +07:00
|
|
|
import useOptionStore from 'stores/options';
|
2024-08-09 14:00:57 +07:00
|
|
|
|
2024-10-28 19:57:46 +07:00
|
|
|
const optionStore = useOptionStore();
|
2024-08-09 14:00:57 +07:00
|
|
|
defineProps<{
|
|
|
|
|
title?: string;
|
|
|
|
|
addressTitle?: string;
|
|
|
|
|
addressTitleEN?: string;
|
|
|
|
|
dense?: boolean;
|
|
|
|
|
outlined?: boolean;
|
|
|
|
|
readonly?: boolean;
|
|
|
|
|
separator?: boolean;
|
|
|
|
|
employee?: boolean;
|
|
|
|
|
disabledRule?: boolean;
|
|
|
|
|
indexId?: number;
|
|
|
|
|
prefixId: string;
|
|
|
|
|
hideTitle?: boolean;
|
2024-09-20 14:21:30 +07:00
|
|
|
hideInputEn?: boolean;
|
|
|
|
|
hideIcon?: boolean;
|
2024-08-22 09:48:23 +07:00
|
|
|
|
2024-09-16 14:38:04 +07:00
|
|
|
useEmployment?: boolean;
|
2024-08-22 09:48:23 +07:00
|
|
|
useWorkPlace?: boolean;
|
2024-08-09 14:00:57 +07:00
|
|
|
}>();
|
|
|
|
|
|
2024-11-14 14:51:40 +07:00
|
|
|
const addressStore = useAddressStore();
|
2024-08-21 14:42:05 +07:00
|
|
|
const workplace = defineModel<string>('workplace', { default: '' });
|
2024-08-22 09:44:11 +07:00
|
|
|
const workplaceEN = defineModel<string>('workplaceEn', { default: '' });
|
2024-08-09 14:00:57 +07:00
|
|
|
const address = defineModel('address', { default: '' });
|
2024-10-02 11:39:56 +07:00
|
|
|
const addressEN = defineModel('addressEn', { default: '' });
|
2024-11-08 13:11:42 +07:00
|
|
|
const street = defineModel<string | null | undefined>('street', {
|
|
|
|
|
default: '',
|
|
|
|
|
});
|
|
|
|
|
const streetEN = defineModel<string | null | undefined>('streetEn', {
|
|
|
|
|
default: '',
|
|
|
|
|
});
|
|
|
|
|
const moo = defineModel<string | null | undefined>('moo', { default: '' });
|
|
|
|
|
const mooEN = defineModel<string | null | undefined>('mooEn', { default: '' });
|
|
|
|
|
const soi = defineModel<string | null | undefined>('soi', { default: '' });
|
|
|
|
|
const soiEN = defineModel<string | null | undefined>('soiEn', { default: '' });
|
2024-11-08 16:47:58 +07:00
|
|
|
const provinceId = defineModel<string | null | undefined>('provinceId', {
|
|
|
|
|
default: '',
|
|
|
|
|
});
|
|
|
|
|
const districtId = defineModel<string | null | undefined>('districtId', {
|
|
|
|
|
default: '',
|
|
|
|
|
});
|
2024-08-09 14:00:57 +07:00
|
|
|
const subDistrictId = defineModel<string | null | undefined>('subDistrictId');
|
|
|
|
|
const zipCode = defineModel<string | null | undefined>('zipCode');
|
|
|
|
|
const sameWithEmployer = defineModel<boolean>('sameWithEmployer');
|
|
|
|
|
|
2024-09-16 14:38:04 +07:00
|
|
|
const homeCode = defineModel<string | null | undefined>('homeCode');
|
|
|
|
|
const employmentOffice = defineModel<string | null | undefined>(
|
|
|
|
|
'employmentOffice',
|
|
|
|
|
);
|
|
|
|
|
const employmentOfficeEN = defineModel<string | null | undefined>(
|
2024-10-02 11:39:56 +07:00
|
|
|
'employmentOfficeEn',
|
2024-09-16 14:38:04 +07:00
|
|
|
);
|
|
|
|
|
|
2024-08-09 14:00:57 +07:00
|
|
|
const addrOptions = reactive<{
|
|
|
|
|
provinceOps: Province[];
|
|
|
|
|
districtOps: District[];
|
|
|
|
|
subDistrictOps: SubDistrict[];
|
|
|
|
|
}>({
|
|
|
|
|
provinceOps: [],
|
|
|
|
|
districtOps: [],
|
|
|
|
|
subDistrictOps: [],
|
|
|
|
|
});
|
|
|
|
|
|
2024-11-14 15:49:20 +07:00
|
|
|
const area = ref<Office[]>([]);
|
2024-11-14 14:51:40 +07:00
|
|
|
|
2024-09-12 14:03:12 +07:00
|
|
|
const fullAddress = computed(() => {
|
|
|
|
|
const province = provinceOptions.value.find((v) => v.id === provinceId.value);
|
|
|
|
|
const district = districtOptions.value.find((v) => v.id === districtId.value);
|
|
|
|
|
const sDistrict = subDistrictOptions.value.find(
|
|
|
|
|
(v) => v.id === subDistrictId.value,
|
|
|
|
|
);
|
|
|
|
|
|
2024-11-11 11:29:56 +07:00
|
|
|
if (province && district && sDistrict) {
|
|
|
|
|
const fullAddress = formatAddress({
|
|
|
|
|
address: address.value,
|
2024-11-11 11:49:29 +07:00
|
|
|
addressEN: addressEN.value,
|
2024-11-11 11:29:56 +07:00
|
|
|
moo: moo.value ? moo.value : '',
|
|
|
|
|
mooEN: mooEN.value ? mooEN.value : '',
|
|
|
|
|
soi: soi.value ? soi.value : '',
|
|
|
|
|
soiEN: soiEN.value ? soiEN.value : '',
|
|
|
|
|
street: street.value ? street.value : '',
|
|
|
|
|
streetEN: streetEN.value ? streetEN.value : '',
|
|
|
|
|
province: province as unknown as Province,
|
|
|
|
|
district: district as unknown as District,
|
|
|
|
|
subDistrict: sDistrict as unknown as SubDistrict,
|
|
|
|
|
});
|
|
|
|
|
return fullAddress;
|
2024-09-12 14:03:12 +07:00
|
|
|
}
|
2024-11-11 11:29:56 +07:00
|
|
|
return '-';
|
2024-09-12 14:03:12 +07:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const fullAddressEN = computed(() => {
|
|
|
|
|
const province = provinceOptions.value.find((v) => v.id === provinceId.value);
|
|
|
|
|
const district = districtOptions.value.find((v) => v.id === districtId.value);
|
|
|
|
|
const sDistrict = subDistrictOptions.value.find(
|
|
|
|
|
(v) => v.id === subDistrictId.value,
|
|
|
|
|
);
|
|
|
|
|
|
2024-11-11 11:29:56 +07:00
|
|
|
if (province && district && sDistrict) {
|
|
|
|
|
const fullAddress = formatAddress({
|
|
|
|
|
address: address.value,
|
2024-11-11 11:49:29 +07:00
|
|
|
addressEN: addressEN.value,
|
2024-11-11 11:29:56 +07:00
|
|
|
moo: moo.value ? moo.value : '',
|
|
|
|
|
mooEN: mooEN.value ? mooEN.value : '',
|
|
|
|
|
soi: soi.value ? soi.value : '',
|
|
|
|
|
soiEN: soiEN.value ? soiEN.value : '',
|
|
|
|
|
street: street.value ? street.value : '',
|
|
|
|
|
streetEN: streetEN.value ? streetEN.value : '',
|
|
|
|
|
province: province as unknown as Province,
|
|
|
|
|
district: district as unknown as District,
|
|
|
|
|
subDistrict: sDistrict as unknown as SubDistrict,
|
|
|
|
|
en: true,
|
|
|
|
|
});
|
|
|
|
|
return fullAddress;
|
2024-09-12 14:03:12 +07:00
|
|
|
}
|
2024-11-11 11:29:56 +07:00
|
|
|
return '-';
|
2024-09-12 14:03:12 +07:00
|
|
|
});
|
|
|
|
|
|
2024-08-09 14:00:57 +07:00
|
|
|
async function fetchProvince() {
|
2024-11-14 14:51:40 +07:00
|
|
|
const result = await addressStore.fetchProvince();
|
2024-08-09 14:00:57 +07:00
|
|
|
|
|
|
|
|
if (result) addrOptions.provinceOps = result;
|
|
|
|
|
|
|
|
|
|
provinceFilter = selectFilterOptionRefMod(
|
|
|
|
|
ref(addrOptions.provinceOps),
|
|
|
|
|
provinceOptions,
|
|
|
|
|
'name',
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
provinceEnFilter = selectFilterOptionRefMod(
|
|
|
|
|
ref(addrOptions.provinceOps),
|
|
|
|
|
provinceOptions,
|
|
|
|
|
'nameEN',
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function fetchDistrict() {
|
|
|
|
|
if (!provinceId.value) return;
|
|
|
|
|
|
2024-11-14 14:51:40 +07:00
|
|
|
const result = await addressStore.fetchDistrictByProvinceId(provinceId.value);
|
2024-08-09 14:00:57 +07:00
|
|
|
if (result) addrOptions.districtOps = result;
|
|
|
|
|
|
|
|
|
|
districtFilter = selectFilterOptionRefMod(
|
|
|
|
|
ref(addrOptions.districtOps),
|
|
|
|
|
districtOptions,
|
|
|
|
|
'name',
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
districtEnFilter = selectFilterOptionRefMod(
|
|
|
|
|
ref(addrOptions.districtOps),
|
|
|
|
|
districtOptions,
|
|
|
|
|
'nameEN',
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function fetchSubDistrict() {
|
|
|
|
|
if (!districtId.value) return;
|
2024-11-14 14:51:40 +07:00
|
|
|
const result = await addressStore.fetchSubDistrictByProvinceId(
|
2024-08-09 14:00:57 +07:00
|
|
|
districtId.value,
|
|
|
|
|
);
|
|
|
|
|
if (result) addrOptions.subDistrictOps = result;
|
|
|
|
|
|
|
|
|
|
subDistrictFilter = selectFilterOptionRefMod(
|
|
|
|
|
ref(addrOptions.subDistrictOps),
|
|
|
|
|
subDistrictOptions,
|
|
|
|
|
'name',
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
subDistrictEnFilter = selectFilterOptionRefMod(
|
|
|
|
|
ref(addrOptions.subDistrictOps),
|
|
|
|
|
subDistrictOptions,
|
|
|
|
|
'nameEN',
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-22 14:20:48 +07:00
|
|
|
async function selectSubDistrict(id: string) {
|
|
|
|
|
if (!id) return;
|
|
|
|
|
zipCode.value =
|
|
|
|
|
addrOptions.subDistrictOps
|
|
|
|
|
?.filter((x) => x.id === id)
|
|
|
|
|
.map((x) => x.zipCode)[0] ?? '';
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-14 15:49:20 +07:00
|
|
|
async function getOfficeName(districtId: string) {
|
|
|
|
|
const result = await addressStore.fetchOffice({
|
|
|
|
|
districtId,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (result) return result;
|
|
|
|
|
return [];
|
2024-11-08 16:47:58 +07:00
|
|
|
}
|
|
|
|
|
|
2024-11-14 15:49:20 +07:00
|
|
|
const office = computed(() => {
|
|
|
|
|
if (area.value[0]) return area.value[0].name;
|
|
|
|
|
});
|
|
|
|
|
const officeEn = computed(() => {
|
|
|
|
|
if (area.value[0]) return area.value[0].nameEN;
|
|
|
|
|
});
|
2024-11-08 16:47:58 +07:00
|
|
|
|
2024-08-09 14:00:57 +07:00
|
|
|
const provinceOptions = ref<Record<string, unknown>[]>([]);
|
2024-10-28 19:57:46 +07:00
|
|
|
|
2024-08-09 14:00:57 +07:00
|
|
|
let provinceFilter: (
|
|
|
|
|
value: string,
|
|
|
|
|
update: (callbackFn: () => void, afterFn?: (ref: QSelect) => void) => void,
|
|
|
|
|
) => void;
|
|
|
|
|
let provinceEnFilter: (
|
|
|
|
|
value: string,
|
|
|
|
|
update: (callbackFn: () => void, afterFn?: (ref: QSelect) => void) => void,
|
|
|
|
|
) => void;
|
|
|
|
|
|
|
|
|
|
const districtOptions = ref<Record<string, unknown>[]>([]);
|
|
|
|
|
let districtFilter: (
|
|
|
|
|
value: string,
|
|
|
|
|
update: (callbackFn: () => void, afterFn?: (ref: QSelect) => void) => void,
|
|
|
|
|
) => void;
|
|
|
|
|
let districtEnFilter: (
|
|
|
|
|
value: string,
|
|
|
|
|
update: (callbackFn: () => void, afterFn?: (ref: QSelect) => void) => void,
|
|
|
|
|
) => void;
|
|
|
|
|
|
|
|
|
|
const subDistrictOptions = ref<Record<string, unknown>[]>([]);
|
|
|
|
|
let subDistrictFilter: (
|
|
|
|
|
value: string,
|
|
|
|
|
update: (callbackFn: () => void, afterFn?: (ref: QSelect) => void) => void,
|
|
|
|
|
) => void;
|
|
|
|
|
let subDistrictEnFilter: (
|
|
|
|
|
value: string,
|
|
|
|
|
update: (callbackFn: () => void, afterFn?: (ref: QSelect) => void) => void,
|
|
|
|
|
) => void;
|
|
|
|
|
|
2024-10-28 19:57:46 +07:00
|
|
|
const rawOption = ref();
|
|
|
|
|
const areaENOption = ref([]);
|
|
|
|
|
|
2024-08-09 14:00:57 +07:00
|
|
|
onMounted(async () => {
|
2024-10-28 19:57:46 +07:00
|
|
|
const resultOption = await fetch('/option/option.json');
|
|
|
|
|
rawOption.value = await resultOption.json();
|
|
|
|
|
areaENOption.value = rawOption.value.eng.area;
|
|
|
|
|
|
2024-08-09 14:00:57 +07:00
|
|
|
await fetchProvince();
|
|
|
|
|
await fetchDistrict();
|
|
|
|
|
await fetchSubDistrict();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
watch(provinceId, fetchDistrict);
|
|
|
|
|
watch(districtId, fetchSubDistrict);
|
2024-11-14 15:49:20 +07:00
|
|
|
|
|
|
|
|
watchEffect(async () => {
|
|
|
|
|
if (!districtId.value) {
|
|
|
|
|
area.value = [];
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
area.value = await getOfficeName(districtId.value);
|
|
|
|
|
});
|
2024-08-09 14:00:57 +07:00
|
|
|
</script>
|
|
|
|
|
<template>
|
|
|
|
|
<div class="col-12">
|
|
|
|
|
<div
|
|
|
|
|
v-if="!hideTitle"
|
|
|
|
|
class="col-12 q-pb-sm text-weight-bold text-body1 row items-center"
|
|
|
|
|
>
|
|
|
|
|
<q-icon
|
|
|
|
|
size="xs"
|
|
|
|
|
class="q-pa-sm rounded q-mr-xs"
|
|
|
|
|
color="info"
|
|
|
|
|
name="mdi-map-marker-radius-outline"
|
|
|
|
|
style="background-color: var(--surface-3)"
|
|
|
|
|
/>
|
|
|
|
|
|
2024-08-26 16:24:08 +07:00
|
|
|
{{ (title && $t(title)) || $t('form.field.address') }}
|
2024-08-09 14:00:57 +07:00
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
v-if="employee"
|
|
|
|
|
class="surface-3 q-px-sm q-py-xs row text-caption q-ml-md app-text-muted"
|
|
|
|
|
style="border-radius: var(--radius-3)"
|
|
|
|
|
>
|
|
|
|
|
<span
|
|
|
|
|
:id="`${prefixId}-same`"
|
|
|
|
|
class="q-px-sm q-mr-lg rounded cursor-pointer"
|
|
|
|
|
:class="{
|
|
|
|
|
dark: $q.dark.isActive,
|
|
|
|
|
'active-addr': sameWithEmployer,
|
|
|
|
|
'cursor-not-allowed': readonly,
|
|
|
|
|
}"
|
|
|
|
|
@click="readonly ? '' : (sameWithEmployer = true)"
|
|
|
|
|
>
|
2024-08-26 16:24:08 +07:00
|
|
|
{{ $t('customerEmployee.form.addressSame') }}
|
2024-08-09 14:00:57 +07:00
|
|
|
</span>
|
|
|
|
|
<span
|
|
|
|
|
:id="`${prefixId}-custom`"
|
|
|
|
|
class="q-px-sm rounded cursor-pointer"
|
|
|
|
|
:class="{
|
|
|
|
|
dark: $q.dark.isActive,
|
|
|
|
|
'active-addr': !sameWithEmployer,
|
|
|
|
|
'cursor-not-allowed': readonly,
|
|
|
|
|
}"
|
|
|
|
|
@click="readonly ? '' : (sameWithEmployer = false)"
|
|
|
|
|
>
|
2024-08-26 16:24:08 +07:00
|
|
|
{{ $t('customerEmployee.form.addressCustom') }}
|
2024-08-09 14:00:57 +07:00
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-12 row q-col-gutter-y-md">
|
2024-09-16 14:38:04 +07:00
|
|
|
<div v-if="useEmployment" class="col-12 row q-col-gutter-sm">
|
|
|
|
|
<q-input
|
|
|
|
|
outlined
|
|
|
|
|
hide-bottom-space
|
2025-01-27 13:47:33 +07:00
|
|
|
class="col-md-3 col-12"
|
2024-09-16 14:38:04 +07:00
|
|
|
v-model="homeCode"
|
2024-09-17 10:00:35 +07:00
|
|
|
mask="###########"
|
2024-09-16 14:38:04 +07:00
|
|
|
:dense="dense"
|
|
|
|
|
:label="$t('customer.form.homeCode')"
|
|
|
|
|
:readonly="readonly || sameWithEmployer"
|
|
|
|
|
:for="`${prefixId}-${indexId !== undefined ? `input-address-${indexId}` : 'input-address'}`"
|
|
|
|
|
:rules="
|
|
|
|
|
disabledRule
|
|
|
|
|
? []
|
2024-10-15 11:14:30 +07:00
|
|
|
: [
|
|
|
|
|
(val) =>
|
2024-10-28 13:13:19 +07:00
|
|
|
!val ||
|
2024-10-15 11:14:30 +07:00
|
|
|
(val && val.length === 11 && /[0-9]+/.test(val)) ||
|
|
|
|
|
$t('form.error.invalidCustomeMessage', {
|
|
|
|
|
msg: $t('form.error.requireLength', { msg: 11 }),
|
|
|
|
|
}),
|
|
|
|
|
]
|
2024-09-16 14:38:04 +07:00
|
|
|
"
|
|
|
|
|
/>
|
2024-10-28 19:57:46 +07:00
|
|
|
|
2024-11-08 16:47:58 +07:00
|
|
|
<q-input
|
|
|
|
|
outlined
|
|
|
|
|
hide-bottom-space
|
2025-01-27 13:47:33 +07:00
|
|
|
class="col-md col-12"
|
2024-11-08 16:47:58 +07:00
|
|
|
:model-value="office"
|
|
|
|
|
:dense="dense"
|
|
|
|
|
:label="$t('customer.form.employmentOffice')"
|
2024-11-14 15:49:20 +07:00
|
|
|
readonly
|
|
|
|
|
:disable="!readonly && !sameWithEmployer"
|
2024-11-08 16:47:58 +07:00
|
|
|
:for="`${prefixId}-${indexId !== undefined ? `input-address-${indexId}` : 'input-address'}`"
|
|
|
|
|
@update:model-value="
|
|
|
|
|
(v) => (typeof v === 'string' ? (employmentOffice = v) : '')
|
|
|
|
|
"
|
|
|
|
|
/>
|
|
|
|
|
<q-input
|
|
|
|
|
outlined
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
class="col"
|
|
|
|
|
:model-value="officeEn"
|
|
|
|
|
:dense="dense"
|
|
|
|
|
:label="`${$t('customer.form.employmentOffice')} (EN)`"
|
2024-11-14 15:49:20 +07:00
|
|
|
readonly
|
|
|
|
|
:disable="!readonly && !sameWithEmployer"
|
2024-11-08 16:47:58 +07:00
|
|
|
:for="`${prefixId}-${indexId !== undefined ? `input-address-${indexId}` : 'input-address'}`"
|
|
|
|
|
@update:model-value="
|
|
|
|
|
(v) => (typeof v === 'string' ? (employmentOfficeEN = v) : '')
|
|
|
|
|
"
|
|
|
|
|
/>
|
2024-09-16 14:38:04 +07:00
|
|
|
</div>
|
2024-09-20 14:21:30 +07:00
|
|
|
|
|
|
|
|
<template v-if="!hideIcon">
|
|
|
|
|
<div class="col-12 app-text-muted-2">
|
|
|
|
|
<q-icon size="xs" class="q-mr-xs" name="mdi-map-marker-outline" />
|
|
|
|
|
{{ addressTitle || $t('form.address') }}
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
2024-08-09 14:00:57 +07:00
|
|
|
<div class="col-12 row q-col-gutter-sm">
|
2024-08-22 09:48:23 +07:00
|
|
|
<div class="row col-12" v-if="useWorkPlace">
|
2024-08-21 14:42:05 +07:00
|
|
|
<q-input
|
|
|
|
|
outlined
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
class="col-6"
|
|
|
|
|
v-model="workplace"
|
|
|
|
|
:dense="dense"
|
|
|
|
|
:label="$t('customer.form.workplace')"
|
|
|
|
|
:readonly="readonly || sameWithEmployer"
|
|
|
|
|
:for="`${prefixId}-${indexId !== undefined ? `input-address-${indexId}` : 'input-address'}`"
|
|
|
|
|
:rules="
|
|
|
|
|
disabledRule
|
|
|
|
|
? []
|
|
|
|
|
: [
|
|
|
|
|
(val) =>
|
2024-08-26 16:24:08 +07:00
|
|
|
(val && val.length > 0) || $t('form.error.required'),
|
2024-08-21 14:42:05 +07:00
|
|
|
]
|
|
|
|
|
"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
2024-08-09 14:00:57 +07:00
|
|
|
<q-input
|
|
|
|
|
outlined
|
|
|
|
|
hide-bottom-space
|
2024-09-12 17:05:42 +07:00
|
|
|
class="col-md-5 col-8"
|
2024-08-09 14:00:57 +07:00
|
|
|
v-model="address"
|
|
|
|
|
:dense="dense"
|
2024-09-12 14:03:12 +07:00
|
|
|
:label="$t('form.addressNo')"
|
2024-08-09 14:00:57 +07:00
|
|
|
:readonly="readonly || sameWithEmployer"
|
2024-09-12 14:03:12 +07:00
|
|
|
:for="`${prefixId}-${indexId !== undefined ? `input-address-no-${indexId}` : 'input-address-no'}`"
|
2024-08-09 14:00:57 +07:00
|
|
|
:rules="
|
|
|
|
|
disabledRule
|
|
|
|
|
? []
|
2024-08-26 16:24:08 +07:00
|
|
|
: [(val) => (val && val.length > 0) || $t('form.error.required')]
|
2024-08-09 14:00:57 +07:00
|
|
|
"
|
|
|
|
|
/>
|
2024-09-12 14:03:12 +07:00
|
|
|
<q-input
|
|
|
|
|
outlined
|
|
|
|
|
hide-bottom-space
|
2024-09-12 17:05:42 +07:00
|
|
|
class="col-md-1 col-4"
|
2024-09-17 10:00:35 +07:00
|
|
|
:model-value="readonly ? moo || '-' : moo"
|
2024-09-12 14:03:12 +07:00
|
|
|
:dense="dense"
|
|
|
|
|
:label="$t('form.moo')"
|
|
|
|
|
:readonly="readonly || sameWithEmployer"
|
|
|
|
|
:for="`${prefixId}-${indexId !== undefined ? `input-moo-${indexId}` : 'input-moo'}`"
|
2024-09-17 10:40:11 +07:00
|
|
|
@update:model-value="(v) => (typeof v === 'string' ? (moo = v) : '')"
|
2024-09-12 14:03:12 +07:00
|
|
|
/>
|
|
|
|
|
<q-input
|
|
|
|
|
outlined
|
|
|
|
|
hide-bottom-space
|
2024-09-12 17:05:42 +07:00
|
|
|
class="col-md-3 col-6"
|
2024-09-17 10:00:35 +07:00
|
|
|
:model-value="readonly ? soi || '-' : soi"
|
2024-09-12 14:03:12 +07:00
|
|
|
:dense="dense"
|
|
|
|
|
:label="$t('form.soi')"
|
|
|
|
|
:readonly="readonly || sameWithEmployer"
|
|
|
|
|
:for="`${prefixId}-${indexId !== undefined ? `input-soi-${indexId}` : 'input-soi'}`"
|
2024-09-17 10:40:11 +07:00
|
|
|
@update:model-value="(v) => (typeof v === 'string' ? (soi = v) : '')"
|
2024-09-12 14:03:12 +07:00
|
|
|
/>
|
|
|
|
|
<q-input
|
|
|
|
|
outlined
|
|
|
|
|
hide-bottom-space
|
2024-09-12 17:05:42 +07:00
|
|
|
class="col-md-3 col-6"
|
2024-09-17 10:00:35 +07:00
|
|
|
:model-value="readonly ? street || '-' : street"
|
2024-09-12 14:03:12 +07:00
|
|
|
:dense="dense"
|
2024-09-23 15:03:54 +07:00
|
|
|
:label="$t('form.road')"
|
2024-09-12 14:03:12 +07:00
|
|
|
:readonly="readonly || sameWithEmployer"
|
|
|
|
|
:for="`${prefixId}-${indexId !== undefined ? `input-street-${indexId}` : 'input-street'}`"
|
2024-09-17 10:40:11 +07:00
|
|
|
@update:model-value="
|
|
|
|
|
(v) => (typeof v === 'string' ? (street = v) : '')
|
|
|
|
|
"
|
2024-09-12 14:03:12 +07:00
|
|
|
/>
|
2024-08-09 14:00:57 +07:00
|
|
|
<q-select
|
2024-08-09 17:54:17 +07:00
|
|
|
autocomplete="off"
|
2024-08-09 14:00:57 +07:00
|
|
|
outlined
|
|
|
|
|
clearable
|
|
|
|
|
use-input
|
|
|
|
|
fill-input
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
hide-selected
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
option-value="id"
|
|
|
|
|
input-debounce="0"
|
|
|
|
|
option-label="name"
|
|
|
|
|
v-model="provinceId"
|
|
|
|
|
class="col-md-3 col-6"
|
|
|
|
|
:dense="dense"
|
2024-08-26 16:24:08 +07:00
|
|
|
:label="$t('form.province')"
|
2024-08-09 14:00:57 +07:00
|
|
|
:options="provinceOptions"
|
|
|
|
|
:readonly="readonly || sameWithEmployer"
|
|
|
|
|
:hide-dropdown-icon="readonly || sameWithEmployer"
|
|
|
|
|
:for="`${prefixId}-${indexId !== undefined ? `select-province-${indexId}` : 'select-province'}`"
|
|
|
|
|
:rules="
|
|
|
|
|
disabledRule
|
|
|
|
|
? []
|
|
|
|
|
: [
|
|
|
|
|
(val) =>
|
|
|
|
|
(val && val.length > 0) ||
|
2024-08-26 16:24:08 +07:00
|
|
|
$t('form.error.selectField', {
|
|
|
|
|
field: $t('form.province'),
|
|
|
|
|
}),
|
2024-08-09 14:00:57 +07:00
|
|
|
]
|
|
|
|
|
"
|
|
|
|
|
@filter="provinceFilter"
|
|
|
|
|
@update:model-value="districtId = subDistrictId = zipCode = null"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:no-option>
|
|
|
|
|
<q-item>
|
|
|
|
|
<q-item-section class="text-grey">
|
2024-08-26 16:24:08 +07:00
|
|
|
{{ $t('general.noData') }}
|
2024-08-09 14:00:57 +07:00
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</template>
|
|
|
|
|
</q-select>
|
|
|
|
|
|
|
|
|
|
<q-select
|
2024-08-09 17:54:17 +07:00
|
|
|
autocomplete="off"
|
2024-08-09 14:00:57 +07:00
|
|
|
outlined
|
|
|
|
|
clearable
|
|
|
|
|
use-input
|
|
|
|
|
fill-input
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
hide-selected
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
option-value="id"
|
|
|
|
|
input-debounce="0"
|
|
|
|
|
option-label="name"
|
|
|
|
|
v-model="districtId"
|
|
|
|
|
class="col-md-3 col-6"
|
|
|
|
|
:dense="dense"
|
2024-08-26 16:24:08 +07:00
|
|
|
:label="$t('form.district')"
|
2024-08-09 14:00:57 +07:00
|
|
|
:options="districtOptions"
|
|
|
|
|
:readonly="readonly || sameWithEmployer"
|
|
|
|
|
:hide-dropdown-icon="readonly || sameWithEmployer"
|
|
|
|
|
:for="`${prefixId}-${indexId !== undefined ? `select-district-${indexId}` : 'select-district'}`"
|
|
|
|
|
:rules="
|
|
|
|
|
disabledRule
|
|
|
|
|
? []
|
|
|
|
|
: [
|
|
|
|
|
(val) =>
|
|
|
|
|
(val && val.length > 0) ||
|
2024-08-26 16:24:08 +07:00
|
|
|
$t('form.error.selectField', {
|
|
|
|
|
field: $t('form.district'),
|
|
|
|
|
}),
|
2024-08-09 14:00:57 +07:00
|
|
|
]
|
|
|
|
|
"
|
|
|
|
|
@filter="districtFilter"
|
|
|
|
|
@update:model-value="subDistrictId = zipCode = null"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:no-option>
|
|
|
|
|
<q-item>
|
|
|
|
|
<q-item-section class="text-grey">
|
2024-08-26 16:24:08 +07:00
|
|
|
{{ $t('general.noData') }}
|
2024-08-09 14:00:57 +07:00
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</template>
|
|
|
|
|
</q-select>
|
|
|
|
|
<q-select
|
2024-08-09 17:54:17 +07:00
|
|
|
autocomplete="off"
|
2024-08-09 14:00:57 +07:00
|
|
|
outlined
|
|
|
|
|
clearable
|
|
|
|
|
use-input
|
|
|
|
|
fill-input
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
hide-selected
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
option-value="id"
|
|
|
|
|
input-debounce="0"
|
|
|
|
|
option-label="name"
|
|
|
|
|
class="col-md-3 col-6"
|
|
|
|
|
v-model="subDistrictId"
|
|
|
|
|
:dense="dense"
|
2024-08-26 16:24:08 +07:00
|
|
|
:label="$t('form.subDistrict')"
|
2024-08-09 14:00:57 +07:00
|
|
|
:options="subDistrictOptions"
|
|
|
|
|
:readonly="readonly || sameWithEmployer"
|
|
|
|
|
:hide-dropdown-icon="readonly || sameWithEmployer"
|
|
|
|
|
:for="`${prefixId}-${indexId !== undefined ? `select-sub-district-${indexId}` : 'select-sub-district'}`"
|
|
|
|
|
:rules="
|
|
|
|
|
disabledRule
|
|
|
|
|
? []
|
|
|
|
|
: [
|
|
|
|
|
(val) =>
|
|
|
|
|
(val && val.length > 0) ||
|
2024-08-26 16:24:08 +07:00
|
|
|
$t('form.error.selectField', {
|
|
|
|
|
field: $t('form.subDistrict'),
|
|
|
|
|
}),
|
2024-08-09 14:00:57 +07:00
|
|
|
]
|
|
|
|
|
"
|
2024-08-22 14:20:48 +07:00
|
|
|
@update:model-value="(v: string) => selectSubDistrict(v)"
|
2024-08-09 14:00:57 +07:00
|
|
|
@filter="subDistrictFilter"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:no-option>
|
|
|
|
|
<q-item>
|
|
|
|
|
<q-item-section class="text-grey">
|
2024-08-26 16:24:08 +07:00
|
|
|
{{ $t('general.noData') }}
|
2024-08-09 14:00:57 +07:00
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</template>
|
|
|
|
|
</q-select>
|
|
|
|
|
<q-input
|
|
|
|
|
:for="`${prefixId}-${indexId !== undefined ? `input-zip-code-${indexId}` : 'input-zip-code'}`"
|
|
|
|
|
:dense="dense"
|
|
|
|
|
outlined
|
2024-08-27 15:32:04 +07:00
|
|
|
:disable="!readonly && !sameWithEmployer"
|
2024-08-09 14:00:57 +07:00
|
|
|
readonly
|
2024-08-26 16:24:08 +07:00
|
|
|
:label="$t('form.zipCode')"
|
2024-09-12 17:05:42 +07:00
|
|
|
class="col-md-3 col-6"
|
2024-08-22 11:50:52 +07:00
|
|
|
:model-value="
|
|
|
|
|
addrOptions.subDistrictOps
|
|
|
|
|
?.filter((x) => x.id === subDistrictId)
|
|
|
|
|
.map((x) => x.zipCode)[0] ?? ''
|
|
|
|
|
"
|
2024-08-09 14:00:57 +07:00
|
|
|
/>
|
2024-09-12 14:03:12 +07:00
|
|
|
<q-input
|
|
|
|
|
outlined
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
class="col-12"
|
2024-09-23 15:03:54 +07:00
|
|
|
:model-value="
|
2024-09-24 09:51:22 +07:00
|
|
|
address ? ($i18n.locale === 'eng' ? fullAddress : fullAddress) : ''
|
2024-09-23 15:03:54 +07:00
|
|
|
"
|
2024-09-12 14:03:12 +07:00
|
|
|
:dense="dense"
|
|
|
|
|
:label="$t('form.fullAddress')"
|
|
|
|
|
readonly
|
|
|
|
|
:disable="!readonly && !sameWithEmployer"
|
2024-09-12 15:41:54 +07:00
|
|
|
:for="`${prefixId}-${indexId !== undefined ? `input-full-address-${indexId}` : 'input-full-address'}`"
|
2024-09-12 14:03:12 +07:00
|
|
|
/>
|
2024-08-09 14:00:57 +07:00
|
|
|
</div>
|
2024-09-20 14:21:30 +07:00
|
|
|
<template v-if="!hideIcon">
|
|
|
|
|
<div class="col-12 app-text-muted-2" v-if="!hideInputEn">
|
|
|
|
|
<q-icon size="xs" class="q-mr-xs" name="mdi-map-marker-outline" />
|
|
|
|
|
{{ addressTitleEN || $t('form.address', { suffix: '(EN)' }) }}
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<div class="col-12 row q-col-gutter-sm" v-if="!hideInputEn">
|
2024-08-22 09:48:23 +07:00
|
|
|
<div class="row col-12" v-if="useWorkPlace">
|
2024-08-21 14:42:05 +07:00
|
|
|
<q-input
|
|
|
|
|
outlined
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
class="col-6"
|
|
|
|
|
v-model="workplaceEN"
|
|
|
|
|
:dense="dense"
|
|
|
|
|
:label="$t('customer.form.workplaceEN')"
|
|
|
|
|
:readonly="readonly || sameWithEmployer"
|
|
|
|
|
:for="`${prefixId}-${indexId !== undefined ? `input-address-${indexId}` : 'input-address'}`"
|
|
|
|
|
:rules="
|
|
|
|
|
disabledRule
|
|
|
|
|
? []
|
|
|
|
|
: [
|
|
|
|
|
(val) =>
|
2024-08-26 16:24:08 +07:00
|
|
|
(val && val.length > 0) || $t('form.error.required'),
|
2024-08-21 14:42:05 +07:00
|
|
|
]
|
|
|
|
|
"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
2024-08-09 14:00:57 +07:00
|
|
|
<q-input
|
|
|
|
|
:for="`${prefixId}-${indexId !== undefined ? `input-address-en-${indexId}` : 'input-address-en'}`"
|
|
|
|
|
:dense="dense"
|
|
|
|
|
:readonly="readonly || sameWithEmployer"
|
|
|
|
|
outlined
|
|
|
|
|
hide-bottom-space
|
2024-09-12 14:03:12 +07:00
|
|
|
label="Address No."
|
2024-09-12 17:05:42 +07:00
|
|
|
class="col-md-5 col-8"
|
2024-08-09 14:00:57 +07:00
|
|
|
v-model="addressEN"
|
|
|
|
|
:rules="
|
|
|
|
|
disabledRule
|
|
|
|
|
? []
|
2024-08-26 16:24:08 +07:00
|
|
|
: [(val) => (val && val.length > 0) || $t('form.error.required')]
|
2024-08-09 14:00:57 +07:00
|
|
|
"
|
|
|
|
|
/>
|
2024-09-12 14:03:12 +07:00
|
|
|
<q-input
|
|
|
|
|
outlined
|
|
|
|
|
hide-bottom-space
|
2024-09-12 17:05:42 +07:00
|
|
|
class="col-md-1 col-4"
|
2024-09-17 10:00:35 +07:00
|
|
|
:model-value="readonly ? mooEN || '-' : mooEN"
|
2024-09-12 14:03:12 +07:00
|
|
|
:dense="dense"
|
|
|
|
|
label="Moo"
|
|
|
|
|
:readonly="readonly || sameWithEmployer"
|
|
|
|
|
:for="`${prefixId}-${indexId !== undefined ? `input-moo-${indexId}` : 'input-moo'}`"
|
2024-09-17 10:40:11 +07:00
|
|
|
@update:model-value="
|
|
|
|
|
(v) => (typeof v === 'string' ? (mooEN = v) : '')
|
|
|
|
|
"
|
2024-09-12 14:03:12 +07:00
|
|
|
/>
|
|
|
|
|
<q-input
|
|
|
|
|
outlined
|
|
|
|
|
hide-bottom-space
|
2024-09-12 17:05:42 +07:00
|
|
|
class="col-md-3 col-6"
|
2024-09-17 10:00:35 +07:00
|
|
|
:model-value="readonly ? soiEN || '-' : soiEN"
|
2024-09-12 14:03:12 +07:00
|
|
|
:dense="dense"
|
|
|
|
|
label="Soi"
|
|
|
|
|
:readonly="readonly || sameWithEmployer"
|
|
|
|
|
:for="`${prefixId}-${indexId !== undefined ? `input-soi-${indexId}` : 'input-soi'}`"
|
2024-09-17 10:40:11 +07:00
|
|
|
@update:model-value="
|
|
|
|
|
(v) => (typeof v === 'string' ? (soiEN = v) : '')
|
|
|
|
|
"
|
2024-09-12 14:03:12 +07:00
|
|
|
/>
|
|
|
|
|
<q-input
|
|
|
|
|
outlined
|
|
|
|
|
hide-bottom-space
|
2024-09-12 17:05:42 +07:00
|
|
|
class="col-md-3 col-6"
|
2024-09-17 10:00:35 +07:00
|
|
|
:model-value="readonly ? streetEN || '-' : streetEN"
|
2024-09-12 14:03:12 +07:00
|
|
|
:dense="dense"
|
2024-09-23 15:03:54 +07:00
|
|
|
label="Road"
|
2024-09-12 14:03:12 +07:00
|
|
|
:readonly="readonly || sameWithEmployer"
|
|
|
|
|
:for="`${prefixId}-${indexId !== undefined ? `input-street-${indexId}` : 'input-street'}`"
|
2024-09-17 10:40:11 +07:00
|
|
|
@update:model-value="
|
|
|
|
|
(v) => (typeof v === 'string' ? (streetEN = v) : '')
|
|
|
|
|
"
|
2024-09-12 14:03:12 +07:00
|
|
|
/>
|
2024-08-09 14:00:57 +07:00
|
|
|
<q-select
|
2024-08-09 17:54:17 +07:00
|
|
|
autocomplete="off"
|
2024-08-09 14:00:57 +07:00
|
|
|
outlined
|
|
|
|
|
clearable
|
|
|
|
|
use-input
|
|
|
|
|
fill-input
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
hide-selected
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
option-value="id"
|
|
|
|
|
input-debounce="0"
|
|
|
|
|
v-model="provinceId"
|
|
|
|
|
option-label="nameEN"
|
|
|
|
|
class="col-md-3 col-6"
|
|
|
|
|
:dense="dense"
|
2024-09-12 14:03:12 +07:00
|
|
|
label="Province"
|
2024-08-09 14:00:57 +07:00
|
|
|
:options="provinceOptions"
|
|
|
|
|
:readonly="readonly || sameWithEmployer"
|
|
|
|
|
:hide-dropdown-icon="readonly || sameWithEmployer"
|
|
|
|
|
:for="`${prefixId}-${indexId !== undefined ? `select-province-en-${indexId}` : 'select-province-en'}`"
|
|
|
|
|
:rules="
|
|
|
|
|
disabledRule
|
|
|
|
|
? []
|
|
|
|
|
: [
|
|
|
|
|
(val) =>
|
|
|
|
|
(val && val.length > 0) ||
|
2024-08-26 16:24:08 +07:00
|
|
|
$t('form.error.selectField', {
|
|
|
|
|
field: $t('form.province'),
|
|
|
|
|
}),
|
2024-08-09 14:00:57 +07:00
|
|
|
]
|
|
|
|
|
"
|
|
|
|
|
@update:model-value="districtId = subDistrictId = zipCode = null"
|
|
|
|
|
@filter="provinceEnFilter"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:no-option>
|
|
|
|
|
<q-item>
|
|
|
|
|
<q-item-section class="text-grey">
|
2024-08-26 16:24:08 +07:00
|
|
|
{{ $t('general.noData') }}
|
2024-08-09 14:00:57 +07:00
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</template>
|
|
|
|
|
</q-select>
|
|
|
|
|
<q-select
|
2024-08-09 17:54:17 +07:00
|
|
|
autocomplete="off"
|
2024-08-09 14:00:57 +07:00
|
|
|
outlined
|
|
|
|
|
clearable
|
|
|
|
|
use-input
|
|
|
|
|
fill-input
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
hide-selected
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
option-value="id"
|
|
|
|
|
input-debounce="0"
|
|
|
|
|
v-model="districtId"
|
|
|
|
|
option-label="nameEN"
|
|
|
|
|
class="col-md-3 col-6"
|
|
|
|
|
:dense="dense"
|
2024-09-12 14:03:12 +07:00
|
|
|
label="District"
|
2024-08-09 14:00:57 +07:00
|
|
|
:options="districtOptions"
|
|
|
|
|
:readonly="readonly || sameWithEmployer"
|
|
|
|
|
:hide-dropdown-icon="readonly || sameWithEmployer"
|
|
|
|
|
:for="`${prefixId}-${indexId !== undefined ? `select-district-en-${indexId}` : 'select-district-en'}`"
|
|
|
|
|
:rules="
|
|
|
|
|
disabledRule
|
|
|
|
|
? []
|
|
|
|
|
: [
|
|
|
|
|
(val) =>
|
|
|
|
|
(val && val.length > 0) ||
|
2024-08-26 16:24:08 +07:00
|
|
|
$t('form.error.selectField', {
|
|
|
|
|
field: $t('form.district'),
|
|
|
|
|
}),
|
2024-08-09 14:00:57 +07:00
|
|
|
]
|
|
|
|
|
"
|
|
|
|
|
@update:model-value="subDistrictId = zipCode = null"
|
|
|
|
|
@filter="districtEnFilter"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:no-option>
|
|
|
|
|
<q-item>
|
|
|
|
|
<q-item-section class="text-grey">
|
2024-08-26 16:24:08 +07:00
|
|
|
{{ $t('general.noData') }}
|
2024-08-09 14:00:57 +07:00
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</template>
|
|
|
|
|
</q-select>
|
|
|
|
|
<q-select
|
2024-08-09 17:54:17 +07:00
|
|
|
autocomplete="off"
|
2024-08-09 14:00:57 +07:00
|
|
|
outlined
|
|
|
|
|
clearable
|
|
|
|
|
use-input
|
|
|
|
|
fill-input
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
hide-selected
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
option-value="id"
|
|
|
|
|
input-debounce="0"
|
|
|
|
|
option-label="nameEN"
|
|
|
|
|
class="col-md-3 col-6"
|
|
|
|
|
v-model="subDistrictId"
|
|
|
|
|
:dense="dense"
|
2024-09-12 14:03:12 +07:00
|
|
|
label="Sub-District"
|
2024-08-09 14:00:57 +07:00
|
|
|
:options="subDistrictOptions"
|
|
|
|
|
:readonly="readonly || sameWithEmployer"
|
|
|
|
|
:hide-dropdown-icon="readonly || sameWithEmployer"
|
|
|
|
|
:for="`${prefixId}-${indexId !== undefined ? `select-sub-district-en-${indexId}` : 'select-sub-district-en'}`"
|
|
|
|
|
:rules="
|
|
|
|
|
disabledRule
|
|
|
|
|
? []
|
|
|
|
|
: [
|
|
|
|
|
(val) =>
|
|
|
|
|
(val && val.length > 0) ||
|
2024-08-26 16:24:08 +07:00
|
|
|
$t('form.error.selectField', {
|
|
|
|
|
field: $t('form.subDistrict'),
|
|
|
|
|
}),
|
2024-08-09 14:00:57 +07:00
|
|
|
]
|
|
|
|
|
"
|
|
|
|
|
@update:model-value="(v: string) => selectSubDistrict(v)"
|
|
|
|
|
@filter="subDistrictEnFilter"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:no-option>
|
|
|
|
|
<q-item>
|
|
|
|
|
<q-item-section class="text-grey">
|
2024-08-26 16:24:08 +07:00
|
|
|
{{ $t('general.noData') }}
|
2024-08-09 14:00:57 +07:00
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</template>
|
|
|
|
|
</q-select>
|
|
|
|
|
<q-input
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
:for="`${prefixId}-${indexId !== undefined ? `input-zip-code-${indexId}` : 'input-zip-code'}`"
|
|
|
|
|
:dense="dense"
|
|
|
|
|
outlined
|
|
|
|
|
readonly
|
2024-08-27 15:32:04 +07:00
|
|
|
:disable="!readonly && !sameWithEmployer"
|
2024-08-09 14:00:57 +07:00
|
|
|
zip="zip-en"
|
2024-09-12 14:03:12 +07:00
|
|
|
label="Zip Code"
|
2024-09-12 17:05:42 +07:00
|
|
|
class="col-md-3 col-6"
|
2024-08-22 11:50:52 +07:00
|
|
|
:model-value="
|
|
|
|
|
addrOptions.subDistrictOps
|
|
|
|
|
?.filter((x) => x.id === subDistrictId)
|
|
|
|
|
.map((x) => x.zipCode)[0] ?? ''
|
|
|
|
|
"
|
2024-08-09 14:00:57 +07:00
|
|
|
/>
|
2024-09-12 14:03:12 +07:00
|
|
|
<q-input
|
|
|
|
|
outlined
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
class="col-12"
|
|
|
|
|
:model-value="addressEN ? fullAddressEN : ''"
|
|
|
|
|
:dense="dense"
|
|
|
|
|
label="Full Address"
|
|
|
|
|
readonly
|
|
|
|
|
:disable="!readonly && !sameWithEmployer"
|
2024-09-12 15:41:54 +07:00
|
|
|
:for="`${prefixId}-${indexId !== undefined ? `input-full-address-en-${indexId}` : 'input-full-address-en'}`"
|
2024-09-12 14:03:12 +07:00
|
|
|
/>
|
2024-08-09 14:00:57 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.active-addr {
|
|
|
|
|
color: hsl(var(--info-bg));
|
|
|
|
|
background-color: hsla(var(--info-bg) / 0.1);
|
|
|
|
|
border-radius: var(--radius-3);
|
|
|
|
|
|
|
|
|
|
&.dark {
|
|
|
|
|
background-color: var(--surface-1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|