feat: branch stats

This commit is contained in:
Methapon2001 2024-04-10 17:41:22 +07:00
parent c2d7e1f9c5
commit 06f3b2b1bb
3 changed files with 16 additions and 31 deletions

View file

@ -34,7 +34,7 @@ const currentBranchContactIdEdit = ref<string>('');
const showCurrentBranch = ref<Branch>();
const shape = ref<boolean>(false);
const openBranchDrawer = ref<boolean>(true);
const openBranchDrawer = ref<boolean>(false);
const openCardDetails = ref<boolean>(false);
const openTableCard = ref<boolean>(true);
@ -82,34 +82,7 @@ const selected = ref<string>('');
const expanded = ref<string[]>([]);
const branchStat = ref<
{
amount: number;
label: string;
}[]
>([
{
amount: 1,
label: 'สำนักงานใหญ่ 1',
},
{
amount: 2,
label: 'สำนักงานใหญ่ 2',
},
{
amount: 3,
label: 'สำนักงานใหญ่ 3',
},
{
amount: 4,
label: 'สำนักงานใหญ่ 4',
},
{
amount: 5,
label: 'สำนักงานใหญ่ 5',
},
]);
const branchStat = ref<{ amount: number; label: string }[]>([]);
const treeData = ref<BranchWithChildren[]>([]);
@ -381,6 +354,18 @@ async function fetchSubBranch(id: string) {
onMounted(async () => {
getTree();
const result = await branchStore.stats();
if (result) {
branchStat.value.push({
amount: result.hq,
label: 'branchHQLabel',
});
branchStat.value.push({
amount: result.br,
label: 'branchLabel',
});
}
});
</script>
<template>