Spaces:
Running
Running
<html lang="pt-BR"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>SST Document Manager - Cadastro de Terceiros</title> | |
<script src="https://cdn.tailwindcss.com"></script> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
<style> | |
.gradient-bg { | |
background: linear-gradient(135deg, #10b981 0%, #ffffff 50%, #1f2937 100%); | |
} | |
.document-card:hover { | |
transform: translateY(-5px); | |
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); | |
} | |
.sidebar { | |
transition: all 0.3s ease; | |
} | |
.chat-bubble { | |
animation: fadeIn 0.3s ease-in-out; | |
} | |
@keyframes fadeIn { | |
from { opacity: 0; transform: translateY(10px); } | |
to { opacity: 1; transform: translateY(0); } | |
} | |
.pulse-alert { | |
animation: pulse 2s infinite; | |
} | |
@keyframes pulse { | |
0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); } | |
70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); } | |
100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } | |
} | |
.slide-in { | |
animation: slideIn 0.3s ease-out; | |
} | |
@keyframes slideIn { | |
from { transform: translateX(100%); opacity: 0; } | |
to { transform: translateX(0); opacity: 1; } | |
} | |
.input-error { | |
border-color: #ef4444; | |
} | |
.error-message { | |
color: #ef4444; | |
font-size: 0.75rem; | |
margin-top: 0.25rem; | |
} | |
</style> | |
</head> | |
<body class="bg-gray-50 font-sans"> | |
<!-- Main Container --> | |
<div class="flex h-screen overflow-hidden"> | |
<!-- Sidebar --> | |
<div class="sidebar bg-gray-800 text-white w-64 flex-shrink-0 flex flex-col"> | |
<div class="p-4 flex items-center justify-center border-b border-gray-700"> | |
<div class="flex items-center"> | |
<div class="w-10 h-10 rounded-full bg-green-500 flex items-center justify-center mr-3"> | |
<i class="fas fa-shield-alt text-white"></i> | |
</div> | |
<span class="text-xl font-bold">SST Manager</span> | |
</div> | |
</div> | |
<div class="p-4 border-b border-gray-700"> | |
<div class="flex items-center space-x-3"> | |
<div class="w-10 h-10 rounded-full bg-green-100 flex items-center justify-center"> | |
<i class="fas fa-user text-green-800"></i> | |
</div> | |
<div> | |
<p class="font-medium">Admin User</p> | |
<p class="text-xs text-gray-400">[email protected]</p> | |
</div> | |
</div> | |
</div> | |
<nav class="flex-1 overflow-y-auto"> | |
<div class="p-2"> | |
<p class="text-xs uppercase text-gray-400 mb-2 px-2">Menu Principal</p> | |
<a href="#" class="flex items-center space-x-2 px-3 py-2 rounded hover:bg-gray-700 text-gray-300 hover:text-white"> | |
<i class="fas fa-tachometer-alt w-5"></i> | |
<span>Dashboard</span> | |
</a> | |
<a href="#" class="flex items-center space-x-2 px-3 py-2 rounded hover:bg-gray-700 text-gray-300 hover:text-white mt-1"> | |
<i class="fas fa-file-alt w-5"></i> | |
<span>Documentos SST</span> | |
</a> | |
<a href="#" class="flex items-center space-x-2 px-3 py-2 rounded hover:bg-gray-700 text-gray-300 hover:text-white mt-1"> | |
<i class="fas fa-leaf w-5"></i> | |
<span>Ambientais</span> | |
</a> | |
<a href="terceiros.html" class="flex items-center space-x-2 px-3 py-2 rounded bg-gray-700 text-white mt-1"> | |
<i class="fas fa-building w-5"></i> | |
<span>Terceiros</span> | |
</a> | |
<a href="#" class="flex items-center space-x-2 px-3 py-2 rounded hover:bg-gray-700 text-gray-300 hover:text-white mt-1"> | |
<i class="fas fa-cog w-5"></i> | |
<span>Configurações</span> | |
</a> | |
</div> | |
<div class="p-2 mt-4"> | |
<p class="text-xs uppercase text-gray-400 mb-2 px-2">Ramo de Atividade</p> | |
<div class="px-2"> | |
<select class="w-full bg-gray-700 text-white rounded px-3 py-2 text-sm border border-gray-600 focus:outline-none focus:ring-1 focus:ring-green-500"> | |
<option>Construção Civil</option> | |
<option>Indústria</option> | |
<option>Comércio</option> | |
<option>Serviços</option> | |
<option>Saúde</option> | |
</select> | |
</div> | |
</div> | |
</nav> | |
<div class="p-4 border-t border-gray-700"> | |
<button class="w-full bg-gray-700 hover:bg-gray-600 text-white py-2 rounded flex items-center justify-center space-x-2"> | |
<i class="fas fa-sign-out-alt"></i> | |
<span>Sair</span> | |
</button> | |
</div> | |
</div> | |
<!-- Main Content --> | |
<div class="flex-1 flex flex-col overflow-hidden"> | |
<!-- Top Navigation --> | |
<header class="bg-white border-b border-gray-200 flex items-center justify-between px-6 py-3"> | |
<div class="flex items-center"> | |
<button id="sidebarToggle" class="text-gray-500 mr-4 md:hidden"> | |
<i class="fas fa-bars"></i> | |
</button> | |
<h1 class="text-xl font-semibold text-gray-800">Cadastro de Terceiros</h1> | |
</div> | |
<div class="flex items-center space-x-4"> | |
<div class="relative"> | |
<button class="text-gray-500 hover:text-gray-700"> | |
<i class="fas fa-bell"></i> | |
</button> | |
<span class="absolute top-0 right-0 w-2 h-2 bg-red-500 rounded-full"></span> | |
</div> | |
<div class="relative"> | |
<button class="text-gray-500 hover:text-gray-700"> | |
<i class="fas fa-envelope"></i> | |
</button> | |
<span class="absolute top-0 right-0 w-2 h-2 bg-blue-500 rounded-full"></span> | |
</div> | |
<div class="w-8 h-8 rounded-full bg-green-100 flex items-center justify-center"> | |
<i class="fas fa-user text-green-800"></i> | |
</div> | |
</div> | |
</header> | |
<!-- Dashboard Content --> | |
<main class="flex-1 overflow-y-auto p-6 bg-gray-50"> | |
<!-- Terceiros Content --> | |
<div class="grid grid-cols-1 lg:grid-cols-4 gap-6"> | |
<!-- Lista de Terceiros --> | |
<div class="lg:col-span-1 bg-white rounded-lg shadow overflow-hidden"> | |
<div class="px-6 py-4 border-b border-gray-200 flex justify-between items-center"> | |
<h2 class="text-lg font-semibold text-gray-800">Terceiros Cadastrados</h2> | |
<span class="text-xs bg-green-100 text-green-800 px-2 py-1 rounded-full">24</span> | |
</div> | |
<div class="divide-y divide-gray-200 max-h-[calc(100vh-220px)] overflow-y-auto"> | |
<!-- Terceiro Item --> | |
<div class="p-4 hover:bg-gray-50 cursor-pointer transition flex items-center justify-between group"> | |
<div class="flex items-center space-x-3"> | |
<div class="w-10 h-10 rounded-full bg-blue-100 flex items-center justify-center"> | |
<i class="fas fa-building text-blue-600"></i> | |
</div> | |
<div> | |
<p class="font-medium group-hover:text-blue-600">Construtora ABC</p> | |
<p class="text-xs text-gray-500">CNPJ: 12.345.678/0001-99</p> | |
</div> | |
</div> | |
<span class="text-xs bg-green-100 text-green-800 px-2 py-1 rounded-full">Ativo</span> | |
</div> | |
<!-- Terceiro Item --> | |
<div class="p-4 hover:bg-gray-50 cursor-pointer transition flex items-center justify-between group"> | |
<div class="flex items-center space-x-3"> | |
<div class="w-10 h-10 rounded-full bg-purple-100 flex items-center justify-center"> | |
<i class="fas fa-tools text-purple-600"></i> | |
</div> | |
<div> | |
<p class="font-medium group-hover:text-blue-600">Manutenção Industrial</p> | |
<p class="text-xs text-gray-500">CNPJ: 98.765.432/0001-11</p> | |
</div> | |
</div> | |
<span class="text-xs bg-yellow-100 text-yellow-800 px-2 py-1 rounded-full">Pendente</span> | |
</div> | |
<!-- Terceiro Item --> | |
<div class="p-4 hover:bg-gray-50 cursor-pointer transition flex items-center justify-between group"> | |
<div class="flex items-center space-x-3"> | |
<div class="w-10 h-10 rounded-full bg-red-100 flex items-center justify-center"> | |
<i class="fas fa-truck text-red-600"></i> | |
</div> | |
<div> | |
<p class="font-medium group-hover:text-blue-600">Transportes XYZ</p> | |
<p class="text-xs text-gray-500">CNPJ: 45.678.123/0001-44</p> | |
</div> | |
</div> | |
<span class="text-xs bg-red-100 text-red-800 px-2 py-1 rounded-full">Vencido</span> | |
</div> | |
<!-- Terceiro Item --> | |
<div class="p-4 hover:bg-gray-50 cursor-pointer transition flex items-center justify-between group"> | |
<div class="flex items-center space-x-3"> | |
<div class="w-10 h-10 rounded-full bg-green-100 flex items-center justify-center"> | |
<i class="fas fa-bolt text-green-600"></i> | |
</div> | |
<div> | |
<p class="font-medium group-hover:text-blue-600">Energia Solar Ltda</p> | |
<p class="text-xs text-gray-500">CNPJ: 78.912.345/0001-66</p> | |
</div> | |
</div> | |
<span class="text-xs bg-green-100 text-green-800 px-2 py-1 rounded-full">Ativo</span> | |
</div> | |
<!-- Terceiro Item --> | |
<div class="p-4 hover:bg-gray-50 cursor-pointer transition flex items-center justify-between group"> | |
<div class="flex items-center space-x-3"> | |
<div class="w-10 h-10 rounded-full bg-orange-100 flex items-center justify-center"> | |
<i class="fas fa-shield-alt text-orange-600"></i> | |
</div> | |
<div> | |
<p class="font-medium group-hover:text-blue-600">Segurança Total</p> | |
<p class="text-xs text-gray-500">CNPJ: 34.567.891/0001-22</p> | |
</div> | |
</div> | |
<span class="text-xs bg-green-100 text-green-800 px-2 py-1 rounded-full">Ativo</span> | |
</div> | |
<!-- Botão Adicionar --> | |
<div class="p-4"> | |
<button id="addTerceiroBtn" class="w-full bg-green-600 hover:bg-green-700 text-white py-2 rounded flex items-center justify-center space-x-2 transition"> | |
<i class="fas fa-plus"></i> | |
<span>Adicionar Terceiro</span> | |
</button> | |
</div> | |
</div> | |
</div> | |
<!-- Formulário de Cadastro --> | |
<div class="lg:col-span-3"> | |
<div id="formContainer" class="bg-white rounded-lg shadow overflow-hidden slide-in"> | |
<div class="px-6 py-4 border-b border-gray-200 flex justify-between items-center"> | |
<h2 class="text-lg font-semibold text-gray-800">Cadastrar Novo Terceiro</h2> | |
<div class="flex items-center space-x-2"> | |
<span class="text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded-full">Obrigatório</span> | |
<span class="text-xs bg-gray-100 text-gray-800 px-2 py-1 rounded-full">Todos os campos</span> | |
</div> | |
</div> | |
<form id="terceiroForm" class="p-6"> | |
<!-- Dados Básicos --> | |
<div class="mb-8"> | |
<h3 class="text-md font-semibold text-gray-700 mb-4 flex items-center"> | |
<i class="fas fa-info-circle text-blue-500 mr-2"></i> | |
Dados Básicos | |
</h3> | |
<div class="grid grid-cols-1 md:grid-cols-2 gap-6"> | |
<div> | |
<label for="razaoSocial" class="block text-sm font-medium text-gray-700 mb-1">Razão Social *</label> | |
<input type="text" id="razaoSocial" name="razaoSocial" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500" required> | |
<p id="razaoSocialError" class="error-message hidden">Campo obrigatório</p> | |
</div> | |
<div> | |
<label for="nomeFantasia" class="block text-sm font-medium text-gray-700 mb-1">Nome Fantasia</label> | |
<input type="text" id="nomeFantasia" name="nomeFantasia" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500"> | |
</div> | |
<div> | |
<label for="cnpj" class="block text-sm font-medium text-gray-700 mb-1">CNPJ *</label> | |
<input type="text" id="cnpj" name="cnpj" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500" required> | |
<p id="cnpjError" class="error-message hidden">CNPJ inválido</p> | |
</div> | |
<div> | |
<label for="inscricaoEstadual" class="block text-sm font-medium text-gray-700 mb-1">Inscrição Estadual</label> | |
<input type="text" id="inscricaoEstadual" name="inscricaoEstadual" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500"> | |
</div> | |
</div> | |
</div> | |
<!-- Contato --> | |
<div class="mb-8"> | |
<h3 class="text-md font-semibold text-gray-700 mb-4 flex items-center"> | |
<i class="fas fa-address-book text-blue-500 mr-2"></i> | |
Contato | |
</h3> | |
<div class="grid grid-cols-1 md:grid-cols-2 gap-6"> | |
<div> | |
<label for="email" class="block text-sm font-medium text-gray-700 mb-1">E-mail *</label> | |
<input type="email" id="email" name="email" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500" required> | |
<p id="emailError" class="error-message hidden">E-mail inválido</p> | |
</div> | |
<div> | |
<label for="telefone" class="block text-sm font-medium text-gray-700 mb-1">Telefone *</label> | |
<input type="tel" id="telefone" name="telefone" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500" required> | |
<p id="telefoneError" class="error-message hidden">Telefone inválido</p> | |
</div> | |
<div> | |
<label for="responsavel" class="block text-sm font-medium text-gray-700 mb-1">Responsável</label> | |
<input type="text" id="responsavel" name="responsavel" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500"> | |
</div> | |
<div> | |
<label for="celularResponsavel" class="block text-sm font-medium text-gray-700 mb-1">Celular do Responsável</label> | |
<input type="tel" id="celularResponsavel" name="celularResponsavel" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500"> | |
</div> | |
</div> | |
</div> | |
<!-- Endereço --> | |
<div class="mb-8"> | |
<h3 class="text-md font-semibold text-gray-700 mb-4 flex items-center"> | |
<i class="fas fa-map-marker-alt text-blue-500 mr-2"></i> | |
Endereço | |
</h3> | |
<div class="grid grid-cols-1 md:grid-cols-2 gap-6"> | |
<div> | |
<label for="cep" class="block text-sm font-medium text-gray-700 mb-1">CEP</label> | |
<div class="flex"> | |
<input type="text" id="cep" name="cep" class="flex-1 px-3 py-2 border border-gray-300 rounded-l-md focus:outline-none focus:ring-1 focus:ring-blue-500"> | |
<button type="button" id="buscarCep" class="bg-blue-500 text-white px-3 py-2 rounded-r-md hover:bg-blue-600 transition"> | |
<i class="fas fa-search"></i> | |
</button> | |
</div> | |
</div> | |
<div> | |
<label for="logradouro" class="block text-sm font-medium text-gray-700 mb-1">Logradouro</label> | |
<input type="text" id="logradouro" name="logradouro" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500"> | |
</div> | |
<div> | |
<label for="numero" class="block text-sm font-medium text-gray-700 mb-1">Número</label> | |
<input type="text" id="numero" name="numero" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500"> | |
</div> | |
<div> | |
<label for="complemento" class="block text-sm font-medium text-gray-700 mb-1">Complemento</label> | |
<input type="text" id="complemento" name="complemento" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500"> | |
</div> | |
<div> | |
<label for="bairro" class="block text-sm font-medium text-gray-700 mb-1">Bairro</label> | |
<input type="text" id="bairro" name="bairro" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500"> | |
</div> | |
<div> | |
<label for="cidade" class="block text-sm font-medium text-gray-700 mb-1">Cidade</label> | |
<input type="text" id="cidade" name="cidade" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500"> | |
</div> | |
<div> | |
<label for="estado" class="block text-sm font-medium text-gray-700 mb-1">Estado</label> | |
<select id="estado" name="estado" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500"> | |
<option value="">Selecione...</option> | |
<option value="AC">Acre</option> | |
<option value="AL">Alagoas</option> | |
<option value="AP">Amapá</option> | |
<option value="AM">Amazonas</option> | |
<option value="BA">Bahia</option> | |
<option value="CE">Ceará</option> | |
<option value="DF">Distrito Federal</option> | |
<option value="ES">Espírito Santo</option> | |
<option value="GO">Goiás</option> | |
<option value="MA">Maranhão</option> | |
<option value="MT">Mato Grosso</option> | |
<option value="MS">Mato Grosso do Sul</option> | |
<option value="MG">Minas Gerais</option> | |
<option value="PA">Pará</option> | |
<option value="PB">Paraíba</option> | |
<option value="PR">Paraná</option> | |
<option value="PE">Pernambuco</option> | |
<option value="PI">Piauí</option> | |
<option value="RJ">Rio de Janeiro</option> | |
<option value="RN">Rio Grande do Norte</option> | |
<option value="RS">Rio Grande do Sul</option> | |
<option value="RO">Rondônia</option> | |
<option value="RR">Roraima</option> | |
<option value="SC">Santa Catarina</option> | |
<option value="SP">São Paulo</option> | |
<option value="SE">Sergipe</option> | |
<option value="TO">Tocantins</option> | |
</select> | |
</div> | |
</div> | |
</div> | |
<!-- Informações Adicionais --> | |
<div class="mb-8"> | |
<h3 class="text-md font-semibold text-gray-700 mb-4 flex items-center"> | |
<i class="fas fa-clipboard-list text-blue-500 mr-2"></i> | |
Informações Adicionais | |
</h3> | |
<div class="grid grid-cols-1 md:grid-cols-2 gap-6"> | |
<div> | |
<label for="ramoAtividade" class="block text-sm font-medium text-gray-700 mb-1">Ramo de Atividade *</label> | |
<select id="ramoAtividade" name="ramoAtividade" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500" required> | |
<option value="">Selecione...</option> | |
<option value="construcao">Construção Civil</option> | |
<option value="industria">Indústria</option> | |
<option value="comercio">Comércio</option> | |
<option value="servicos">Serviços</option> | |
<option value="transporte">Transporte</option> | |
<option value="limpeza">Limpeza</option> | |
<option value="seguranca">Segurança</option> | |
<option value="alimentacao">Alimentação</option> | |
<option value="outro">Outro</option> | |
</select> | |
<p id="ramoAtividadeError" class="error-message hidden">Campo obrigatório</p> | |
</div> | |
<div> | |
<label for="tipoServico" class="block text-sm font-medium text-gray-700 mb-1">Tipo de Serviço Prestado</label> | |
<input type="text" id="tipoServico" name="tipoServico" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500"> | |
</div> | |
<div class="md:col-span-2"> | |
<label for="observacoes" class="block text-sm font-medium text-gray-700 mb-1">Observações</label> | |
<textarea id="observacoes" name="observacoes" rows="3" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500"></textarea> | |
</div> | |
</div> | |
</div> | |
<!-- Documentos Obrigatórios --> | |
<div class="mb-8"> | |
<h3 class="text-md font-semibold text-gray-700 mb-4 flex items-center"> | |
<i class="fas fa-file-contract text-blue-500 mr-2"></i> | |
Documentos Obrigatórios | |
</h3> | |
<div class="grid grid-cols-1 md:grid-cols-2 gap-6"> | |
<div> | |
<label class="block text-sm font-medium text-gray-700 mb-2">Documentos</label> | |
<div class="space-y-2"> | |
<div class="flex items-center"> | |
<input type="checkbox" id="docCarteiraTrabalho" name="docCarteiraTrabalho" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"> | |
<label for="docCarteiraTrabalho" class="ml-2 block text-sm text-gray-700">Carteira de Trabalho</label> | |
</div> | |
<div class="flex items-center"> | |
<input type="checkbox" id="docASO" name="docASO" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"> | |
<label for="docASO" class="ml-2 block text-sm text-gray-700">ASO</label> | |
</div> | |
<div class="flex items-center"> | |
<input type="checkbox" id="docEPI" name="docEPI" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"> | |
<label for="docEPI" class="ml-2 block text-sm text-gray-700">EPI</label> | |
</div> | |
</div> | |
</div> | |
<div> | |
<label for="validadeDocumentos" class="block text-sm font-medium text-gray-700 mb-1">Validade dos Documentos</label> | |
<input type="date" id="validadeDocumentos" name="validadeDocumentos" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500"> | |
</div> | |
</div> | |
</div> | |
<!-- Status --> | |
<div class="mb-8"> | |
<h3 class="text-md font-semibold text-gray-700 mb-4 flex items-center"> | |
<i class="fas fa-toggle-on text-blue-500 mr-2"></i> | |
Status | |
</h3> | |
<div class="grid grid-cols-1 md:grid-cols-2 gap-6"> | |
<div> | |
<label for="statusTerceiro" class="block text-sm font-medium text-gray-700 mb-1">Status *</label> | |
<select id="statusTerceiro" name="statusTerceiro" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500" required> | |
<option value="ativo" selected>Ativo</option> | |
<option value="inativo">Inativo</option> | |
<option value="pendente">Pendente</option> | |
<option value="bloqueado">Bloqueado</option> | |
</select> | |
</div> | |
<div> | |
<label for="dataCadastro" class="block text-sm font-medium text-gray-700 mb-1">Data de Cadastro</label> | |
<input type="date" id="dataCadastro" name="dataCadastro" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500"> | |
</div> | |
</div> | |
</div> | |
<!-- Botões de Ação --> | |
<div class="flex justify-end space-x-4 pt-6 border-t border-gray-200"> | |
<button type="button" id="cancelarBtn" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition"> | |
Cancelar | |
</button> | |
<button type="submit" class="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition flex items-center"> | |
<i class="fas fa-save mr-2"></i> | |
Salvar Terceiro | |
</button> | |
</div> | |
</form> | |
</div> | |
<!-- Visualização de Terceiro (Oculto por padrão) --> | |
<div id="viewContainer" class="bg-white rounded-lg shadow overflow-hidden hidden"> | |
<div class="px-6 py-4 border-b border-gray-200 flex justify-between items-center"> | |
<h2 class="text-lg font-semibold text-gray-800">Detalhes do Terceiro</h2> | |
<div class="flex items-center space-x-2"> | |
<span class="text-xs bg-green-100 text-green-800 px-2 py-1 rounded-full">Ativo</span> | |
<button id="editTerceiroBtn" class="text-blue-600 hover:text-blue-800"> | |
<i class="fas fa-edit"></i> | |
</button> | |
</div> | |
</div> | |
<div class="p-6"> | |
<div class="grid grid-cols-1 md:grid-cols-2 gap-8"> | |
<!-- Dados Básicos --> | |
<div> | |
<h3 class="text-md font-semibold text-gray-700 mb-4 flex items-center"> | |
<i class="fas fa-info-circle text-blue-500 mr-2"></i> | |
Dados Básicos | |
</h3> | |
<div class="space-y-3"> | |
<div> | |
<p class="text-sm text-gray-500">Razão Social</p> | |
<p class="font-medium">Construtora ABC Ltda</p> | |
</div> | |
<div> | |
<p class="text-sm text-gray-500">Nome Fantasia</p> | |
<p class="font-medium">Construtora ABC</p> | |
</div> | |
<div> | |
<p class="text-sm text-gray-500">CNPJ</p> | |
<p class="font-medium">12.345.678/0001-99</p> | |
</div> | |
<div> | |
<p class="text-sm text-gray-500">Inscrição Estadual</p> | |
<p class="font-medium">123.456.789.112</p> | |
</div> | |
</div> | |
</div> | |
<!-- Contato --> | |
<div> | |
<h3 class="text-md font-semibold text-gray-700 mb-4 flex items-center"> | |
<i class="fas fa-address-book text-blue-500 mr-2"></i> | |
Contato | |
</h3> | |
<div class="space-y-3"> | |
<div> | |
<p class="text-sm text-gray-500">E-mail</p> | |
<p class="font-medium">[email protected]</p> | |
</div> | |
<div> | |
<p class="text-sm text-gray-500">Telefone</p> | |
<p class="font-medium">(11) 1234-5678</p> | |
</div> | |
<div> | |
<p class="text-sm text-gray-500">Responsável</p> | |
<p class="font-medium">João da Silva</p> | |
</div> | |
<div> | |
<p class="text-sm text-gray-500">Celular do Responsável</p> | |
<p class="font-medium">(11) 98765-4321</p> | |
</div> | |
</div> | |
</div> | |
<!-- Endereço --> | |
<div> | |
<h3 class="text-md font-semibold text-gray-700 mb-4 flex items-center"> | |
<i class="fas fa-map-marker-alt text-blue-500 mr-2"></i> | |
Endereço | |
</h3> | |
<div class="space-y-3"> | |
<div> | |
<p class="text-sm text-gray-500">CEP</p> | |
<p class="font-medium">01234-567</p> | |
</div> | |
<div> | |
<p class="text-sm text-gray-500">Logradouro</p> | |
<p class="font-medium">Rua das Construções, 123</p> | |
</div> | |
<div> | |
<p class="text-sm text-gray-500">Complemento</p> | |
<p class="font-medium">Sala 45</p> | |
</div> | |
<div> | |
<p class="text-sm text-gray-500">Bairro</p> | |
<p class="font-medium">Centro</p> | |
</div> | |
<div> | |
<p class="text-sm text-gray-500">Cidade/Estado</p> | |
<p class="font-medium">São Paulo/SP</p> | |
</div> | |
</div> | |
</div> | |
<!-- Informações Adicionais --> | |
<div> | |
<h3 class="text-md font-semibold text-gray-700 mb-4 flex items-center"> | |
<i class="fas fa-clipboard-list text-blue-500 mr-2"></i> | |
Informações Adicionais | |
</h3> | |
<div class="space-y-3"> | |
<div> | |
<p class="text-sm text-gray-500">Ramo de Atividade</p> | |
<p class="font-medium">Construção Civil</p> | |
</div> | |
<div> | |
<p class="text-sm text-gray-500">Tipo de Serviço Prestado</p> | |
<p class="font-medium">Construção de edifícios comerciais</p> | |
</div> | |
<div> | |
<p class="text-sm text-gray-500">Observações</p> | |
<p class="font-medium">Empresa especializada em estruturas metálicas.</p> | |
</div> | |
<div> | |
<p class="text-sm text-gray-500">Documentos Obrigatórios</p> | |
<p class="font-medium">Carteira de Trabalho, ASO, EPI</p> | |
</div> | |
<div> | |
<p class="text-sm text-gray-500">Validade dos Documentos</p> | |
<p class="font-medium">31/12/2023</p> | |
</div> | |
</div> | |
</div> | |
</div> | |
<!-- Botões de Ação --> | |
<div class="flex justify-end space-x-4 pt-6 mt-6 border-t border-gray-200"> | |
<button id="backToListBtn" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition"> | |
Voltar para Lista | |
</button> | |
<button class="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition flex items-center"> | |
<i class="fas fa-print mr-2"></i> | |
Imprimir Ficha | |
</button> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
</main> | |
</div> | |
</div> | |
<!-- Modal de Confirmação --> | |
<div id="confirmModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden"> | |
<div class="bg-white rounded-lg shadow-xl w-full max-w-md"> | |
<div class="px-6 py-4 border-b border-gray-200"> | |
<h3 class="text-lg font-semibold text-gray-800">Confirmar Exclusão</h3> | |
</div> | |
<div class="p-6"> | |
<p class="text-gray-700 mb-6">Tem certeza que deseja excluir este terceiro? Esta ação não pode ser desfeita.</p> | |
<div class="flex justify-end space-x-3"> | |
<button id="cancelDeleteBtn" class="px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50"> | |
Cancelar | |
</button> | |
<button id="confirmDeleteBtn" class="px-4 py-2 bg-red-600 hover:bg-red-700 text-white rounded-lg"> | |
Confirmar Exclusão | |
</button> | |
</div> | |
</div> | |
</div> | |
</div> | |
<!-- Modal de Sucesso --> | |
<div id="successModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden"> | |
<div class="bg-white rounded-lg shadow-xl w-full max-w-md"> | |
<div class="px-6 py-4 border-b border-gray-200 flex justify-between items-center"> | |
<h3 class="text-lg font-semibold text-gray-800">Sucesso!</h3> | |
<button id="closeSuccessModal" class="text-gray-500 hover:text-gray-700"> | |
<i class="fas fa-times"></i> | |
</button> | |
</div> | |
<div class="p-6 text-center"> | |
<div class="w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4"> | |
<i class="fas fa-check text-green-600 text-2xl"></i> | |
</div> | |
<p class="text-gray-700 mb-6" id="successMessage">Terceiro cadastrado com sucesso!</p> | |
<button id="okSuccessBtn" class="px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg"> | |
OK | |
</button> | |
</div> | |
</div> | |
</div> | |
<script> | |
// Toggle sidebar on mobile | |
document.getElementById('sidebarToggle').addEventListener('click', function() { | |
document.querySelector('.sidebar').classList.toggle('hidden'); | |
document.querySelector('.sidebar').classList.toggle('block'); | |
}); | |
// Máscaras para os campos | |
document.addEventListener('DOMContentLoaded', function() { | |
// Máscara para CNPJ | |
const cnpjInput = document.getElementById('cnpj'); | |
cnpjInput.addEventListener('input', function(e) { | |
let value = e.target.value.replace(/\D/g, ''); | |
if (value.length > 2) { | |
value = value.substring(0, 2) + '.' + value.substring(2); | |
} | |
if (value.length > 6) { | |
value = value.substring(0, 6) + '.' + value.substring(6); | |
} | |
if (value.length > 10) { | |
value = value.substring(0, 10) + '/' + value.substring(10); | |
} | |
if (value.length > 15) { | |
value = value.substring(0, 15) + '-' + value.substring(15); | |
} | |
if (value.length > 18) { | |
value = value.substring(0, 18); | |
} | |
e.target.value = value; | |
}); | |
// Máscara para Telefone | |
const telefoneInput = document.getElementById('telefone'); | |
telefoneInput.addEventListener('input', function(e) { | |
let value = e.target.value.replace(/\D/g, ''); | |
if (value.length > 0) { | |
value = '(' + value.substring(0, 2) + ') ' + value.substring(2); | |
} | |
if (value.length > 10) { | |
value = value.substring(0, 10) + '-' + value.substring(10, 14); | |
} | |
if (value.length > 15) { | |
value = value.substring(0, 15); | |
} | |
e.target.value = value; | |
}); | |
// Máscara para Celular | |
const celularInput = document.getElementById('celularResponsavel'); | |
celularInput.addEventListener('input', function(e) { | |
let value = e.target.value.replace(/\D/g, ''); | |
if (value.length > 0) { | |
value = '(' + value.substring(0, 2) + ') ' + value.substring(2); | |
} | |
if (value.length > 10) { | |
value = value.substring(0, 10) + '-' + value.substring(10, 15); | |
} | |
if (value.length > 16) { | |
value = value.substring(0, 16); | |
} | |
e.target.value = value; | |
}); | |
// Máscara para CEP | |
const cepInput = document.getElementById('cep'); | |
cepInput.addEventListener('input', function(e) { | |
let value = e.target.value.replace(/\D/g, ''); | |
if (value.length > 5) { | |
value = value.substring(0, 5) + '-' + value.substring(5, 8); | |
} | |
if (value.length > 9) { | |
value = value.substring(0, 9); | |
} | |
e.target.value = value; | |
}); | |
}); | |
// Buscar CEP | |
document.getElementById('buscarCep').addEventListener('click', function() { | |
const cep = document.getElementById('cep').value.replace(/\D/g, ''); | |
if (cep.length !== 8) { | |
alert('CEP inválido! Digite um CEP com 8 dígitos.'); | |
return; | |
} | |
// Simulação de busca de CEP (em uma aplicação real, seria uma chamada API) | |
setTimeout(() => { | |
document.getElementById('logradouro').value = 'Rua das Construções'; | |
document.getElementById('bairro').value = 'Centro'; | |
document.getElementById('cidade').value = 'São Paulo'; | |
document.getElementById('estado').value = 'SP'; | |
}, 1000); | |
}); | |
// Validação do formulário | |
document.getElementById('terceiroForm').addEventListener('submit', function(e) { | |
e.preventDefault(); | |
let isValid = true; | |
// Validação Razão Social | |
const razaoSocial = document.getElementById('razaoSocial'); | |
const razaoSocialError = document.getElementById('razaoSocialError'); | |
if (!razaoSocial.value.trim()) { | |
razaoSocial.classList.add('input-error'); | |
razaoSocialError.classList.remove('hidden'); | |
isValid = false; | |
} else { | |
razaoSocial.classList.remove('input-error'); | |
razaoSocialError.classList.add('hidden'); | |
} | |
// Validação CNPJ | |
const cnpj = document.getElementById('cnpj'); | |
const cnpjError = document.getElementById('cnpjError'); | |
if (!cnpj.value.trim() || cnpj.value.replace(/\D/g, '').length !== 14) { | |
cnpj.classList.add('input-error'); | |
cnpjError.classList.remove('hidden'); | |
isValid = false; | |
} else { | |
cnpj.classList.remove('input-error'); | |
cnpjError.classList.add('hidden'); | |
} | |
// Validação Email | |
const email = document.getElementById('email'); | |
const emailError = document.getElementById('emailError'); | |
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; | |
if (!email.value.trim() || !emailRegex.test(email.value)) { | |
email.classList.add('input-error'); | |
emailError.classList.remove('hidden'); | |
isValid = false; | |
} else { | |
email.classList.remove('input-error'); | |
emailError.classList.add('hidden'); | |
} | |
// Validação Telefone | |
const telefone = document.getElementById('telefone'); | |
const telefoneError = document.getElementById('telefoneError'); | |
if (!telefone.value.trim() || telefone.value.replace(/\D/g, '').length < 10) { | |
telefone.classList.add('input-error'); | |
telefoneError.classList.remove('hidden'); | |
isValid = false; | |
} else { | |
telefone.classList.remove('input-error'); | |
telefoneError.classList.add('hidden'); | |
} | |
// Validação Ramo de Atividade | |
const ramoAtividade = document.getElementById('ramoAtividade'); | |
const ramoAtividadeError = document.getElementById('ramoAtividadeError'); | |
if (!ramoAtividade.value) { | |
ramoAtividade.classList.add('input-error'); | |
ramoAtividadeError.classList.remove('hidden'); | |
isValid = false; | |
} else { | |
ramoAtividade.classList.remove('input-error'); | |
ramoAtividadeError.classList.add('hidden'); | |
} | |
if (isValid) { | |
// Simular envio do formulário | |
setTimeout(() => { | |
document.getElementById('successMessage').textContent = 'Terceiro cadastrado com sucesso!'; | |
document.getElementById('successModal').classList.remove('hidden'); | |
}, 1000); | |
} | |
}); | |
// Navegação entre formulário e visualização | |
document.getElementById('addTerceiroBtn').addEventListener('click', function() { | |
document.getElementById('formContainer').classList.remove('hidden'); | |
document.getElementById('viewContainer').classList.add('hidden'); | |
document.getElementById('terceiroForm').reset(); | |
}); | |
document.getElementById('cancelarBtn').addEventListener('click', function() { | |
document.getElementById('formContainer').classList.add('hidden'); | |
document.getElementById('viewContainer').classList.remove('hidden'); | |
}); | |
document.getElementById('editTerceiroBtn').addEventListener('click', function() { | |
document.getElementById('formContainer').classList.remove('hidden'); | |
document.getElementById('viewContainer').classList.add('hidden'); | |
}); | |
document.getElementById('backToListBtn').addEventListener('click', function() { | |
document.getElementById('formContainer').classList.add('hidden'); | |
document.getElementById('viewContainer').classList.add('hidden'); | |
}); | |
// Modal de confirmação | |
document.getElementById('confirmDeleteBtn').addEventListener('click', function() { | |
document.getElementById('confirmModal').classList.add('hidden'); | |
document.getElementById('successMessage').textContent = 'Terceiro excluído com sucesso!'; | |
document.getElementById('successModal').classList.remove('hidden'); | |
}); | |
document.getElementById('cancelDeleteBtn').addEventListener('click', function() { | |
document.getElementById('confirmModal').classList.add('hidden'); | |
}); | |
// Modal de sucesso | |
document.getElementById('okSuccessBtn').addEventListener('click', function() { | |
document.getElementById('successModal').classList.add('hidden'); | |
document.getElementById('formContainer').classList.add('hidden'); | |
document.getElementById('viewContainer').classList.remove('hidden'); | |
}); | |
document.getElementById('closeSuccessModal').addEventListener('click', function() { | |
document.getElementById('successModal').classList.add('hidden'); | |
document.getElementById('formContainer').classList.add('hidden'); | |
document.getElementById('viewContainer').classList.remove('hidden'); | |
}); | |
// Selecionar terceiro da lista | |
document.querySelectorAll('.group').forEach(item => { | |
item.addEventListener('click', function() { | |
if (!this.querySelector('button')) { // Não disparar quando clicar no botão de adicionar | |
document.getElementById('formContainer').classList.add('hidden'); | |
document.getElementById('viewContainer').classList.remove('hidden'); | |
} | |
}); | |
}); | |
</script> | |
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Prstore38/prstore38-sst-menager" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
</html> |