refactor: add contact information fields to agency forms and update data models
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 12s
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 12s
This commit is contained in:
parent
3efe8e19f4
commit
1a8be5ac34
3 changed files with 167 additions and 9 deletions
|
|
@ -10,6 +10,7 @@ import DrawerInfo from 'src/components/DrawerInfo.vue';
|
|||
import DialogForm from 'src/components/DialogForm.vue';
|
||||
import ProfileBanner from 'src/components/ProfileBanner.vue';
|
||||
import SideMenu from 'src/components/SideMenu.vue';
|
||||
import FormBank from 'src/components/01_branch-management/FormBank.vue';
|
||||
import FormBasicInfoAgencies from 'src/components/07_agencies-management/FormBasicInfoAgencies.vue';
|
||||
import {
|
||||
UndoButton,
|
||||
|
|
@ -19,6 +20,7 @@ import {
|
|||
} from 'src/components/button';
|
||||
import AddressForm from 'src/components/form/AddressForm.vue';
|
||||
import ImageUploadDialog from 'src/components/ImageUploadDialog.vue';
|
||||
import { BankBook } from 'src/stores/branch/types';
|
||||
|
||||
const institutionStore = useInstitution();
|
||||
|
||||
|
|
@ -73,6 +75,9 @@ const data = defineModel<InstitutionPayload>('data', {
|
|||
group: '',
|
||||
name: '',
|
||||
nameEN: '',
|
||||
contactName: '',
|
||||
contactEmail: '',
|
||||
contactTel: '',
|
||||
code: '',
|
||||
addressEN: '',
|
||||
address: '',
|
||||
|
|
@ -88,6 +93,19 @@ const data = defineModel<InstitutionPayload>('data', {
|
|||
selectedImage: '',
|
||||
},
|
||||
});
|
||||
const formBankBook = defineModel<BankBook[]>('formBankBook', {
|
||||
default: [
|
||||
{
|
||||
bankName: '',
|
||||
accountNumber: '',
|
||||
bankBranch: '',
|
||||
accountName: '',
|
||||
accountType: '',
|
||||
currentlyUse: true,
|
||||
bankUrl: '',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
function viewImage() {
|
||||
imageState.imageDialog = true;
|
||||
|
|
@ -237,11 +255,15 @@ watch(
|
|||
:menu="[
|
||||
{
|
||||
name: $t('form.field.basicInformation'),
|
||||
anchor: 'agencies-basic-info',
|
||||
anchor: 'agencies-form-basic-info',
|
||||
},
|
||||
{
|
||||
name: $t('general.address'),
|
||||
anchor: 'agencies-address-info',
|
||||
anchor: 'agencies-form-address-info',
|
||||
},
|
||||
{
|
||||
name: $t('agencies.bankInfo'),
|
||||
anchor: 'agencies-form-bank-info',
|
||||
},
|
||||
]"
|
||||
background="transparent"
|
||||
|
|
@ -275,14 +297,17 @@ watch(
|
|||
</div>
|
||||
</div>
|
||||
<FormBasicInfoAgencies
|
||||
id="agencies-basic-info"
|
||||
id="agencies-form-basic-info"
|
||||
class="q-mb-xl"
|
||||
v-model:group="data.group"
|
||||
v-model:name="data.name"
|
||||
v-model:name-en="data.nameEN"
|
||||
v-model:contact-name="data.contactName"
|
||||
v-model:email="data.contactEmail"
|
||||
v-model:contact-tel="data.contactTel"
|
||||
/>
|
||||
<AddressForm
|
||||
id="agencies-address-info"
|
||||
id="agencies-form-address-info"
|
||||
dense
|
||||
:prefix-id="''"
|
||||
v-model:address="data.address"
|
||||
|
|
@ -297,6 +322,14 @@ watch(
|
|||
v-model:district-id="data.districtId"
|
||||
v-model:sub-district-id="data.subDistrictId"
|
||||
/>
|
||||
<FormBank
|
||||
id="agencies-form-bank-info"
|
||||
title="agencies.bankInfo"
|
||||
class="q-pt-xl"
|
||||
dense
|
||||
single
|
||||
v-model:bank-book-list="formBankBook"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</DialogForm>
|
||||
|
|
@ -427,13 +460,17 @@ watch(
|
|||
name: $t('general.address'),
|
||||
anchor: 'agencies-address-info',
|
||||
},
|
||||
{
|
||||
name: $t('agencies.bankInfo'),
|
||||
anchor: 'agencies-bank-info',
|
||||
},
|
||||
]"
|
||||
background="transparent"
|
||||
:active="{
|
||||
background: 'hsla(var(--blue-6-hsl) / .2)',
|
||||
foreground: 'var(--blue-6)',
|
||||
}"
|
||||
scroll-element="#agencies-form-content"
|
||||
scroll-element="#agencies-view-content"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -444,7 +481,7 @@ watch(
|
|||
'q-py-md q-pr-md ': $q.screen.gt.sm,
|
||||
'q-pa-sm': !$q.screen.gt.sm,
|
||||
}"
|
||||
id="user-form-content"
|
||||
id="agencies-view-content"
|
||||
style="height: 100%; max-height: 100; overflow-y: auto"
|
||||
>
|
||||
<FormBasicInfoAgencies
|
||||
|
|
@ -455,6 +492,9 @@ watch(
|
|||
v-model:group="data.group"
|
||||
v-model:name="data.name"
|
||||
v-model:name-en="data.nameEN"
|
||||
v-model:contact-name="data.contactName"
|
||||
v-model:email="data.contactEmail"
|
||||
v-model:contact-tel="data.contactTel"
|
||||
/>
|
||||
<AddressForm
|
||||
id="agencies-address-info"
|
||||
|
|
@ -473,6 +513,15 @@ watch(
|
|||
v-model:district-id="data.districtId"
|
||||
v-model:sub-district-id="data.subDistrictId"
|
||||
/>
|
||||
<FormBank
|
||||
id="agencies-bank-info"
|
||||
title="agencies.bankInfo"
|
||||
class="q-pt-xl"
|
||||
dense
|
||||
single
|
||||
:readonly
|
||||
v-model:bank-book-list="formBankBook"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -85,6 +85,9 @@ const blankFormData: InstitutionPayload = {
|
|||
code: '',
|
||||
name: '',
|
||||
nameEN: '',
|
||||
contactName: '',
|
||||
contactEmail: '',
|
||||
contactTel: '',
|
||||
addressEN: '',
|
||||
address: '',
|
||||
soi: '',
|
||||
|
|
@ -98,6 +101,16 @@ const blankFormData: InstitutionPayload = {
|
|||
provinceId: '',
|
||||
selectedImage: '',
|
||||
status: 'CREATED',
|
||||
bank: [
|
||||
{
|
||||
bankName: '',
|
||||
accountNumber: '',
|
||||
bankBranch: '',
|
||||
accountName: '',
|
||||
accountType: '',
|
||||
currentlyUse: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const statusFilter = ref<'all' | 'statusACTIVE' | 'statusINACTIVE'>('all');
|
||||
|
|
@ -160,6 +173,19 @@ function assignFormData(data: Institution) {
|
|||
provinceId: data.provinceId,
|
||||
selectedImage: data.selectedImage,
|
||||
status: data.status,
|
||||
contactEmail: data.contactEmail,
|
||||
contactName: data.contactName,
|
||||
contactTel: data.contactTel,
|
||||
bank: [
|
||||
{
|
||||
bankName: data.bank[0]?.bankName,
|
||||
accountNumber: data.bank[0]?.accountNumber,
|
||||
bankBranch: data.bank[0]?.bankBranch,
|
||||
accountName: data.bank[0]?.accountName,
|
||||
accountType: data.bank[0]?.accountType,
|
||||
currentlyUse: data.bank[0]?.currentlyUse,
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -169,6 +195,9 @@ async function submit(opt?: { selectedImage: string }) {
|
|||
code: formData.value.code,
|
||||
name: formData.value.name,
|
||||
nameEN: formData.value.nameEN,
|
||||
contactName: formData.value.contactName,
|
||||
contactEmail: formData.value.contactEmail,
|
||||
contactTel: formData.value.contactTel,
|
||||
addressEN: formData.value.addressEN,
|
||||
address: formData.value.address,
|
||||
soi: formData.value.soi,
|
||||
|
|
@ -181,6 +210,14 @@ async function submit(opt?: { selectedImage: string }) {
|
|||
districtId: formData.value.districtId,
|
||||
provinceId: formData.value.provinceId,
|
||||
status: formData.value.status,
|
||||
bank: formData.value.bank.map((v) => ({
|
||||
bankName: v.bankName,
|
||||
accountNumber: v.accountNumber,
|
||||
bankBranch: v.bankBranch,
|
||||
accountName: v.accountName,
|
||||
accountType: v.accountType,
|
||||
currentlyUse: v.currentlyUse,
|
||||
})),
|
||||
};
|
||||
if (
|
||||
(pageState.isDrawerEdit && currAgenciesData.value?.id) ||
|
||||
|
|
@ -922,6 +959,7 @@ watch(
|
|||
v-model="pageState.addModal"
|
||||
v-model:drawer-model="pageState.viewDrawer"
|
||||
v-model:data="formData"
|
||||
v-model:form-bank-book="formData.bank"
|
||||
v-model:on-create-image-list="onCreateImageList"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue