feat: branch stats
This commit is contained in:
parent
c2d7e1f9c5
commit
06f3b2b1bb
3 changed files with 16 additions and 31 deletions
|
|
@ -38,7 +38,7 @@ const color = ['pink', 'purple'];
|
||||||
|
|
||||||
<div class="column justify-around stat-card-content">
|
<div class="column justify-around stat-card-content">
|
||||||
<div class="col-4 text-h5 text-weight-bold">{{ v.amount }}</div>
|
<div class="col-4 text-h5 text-weight-bold">{{ v.amount }}</div>
|
||||||
<div class="text-weight-bold">{{ v.label }}</div>
|
<div class="text-weight-bold">{{ $t(v.label) }}</div>
|
||||||
</div>
|
</div>
|
||||||
</app-box>
|
</app-box>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
export default {
|
export default {
|
||||||
branchLabel: 'สาขา',
|
branchLabel: 'สาขา',
|
||||||
branchHQLabel: 'สาขาใหญ่',
|
branchHQLabel: 'สำนักงานใหญ่',
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ const currentBranchContactIdEdit = ref<string>('');
|
||||||
const showCurrentBranch = ref<Branch>();
|
const showCurrentBranch = ref<Branch>();
|
||||||
|
|
||||||
const shape = ref<boolean>(false);
|
const shape = ref<boolean>(false);
|
||||||
const openBranchDrawer = ref<boolean>(true);
|
const openBranchDrawer = ref<boolean>(false);
|
||||||
const openCardDetails = ref<boolean>(false);
|
const openCardDetails = ref<boolean>(false);
|
||||||
const openTableCard = ref<boolean>(true);
|
const openTableCard = ref<boolean>(true);
|
||||||
|
|
||||||
|
|
@ -82,34 +82,7 @@ const selected = ref<string>('');
|
||||||
|
|
||||||
const expanded = ref<string[]>([]);
|
const expanded = ref<string[]>([]);
|
||||||
|
|
||||||
const branchStat = ref<
|
const branchStat = ref<{ amount: number; label: string }[]>([]);
|
||||||
{
|
|
||||||
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 treeData = ref<BranchWithChildren[]>([]);
|
const treeData = ref<BranchWithChildren[]>([]);
|
||||||
|
|
||||||
|
|
@ -381,6 +354,18 @@ async function fetchSubBranch(id: string) {
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
getTree();
|
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>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue