|
|
@@ -21,6 +21,10 @@
|
|
|
</q-td>
|
|
|
</template>
|
|
|
|
|
|
+ <template #body-cell-origin="{ row }">
|
|
|
+ <q-td align="left">{{ originLabel(row) }}</q-td>
|
|
|
+ </template>
|
|
|
+
|
|
|
<template #body-cell-status="{ row }">
|
|
|
<q-td align="left">
|
|
|
<q-badge
|
|
|
@@ -34,9 +38,8 @@
|
|
|
<template #body-cell-actions="{ row }">
|
|
|
<q-td style="display: flex; gap: 4px; align-items: center; justify-content: center">
|
|
|
<q-btn
|
|
|
- v-if="canManage(row)"
|
|
|
outline
|
|
|
- icon="mdi-pencil-outline"
|
|
|
+ :icon="canManage(row) ? 'mdi-pencil-outline' : 'mdi-eye-outline'"
|
|
|
style="width: 36px"
|
|
|
@click.prevent.stop="handleEdit(row)"
|
|
|
/>
|
|
|
@@ -94,12 +97,18 @@ const columns = [
|
|
|
{ name: "id", label: "Ticket", field: "id", align: "left", style: "width: 5%" },
|
|
|
{ name: "severity", label: "Prioridade", field: "severity", align: "left", style: "width: 10%" },
|
|
|
{ name: "created_at", label: "Data", field: "created_at", align: "left", style: "width: 12%" },
|
|
|
- { name: "sector", label: "Setor", field: "sector", align: "left", style: "width: 18%" },
|
|
|
- { name: "title", label: "Título", field: "title", align: "left", style: "width: 35%" },
|
|
|
+ { name: "origin", label: "Origem", field: "origin", align: "left", style: "width: 12%" },
|
|
|
+ { name: "sector", label: "Setor", field: "sector", align: "left", style: "width: 16%" },
|
|
|
+ { name: "title", label: "Título", field: "title", align: "left", style: "width: 25%" },
|
|
|
{ name: "status", label: "Status", field: "status", align: "left", style: "width: 10%" },
|
|
|
{ name: "actions", label: "Ações", field: "actions", align: "center", style: "width: 10%" },
|
|
|
];
|
|
|
|
|
|
+const originLabel = (row) => {
|
|
|
+ if (row.scope === "internal") return "Interno";
|
|
|
+ return "Matriz";
|
|
|
+};
|
|
|
+
|
|
|
// Franchisee só pode gerenciar tickets internos que ela mesma criou
|
|
|
const canManage = (row) => row.origin === "unit" && row.scope === "internal";
|
|
|
|