diff --git a/src/Components/Corresponsales/Rectificaciones/HistorialRectificaciones.tsx b/src/Components/Corresponsales/Rectificaciones/HistorialRectificaciones.tsx index 43061bd..f0a3448 100644 --- a/src/Components/Corresponsales/Rectificaciones/HistorialRectificaciones.tsx +++ b/src/Components/Corresponsales/Rectificaciones/HistorialRectificaciones.tsx @@ -1,13 +1,18 @@ import { useEffect, useState } from "react" -import { Alert, Card, Col, Row, Table } from "react-bootstrap" +import { Alert, Card, Col, Form, Row, Table } from "react-bootstrap" import { useSelector } from "react-redux" import { RootState } from "../../../store/store" import { AgGridReact } from "ag-grid-react" import ICorresponsalRectificacionHistorico from "../../../Interfaces/Corresponsales/ICorresponsalRectificacionHistorico" +import { FaPencilAlt, FaSave } from "react-icons/fa" +import { CiCircleAlert } from "react-icons/ci" +import { ICatClavesPedimentos } from "../../../Interfaces/Catalogos/ICatClavesPedimentos" +import { BsSave, BsSave2, BsXCircle } from "react-icons/bs" interface IProps{ //pedimento: number IdPedimentoConsolidado: string + ClavesPedimento: ICatClavesPedimentos[] } export const HistorialRectificaciones: React.FC = (props) => { @@ -38,6 +43,7 @@ export const HistorialRectificaciones: React.FC = (props) => { ]) const mcRectificaciones = useSelector((state:RootState) => state.CRectificaciones.RectificacionesPedimentos) const [Rectificaciones, setRectificaciones] = useState([]); + const [EditMode, setIsEditMode] = useState(false) useEffect(()=>{ if(props.IdPedimentoConsolidado !== '#') setRectificaciones(mcRectificaciones.filter(x => x.idPedimentoConsolidado === + props.IdPedimentoConsolidado)) @@ -60,19 +66,63 @@ export const HistorialRectificaciones: React.FC = (props) => { size="sm" > - #AduanaPatentePedimentoClaveFecha de Pago + #AduanaPatentePedimentoClaveFecha de Pago {Rectificaciones ? Rectificaciones.map((item, index) => { return( - - {index + 1} - {item.aduana} - {item.patente} - {item.pedimento} - {item.clave} - {item.fechaPago ? item.fechaPago.substring(0,10) : ''} + !EditMode ? + + {index + 1} + {item.aduana} + {item.patente} + {item.pedimento} + {item.clave} + {item.fechaPago ? item.fechaPago.substring(0,10) : ''} + setIsEditMode(true)}/> + : + + {index + 1} + {item.aduana} + {item.patente} + {item.pedimento} + + { + item.clave = e.target.value + }} + className="form-select form-select-sm" + value={item.clave} + > + + {props.ClavesPedimento + ? props.ClavesPedimento.map((item, index) => { + return ( + + ) + }) + : ''} + + + + item.fechaPago = e.target.value} + /> + + + setIsEditMode(false)}/> +   + setIsEditMode(false)}/> + ) }) diff --git a/src/Components/Corresponsales/Rectificaciones/NuevaRectificacion.tsx b/src/Components/Corresponsales/Rectificaciones/NuevaRectificacion.tsx index bb20c81..5ee7abf 100644 --- a/src/Components/Corresponsales/Rectificaciones/NuevaRectificacion.tsx +++ b/src/Components/Corresponsales/Rectificaciones/NuevaRectificacion.tsx @@ -332,7 +332,7 @@ export const NuevaRectificacion:React.FC = (props) => {
: '' } - +