fix: customer

This commit is contained in:
puriphatt 2024-09-16 14:38:04 +07:00
parent cfaf1467a6
commit 4bf1a4a346
11 changed files with 1569 additions and 533 deletions

View file

@ -23,6 +23,7 @@ defineProps<{
prefixId: string;
hideTitle?: boolean;
useEmployment?: boolean;
useWorkPlace?: boolean;
}>();
@ -43,6 +44,14 @@ const subDistrictId = defineModel<string | null | undefined>('subDistrictId');
const zipCode = defineModel<string | null | undefined>('zipCode');
const sameWithEmployer = defineModel<boolean>('sameWithEmployer');
const homeCode = defineModel<string | null | undefined>('homeCode');
const employmentOffice = defineModel<string | null | undefined>(
'employmentOffice',
);
const employmentOfficeEN = defineModel<string | null | undefined>(
'employmentOfficeEN',
);
const addrOptions = reactive<{
provinceOps: Province[];
districtOps: District[];
@ -274,6 +283,43 @@ watch(districtId, fetchSubDistrict);
</div>
<div class="col-12 row q-col-gutter-y-md">
<div v-if="useEmployment" class="col-12 row q-col-gutter-sm">
<q-input
outlined
hide-bottom-space
class="col-3"
v-model="homeCode"
:dense="dense"
:label="$t('customer.form.homeCode')"
:readonly="readonly || sameWithEmployer"
:for="`${prefixId}-${indexId !== undefined ? `input-address-${indexId}` : 'input-address'}`"
:rules="
disabledRule
? []
: [(val) => (val && val.length > 0) || $t('form.error.required')]
"
/>
<q-input
outlined
hide-bottom-space
class="col"
v-model="employmentOffice"
:dense="dense"
:label="$t('customer.form.employmentOffice')"
:readonly="readonly || sameWithEmployer"
:for="`${prefixId}-${indexId !== undefined ? `input-address-${indexId}` : 'input-address'}`"
/>
<q-input
outlined
hide-bottom-space
class="col"
v-model="employmentOfficeEN"
:dense="dense"
:label="`${$t('customer.form.employmentOffice')} (EN)`"
:readonly="readonly || sameWithEmployer"
:for="`${prefixId}-${indexId !== undefined ? `input-address-${indexId}` : 'input-address'}`"
/>
</div>
<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') }}