feat: customer drawer info

This commit is contained in:
puriphatt 2024-06-06 10:28:59 +00:00
parent 30d1abe123
commit da2c6115b4

View file

@ -70,6 +70,7 @@ const profileSubmit = ref<boolean>(false);
const profileFile = ref<File | undefined>(undefined); const profileFile = ref<File | undefined>(undefined);
const profileUrl = ref<string | null>(''); const profileUrl = ref<string | null>('');
const infoDrawer = ref(false); const infoDrawer = ref(false);
const infoDrawerEdit = ref(false);
const inputFile = (() => { const inputFile = (() => {
const element = document.createElement('input'); const element = document.createElement('input');
@ -206,6 +207,10 @@ async function onSubmit() {
}); });
clearForm(); clearForm();
} }
function undo() {
infoDrawerEdit.value = false;
}
</script> </script>
<template> <template>
@ -507,14 +512,17 @@ async function onSubmit() {
</FormDialog> </FormDialog>
<DrawerInfo <DrawerInfo
:close="() => onClose()" title="บริษัททดสอบ"
title="test"
v-model:drawer-open="infoDrawer" v-model:drawer-open="infoDrawer"
badgeLabel="HQ006" badgeLabel="HQ006"
badgeClass="app-bg-pers" badgeClass="app-bg-pers"
:undo="() => undo()"
:isEdit="infoDrawerEdit"
:close="() => onClose()"
:editData="() => (infoDrawerEdit = true)"
> >
<template #info> <template #info>
<InfoForm no-address> <InfoForm>
<template #person-card> <template #person-card>
<div class="q-ma-md"> <div class="q-ma-md">
<AppBox class="surface-1" style="padding: 0"> <AppBox class="surface-1" style="padding: 0">
@ -545,6 +553,123 @@ async function onSubmit() {
</AppBox> </AppBox>
</div> </div>
</template> </template>
<template #information>
<BasicInformation
dense
outlined
separator
:readonly="!infoDrawerEdit"
/>
</template>
<template #address>
<!-- <FormCustomerBranch separator dense outlined /> -->
<div class="col-3 app-text-muted">
{{ $t('formDialogCustomerBranch') }}
</div>
<div class="col-12 row bordered q-pt-none rounded">
<TabComponent
:readonly="!infoDrawerEdit"
v-model:customer-branch="formData.customerBranch"
v-model:tab-index="indexTab"
>
<template #address>
<FormAddress
v-if="
indexTab !== undefined &&
formData.customerBranch?.[indexTab]
"
v-model:address="formData.customerBranch[indexTab].address"
v-model:address-e-n="
formData.customerBranch[indexTab].addressEN
"
v-model:province-id="
formData.customerBranch[indexTab].provinceId
"
v-model:district-id="
formData.customerBranch[indexTab].districtId
"
v-model:sub-district-id="
formData.customerBranch[indexTab].subDistrictId
"
v-model:zip-code="formData.customerBranch[indexTab].zipCode"
separator
dense
outlined
:readonly="!infoDrawerEdit"
/>
</template>
<template #businessInformation>
<FormBusiness
v-if="
indexTab !== undefined &&
formData.customerBranch?.[indexTab]
"
separator
dense
outlined
:readonly="!infoDrawerEdit"
/>
</template>
<template #about>
<AboutComponent
v-if="
indexTab !== undefined &&
formData.customerBranch?.[indexTab]
"
v-model:customer-name="formData.customerBranch[indexTab].name"
v-model:customer-english-name="
formData.customerBranch[indexTab].nameEN
"
v-model:authorized-capital="
formData.customerBranch[indexTab].authorizedCapital
"
v-model:register-name="
formData.customerBranch[indexTab].registerName
"
v-model:register-date="
formData.customerBranch[indexTab].registerDate
"
dense
outlined
bordered
separator
:readonly="!infoDrawerEdit"
/>
</template>
<template #contactInformation>
<ContactComponent
v-if="
indexTab !== undefined &&
formData.customerBranch?.[indexTab]
"
v-model:mail="formData.customerBranch[indexTab].email"
v-model:telephone="
formData.customerBranch[indexTab].telephoneNo
"
dense
outlined
separator
:readonly="!infoDrawerEdit"
/>
</template>
<template #otherDocuments>
<OtherInformation
v-if="
indexTab !== undefined &&
formData.customerBranch?.[indexTab]
"
dense
outlined
:readonly="!infoDrawerEdit"
/>
</template>
</TabComponent>
</div>
</template>
</InfoForm> </InfoForm>
</template> </template>
</DrawerInfo> </DrawerInfo>