|
|
@@ -56,10 +56,10 @@
|
|
|
<DashboardStatCard
|
|
|
title="Total alunos (contratos ativos)"
|
|
|
icon="mdi-account-multiple-outline"
|
|
|
- value="4.527"
|
|
|
- badge="3.200 ativos"
|
|
|
+ :value="totalStudents"
|
|
|
+ :badge="`${activeContracts} ativos`"
|
|
|
clickable
|
|
|
- @click="openAlunosDialog"
|
|
|
+ @click="openActiveStudentsDialog"
|
|
|
/>
|
|
|
<DashboardStatCard
|
|
|
title="Contratos Congelados"
|
|
|
@@ -67,7 +67,7 @@
|
|
|
value="57"
|
|
|
subtitle="É hora de incentivar nossos alunos"
|
|
|
clickable
|
|
|
- @click="openContratosCongeladosDialog"
|
|
|
+ @click="openFrozenContractsDialog"
|
|
|
/>
|
|
|
<DashboardStatCard
|
|
|
title="Contratos Cancelados"
|
|
|
@@ -75,7 +75,7 @@
|
|
|
value="57"
|
|
|
subtitle="É hora de incentivar nossos alunos"
|
|
|
clickable
|
|
|
- @click="openContratosCanceladosDialog"
|
|
|
+ @click="openCancelledContractsDialog"
|
|
|
/>
|
|
|
<DashboardStatCard
|
|
|
title="Receita Geral"
|
|
|
@@ -94,14 +94,14 @@
|
|
|
badge-color="approved"
|
|
|
custom-style="padding: 6px 24px"
|
|
|
clickable
|
|
|
- @click="openFrequenciaMediaDialog"
|
|
|
+ @click="openAverageAttendanceDialog"
|
|
|
/>
|
|
|
<DashboardStatCard
|
|
|
title="Estoque Geral de Produtos"
|
|
|
icon="mdi-currency-usd"
|
|
|
value="56"
|
|
|
clickable
|
|
|
- @click="openEstoqueProdutosDialog"
|
|
|
+ @click="openProductStockDialog"
|
|
|
/>
|
|
|
<DashboardStatCard
|
|
|
title="Tarefas Pendentes"
|
|
|
@@ -115,7 +115,7 @@
|
|
|
value="2"
|
|
|
subtitle="Estável"
|
|
|
clickable
|
|
|
- @click="openTicketsAbertoDialog"
|
|
|
+ @click="openTicketsDialog"
|
|
|
/>
|
|
|
</div>
|
|
|
|
|
|
@@ -144,8 +144,8 @@
|
|
|
/>
|
|
|
</DashboardChartCard>
|
|
|
|
|
|
- <FeriadosCard />
|
|
|
- <AniversariantesCard :people="aniversariantes" />
|
|
|
+ <HolidaysCard />
|
|
|
+ <BirthdaysCard :people="birthdays" />
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -166,14 +166,15 @@ import UnitSelect from "src/components/selects/UnitSelect.vue";
|
|
|
import DashboardStatCard from "src/components/charts/DashboardStatCard.vue";
|
|
|
import DashboardChartCard from "src/components/charts/DashboardChartCard.vue";
|
|
|
import GroupedBarChart from "src/components/charts/normal/GroupedBarChart.vue";
|
|
|
-import AniversariantesCard from "src/components/charts/AniversariantesCard.vue";
|
|
|
-import FeriadosCard from "src/components/charts/FeriadosCard.vue";
|
|
|
-import AlunosAtivosDialog from "src/pages/dashboard/components/AlunosAtivosDialog.vue";
|
|
|
-import ContratosCongeladosDialog from "src/pages/dashboard/components/ContratosCongeladosDialog.vue";
|
|
|
-import ContratosCanceladosDialog from "src/pages/dashboard/components/ContratosCanceladosDialog.vue";
|
|
|
-import FrequenciaMediaDialog from "src/pages/dashboard/components/FrequenciaMediaDialog.vue";
|
|
|
-import EstoqueProdutosDialog from "src/pages/dashboard/components/EstoqueProdutosDialog.vue";
|
|
|
-import TicketsAbertoDialog from "src/pages/dashboard/components/TicketsAbertoDialog.vue";
|
|
|
+import BirthdaysCard from "src/components/charts/BirthdaysCard.vue";
|
|
|
+import HolidaysCard from "src/components/charts/HolidaysCard.vue";
|
|
|
+import ActiveStudentsDialog from "src/pages/dashboard/components/ActiveStudentsDialog.vue";
|
|
|
+import { getStudentSummaryFranchisor } from "src/api/student";
|
|
|
+import FrozenContractsDialog from "src/pages/dashboard/components/FrozenContractsDialog.vue";
|
|
|
+import CancelledContractsDialog from "src/pages/dashboard/components/CancelledContractsDialog.vue";
|
|
|
+import AverageAttendanceDialog from "src/pages/dashboard/components/AverageAttendanceDialog.vue";
|
|
|
+import ProductStockDialog from "src/pages/dashboard/components/ProductStockDialog.vue";
|
|
|
+import OpenTicketsDialog from "src/pages/dashboard/components/OpenTicketsDialog.vue";
|
|
|
|
|
|
const { t } = useI18n();
|
|
|
|
|
|
@@ -181,28 +182,31 @@ const $q = useQuasar();
|
|
|
|
|
|
const isLoading = ref(true);
|
|
|
|
|
|
-const openAlunosDialog = () => {
|
|
|
- $q.dialog({ component: AlunosAtivosDialog });
|
|
|
+const totalStudents = ref(0);
|
|
|
+const activeContracts = ref(0);
|
|
|
+
|
|
|
+const openActiveStudentsDialog = () => {
|
|
|
+ $q.dialog({ component: ActiveStudentsDialog });
|
|
|
};
|
|
|
|
|
|
-const openContratosCongeladosDialog = () => {
|
|
|
- $q.dialog({ component: ContratosCongeladosDialog });
|
|
|
+const openFrozenContractsDialog = () => {
|
|
|
+ $q.dialog({ component: FrozenContractsDialog });
|
|
|
};
|
|
|
|
|
|
-const openContratosCanceladosDialog = () => {
|
|
|
- $q.dialog({ component: ContratosCanceladosDialog });
|
|
|
+const openCancelledContractsDialog = () => {
|
|
|
+ $q.dialog({ component: CancelledContractsDialog });
|
|
|
};
|
|
|
|
|
|
-const openFrequenciaMediaDialog = () => {
|
|
|
- $q.dialog({ component: FrequenciaMediaDialog });
|
|
|
+const openAverageAttendanceDialog = () => {
|
|
|
+ $q.dialog({ component: AverageAttendanceDialog });
|
|
|
};
|
|
|
|
|
|
-const openEstoqueProdutosDialog = () => {
|
|
|
- $q.dialog({ component: EstoqueProdutosDialog });
|
|
|
+const openProductStockDialog = () => {
|
|
|
+ $q.dialog({ component: ProductStockDialog });
|
|
|
};
|
|
|
|
|
|
-const openTicketsAbertoDialog = () => {
|
|
|
- $q.dialog({ component: TicketsAbertoDialog });
|
|
|
+const openTicketsDialog = () => {
|
|
|
+ $q.dialog({ component: OpenTicketsDialog });
|
|
|
};
|
|
|
const defaultPeriod = ref("month");
|
|
|
const defaultEventId = ref(1);
|
|
|
@@ -221,7 +225,7 @@ const periodOptions = [
|
|
|
{ label: "Personalizado", value: "custom" },
|
|
|
];
|
|
|
|
|
|
-const aniversariantes = [
|
|
|
+const birthdays = [
|
|
|
{ day: 10, name: "Heloisa Faria" },
|
|
|
{ day: 11, name: "Juliana Costa" },
|
|
|
{ day: 16, name: "Juliana Costa" },
|
|
|
@@ -437,6 +441,10 @@ watch([defaultPeriod, defaultEventId], async () => {
|
|
|
});
|
|
|
|
|
|
onMounted(async () => {
|
|
|
+ getStudentSummaryFranchisor().then((summary) => {
|
|
|
+ totalStudents.value = summary.total;
|
|
|
+ activeContracts.value = summary.active;
|
|
|
+ });
|
|
|
await updateDashboardData();
|
|
|
});
|
|
|
</script>
|