refactor: citizen missig

This commit is contained in:
Thanaphon Frappet 2024-11-20 17:35:33 +07:00
parent aa823d68aa
commit bad389f6be
3 changed files with 23 additions and 14 deletions

View file

@ -40,6 +40,7 @@ import {
} from './components';
import { formatAddress } from 'src/utils/address';
import PaginationPageSize from 'src/components/PaginationPageSize.vue';
import { nextTick } from 'vue';
const flowStore = useFlowStore();
const customerStore = useCustomerStore();
@ -81,6 +82,7 @@ const prop = withDefaults(
currentCustomerName?: string;
customerType: CustomerType;
countEmployee?: number;
currentCitizenId?: string;
gender: string;
selectedImage: string;
}>(),
@ -103,6 +105,7 @@ defineEmits<{
onMounted(async () => {
const url = window.location.href;
const parts = url.split('/');
customerBranchFormState.value.currentCustomerId = parts[4];
await fetchList();
@ -213,6 +216,10 @@ async function fetchList() {
function openEmployerBranchForm(formType: 'create' | 'edit' | 'info') {
customerBranchFormState.value.dialogType = formType;
customerBranchFormState.value.dialogModal = true;
nextTick(() => {
customerBranchFormState.value.customerType = prop.customerType;
customerBranchFormData.value.citizenId = prop.currentCitizenId;
});
}
async function fetchEmployee(opts: { branchId: string; pageSize?: number }) {
@ -871,24 +878,24 @@ watch(
:readonly="customerBranchFormState.dialogType === 'info'"
outlined
:title="$t('form.address')"
v-model:homeCode="customerBranchFormData.homeCode"
v-model:employmentOffice="customerBranchFormData.employmentOffice"
v-model:employmentOfficeEN="
v-model:home-code="customerBranchFormData.homeCode"
v-model:employment-office="customerBranchFormData.employmentOffice"
v-model:employment-office-en="
customerBranchFormData.employmentOfficeEN
"
v-model:address="customerBranchFormData.address"
v-model:addressEN="customerBranchFormData.addressEN"
v-model:address-en="customerBranchFormData.addressEN"
v-model:province-id="customerBranchFormData.provinceId"
v-model:district-id="customerBranchFormData.districtId"
v-model:sub-district-id="customerBranchFormData.subDistrictId"
v-model:street="customerBranchFormData.street"
v-model:streetEN="customerBranchFormData.streetEN"
v-model:street-en="customerBranchFormData.streetEN"
v-model:moo="customerBranchFormData.moo"
v-model:mooEN="customerBranchFormData.mooEN"
v-model:moo-en="customerBranchFormData.mooEN"
v-model:soi="customerBranchFormData.soi"
v-model:soiEN="customerBranchFormData.soiEN"
:addressTitle="$t('form.address')"
:addressTitleEN="$t('form.address', { suffix: '(EN)' })"
v-model:soi-en="customerBranchFormData.soiEN"
:address-title="$t('form.address')"
:address-title-en="$t('form.address', { suffix: '(EN)' })"
/>
<div class="row q-col-gutter-sm q-mb-sm" id="employer-branch-contact">
<div class="col-12 text-weight-bold text-body1 row items-center">