|
|
|
@@ -74,6 +74,61 @@ export const SeletorItensOtimizado: React.FC<SeletorItensOtimizadoProps> = ({
|
|
|
|
|
const { isAdmin } = useUserRole();
|
|
|
|
|
const { fetchComponentesPeca } = useComponentesPeca();
|
|
|
|
|
|
|
|
|
|
// Função para buscar apontamentos de uma peça específica
|
|
|
|
|
const buscarApontamentosPeca = useCallback(async (peca: ItemDisponivel) => {
|
|
|
|
|
setLoadingApontamentos(true);
|
|
|
|
|
try {
|
|
|
|
|
const { data, error } = await supabase
|
|
|
|
|
.from('apontamentos_producao')
|
|
|
|
|
.select(`
|
|
|
|
|
id,
|
|
|
|
|
quantidade_produzida,
|
|
|
|
|
data_apontamento,
|
|
|
|
|
created_at,
|
|
|
|
|
processo:processos_fabricacao!processo_id(nome, ordem),
|
|
|
|
|
peca:pecas!peca_id(marca, of_number)
|
|
|
|
|
`)
|
|
|
|
|
.eq('tipo_apontamento', 'peca')
|
|
|
|
|
.eq('peca_id', peca.id)
|
|
|
|
|
.order('created_at', { ascending: false });
|
|
|
|
|
|
|
|
|
|
if (error) {
|
|
|
|
|
console.error('Erro ao buscar apontamentos da peça:', error);
|
|
|
|
|
toast.error('Erro ao buscar apontamentos da peça');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setApontamentosPeca(data || []);
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('Erro ao buscar apontamentos:', error);
|
|
|
|
|
toast.error('Erro ao buscar apontamentos');
|
|
|
|
|
} finally {
|
|
|
|
|
setLoadingApontamentos(false);
|
|
|
|
|
}
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
// Função para abrir o modal administrativo
|
|
|
|
|
const handleAdminAction = useCallback(async (peca: ItemDisponivel) => {
|
|
|
|
|
setSelectedPecaForAdmin(peca);
|
|
|
|
|
setShowAdminModal(true);
|
|
|
|
|
await buscarApontamentosPeca(peca);
|
|
|
|
|
}, [buscarApontamentosPeca]);
|
|
|
|
|
|
|
|
|
|
// Função para forçar exclusão da peça da tela
|
|
|
|
|
const handleForceRemove = useCallback(async () => {
|
|
|
|
|
if (!selectedPecaForAdmin) return;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
toast.success(`Peça ${selectedPecaForAdmin.marca} foi removida da exibição`);
|
|
|
|
|
setShowAdminModal(false);
|
|
|
|
|
setSelectedPecaForAdmin(null);
|
|
|
|
|
setApontamentosPeca([]);
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('Erro ao remover peça:', error);
|
|
|
|
|
toast.error('Erro ao remover peça da exibição');
|
|
|
|
|
}
|
|
|
|
|
}, [selectedPecaForAdmin]);
|
|
|
|
|
|
|
|
|
|
const pecasOrdenadas = useMemo(() => {
|
|
|
|
|
let pecasFiltradas = pecasDisponiveis;
|
|
|
|
|
if (filtroNumeroPeca) {
|
|
|
|
@@ -591,688 +646,4 @@ export const SeletorItensOtimizado: React.FC<SeletorItensOtimizadoProps> = ({
|
|
|
|
|
</Dialog>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// Função para buscar apontamentos de uma peça específica
|
|
|
|
|
const buscarApontamentosPeca = useCallback(async (peca: ItemDisponivel) => {
|
|
|
|
|
setLoadingApontamentos(true);
|
|
|
|
|
try {
|
|
|
|
|
const { data, error } = await supabase
|
|
|
|
|
.from('apontamentos_producao')
|
|
|
|
|
.select(`
|
|
|
|
|
id,
|
|
|
|
|
quantidade_produzida,
|
|
|
|
|
data_apontamento,
|
|
|
|
|
created_at,
|
|
|
|
|
processo:processos_fabricacao(nome, ordem),
|
|
|
|
|
peca:pecas(marca, of_number)
|
|
|
|
|
`)
|
|
|
|
|
.eq('tipo_apontamento', 'peca')
|
|
|
|
|
.eq('peca_id', peca.id)
|
|
|
|
|
.order('created_at', { ascending: false });
|
|
|
|
|
|
|
|
|
|
if (error) {
|
|
|
|
|
console.error('Erro ao buscar apontamentos da peça:', error);
|
|
|
|
|
toast.error('Erro ao buscar apontamentos da peça');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setApontamentosPeca(data || []);
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('Erro ao buscar apontamentos:', error);
|
|
|
|
|
toast.error('Erro ao buscar apontamentos');
|
|
|
|
|
} finally {
|
|
|
|
|
setLoadingApontamentos(false);
|
|
|
|
|
}
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
// Função para abrir o modal administrativo
|
|
|
|
|
const handleAdminAction = useCallback(async (peca: ItemDisponivel) => {
|
|
|
|
|
setSelectedPecaForAdmin(peca);
|
|
|
|
|
setShowAdminModal(true);
|
|
|
|
|
await buscarApontamentosPeca(peca);
|
|
|
|
|
}, [buscarApontamentosPeca]);
|
|
|
|
|
|
|
|
|
|
// Função para forçar exclusão da peça da tela
|
|
|
|
|
const handleForceRemove = useCallback(async () => {
|
|
|
|
|
if (!selectedPecaForAdmin) return;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
// Aqui você pode implementar a lógica específica para "excluir" a peça da exibição
|
|
|
|
|
// Por exemplo, marcar como processada ou adicionar a uma lista de exclusões
|
|
|
|
|
|
|
|
|
|
// Por enquanto, vamos apenas mostrar uma mensagem e fechar o modal
|
|
|
|
|
toast.success(`Peça ${selectedPecaForAdmin.marca} foi removida da exibição`);
|
|
|
|
|
|
|
|
|
|
// Fechar modal
|
|
|
|
|
setShowAdminModal(false);
|
|
|
|
|
setSelectedPecaForAdmin(null);
|
|
|
|
|
setApontamentosPeca([]);
|
|
|
|
|
|
|
|
|
|
// Aqui você poderia chamar uma função para atualizar a lista de peças disponíveis
|
|
|
|
|
// ou implementar a lógica específica do seu sistema
|
|
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('Erro ao remover peça:', error);
|
|
|
|
|
toast.error('Erro ao remover peça da exibição');
|
|
|
|
|
}
|
|
|
|
|
}, [selectedPecaForAdmin]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div>
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
Esta peça possui {apontamentosPeca.length} apontamento(s) registrado(s).
|
|
|
|
|
Forçar a exclusão irá removê-la da exibição atual, mas não afetará os dados já salvos.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{apontamentosPeca.length > 0 && (
|
|
|
|
|
<>
|
|
|
|
|
<div className="bg-orange-900/20 border border-orange-700 p-4 rounded-lg">
|
|
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<AlertTriangle className="h-5 w-5 text-orange-400 mt-0.5" />
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
<h5 className="font-semibold text-orange-300">Atenção!</h5>
|
|
|
|
|
<p className="text-sm text-orange-200 mt-1">
|
|
|
|
|
{`${apontamentosPeca.length} apontamento(s) registrado(s) encontrado(s) para esta peça`}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</>
|
|
|
|
|
)}
|
|
|
|
|
`${apontamentosPeca.length} registered appointment(s) found for this piece`;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|