|
|
@@ -117,10 +117,10 @@
|
|
|
|
|
|
<div class="stat-cards-row">
|
|
|
<DashboardStatCard
|
|
|
- title="Total alunos (contratos ativos)"
|
|
|
+ title="Total alunos"
|
|
|
icon="mdi-account-multiple-outline"
|
|
|
:value="totalStudents"
|
|
|
- :badge="`${activeContracts} ativos`"
|
|
|
+ :badges="studentsStatusBadges"
|
|
|
clickable
|
|
|
@click="openActiveStudentsDialog"
|
|
|
/>
|
|
|
@@ -248,7 +248,7 @@ const isLoading = ref(true);
|
|
|
|
|
|
// ─── Metric counters ─────────────────────────────────────────
|
|
|
const totalStudents = ref(0);
|
|
|
-const activeContracts = ref(0);
|
|
|
+const studentsByStatus = ref({ active: 0, ex_student: 0, lead: 0, locked: 0 });
|
|
|
const frozenContracts = ref(0);
|
|
|
const cancelledContracts = ref(0);
|
|
|
const openTickets = ref(0);
|
|
|
@@ -340,6 +340,13 @@ const receivablesPeriodLabel = computed(() => {
|
|
|
* - Unit selected → just that unit ID
|
|
|
* - Nothing selected → [] (no filter = all units)
|
|
|
*/
|
|
|
+const studentsStatusBadges = computed(() => [
|
|
|
+ { color: "info", label: `${studentsByStatus.value.lead} Lead` },
|
|
|
+ { color: "positive", label: `${studentsByStatus.value.active} Ativo` },
|
|
|
+ { color: "grey", label: `${studentsByStatus.value.ex_student} Ex-aluno` },
|
|
|
+ { color: "warning", label: `${studentsByStatus.value.locked} Trancado` },
|
|
|
+]);
|
|
|
+
|
|
|
const activeUnitIds = computed(() => {
|
|
|
if (selectedGroup.value?.unit_ids?.length) {
|
|
|
return selectedGroup.value.unit_ids;
|
|
|
@@ -431,7 +438,7 @@ const fetchMetrics = async () => {
|
|
|
]);
|
|
|
|
|
|
totalStudents.value = studentSummary.total;
|
|
|
- activeContracts.value = contractSummary.active ?? 0;
|
|
|
+ studentsByStatus.value = studentSummary.by_status ?? studentsByStatus.value;
|
|
|
frozenContracts.value = contractSummary.frozen;
|
|
|
cancelledContracts.value = contractSummary.cancelled;
|
|
|
|