From b3308cd1fdf98353274ce74c727e9442491ed990 Mon Sep 17 00:00:00 2001 From: alfonso Date: Thu, 6 Jul 2023 11:48:38 -0500 Subject: [PATCH] Se agregan en total 6 reportes para direccion --- .../Dashboard/DashboardDireccion.tsx | 2 +- .../Direccion/RptPedimentosCruces06.tsx | 127 ++++++++++++++++++ src/index.tsx | 13 +- 3 files changed, 137 insertions(+), 5 deletions(-) create mode 100644 src/Components/Reportes/Direccion/RptPedimentosCruces06.tsx diff --git a/src/Components/Dashboard/DashboardDireccion.tsx b/src/Components/Dashboard/DashboardDireccion.tsx index ebb5b1c..5cb8cca 100644 --- a/src/Components/Dashboard/DashboardDireccion.tsx +++ b/src/Components/Dashboard/DashboardDireccion.tsx @@ -558,7 +558,7 @@ const DashboardDireccion: FC = (props) => { ( + [] + ) + const [Data, setData] = useState([]) + const [Cliente, setCliente] = useState('') + const [IDCliente, setIDCliente] = useState(0) + const [Pedimentos, setPedimentos] = useState([]) + const [Cruces, setCruces] = useState([]) + const [data5, setData5] = useState([ + ['Mes', 'Pedimentos', 'Cruces'], + ['2004/05', 165, 938], + ['2005/06', 135, 1120], + ['2006/07', 157, 1167], + ['2007/08', 139, 1110], + ['2008/09', 136, 691] + ]) + const options5 = { + title: '', + vAxis: { title: '' }, + hAxis: { title: 'Meses' }, + seriesType: 'bars', + series: { 1: { type: 'line' } }, + colors: ['#1850D0', '70D63E'] + } + + useEffect(() => { + DashboardDS.GETPedimentosCruzadosListaCliente() + .then((response) => { + setClientes(response.data) + }) + .catch((e: Error) => { + return + }) + }, []) + + useEffect(() => { + DashboardDS.GETPedimentosCruzadosData(IDCliente) + .then((response) => { + setData(response.data) + let Pedimentos: number[] = [] + let Cruces: number[] = [] + let Categorias: string[] = [] + let RechartsData: IRechartsData[] = [] + let RGoogleChartData: Array> = [] + RGoogleChartData.push(['Mes', 'Pedimentos', 'Cruces']) + response.data.forEach(function (item) { + Pedimentos.push(item.pedimentos) + Cruces.push(item.despachos) + Categorias.push(item.sMes) + RechartsData.push({ + name: item.sMes, + pv: item.pedimentos, + uv: item.despachos, + amt: 1 + }) + RGoogleChartData.push([item.sMes, item.pedimentos, item.despachos]) + }) + setData5(RGoogleChartData) + var arrClientes = Clientes.filter((item) => { + return item.id == IDCliente + }) + setCliente(arrClientes[0].razonSocial) + }) + .catch((e: Error) => { + return + }) + }, [IDCliente]) + return ( +
+ + + { + setIDCliente(parseInt(e.target.value)) + }} + className="form-select form-select-sm" + > + + {Clientes + ? Clientes.map((c) => { + return + }) + : null} + + + +
+ + + + {Cliente} +
+
+
+ +
+
+
+ ) +} diff --git a/src/index.tsx b/src/index.tsx index 9c1e5ed..1fb9b1e 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -58,6 +58,7 @@ import RptPedimentosCruces02 from './Components/Reportes/Direccion/RptPedimentos import RptPedimentosCruces03 from './Components/Reportes/Direccion/RptPedimentosCruces03' import RptPedimentosCruces04 from './Components/Reportes/Direccion/RptPedimentosCruces04' import RptPedimentosCruces05 from './Components/Reportes/Direccion/RptPedimentosCruces05' +import RptPedimentosCruces06 from './Components/Reportes/Direccion/RptPedimentosCruces06' require(`./css/${process.env.REACT_APP_ENVIRONMENT}-home.css`) @@ -114,7 +115,7 @@ ReactDOM.render( path="/DashboardCorresponsales" element={} /> - } /> @@ -195,7 +196,7 @@ ReactDOM.render( path="/RptPedimentosPagadosFacturasCruzadas" element={} /> - } /> @@ -210,11 +211,15 @@ ReactDOM.render( } - /> + /> } - /> + /> + } + /> } />