|
|
@@ -2,7 +2,7 @@
|
|
|
<q-dialog ref="dialogRef" @hide="onDialogHide">
|
|
|
<q-card style="width: 800px; max-width: 95vw; border-radius: 12px">
|
|
|
<q-bar class="bg-transparent q-px-md" style="height: 55px">
|
|
|
- <span class="text-h6 text-dark" style="font-weight: 600">Alunos Ativos</span>
|
|
|
+ <span class="text-h6 text-dark" style="font-weight: 600">Alunos</span>
|
|
|
<q-space />
|
|
|
<q-btn dense flat icon="mdi-close" @click="onDialogCancel" />
|
|
|
</q-bar>
|
|
|
@@ -10,9 +10,9 @@
|
|
|
<q-card-section class="q-pt-none q-pb-md q-px-md">
|
|
|
<q-card flat bordered style="border-radius: 8px">
|
|
|
<q-card-section class="q-pb-xs">
|
|
|
- <div class="text-subtitle2 text-dark">Lista de alunos ativos</div>
|
|
|
+ <div class="text-subtitle2 text-dark">Lista de alunos</div>
|
|
|
<div class="text-caption text-grey-6">
|
|
|
- {{ students.length }} Alunos Ativos
|
|
|
+ {{ students.length }} Alunos
|
|
|
<q-spinner v-if="loading" size="16px" color="primary" class="q-ml-sm" />
|
|
|
</div>
|
|
|
</q-card-section>
|
|
|
@@ -52,8 +52,8 @@
|
|
|
<span class="text-caption text-grey-6">{{ student.unit }}</span>
|
|
|
</div>
|
|
|
<q-badge
|
|
|
- label="Ativo"
|
|
|
- color="btn-badge"
|
|
|
+ :label="statusLabel(student.status)"
|
|
|
+ :color="statusColor(student.status)"
|
|
|
style="
|
|
|
border-radius: 8px;
|
|
|
font-size: 11px;
|
|
|
@@ -85,7 +85,7 @@
|
|
|
import { ref, computed, onMounted } from "vue";
|
|
|
import { useDialogPluginComponent } from "quasar";
|
|
|
import { useRouter } from "vue-router";
|
|
|
-import { getFranchisorActiveStudents } from "src/api/student";
|
|
|
+import { getFranchisorStudents } from "src/api/student";
|
|
|
import { formatUnitName } from "src/helpers/utils";
|
|
|
|
|
|
const props = defineProps({
|
|
|
@@ -105,11 +105,12 @@ const students = ref([]);
|
|
|
onMounted(async () => {
|
|
|
loading.value = true;
|
|
|
try {
|
|
|
- const data = await getFranchisorActiveStudents(props.unitIds);
|
|
|
+ const data = await getFranchisorStudents(props.unitIds);
|
|
|
students.value = data.map((s) => ({
|
|
|
id: s.id,
|
|
|
name: s.name,
|
|
|
phone: s.phone ?? "—",
|
|
|
+ status: s.status,
|
|
|
unit: formatUnitName(s.unit),
|
|
|
}));
|
|
|
} catch {
|
|
|
@@ -134,6 +135,20 @@ const goToDetail = (student) => {
|
|
|
onDialogOK();
|
|
|
router.push({ name: "StudentDetailPage", params: { id: student.id } });
|
|
|
};
|
|
|
+
|
|
|
+const statusLabel = (status) => {
|
|
|
+ if (status === "active") return "Ativo";
|
|
|
+ if (status === "locked") return "Trancado";
|
|
|
+ if (status === "ex_student") return "Ex-aluno";
|
|
|
+ return "Lead";
|
|
|
+};
|
|
|
+
|
|
|
+const statusColor = (status) => {
|
|
|
+ if (status === "active") return "positive";
|
|
|
+ if (status === "locked") return "orange";
|
|
|
+ if (status === "ex_student") return "grey-7";
|
|
|
+ return "blue";
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|