Compare commits
No commits in common. "fbf15e1cbc77c728e5cef2161c913def3013f440" and "bd20c2d811736d2917b136b7b65882b7c7c8790a" have entirely different histories.
fbf15e1cbc
...
bd20c2d811
@ -1,56 +0,0 @@
|
|||||||
[33m3993097[m[33m ([m[1;36mHEAD[m[33m -> [m[1;32mmain[m[33m)[m Merge branch 'main' of https://git.popcode.com.br/RiseUP/riseup-squad23
|
|
||||||
[33m63659b6[m Verificação do cpf e colocar o erro 404
|
|
||||||
[33mecae83c[m[33m ([m[1;31mriseup/main[m[33m, [m[1;31mriseup/HEAD[m[33m, [m[1;31morigin/main[m[33m, [m[1;31morigin/HEAD[m[33m)[m Merge pull request 'Conectando-o-resto-das-API' (#2) from Conectando-o-resto-das-API into main
|
|
||||||
[33m908d545[m[33m ([m[1;31mriseup/Conectando-o-resto-das-API[m[33m, [m[1;31morigin/Conectando-o-resto-das-API[m[33m)[m feat: adicionar upload e delete de anexos do paciente
|
|
||||||
[33m4b404c0[m Merge branch 'main' of https://git.popcode.com.br/RiseUP/riseup-squad23
|
|
||||||
[33mbd20c2d[m Merge remote-tracking branch 'origin/main'
|
|
||||||
[33m8aeabd1[m[33m ([m[1;31mriseup/Fix-dos-erros-do-projeto[m[33m, [m[1;31morigin/Fix-dos-erros-do-projeto[m[33m)[m FIx: todos os erros que aparecia no console foram resolvidos
|
|
||||||
[33m0e29e7d[m melhorias na organização de pastas
|
|
||||||
[33m98f076a[m Mergin com TableMelhorias
|
|
||||||
[33m589d590[m Mergin com novas alterações de laudo
|
|
||||||
[33m7b28e2a[m Details melhorias
|
|
||||||
[33m9480edc[m[33m ([m[1;31mriseup/PaginaDetalhes[m[33m, [m[1;31morigin/PaginaDetalhes[m[33m)[m Pàgina detalhes
|
|
||||||
[33me4515cf[m Adição das cores nos cards de consulta
|
|
||||||
[33md3dd2fd[m[33m ([m[1;31mriseup/TableMelhorias[m[33m, [m[1;31morigin/TableMelhorias[m[33m)[m Detalhe nas tabelas
|
|
||||||
[33ma54b119[m Delete Anexos apos pacientes forem excluidos
|
|
||||||
[33m6e93cb5[m atualizar paciente
|
|
||||||
[33mb9a35be[m começo do concerto do editar
|
|
||||||
[33m82469bc[m Details funcional
|
|
||||||
[33mcdfe4ea[m Validação de CPF
|
|
||||||
[33m57c8f67[m[33m ([m[1;31mriseup/DetalhesMedico[m[33m, [m[1;31morigin/DetalhesMedico[m[33m)[m Detalhes do medico
|
|
||||||
[33mb021444[m Mudanças formularios e detalhes
|
|
||||||
[33md5d03b0[m[33m ([m[1;31mriseup/mudanças-de-laudo[m[33m, [m[1;31morigin/mudanças-de-laudo[m[33m)[m atualização do laudo
|
|
||||||
[33ma502bbd[m agendamentos no incio
|
|
||||||
[33m8e1fcd9[m Merge branch 'feature/novo-cadastro-paciente'
|
|
||||||
[33mbea9076[m Merge remote-tracking branch 'origin/PaginaDetalhes'
|
|
||||||
[33me35f217[m mergin branch inicio com main
|
|
||||||
[33m1af8268[m Atualizacão do laudo
|
|
||||||
[33m725d60d[m feat: ajeitei o nome
|
|
||||||
[33mbab85ff[m[33m ([m[1;31mriseup/AgendamentoSidebar[m[33m, [m[1;31morigin/AgendamentoSidebar[m[33m)[m Concertar Agendamento
|
|
||||||
[33mb2707e3[m Refatora o estilo do formulário do paciente para uma aparência de cartão com tipografia maior
|
|
||||||
[33m37e8959[m Refatora o estilo do formulário do paciente para uma aparência de cartão com tipografia maior
|
|
||||||
[33m0930385[m feat: uma piquena mudança
|
|
||||||
[33mf6a19c4[m feat: Adiciona formulário de cadastro de paciente
|
|
||||||
[33md91b5cf[m form de agendar consulta melhorado
|
|
||||||
[33m0a60dd7[m Tabela semana e mes
|
|
||||||
[33m7f07950[m[33m ([m[1;31mriseup/feature-Melhoria-no-Dashboard[m[33m, [m[1;31morigin/feature-Melhoria-no-Dashboard[m[33m)[m feat: Criação da página início e melhoria na navegação
|
|
||||||
[33m39e25ad[m Pagina de detalhes atualizada
|
|
||||||
[33m4f84791[m pequenas mudanaças na tabela de semana e mes
|
|
||||||
[33m6737955[m form para nova consulta e tabelas de horario
|
|
||||||
[33m26ded17[m Nova pagina de detalhes
|
|
||||||
[33m874de84[m Inicio do agendamento
|
|
||||||
[33mf3e7470[m[33m ([m[1;31mriseup/gerenciamento-de-laudo[m[33m, [m[1;31morigin/gerenciamento-de-laudo[m[33m)[m Laudo do Paciente
|
|
||||||
[33m709cd4e[m Merge finalizado
|
|
||||||
[33md6b3e86[m Merge detalhes-do-pacientes para main
|
|
||||||
[33m08ffa55[m Merge remote-tracking branch 'origin/CrudMedico'
|
|
||||||
[33m70c4d5f[m Termino da organização
|
|
||||||
[33medd567d[m Inicio da organização
|
|
||||||
[33m9c09113[m Mudanças pos feedback de davi
|
|
||||||
[33maa3a5fa[m Criação da página dos detalhes dos pacientes
|
|
||||||
[33m5534568[m Inicio de detalhes e atualização do paciente
|
|
||||||
[33m06ff7d5[m Funcionalidade de delete e botão de opções
|
|
||||||
[33m5b63fa2[m Mascara telefones
|
|
||||||
[33mfb9d783[m adição da mascara do CPF
|
|
||||||
[33ma489d84[m metodo GET e POST
|
|
||||||
[33m4eaabbd[m first commit
|
|
||||||
[33ma244691[m Initial commit
|
|
||||||
6205
package-lock.json
generated
6205
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -28,7 +28,6 @@
|
|||||||
"react-icons": "^5.5.0",
|
"react-icons": "^5.5.0",
|
||||||
"react-input-mask": "^2.0.4",
|
"react-input-mask": "^2.0.4",
|
||||||
"react-quill": "^2.0.0",
|
"react-quill": "^2.0.0",
|
||||||
"react-router-dom": "^7.9.2",
|
|
||||||
"react-scripts": "5.0.1",
|
"react-scripts": "5.0.1",
|
||||||
"recharts": "^3.1.2",
|
"recharts": "^3.1.2",
|
||||||
"sweetalert2": "^11.22.4",
|
"sweetalert2": "^11.22.4",
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta name="theme-color" content="#000000" />
|
<meta name="theme-color" content="#000000" />
|
||||||
<meta name="description" content="Web site created using create-react-app" />
|
<meta name="description" content="Web site created using create-react-app" />
|
||||||
|
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
||||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
||||||
|
|
||||||
<!-- Mazer CSS -->
|
<!-- Mazer CSS -->
|
||||||
@ -20,8 +21,8 @@
|
|||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|
||||||
<!-- Mazer JS -->
|
<!-- Mazer JS -->
|
||||||
<!-- <script src="%PUBLIC_URL%/vendors/perfect-scrollbar/perfect-scrollbar.min.js"></script>
|
<script src="%PUBLIC_URL%/vendors/perfect-scrollbar/perfect-scrollbar.min.js"></script>
|
||||||
<script src="%PUBLIC_URL%/js/bootstrap.bundle.min.js"></script>
|
<script src="%PUBLIC_URL%/js/bootstrap.bundle.min.js"></script>
|
||||||
<script src="%PUBLIC_URL%/js/main.js"></script> -->
|
<script src="%PUBLIC_URL%/js/main.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -6,6 +6,16 @@
|
|||||||
"src": "favicon.ico",
|
"src": "favicon.ico",
|
||||||
"sizes": "64x64 32x32 24x24 16x16",
|
"sizes": "64x64 32x32 24x24 16x16",
|
||||||
"type": "image/x-icon"
|
"type": "image/x-icon"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "logo192.png",
|
||||||
|
"type": "image/png",
|
||||||
|
"sizes": "192x192"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "logo512.png",
|
||||||
|
"type": "image/png",
|
||||||
|
"sizes": "512x512"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"start_url": ".",
|
"start_url": ".",
|
||||||
|
|||||||
@ -1,53 +1,8 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import React from "react";
|
||||||
import InputMask from "react-input-mask";
|
import InputMask from "react-input-mask";
|
||||||
import "./style/styleagendamentos.css";
|
import "./style/styleagendamentos.css";
|
||||||
|
|
||||||
const FormNovaConsulta = ({ onCancel, patientID }) => {
|
const FormNovaConsulta = ({ onCancel }) => {
|
||||||
const [selectedFile, setSelectedFile] = useState(null);
|
|
||||||
const [anexos, setAnexos] = useState([]);
|
|
||||||
const [loadingAnexos, setLoadingAnexos] = useState(false);
|
|
||||||
useEffect(() => {
|
|
||||||
if (!patientID) return;
|
|
||||||
|
|
||||||
const fetchAnexos = async () => {
|
|
||||||
setLoadingAnexos(true);
|
|
||||||
try {
|
|
||||||
const res = await fetch(`https://mock.apidog.com/m1/1053378-0-default/pacientes/${patientID}/anexos`);
|
|
||||||
const data = await res.json();
|
|
||||||
setAnexos(data.data || []);
|
|
||||||
} catch (err) {
|
|
||||||
console.error("Erro ao buscar anexos:", err);
|
|
||||||
} finally {
|
|
||||||
setLoadingAnexos(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
fetchAnexos();
|
|
||||||
}, [patientID]);
|
|
||||||
|
|
||||||
const handleUpload = async () => {
|
|
||||||
if (!selectedFile) return;
|
|
||||||
|
|
||||||
const formData = new FormData();
|
|
||||||
formData.append("file", selectedFile);
|
|
||||||
|
|
||||||
try {
|
|
||||||
const res = await fetch(`https://mock.apidog.com/m1/1053378-0-default/pacientes/${patientID}/anexos`, {
|
|
||||||
method: "POST",
|
|
||||||
body: formData
|
|
||||||
});
|
|
||||||
if (res.ok) {
|
|
||||||
const novoAnexo = await res.json();
|
|
||||||
setAnexos(prev => [...prev, novoAnexo]);
|
|
||||||
setSelectedFile(null);
|
|
||||||
} else {
|
|
||||||
console.error("Erro ao enviar anexo");
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
console.error("Erro ao enviar anexo:", err);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleSubmit = (e) => {
|
const handleSubmit = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
alert("Agendamento salvo!");
|
alert("Agendamento salvo!");
|
||||||
@ -100,29 +55,7 @@ const FormNovaConsulta = ({ onCancel, patientID }) => {
|
|||||||
|
|
||||||
<h3 className="section-subtitle">Informações adicionais</h3>
|
<h3 className="section-subtitle">Informações adicionais</h3>
|
||||||
<button type="button" className="btn-secondary">Documentos e anexos</button>
|
<button type="button" className="btn-secondary">Documentos e anexos</button>
|
||||||
<label htmlFor="anexo-input" className="btn btn-secondary">Adicionar Anexo</label>
|
|
||||||
<input
|
|
||||||
type="file"
|
|
||||||
id="anexo-input"
|
|
||||||
className="d-none"
|
|
||||||
onChange={(e) => setSelectedFile(e.target.files[0])}
|
|
||||||
/>
|
|
||||||
{selectedFile && (
|
|
||||||
<button type="button" className="btn btn-primary ms-2" onClick={handleUpload}>
|
|
||||||
Enviar
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
<div className="anexos-list">
|
|
||||||
{loadingAnexos ? (
|
|
||||||
<p>Carregando anexos...</p>
|
|
||||||
) : (
|
|
||||||
anexos.map((anexo, index) => (
|
|
||||||
<div key={index} className="anexo-item">
|
|
||||||
<span>{anexo.nome || anexo.fileName}</span>
|
|
||||||
</div>
|
|
||||||
))
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<h2 className="section-title">Informações do atendimento</h2>
|
<h2 className="section-title">Informações do atendimento</h2>
|
||||||
|
|
||||||
<label>Nome do profissional *</label>
|
<label>Nome do profissional *</label>
|
||||||
|
|||||||
@ -56,7 +56,7 @@ function Sidebar(props) {
|
|||||||
props.setCurrentPage('dashboard');
|
props.setCurrentPage('dashboard');
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<h1>MediConnect</h1>
|
<hi>MediConnect</hi>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div className="toggler">
|
<div className="toggler">
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
|
import InputMask from "react-input-mask";
|
||||||
|
|
||||||
function DoctorForm({ onSave, onCancel, PatientDict }) {
|
function DoctorForm({ onSave, onCancel, PatientDict }) {
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,7 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
|
|
||||||
function PatientForm({ onSave, onCancel, formData, setFormData }) {
|
|
||||||
const [showModal, setShowModal] = useState(false);
|
function PatientForm({ onSave, onCancel,formData, setFormData }) {
|
||||||
const [showModal404, setShowModal404] = useState(false);
|
|
||||||
const [pacienteExistente, setPacienteExistente] = useState(null);
|
|
||||||
|
|
||||||
const FormatTelefones = (valor) => {
|
const FormatTelefones = (valor) => {
|
||||||
const digits = String(valor).replace(/\D/g, '').slice(0, 11);
|
const digits = String(valor).replace(/\D/g, '').slice(0, 11);
|
||||||
@ -31,63 +29,29 @@ function PatientForm({ onSave, onCancel, formData, setFormData }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const response = await fetch("https://mock.apidog.com/m1/1053378-0-default/pacientes/validar-cpf", requestOptions)
|
const response = await fetch("https://mock.apidog.com/m1/1053378-0-default/pacientes/validar-cpf", requestOptions)
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
throw new Error('Erro na API de validação de CPF. Status: ' + response.status);
|
|
||||||
}
|
|
||||||
|
|
||||||
const result = await response.json()
|
const result = await response.json()
|
||||||
|
|
||||||
return result.data
|
return result.data
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const BuscarPacientePorId = async (id) => {
|
|
||||||
var myHeaders = new Headers();
|
|
||||||
myHeaders.append("Authorization", "Bearer <token>");
|
|
||||||
|
|
||||||
var requestOptions = {
|
|
||||||
method: 'GET',
|
|
||||||
headers: myHeaders,
|
|
||||||
redirect: 'follow'
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
|
||||||
const response = await fetch(`https://mock.apidog.com/m1/1053378-0-default/pacientes/${id}`, requestOptions);
|
|
||||||
const result = await response.json();
|
|
||||||
return result.data;
|
|
||||||
} catch (error) {
|
|
||||||
console.error("Erro ao buscar paciente por ID:", error);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const ValidarCPF = async (cpf) => {
|
const ValidarCPF = async (cpf) => {
|
||||||
let aviso
|
let aviso
|
||||||
let Erro = false
|
let Erro = false
|
||||||
|
|
||||||
try {
|
const resutadoAPI = await ReceberRespostaAPIdoCPF(cpf)
|
||||||
const resultadoAPI = await ReceberRespostaAPIdoCPF(cpf)
|
|
||||||
const valido = resultadoAPI.valido
|
|
||||||
const ExisteNoBancoDeDados = resultadoAPI.existe
|
|
||||||
const idPaciente = resultadoAPI.id_paciente
|
|
||||||
|
|
||||||
if(valido === false){
|
const valido = resutadoAPI.valido
|
||||||
aviso = 'CPF inválido'
|
const ExisteNoBancoDeDados = resutadoAPI.existe
|
||||||
Erro = true
|
|
||||||
}
|
if(valido === false){
|
||||||
else if(ExisteNoBancoDeDados === true){
|
aviso = 'CPF inválido'
|
||||||
const paciente = await BuscarPacientePorId(idPaciente);
|
Erro = true
|
||||||
if (paciente) {
|
}
|
||||||
setPacienteExistente(paciente);
|
else if(ExisteNoBancoDeDados === true){
|
||||||
setShowModal(true);
|
aviso = 'O CPF informado já está presente no sistema'
|
||||||
}
|
Erro = true
|
||||||
Erro = true
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error("Erro na validação do CPF:", error);
|
|
||||||
setShowModal404(true);
|
|
||||||
Erro = true;
|
|
||||||
}
|
}
|
||||||
return [Erro,aviso]
|
return [Erro,aviso]
|
||||||
}
|
}
|
||||||
@ -106,7 +70,7 @@ function PatientForm({ onSave, onCancel, formData, setFormData }) {
|
|||||||
|
|
||||||
// Estado para controlar quais seções estão colapsadas
|
// Estado para controlar quais seções estão colapsadas
|
||||||
const [collapsedSections, setCollapsedSections] = useState({
|
const [collapsedSections, setCollapsedSections] = useState({
|
||||||
dadosPessoais: true,
|
dadosPessoais: true, // Alterado para true para a seção ficar aberta por padrão
|
||||||
infoMedicas: false,
|
infoMedicas: false,
|
||||||
infoConvenio: false,
|
infoConvenio: false,
|
||||||
endereco: false,
|
endereco: false,
|
||||||
@ -161,21 +125,23 @@ function PatientForm({ onSave, onCancel, formData, setFormData }) {
|
|||||||
reader.readAsDataURL(files[0]);
|
reader.readAsDataURL(files[0]);
|
||||||
} else if (name === 'foto' && !files[0]) {
|
} else if (name === 'foto' && !files[0]) {
|
||||||
setAvatarUrl(null); // Limpa o avatar se nenhum arquivo for selecionado
|
setAvatarUrl(null); // Limpa o avatar se nenhum arquivo for selecionado
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
||||||
if (name.includes('cpf')) {
|
if (name.includes('cpf')) {
|
||||||
|
|
||||||
setFormData({...formData, cpf:FormatCPF(value) });
|
setFormData({...formData, cpf:FormatCPF(value) });
|
||||||
|
|
||||||
} else if (name.includes('telefone')) {
|
} else if (name.includes('telefone')) {
|
||||||
let telefoneFormatado = FormatTelefones(value);
|
let telefoneFormatado = FormatTelefones(value);
|
||||||
setContato(prev => ({ ...prev, [name]: telefoneFormatado }));
|
setContato(prev => ({ ...prev, [name]: telefoneFormatado }));
|
||||||
}else if (name === 'email') {
|
}else if (name === 'email') {
|
||||||
setContato(prev => ({ ...prev, email: value }));
|
setContato(prev => ({ ...prev, email: value }));
|
||||||
}else if(name.includes('endereco')) {
|
}else if(name.includes('endereco')) {
|
||||||
setEnderecoData(prev => ({ ...prev, [name.split('.')[1]]: value }));
|
setEnderecoData(prev => ({ ...prev, [name.split('.')[1]]: value }));
|
||||||
}else{
|
}else{
|
||||||
setFormData({ ...formData, [name]: value });
|
setFormData({ ...formData, [name]: value });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCepBlur = async () => {
|
const handleCepBlur = async () => {
|
||||||
@ -207,11 +173,14 @@ function PatientForm({ onSave, onCancel, formData, setFormData }) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const [CPFinvalido] = await ValidarCPF(formData.cpf);
|
const CPFinvalido = await ValidarCPF(formData.cpf)
|
||||||
if(CPFinvalido === true){
|
console.log(CPFinvalido)
|
||||||
return;
|
if(CPFinvalido[0] === true){
|
||||||
|
alert(CPFinvalido[1])
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
onSave({
|
onSave({
|
||||||
...formData,
|
...formData,
|
||||||
endereco: {
|
endereco: {
|
||||||
@ -426,7 +395,7 @@ function PatientForm({ onSave, onCancel, formData, setFormData }) {
|
|||||||
<div className="col-md-12 mb-3">
|
<div className="col-md-12 mb-3">
|
||||||
<label style={{ fontSize: '1.1rem' }}>Anexos do Paciente:</label>
|
<label style={{ fontSize: '1.1rem' }}>Anexos do Paciente:</label>
|
||||||
<div>
|
<div>
|
||||||
<label htmlFor="anexos-input" className="btn btn-secondary" style={{ fontSize: '1.1rem', background: '#9ca3af' }}>Escolher arquivo</label>
|
<label htmlFor="anexos-input" className="btn btn-secondary" style={{ fontSize: '1.1rem' }}>Escolher arquivo</label>
|
||||||
<input type="file" className="form-control d-none" name="anexos" id="anexos-input" onChange={handleChange} />
|
<input type="file" className="form-control d-none" name="anexos" id="anexos-input" onChange={handleChange} />
|
||||||
<span className="ms-2" style={{ fontSize: '1.1rem' }}>{formData.anexos ? formData.anexos.name : 'Nenhum arquivo escolhido'}</span>
|
<span className="ms-2" style={{ fontSize: '1.1rem' }}>{formData.anexos ? formData.anexos.name : 'Nenhum arquivo escolhido'}</span>
|
||||||
</div>
|
</div>
|
||||||
@ -614,77 +583,6 @@ function PatientForm({ onSave, onCancel, formData, setFormData }) {
|
|||||||
Cancelar
|
Cancelar
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Modal para paciente existente */}
|
|
||||||
{showModal && pacienteExistente && (
|
|
||||||
<div className="modal" style={{ display: 'block', backgroundColor: 'rgba(0,0,0,0.5)' }}>
|
|
||||||
<div className="modal-dialog">
|
|
||||||
<div className="modal-content">
|
|
||||||
<div className="modal-header">
|
|
||||||
<h5 className="modal-title">Ops! Este CPF já está cadastrado</h5>
|
|
||||||
<button type="button" className="btn-close" onClick={() => setShowModal(false)}></button>
|
|
||||||
</div>
|
|
||||||
<div className="modal-body">
|
|
||||||
<div className="text-center mb-3">
|
|
||||||
<img
|
|
||||||
src={pacienteExistente.foto || 'https://via.placeholder.com/100'}
|
|
||||||
alt="Foto do Paciente"
|
|
||||||
className="rounded-circle"
|
|
||||||
style={{ width: '100px', height: '100px', objectFit: 'cover' }}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<p><strong>ID do Paciente:</strong> {pacienteExistente.id}</p>
|
|
||||||
<p><strong>Nome Completo:</strong> {pacienteExistente.nome}</p>
|
|
||||||
<p><strong>CPF:</strong> {pacienteExistente.cpf}</p>
|
|
||||||
<p><strong>Data de Nascimento:</strong> {pacienteExistente.data_nascimento}</p>
|
|
||||||
<p><strong>Telefone:</strong> {pacienteExistente.contato.telefone1}</p>
|
|
||||||
</div>
|
|
||||||
<div className="modal-footer">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="btn btn-primary"
|
|
||||||
onClick={() => setShowModal(false)}
|
|
||||||
>
|
|
||||||
Fechar e Continuar no Cadastro
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="btn btn-primary"
|
|
||||||
onClick={() => {
|
|
||||||
|
|
||||||
alert(`Navegando para os detalhes do paciente ID: ${pacienteExistente.id}`);
|
|
||||||
setShowModal(false);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Visualizar Paciente Existente
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Erro 404 */}
|
|
||||||
{showModal404 && (
|
|
||||||
<div className="modal" style={{ display: 'block', backgroundColor: 'rgba(0,0,0,0.5)' }}>
|
|
||||||
<div className="modal-dialog">
|
|
||||||
<div className="modal-content">
|
|
||||||
<div className="modal-header bg-danger text-white">
|
|
||||||
<h5 className="modal-title">Erro de Validação</h5>
|
|
||||||
<button type="button" className="btn-close btn-close-white" onClick={() => setShowModal404(false)}></button>
|
|
||||||
</div>
|
|
||||||
<div className="modal-body">
|
|
||||||
<p style={{ fontSize: '1.4rem' }}>(Erro 404).Por favor,tente novamente mais tarde.</p>
|
|
||||||
</div>
|
|
||||||
<div className="modal-footer">
|
|
||||||
<button type="button" className="btn btn-primary" onClick={() => setShowModal404(false)}>
|
|
||||||
Fechar
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,13 +1,12 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom/client';
|
import ReactDOM from 'react-dom';
|
||||||
import './assets/scss/bootstrap.scss';
|
import './assets/scss/bootstrap.scss';
|
||||||
import './assets/scss/app.scss';
|
import './assets/scss/app.scss';
|
||||||
import App from './App';
|
import App from './App';
|
||||||
|
|
||||||
const root = ReactDOM.createRoot(document.getElementById('root'));
|
ReactDOM.render(
|
||||||
root.render(
|
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<App />
|
<App />
|
||||||
</React.StrictMode>,
|
</React.StrictMode>,
|
||||||
|
document.getElementById('root')
|
||||||
);
|
);
|
||||||
|
|||||||
@ -3,69 +3,17 @@ import avatarPlaceholder from '../assets/images/avatar_placeholder.png';
|
|||||||
|
|
||||||
const Details = ({ patientID, setCurrentPage }) => {
|
const Details = ({ patientID, setCurrentPage }) => {
|
||||||
const [paciente, setPaciente] = useState({});
|
const [paciente, setPaciente] = useState({});
|
||||||
const [anexos, setAnexos] = useState([]);
|
|
||||||
const [selectedFile, setSelectedFile] = useState(null);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!patientID) return;
|
if (!patientID) return;
|
||||||
|
|
||||||
fetch(`https://mock.apidog.com/m1/1053378-0-default/pacientes/${patientID}`)
|
fetch(`https://mock.apidog.com/m1/1053378-0-default/pacientes/${patientID}`)
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
|
|
||||||
.then(result => {setPaciente(result.data)})
|
.then(result => {setPaciente(result.data)})
|
||||||
.catch(err => console.error("Erro ao buscar paciente:", err));
|
.catch(err => console.error("Erro ao buscar paciente:", err));
|
||||||
|
|
||||||
fetch(`https://mock.apidog.com/m1/1053378-0-default/pacientes/${patientID}/anexos`)
|
|
||||||
.then(res => res.json())
|
|
||||||
.then(data => setAnexos(data.data || []))
|
|
||||||
.catch(err => console.error("Erro ao buscar anexos:", err));
|
|
||||||
|
|
||||||
}, [patientID]);
|
}, [patientID]);
|
||||||
|
|
||||||
const handleUpload = async () => {
|
|
||||||
if (!selectedFile) return;
|
|
||||||
|
|
||||||
const formData = new FormData();
|
|
||||||
formData.append('file', selectedFile);
|
|
||||||
|
|
||||||
try {
|
|
||||||
const response = await fetch(`https://mock.apidog.com/m1/1053378-0-default/pacientes/${patientID}/anexos`, {
|
|
||||||
method: 'POST',
|
|
||||||
body: formData,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (response.ok) {
|
|
||||||
const newAnexo = await response.json();
|
|
||||||
setAnexos(prev => [...prev, newAnexo]);
|
|
||||||
setSelectedFile(null);
|
|
||||||
} else {
|
|
||||||
console.error('Erro ao enviar anexo');
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Erro ao enviar anexo:', err);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleDelete = async (anexoId) => {
|
|
||||||
try {
|
|
||||||
const response = await fetch(
|
|
||||||
`https://mock.apidog.com/m1/1053378-0-default/pacientes/${patientID}/anexos/${anexoId}`,
|
|
||||||
{
|
|
||||||
method: "DELETE",
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
if (response.ok) {
|
|
||||||
setAnexos((prev) => prev.filter((a) => a.id !== anexoId));
|
|
||||||
} else {
|
|
||||||
console.error("Erro ao deletar anexo");
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
console.error("Erro ao deletar anexo:", err);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -189,29 +137,7 @@ const Details = ({ patientID, setCurrentPage }) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="col-md-6 mb-3">
|
<div className="col-md-6 mb-3">
|
||||||
<label className="font-extrabold">Anexos do Paciente:</label>
|
<label className="font-extrabold">Anexos do Paciente:</label>
|
||||||
{anexos.length > 0 ?(
|
<p>{ "-"}</p>
|
||||||
<ul>
|
|
||||||
{anexos.map((anexo) => (
|
|
||||||
<li key={anexo.id} className="d-flex aling-items-center">
|
|
||||||
<a href={anexo.url} target="-blank" rel="noopener noreferrer">
|
|
||||||
{anexo.nome}
|
|
||||||
</a>
|
|
||||||
<button className="btn btn-danger btn-sm" onclick={() => handleDelete(anexo.id)} >Remover</button>
|
|
||||||
</li>
|
|
||||||
))}
|
|
||||||
</ul>
|
|
||||||
) : (
|
|
||||||
<p>-</p>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<div className="col-md-6 mb-3">
|
|
||||||
<label htmlFor="foto-input" className="btn btn-primary" style={{ fontSize: '1rem' }}>
|
|
||||||
Carregar Um Novo Anexo
|
|
||||||
</label>
|
|
||||||
<input
|
|
||||||
type="file" className="form-control d-none" name="foto" id="foto-input" onChange={(e) => setSelectedFile(e.target.files[0])} accept="image/*"/>
|
|
||||||
{selectedFile && <span className="ms-2" style={{ fontSize: '1rem' }}>{selectedFile.name}</span>}
|
|
||||||
<button onClick={handleUpload} className="btn btn-success ms-2">Enviar</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -18,14 +18,13 @@ function Inicio({ setCurrentPage }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const fetchAgendamentos = async () => {
|
const fetchAgendamentos = async () => {
|
||||||
return; // <===serve para que nao cause erro
|
try {
|
||||||
// try {
|
const res = await fetch();
|
||||||
// const res = await fetch();
|
const data = await res.json();
|
||||||
// const data = await res.json();
|
setAgendamentos(data.data);
|
||||||
// setAgendamentos(data.data);
|
} catch (error) {
|
||||||
// } catch (error) {
|
console.error("Erro ao buscar agendamentos:", error);
|
||||||
// console.error("Erro ao buscar agendamentos:", error);
|
}
|
||||||
// }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
fetchPacientes();
|
fetchPacientes();
|
||||||
|
|||||||
@ -7,83 +7,88 @@ function TablePaciente({ setCurrentPage, setPatientID }) {
|
|||||||
const [filtroVIP, setFiltroVIP] = useState(false);
|
const [filtroVIP, setFiltroVIP] = useState(false);
|
||||||
const [filtroAniversariante, setFiltroAniversariante] = useState(false);
|
const [filtroAniversariante, setFiltroAniversariante] = useState(false);
|
||||||
|
|
||||||
// Estado para controlar a exibição do erro 404
|
|
||||||
const [showError404, setShowError404] = useState(false);
|
|
||||||
|
|
||||||
const GetAnexos = async (id) => {
|
const GetAnexos = async (id) => {
|
||||||
var myHeaders = new Headers();
|
var myHeaders = new Headers();
|
||||||
myHeaders.append("Authorization", "Bearer <token>");
|
myHeaders.append("Authorization", "Bearer <token>");
|
||||||
|
|
||||||
|
var requestOptions = {
|
||||||
|
method: 'GET',
|
||||||
|
headers: myHeaders,
|
||||||
|
redirect: 'follow'
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
const response = await fetch(`https://mock.apidog.com/m1/1053378-0-default/pacientes/${id}/anexos`, requestOptions);
|
||||||
|
const result = await response.json();
|
||||||
|
|
||||||
|
return result.data; // agora retorna corretamente
|
||||||
|
} catch (error) {
|
||||||
|
console.log('error', error);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const DeleteAnexo = async (patientID) => {
|
||||||
|
|
||||||
|
|
||||||
|
const RespostaGetAnexos = await GetAnexos(patientID)
|
||||||
|
|
||||||
|
for(let i = 0; i < RespostaGetAnexos.length; i++){
|
||||||
|
|
||||||
|
const idAnexo = RespostaGetAnexos[i].id;
|
||||||
|
|
||||||
|
console.log('anexos',RespostaGetAnexos)
|
||||||
|
|
||||||
|
|
||||||
|
var myHeaders = new Headers();
|
||||||
|
myHeaders.append("Authorization", "Bearer <token>");
|
||||||
|
|
||||||
var requestOptions = {
|
var requestOptions = {
|
||||||
method: 'GET',
|
method: 'DELETE',
|
||||||
headers: myHeaders,
|
headers: myHeaders,
|
||||||
redirect: 'follow'
|
redirect: 'follow'
|
||||||
};
|
};
|
||||||
try {
|
|
||||||
const response = await fetch(`https://mock.apidog.com/m1/1053378-0-default/pacientes/${id}/anexos`, requestOptions);
|
fetch(`https://mock.apidog.com/m1/1053378-0-default/pacientes/${patientID}/anexos/${idAnexo}`, requestOptions)
|
||||||
if (!response.ok) {
|
.then(response => response.text())
|
||||||
setShowError404(true);
|
.then(result => console.log('anexo excluido com sucesso',result))
|
||||||
setTimeout(() => setShowError404(false), 5000); // Esconde a mensagem após 5 segundos
|
.catch(error => console.log('error', error));
|
||||||
throw new Error('Erro 404');
|
|
||||||
}
|
|
||||||
const result = await response.json();
|
|
||||||
return result.data;
|
|
||||||
} catch (error) {
|
|
||||||
console.log('error', error);
|
|
||||||
return [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const DeleteAnexo = async (patientID) => {
|
|
||||||
const RespostaGetAnexos = await GetAnexos(patientID);
|
|
||||||
for (let i = 0; i < RespostaGetAnexos.length; i++) {
|
|
||||||
const idAnexo = RespostaGetAnexos[i].id;
|
|
||||||
|
|
||||||
var myHeaders = new Headers();
|
|
||||||
myHeaders.append("Authorization", "Bearer <token>");
|
|
||||||
|
|
||||||
var requestOptions = {
|
|
||||||
method: 'DELETE',
|
|
||||||
headers: myHeaders,
|
|
||||||
redirect: 'follow'
|
|
||||||
};
|
|
||||||
|
|
||||||
fetch(`https://mock.apidog.com/m1/1053378-0-default/pacientes/${patientID}/anexos/${idAnexo}`, requestOptions)
|
|
||||||
.then(response => {
|
|
||||||
if (!response.ok) {
|
|
||||||
setShowError404(true);
|
|
||||||
setTimeout(() => setShowError404(false), 5000); // Esconde a mensagem após 5 segundos
|
|
||||||
throw new Error('Erro 404');
|
|
||||||
}
|
|
||||||
return response.text();
|
|
||||||
})
|
|
||||||
.then(result => console.log('anexo excluido com sucesso', result))
|
|
||||||
.catch(error => console.log('error', error));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Função para excluir paciente
|
||||||
const deletePatient = async (id) => {
|
const deletePatient = async (id) => {
|
||||||
DeleteAnexo(id);
|
|
||||||
|
DeleteAnexo(id)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const requestOptionsDelete = { method: "DELETE", redirect: "follow" };
|
const requestOptionsDelete = { method: "DELETE", redirect: "follow" };
|
||||||
|
|
||||||
if (!window.confirm("Tem certeza que deseja excluir este paciente?")) return;
|
if (!window.confirm("Tem certeza que deseja excluir este paciente?")) return;
|
||||||
|
|
||||||
await fetch(
|
await fetch(
|
||||||
`https://mock.apidog.com/m1/1053378-0-default/pacientes/${id}`,
|
`https://mock.apidog.com/m1/1053378-0-default/pacientes/${id}`,
|
||||||
requestOptionsDelete
|
requestOptionsDelete
|
||||||
)
|
)
|
||||||
.then((response) => {
|
.then((response) => response.text())
|
||||||
if (!response.ok) {
|
|
||||||
setShowError404(true);
|
|
||||||
setTimeout(() => setShowError404(false), 5000); // Esconde a mensagem após 5 segundos
|
|
||||||
throw new Error('Erro 404');
|
|
||||||
}
|
|
||||||
return response.text();
|
|
||||||
})
|
|
||||||
.then((mensage) => console.log(mensage))
|
.then((mensage) => console.log(mensage))
|
||||||
.catch((error) => console.log("Deu problema", error));
|
.catch((error) => console.log("Deu problema", error));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Função para marcar/desmarcar VIP
|
||||||
const toggleVIP = async (id, atual) => {
|
const toggleVIP = async (id, atual) => {
|
||||||
const novoStatus = atual === true ? false : true;
|
const novoStatus = atual === true ? false : true;
|
||||||
|
|
||||||
await fetch(
|
await fetch(
|
||||||
`https://mock.apidog.com/m1/1053378-0-default/pacientes/${id}`,
|
`https://mock.apidog.com/m1/1053378-0-default/pacientes/${id}`,
|
||||||
{
|
{
|
||||||
@ -92,14 +97,7 @@ function TablePaciente({ setCurrentPage, setPatientID }) {
|
|||||||
body: JSON.stringify({ vip: novoStatus }),
|
body: JSON.stringify({ vip: novoStatus }),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then((response) => {
|
.then((response) => response.json())
|
||||||
if (!response.ok) {
|
|
||||||
setShowError404(true);
|
|
||||||
setTimeout(() => setShowError404(false), 5000);
|
|
||||||
throw new Error('Erro 404');
|
|
||||||
}
|
|
||||||
return response.json();
|
|
||||||
})
|
|
||||||
.then(() => {
|
.then(() => {
|
||||||
setPacientes((prev) =>
|
setPacientes((prev) =>
|
||||||
prev.map((p) => (p.id === id ? { ...p, vip: novoStatus } : p))
|
prev.map((p) => (p.id === id ? { ...p, vip: novoStatus } : p))
|
||||||
@ -108,6 +106,7 @@ function TablePaciente({ setCurrentPage, setPatientID }) {
|
|||||||
.catch((error) => console.log("Erro ao atualizar VIP:", error));
|
.catch((error) => console.log("Erro ao atualizar VIP:", error));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Função para atualizar convênio/particular
|
||||||
const updateConvenio = async (id, convenio) => {
|
const updateConvenio = async (id, convenio) => {
|
||||||
await fetch(
|
await fetch(
|
||||||
`https://mock.apidog.com/m1/1053378-0-default/pacientes/${id}`,
|
`https://mock.apidog.com/m1/1053378-0-default/pacientes/${id}`,
|
||||||
@ -117,14 +116,7 @@ function TablePaciente({ setCurrentPage, setPatientID }) {
|
|||||||
body: JSON.stringify({ convenio }),
|
body: JSON.stringify({ convenio }),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then((response) => {
|
.then((response) => response.json())
|
||||||
if (!response.ok) {
|
|
||||||
setShowError404(true);
|
|
||||||
setTimeout(() => setShowError404(false), 5000);
|
|
||||||
throw new Error('Erro 404');
|
|
||||||
}
|
|
||||||
return response.json();
|
|
||||||
})
|
|
||||||
.then(() => {
|
.then(() => {
|
||||||
setPacientes((prev) =>
|
setPacientes((prev) =>
|
||||||
prev.map((p) => (p.id === id ? { ...p, convenio } : p))
|
prev.map((p) => (p.id === id ? { ...p, convenio } : p))
|
||||||
@ -133,34 +125,32 @@ function TablePaciente({ setCurrentPage, setPatientID }) {
|
|||||||
.catch((error) => console.log("Erro ao atualizar convênio:", error));
|
.catch((error) => console.log("Erro ao atualizar convênio:", error));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Requisição inicial para buscar pacientes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetch("https://mock.apidog.com/m1/1053378-0-default/pacientes")
|
fetch("https://mock.apidog.com/m1/1053378-0-default/pacientes")
|
||||||
.then((response) => {
|
.then((response) => response.json())
|
||||||
if (!response.ok) {
|
|
||||||
setShowError404(true);
|
|
||||||
setTimeout(() => setShowError404(false), 5000);
|
|
||||||
throw new Error('Erro 404');
|
|
||||||
}
|
|
||||||
return response.json();
|
|
||||||
})
|
|
||||||
.then((result) => setPacientes(result["data"]))
|
.then((result) => setPacientes(result["data"]))
|
||||||
.catch((error) =>
|
.catch((error) =>
|
||||||
console.log("Erro para encontrar pacientes no banco de dados", error)
|
console.log("Erro para encontrar pacientes no banco de dados", error)
|
||||||
);
|
);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
// Função para verificar se hoje é aniversário do paciente
|
||||||
const ehAniversariante = (dataNascimento) => {
|
const ehAniversariante = (dataNascimento) => {
|
||||||
if (!dataNascimento) return false;
|
if (!dataNascimento) return false;
|
||||||
const hoje = new Date();
|
const hoje = new Date();
|
||||||
const nascimento = new Date(dataNascimento);
|
const nascimento = new Date(dataNascimento);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
hoje.getDate() === nascimento.getDate() &&
|
hoje.getDate() === nascimento.getDate() &&
|
||||||
hoje.getMonth() === nascimento.getMonth()
|
hoje.getMonth() === nascimento.getMonth()
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const pacientesFiltrados = pacientes.filter((paciente) => {
|
const pacientesFiltrados = pacientes.filter((paciente) => {
|
||||||
const texto = `${paciente.nome}`.toLowerCase();
|
const texto = `${paciente.nome}`.toLowerCase();
|
||||||
|
|
||||||
const passaBusca = texto.includes(search.toLowerCase());
|
const passaBusca = texto.includes(search.toLowerCase());
|
||||||
const passaVIP = filtroVIP ? paciente.vip === true : true;
|
const passaVIP = filtroVIP ? paciente.vip === true : true;
|
||||||
const passaConvenio =
|
const passaConvenio =
|
||||||
@ -168,6 +158,7 @@ function TablePaciente({ setCurrentPage, setPatientID }) {
|
|||||||
const passaAniversario = filtroAniversariante
|
const passaAniversario = filtroAniversariante
|
||||||
? ehAniversariante(paciente.data_nascimento)
|
? ehAniversariante(paciente.data_nascimento)
|
||||||
: true;
|
: true;
|
||||||
|
|
||||||
return passaBusca && passaVIP && passaConvenio && passaAniversario;
|
return passaBusca && passaVIP && passaConvenio && passaAniversario;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -191,15 +182,11 @@ function TablePaciente({ setCurrentPage, setPatientID }) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
{showError404 && (
|
|
||||||
<div className="alert alert-danger" role="alert">
|
|
||||||
(Erro 404). Por favor, tente novamente mais tarde.
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
<div className="card p-3 mb-3">
|
<div className="card p-3 mb-3">
|
||||||
<h5 className="mb-3">
|
<h5 className="mb-3">
|
||||||
<i className="bi bi-funnel-fill me-2 text-primary"></i> Filtros
|
<i className="bi bi-funnel-fill me-2 text-primary"></i> Filtros
|
||||||
</h5>
|
</h5>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className="d-flex flex-nowrap align-items-center gap-2"
|
className="d-flex flex-nowrap align-items-center gap-2"
|
||||||
style={{ overflowX: "auto", paddingBottom: "6px" }}
|
style={{ overflowX: "auto", paddingBottom: "6px" }}
|
||||||
@ -217,6 +204,7 @@ function TablePaciente({ setCurrentPage, setPatientID }) {
|
|||||||
flex: "0 0 auto",
|
flex: "0 0 auto",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<select
|
<select
|
||||||
className="form-select"
|
className="form-select"
|
||||||
value={filtroConvenio}
|
value={filtroConvenio}
|
||||||
@ -232,13 +220,16 @@ function TablePaciente({ setCurrentPage, setPatientID }) {
|
|||||||
<option>Hapvida</option>
|
<option>Hapvida</option>
|
||||||
<option>Unimed</option>
|
<option>Unimed</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
className={`btn ${filtroVIP ? "btn-primary" : "btn-outline-primary"}`}
|
className={`btn ${filtroVIP ? "btn-primary" : "btn-outline-primary"
|
||||||
|
}`}
|
||||||
onClick={() => setFiltroVIP(!filtroVIP)}
|
onClick={() => setFiltroVIP(!filtroVIP)}
|
||||||
style={{ flex: "0 0 auto", whiteSpace: "nowrap" }}
|
style={{ flex: "0 0 auto", whiteSpace: "nowrap" }}
|
||||||
>
|
>
|
||||||
<i className="bi bi-award me-1"></i> VIP
|
<i className="bi bi-award me-1"></i> VIP
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
className={`btn ${filtroAniversariante
|
className={`btn ${filtroAniversariante
|
||||||
? "btn-primary"
|
? "btn-primary"
|
||||||
@ -253,6 +244,8 @@ function TablePaciente({ setCurrentPage, setPatientID }) {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div className="table-responsive">
|
<div className="table-responsive">
|
||||||
<table className="table table-striped table-hover">
|
<table className="table table-striped table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
@ -261,8 +254,6 @@ function TablePaciente({ setCurrentPage, setPatientID }) {
|
|||||||
<th>CPF</th>
|
<th>CPF</th>
|
||||||
<th>Email</th>
|
<th>Email</th>
|
||||||
<th>Telefone</th>
|
<th>Telefone</th>
|
||||||
<th>Status</th>
|
|
||||||
<th>Ações</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -285,6 +276,7 @@ function TablePaciente({ setCurrentPage, setPatientID }) {
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div className="d-flex gap-2">
|
<div className="d-flex gap-2">
|
||||||
|
|
||||||
<button
|
<button
|
||||||
className="btn btn-sm"
|
className="btn btn-sm"
|
||||||
style={{
|
style={{
|
||||||
@ -298,6 +290,8 @@ function TablePaciente({ setCurrentPage, setPatientID }) {
|
|||||||
>
|
>
|
||||||
<i className="bi bi-eye me-1"></i> Ver Detalhes
|
<i className="bi bi-eye me-1"></i> Ver Detalhes
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|
||||||
<button
|
<button
|
||||||
className="btn btn-sm"
|
className="btn btn-sm"
|
||||||
style={{
|
style={{
|
||||||
@ -311,6 +305,7 @@ function TablePaciente({ setCurrentPage, setPatientID }) {
|
|||||||
>
|
>
|
||||||
<i className="bi bi-pencil me-1"></i> Editar
|
<i className="bi bi-pencil me-1"></i> Editar
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
className="btn btn-sm"
|
className="btn btn-sm"
|
||||||
style={{
|
style={{
|
||||||
@ -327,7 +322,7 @@ function TablePaciente({ setCurrentPage, setPatientID }) {
|
|||||||
))
|
))
|
||||||
) : (
|
) : (
|
||||||
<tr>
|
<tr>
|
||||||
<td colSpan="6" className="text-center">
|
<td colSpan="8" className="text-center">
|
||||||
Nenhum paciente encontrado.
|
Nenhum paciente encontrado.
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -344,4 +339,4 @@ function TablePaciente({ setCurrentPage, setPatientID }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default TablePaciente;
|
export default TablePaciente;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user