feat: customer card on main
This commit is contained in:
parent
879e256a1e
commit
4684a8c78a
1 changed files with 132 additions and 20 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
|
|
||||||
|
import UsersDetailCardComponent from 'src/components/UsersDetailCardComponent.vue';
|
||||||
import SelectorList from 'components/SelectorList.vue';
|
import SelectorList from 'components/SelectorList.vue';
|
||||||
import StatCardComponent from 'components/StatCardComponent.vue';
|
import StatCardComponent from 'components/StatCardComponent.vue';
|
||||||
import TooltipComponent from 'components/TooltipComponent.vue';
|
import TooltipComponent from 'components/TooltipComponent.vue';
|
||||||
|
|
@ -17,11 +18,14 @@ import AboutComponent from 'src/components/03_customer-management/AboutComponent
|
||||||
import ContactComponent from 'src/components/03_customer-management/ContactInformation.vue';
|
import ContactComponent from 'src/components/03_customer-management/ContactInformation.vue';
|
||||||
import OtherInformation from 'src/components/03_customer-management/OtherInformation.vue';
|
import OtherInformation from 'src/components/03_customer-management/OtherInformation.vue';
|
||||||
import FormBusiness from 'src/components/03_customer-management/FormBusiness.vue';
|
import FormBusiness from 'src/components/03_customer-management/FormBusiness.vue';
|
||||||
|
import DrawerInfo from 'src/components/DrawerInfo.vue';
|
||||||
|
import InfoForm from 'src/components/02_personnel-management/InfoForm.vue';
|
||||||
|
|
||||||
const statusToggle = ref<boolean>(false);
|
const statusToggle = ref<boolean>(false);
|
||||||
const profileSubmit = ref<boolean>(false);
|
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 inputFile = (() => {
|
const inputFile = (() => {
|
||||||
const element = document.createElement('input');
|
const element = document.createElement('input');
|
||||||
|
|
@ -60,15 +64,13 @@ const customerStats = [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
count: 2,
|
count: 2,
|
||||||
name: 'นายจ้าง 1',
|
name: 'customerLegalEntity',
|
||||||
nameEN: 'Employer 1',
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
count: 3,
|
count: 3,
|
||||||
name: 'นายจ้าง 2',
|
name: 'customerNaturalPerson',
|
||||||
nameEN: 'Employer 2',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -95,8 +97,18 @@ function openDialogCustomerType() {
|
||||||
dialogCustomerType.value = true;
|
dialogCustomerType.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function openDialogInputForm() {
|
function openDialogInputForm(action: 'FORM' | 'INFO' = 'FORM', id?: string) {
|
||||||
|
if (action === 'INFO') {
|
||||||
|
if (!id) return;
|
||||||
|
infoDrawer.value = true;
|
||||||
|
} else {
|
||||||
dialogInputForm.value = true;
|
dialogInputForm.value = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onClose() {
|
||||||
|
infoDrawer.value = false;
|
||||||
|
dialogInputForm.value = false;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -121,10 +133,12 @@ function openDialogInputForm() {
|
||||||
<div class="row full-width q-py-md" style="overflow-x: auto">
|
<div class="row full-width q-py-md" style="overflow-x: auto">
|
||||||
<StatCardComponent
|
<StatCardComponent
|
||||||
v-if="customerStats"
|
v-if="customerStats"
|
||||||
|
labelI18n
|
||||||
:branch="
|
:branch="
|
||||||
customerStats.map((v) => ({
|
customerStats.map((v) => ({
|
||||||
count: v.count,
|
count: v.count,
|
||||||
label: $i18n.locale === 'en-US' ? v.nameEN : v.name,
|
label: v.name,
|
||||||
|
color: v.name === 'customerLegalEntity' ? 'purple' : 'green',
|
||||||
}))
|
}))
|
||||||
"
|
"
|
||||||
:dark="$q.dark.isActive"
|
:dark="$q.dark.isActive"
|
||||||
|
|
@ -136,6 +150,7 @@ function openDialogInputForm() {
|
||||||
|
|
||||||
<!-- main -->
|
<!-- main -->
|
||||||
<AppBox bordered class="column" style="width: 100%; min-height: 70vh">
|
<AppBox bordered class="column" style="width: 100%; min-height: 70vh">
|
||||||
|
<div v-if="false" class="row q-mb-md justify-between">
|
||||||
<div class="col-1 self-end">
|
<div class="col-1 self-end">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<TooltipComponent
|
<TooltipComponent
|
||||||
|
|
@ -156,6 +171,55 @@ function openDialogInputForm() {
|
||||||
@trigger="openDialogCustomerType()"
|
@trigger="openDialogCustomerType()"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="row full-width customer-row"
|
||||||
|
:style="`grid-template-columns: repeat(${$q.screen.lt.sm ? '1' : '4'}, 1fr)`"
|
||||||
|
>
|
||||||
|
<UsersDetailCardComponent
|
||||||
|
color="purple"
|
||||||
|
:metadata="{ id: '1', disabled: false }"
|
||||||
|
:list="{
|
||||||
|
id: '1',
|
||||||
|
type: 'customerLegalEntity',
|
||||||
|
name: 'เจมส์ บอน',
|
||||||
|
code: 'HQ007',
|
||||||
|
detail: [
|
||||||
|
{
|
||||||
|
label: 'ชื่อบริษัท/นิติบุคคล ภาษาไทย',
|
||||||
|
value: 'บริษัทลับ',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'ชื่อบริษัท/นิติบุคคล ภาษาไทย',
|
||||||
|
value: 'บริษัทลับ',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}"
|
||||||
|
@enter-card="openDialogInputForm"
|
||||||
|
/>
|
||||||
|
<UsersDetailCardComponent
|
||||||
|
color="green"
|
||||||
|
:metadata="{ id: '1', disabled: false }"
|
||||||
|
:list="{
|
||||||
|
id: '2',
|
||||||
|
type: 'customerNaturalPerson',
|
||||||
|
name: 'ขอบใจ ขอบใจ',
|
||||||
|
code: 'HQ006',
|
||||||
|
detail: [
|
||||||
|
{
|
||||||
|
label: 'ชื่อบริษัท/นิติบุคคล ภาษาไทย',
|
||||||
|
value: 'บริษัทเฟรบเป้',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'ชื่อบริษัท/นิติบุคคล ภาษาไทย',
|
||||||
|
value: 'บริษัทเฟรบเป้',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}"
|
||||||
|
@enter-card="openDialogInputForm"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</AppBox>
|
</AppBox>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -233,6 +297,54 @@ function openDialogInputForm() {
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</FormDialog>
|
</FormDialog>
|
||||||
|
|
||||||
|
<DrawerInfo
|
||||||
|
:close="() => onClose()"
|
||||||
|
title="test"
|
||||||
|
v-model:drawer-open="infoDrawer"
|
||||||
|
badgeLabel="HQ006"
|
||||||
|
badgeClass="app-bg-pers"
|
||||||
|
>
|
||||||
|
<template #info>
|
||||||
|
<InfoForm no-address>
|
||||||
|
<template #person-card>
|
||||||
|
<div class="q-ma-md">
|
||||||
|
<AppBox class="surface-1" style="padding: 0">
|
||||||
|
<UsersDetailCardComponent
|
||||||
|
no-bg
|
||||||
|
no-detail
|
||||||
|
no-hover
|
||||||
|
color="purple"
|
||||||
|
:metadata="{ id: '1', disabled: false }"
|
||||||
|
:list="{
|
||||||
|
id: '2',
|
||||||
|
type: 'customerNaturalPerson',
|
||||||
|
name: 'เจมส์ บอน',
|
||||||
|
code: 'HQ006',
|
||||||
|
detail: [
|
||||||
|
{
|
||||||
|
label: 'ชื่อบริษัท/นิติบุคคล ภาษาไทย',
|
||||||
|
value: 'บริษัทเฟรบเป้',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'ชื่อบริษัท/นิติบุคคล ภาษาไทย',
|
||||||
|
value: 'บริษัทเฟรบเป้',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}"
|
||||||
|
@enter-card="openDialogInputForm"
|
||||||
|
/>
|
||||||
|
</AppBox>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</InfoForm>
|
||||||
|
</template>
|
||||||
|
</DrawerInfo>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped>
|
||||||
|
.customer-row {
|
||||||
|
display: grid;
|
||||||
|
gap: var(--size-6);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue