From 3951e7c8c159f335c487ea42100c13f13238b8c5 Mon Sep 17 00:00:00 2001 From: Felix Morales Date: Mon, 13 Nov 2023 11:38:20 -0600 Subject: [PATCH] Dar acceso de visualizacion a los tabuladores de los traficos al resto de departamentos --- .../Corresponsales/Tabulador/Tabulador.tsx | 25 ++++++++++++------- .../Corresponsales/TraficoCorresponsales.tsx | 7 ++---- .../Utils/ControlledInput/ControlledInput.tsx | 2 +- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/Components/Corresponsales/Tabulador/Tabulador.tsx b/src/Components/Corresponsales/Tabulador/Tabulador.tsx index 7383453..3f04379 100644 --- a/src/Components/Corresponsales/Tabulador/Tabulador.tsx +++ b/src/Components/Corresponsales/Tabulador/Tabulador.tsx @@ -18,6 +18,7 @@ interface IProps { NombreCliente: string closeTabulador: (arg: boolean) => void cambiaPrecuenta: (IDPrecuenta: number) => void + Depto: string } interface IselectedRows { @@ -56,7 +57,7 @@ export const Tabulador: FC = (props) => { name: 'Costo', width: '15%', cell: (row: ITabuladorConceptos) => { - return {}} /> + return {}} /> /*return row.activo === 1 ? ( {}} /> ) : ( @@ -77,6 +78,7 @@ export const Tabulador: FC = (props) => { onChange={() => { switchConcept(row.id, row.activo ? 0 : 1) }} + disabled={props.Depto !== 'Corresponsalias'} /> ) @@ -229,6 +231,7 @@ export const Tabulador: FC = (props) => { onChange={(e) => setIDTabulador(parseInt(e.target.value))} className='form-select form-select-sm' style={{ fontSize: '15px' }} + disabled={props.Depto !== 'Corresponsalias'} > {Tabuladores @@ -239,14 +242,18 @@ export const Tabulador: FC = (props) => { - + { + (props.Depto === 'Corresponsalias') + ? + : '' + } diff --git a/src/Components/Corresponsales/TraficoCorresponsales.tsx b/src/Components/Corresponsales/TraficoCorresponsales.tsx index 4401671..855b2a0 100644 --- a/src/Components/Corresponsales/TraficoCorresponsales.tsx +++ b/src/Components/Corresponsales/TraficoCorresponsales.tsx @@ -1644,11 +1644,7 @@ export default function TraficoCorresponsales (props:IProps) { - { - return (Depto === 'Corresponsalias' || Depto === 'Sistemas') - ? showModalBox(10) - : '' - }} + {showModalBox(10)}} style={{ cursor: 'pointer' }}>  Precuenta @@ -4235,6 +4231,7 @@ export default function TraficoCorresponsales (props:IProps) { cambiaPrecuenta={function (idTab: number): void { setIDTabulador(idTab) }} + Depto={Depto} /> ) : null} diff --git a/src/Components/Utils/ControlledInput/ControlledInput.tsx b/src/Components/Utils/ControlledInput/ControlledInput.tsx index 65dac89..61cc121 100644 --- a/src/Components/Utils/ControlledInput/ControlledInput.tsx +++ b/src/Components/Utils/ControlledInput/ControlledInput.tsx @@ -3,7 +3,7 @@ import { MsgInformativo } from '../Toast/msgInformativo' interface IProps { id: number - value: number + value: number | string disabled?: boolean postCost: (id: number, value: number) => void }