From d513bab33531cfcd4b771b2be6cd73d0f5612a7b Mon Sep 17 00:00:00 2001 From: Felix Morales Date: Sat, 8 Jul 2023 12:45:52 -0500 Subject: [PATCH] Modal anticipos formulario responsivo, fix a error al cargar archivo a un anticipo recien capturado --- .../Corresponsales/Anticipos/Anticipos.tsx | 50 ++++++++----------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/src/Components/Corresponsales/Anticipos/Anticipos.tsx b/src/Components/Corresponsales/Anticipos/Anticipos.tsx index 3e5c622..697a4a1 100644 --- a/src/Components/Corresponsales/Anticipos/Anticipos.tsx +++ b/src/Components/Corresponsales/Anticipos/Anticipos.tsx @@ -83,7 +83,7 @@ export const Anticipos: FC = (props) => { { - loadRow(params.data.id) + loadRow(params.data) }} style={{ cursor: 'pointer' }} /> @@ -92,7 +92,7 @@ export const Anticipos: FC = (props) => { { - viewDoc(params.value) + viewDoc(params.data) //getFileContent(params.value) }} style={{ cursor: 'pointer' }} @@ -189,7 +189,7 @@ export const Anticipos: FC = (props) => { { - return Depto === 'Contabilidad' ? viewDocConta(params.value) : '#' + return Depto === 'Contabilidad' ? viewDocConta(params.data) : '#' }} style={{ cursor: 'pointer' }} /> @@ -202,7 +202,7 @@ export const Anticipos: FC = (props) => { { - viewDocConta(params.value) + viewDocConta(params.data) }} style={{ cursor: 'pointer' }} /> @@ -278,28 +278,25 @@ export const Anticipos: FC = (props) => { }) } - const loadRow = (idRow: number) => { - var tmpArray = mCAnticipos.filter(function (item) { - return item.id === idRow - }) - setIdAnticipo(tmpArray[0].id) - setAnticipo(tmpArray[0].anticipo) - setConcepto(tmpArray[0].concepto) - setMoneda(tmpArray[0].moneda) + const loadRow = (data: ICorresponsalAnticipos) => { + setIdAnticipo(data.id) + setAnticipo(data.anticipo) + setConcepto(data.concepto) + setMoneda(data.moneda) } - const viewDoc = (idRow: number) => { - loadRow(idRow) + const viewDoc = (data: ICorresponsalAnticipos) => { + loadRow(data) setMsgDialogFileManager(true) } - const viewDocConta = (idRow: number) => { - loadRow(idRow) + const viewDocConta = (data: ICorresponsalAnticipos) => { + loadRow(data) setMsgDialogFileManagerConta(true) } - const authorizeItem = (id: number) => { - loadRow(id) + const authorizeItem = (data: ICorresponsalAnticipos) => { + loadRow(data) setMsgDialog(true) } @@ -377,10 +374,10 @@ export const Anticipos: FC = (props) => { - + - - - - + = (props) => { }} /> - + = (props) => { - + = (props) => { - - + +