Merge remote-tracking branch 'origin' into feat-pedidos
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
<script lang="ts">
|
||||
import { api } from '@sgse-app/backend/convex/_generated/api';
|
||||
import type { Doc, Id } from '@sgse-app/backend/convex/_generated/dataModel';
|
||||
import type { Id, Doc } from '@sgse-app/backend/convex/_generated/dataModel';
|
||||
import UserAvatar from './chat/UserAvatar.svelte';
|
||||
import { Clock, Check, Edit, X, XCircle } from 'lucide-svelte';
|
||||
import { useConvexClient } from 'convex-svelte';
|
||||
|
||||
type PeriodoFerias = Doc<'ferias'> & {
|
||||
@@ -74,7 +76,8 @@
|
||||
dataInicio: periodo.dataInicio,
|
||||
dataFim: periodo.dataFim
|
||||
}
|
||||
]
|
||||
],
|
||||
feriasIdExcluir: periodo._id // Excluir este período do cálculo de saldo pendente
|
||||
});
|
||||
|
||||
if (!validacao.valido) {
|
||||
@@ -219,13 +222,20 @@
|
||||
<div class="card bg-base-100 shadow-xl">
|
||||
<div class="card-body">
|
||||
<div class="mb-4 flex items-start justify-between">
|
||||
<div>
|
||||
<h2 class="card-title text-2xl">
|
||||
{periodo.funcionario?.nome || 'Funcionário'}
|
||||
</h2>
|
||||
<p class="text-base-content/70 mt-1 text-sm">
|
||||
Ano de Referência: {periodo.anoReferencia}
|
||||
</p>
|
||||
<div class="flex items-center gap-3">
|
||||
<UserAvatar
|
||||
fotoPerfilUrl={periodo.funcionario?.fotoPerfilUrl}
|
||||
nome={periodo.funcionario?.nome || 'Funcionário'}
|
||||
size="md"
|
||||
/>
|
||||
<div>
|
||||
<h2 class="card-title text-2xl">
|
||||
{periodo.funcionario?.nome || 'Funcionário'}
|
||||
</h2>
|
||||
<p class="text-base-content/70 mt-1 text-sm">
|
||||
Ano de Referência: {periodo.anoReferencia}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class={`badge ${getStatusBadge(periodo.status)} badge-lg`}>
|
||||
{getStatusTexto(periodo.status)}
|
||||
@@ -270,20 +280,7 @@
|
||||
<div class="space-y-1">
|
||||
{#each periodo.historicoAlteracoes as hist}
|
||||
<div class="text-base-content/70 flex items-center gap-2 text-xs">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="h-3 w-3"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="currentColor"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"
|
||||
/>
|
||||
</svg>
|
||||
<Clock class="h-3 w-3" strokeWidth={2} />
|
||||
<span>{formatarData(hist.data)}</span>
|
||||
<span>-</span>
|
||||
<span>{hist.acao}</span>
|
||||
@@ -307,20 +304,7 @@
|
||||
onclick={aprovar}
|
||||
disabled={processando}
|
||||
>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="h-5 w-5"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="currentColor"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M5 13l4 4L19 7"
|
||||
/>
|
||||
</svg>
|
||||
<Check class="h-5 w-5" strokeWidth={2} />
|
||||
Aprovar
|
||||
</button>
|
||||
|
||||
@@ -330,20 +314,7 @@
|
||||
onclick={() => (modoAjuste = true)}
|
||||
disabled={processando}
|
||||
>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="h-5 w-5"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="currentColor"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"
|
||||
/>
|
||||
</svg>
|
||||
<Edit class="h-5 w-5" strokeWidth={2} />
|
||||
Ajustar Datas e Aprovar
|
||||
</button>
|
||||
</div>
|
||||
@@ -364,20 +335,7 @@
|
||||
onclick={reprovar}
|
||||
disabled={processando || !motivoReprovacao.trim()}
|
||||
>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="h-4 w-4"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="currentColor"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M6 18L18 6M6 6l12 12"
|
||||
/>
|
||||
</svg>
|
||||
<X class="h-4 w-4" strokeWidth={2} />
|
||||
Reprovar
|
||||
</button>
|
||||
</div>
|
||||
@@ -445,20 +403,7 @@
|
||||
onclick={ajustarEAprovar}
|
||||
disabled={processando || !novaDataInicio || !novaDataFim || diasAjustados <= 0}
|
||||
>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="h-4 w-4"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="currentColor"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M5 13l4 4L19 7"
|
||||
/>
|
||||
</svg>
|
||||
<Check class="h-4 w-4" strokeWidth={2} />
|
||||
Confirmar e Aprovar
|
||||
</button>
|
||||
</div>
|
||||
@@ -466,25 +411,48 @@
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
<!-- Informações de Aprovação/Reprovação -->
|
||||
{#if periodo.status === 'aprovado' || periodo.status === 'data_ajustada_aprovada' || periodo.status === 'EmFérias'}
|
||||
<div class="alert alert-success mt-4">
|
||||
<Check class="h-6 w-6 shrink-0 stroke-current" strokeWidth={2} />
|
||||
<div class="flex-1">
|
||||
<div class="font-bold">Aprovado</div>
|
||||
{#if periodo.gestor}
|
||||
<div class="text-sm mt-1">
|
||||
Por: <strong>{periodo.gestor.nome}</strong>
|
||||
</div>
|
||||
{/if}
|
||||
{#if periodo.dataAprovacao}
|
||||
<div class="text-xs mt-1 opacity-80">
|
||||
Em: {formatarData(periodo.dataAprovacao)}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- Motivo Reprovação (se reprovado) -->
|
||||
{#if periodo.status === 'reprovado' && periodo.motivoReprovacao}
|
||||
{#if periodo.status === 'reprovado'}
|
||||
<div class="alert alert-error mt-4">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="h-6 w-6 shrink-0 stroke-current"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"
|
||||
/>
|
||||
</svg>
|
||||
<div>
|
||||
<div class="font-bold">Motivo da Reprovação:</div>
|
||||
<XCircle class="h-6 w-6 shrink-0 stroke-current" strokeWidth={2} />
|
||||
<div class="flex-1">
|
||||
<div class="font-bold">Reprovado</div>
|
||||
{#if periodo.gestor}
|
||||
<div class="text-sm mt-1">
|
||||
Por: <strong>{periodo.gestor.nome}</strong>
|
||||
</div>
|
||||
{/if}
|
||||
{#if periodo.dataReprovacao}
|
||||
<div class="text-xs mt-1 opacity-80">
|
||||
Em: {formatarData(periodo.dataReprovacao)}
|
||||
</div>
|
||||
{/if}
|
||||
{#if periodo.motivoReprovacao}
|
||||
<div class="mt-2">
|
||||
<div class="text-sm font-semibold">Motivo:</div>
|
||||
<div class="text-sm">{periodo.motivoReprovacao}</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -492,19 +460,7 @@
|
||||
<!-- Erro -->
|
||||
{#if erro}
|
||||
<div class="alert alert-error mt-4">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="h-6 w-6 shrink-0 stroke-current"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"
|
||||
/>
|
||||
</svg>
|
||||
<XCircle class="h-6 w-6 shrink-0 stroke-current" />
|
||||
<span>{erro}</span>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user