|
|
@ -36,6 +36,13 @@ export const PedimentosConsolidados:React.FC<IProps> = (props) => { |
|
|
|
const [Pedimento, setPedimento] = useState(0) |
|
|
|
const [Pedimento, setPedimento] = useState(0) |
|
|
|
const [ClavePedimento, setClavePedimento] = useState(''); |
|
|
|
const [ClavePedimento, setClavePedimento] = useState(''); |
|
|
|
const [FechaPago, setFechaPago] = useState('') |
|
|
|
const [FechaPago, setFechaPago] = useState('') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const [AduanaH, setAduanaH] = useState(0) |
|
|
|
|
|
|
|
const [PatenteH, setPatenteH] = useState(0) |
|
|
|
|
|
|
|
const [PedimentoH, setPedimentoH] = useState(0) |
|
|
|
|
|
|
|
const [ClavePedimentoH, setClavePedimentoH] = useState('') |
|
|
|
|
|
|
|
const [FechaPagoH, setFechaPagoH] = useState('') |
|
|
|
|
|
|
|
const [isRectificacion, setIsRectificacion] = useState(false) |
|
|
|
const mCPedimentosConsolidados = useSelector((state:RootState) => state.CPedimentosConsolidados.PedimentosConsolidados) |
|
|
|
const mCPedimentosConsolidados = useSelector((state:RootState) => state.CPedimentosConsolidados.PedimentosConsolidados) |
|
|
|
const [columnDefs] = useState([ |
|
|
|
const [columnDefs] = useState([ |
|
|
|
props.Depto === 'Corresponsalias' ? |
|
|
|
props.Depto === 'Corresponsalias' ? |
|
|
@ -83,12 +90,26 @@ export const PedimentosConsolidados:React.FC<IProps> = (props) => { |
|
|
|
field: 'fechaPago', |
|
|
|
field: 'fechaPago', |
|
|
|
sortable: true, |
|
|
|
sortable: true, |
|
|
|
filter: true, |
|
|
|
filter: true, |
|
|
|
flex: 1, //Se encarga de llenar el espacio sobrante de las columnas
|
|
|
|
|
|
|
|
cellRenderer: (params: any) => { |
|
|
|
cellRenderer: (params: any) => { |
|
|
|
if (params.value) return params.value.substring(0, 10) |
|
|
|
if (params.value) return params.value.substring(0, 10) |
|
|
|
else return '' |
|
|
|
else return '' |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
},props.Depto === 'Corresponsalias' ? |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
field: 'id', |
|
|
|
|
|
|
|
headerName: '', |
|
|
|
|
|
|
|
width: 120, |
|
|
|
|
|
|
|
sortable: true, |
|
|
|
|
|
|
|
filter: true, |
|
|
|
|
|
|
|
flex: 1, //Se encarga de llenar el espacio sobrante de las columnas
|
|
|
|
|
|
|
|
cellRenderer: (params: any) => { |
|
|
|
|
|
|
|
return ( |
|
|
|
|
|
|
|
<div style={{display:'flex', height:'100%', padding:'5px'}}> |
|
|
|
|
|
|
|
<Button size="sm" onClick={() => PrepareRectificacion(params.data)}>Generar Rectificación</Button> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} : {} |
|
|
|
]) |
|
|
|
]) |
|
|
|
const [Data, setData] = useState<DTOPedimentosConsolidados[]>() |
|
|
|
const [Data, setData] = useState<DTOPedimentosConsolidados[]>() |
|
|
|
|
|
|
|
|
|
|
@ -135,6 +156,7 @@ export const PedimentosConsolidados:React.FC<IProps> = (props) => { |
|
|
|
}).then(resp => { |
|
|
|
}).then(resp => { |
|
|
|
if(Id > 0){ |
|
|
|
if(Id > 0){ |
|
|
|
dispatch(updatePedimento(resp.data)) |
|
|
|
dispatch(updatePedimento(resp.data)) |
|
|
|
|
|
|
|
cleanForm() |
|
|
|
setHeader('Informativo') |
|
|
|
setHeader('Informativo') |
|
|
|
setMsg('Datos actualizados correctamente') |
|
|
|
setMsg('Datos actualizados correctamente') |
|
|
|
setShowMsg(true) |
|
|
|
setShowMsg(true) |
|
|
@ -175,12 +197,31 @@ export const PedimentosConsolidados:React.FC<IProps> = (props) => { |
|
|
|
return |
|
|
|
return |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const PrepareRectificacion = (pedimento: DTOPedimentosConsolidados) => { |
|
|
|
|
|
|
|
setIsRectificacion(true) |
|
|
|
|
|
|
|
setAduanaH(pedimento.aduana) |
|
|
|
|
|
|
|
setPatenteH(pedimento.patente) |
|
|
|
|
|
|
|
setPedimentoH(pedimento.pedimento) |
|
|
|
|
|
|
|
setClavePedimentoH(pedimento.clave) |
|
|
|
|
|
|
|
setFechaPagoH(pedimento.fechaPago) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const CancelIsRectificacion = () => { |
|
|
|
|
|
|
|
setIsRectificacion(false) |
|
|
|
|
|
|
|
setAduanaH(0) |
|
|
|
|
|
|
|
setPatenteH(0) |
|
|
|
|
|
|
|
setPedimentoH(0) |
|
|
|
|
|
|
|
setClavePedimentoH('') |
|
|
|
|
|
|
|
setFechaPagoH('') |
|
|
|
|
|
|
|
} |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<> |
|
|
|
<> |
|
|
|
<Card style={{height:'100%'}}> |
|
|
|
<Card style={{height:'100%'}}> |
|
|
|
<Card.Body> |
|
|
|
<Card.Body> |
|
|
|
{props.Depto === 'Corresponsalias' ? <> |
|
|
|
{props.Depto === 'Corresponsalias' ? <> |
|
|
|
<Row className="justify-content-end align-items-center"> |
|
|
|
<Row className="justify-content-end align-items-center"> |
|
|
|
|
|
|
|
<Col xs={1} style={{visibility: isRectificacion ? 'visible' : 'hidden'}}><span style={{wordWrap:'normal'}}>Rectificación</span></Col> |
|
|
|
<Col |
|
|
|
<Col |
|
|
|
xs={1} |
|
|
|
xs={1} |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
@ -282,6 +323,65 @@ export const PedimentosConsolidados:React.FC<IProps> = (props) => { |
|
|
|
<Button onClick={() => Append()}>Agregar</Button> |
|
|
|
<Button onClick={() => Append()}>Agregar</Button> |
|
|
|
</Col> |
|
|
|
</Col> |
|
|
|
</Row> |
|
|
|
</Row> |
|
|
|
|
|
|
|
<Row className="justify-content-end align-items-center" style={{display: isRectificacion ? 'flex' : 'none'}}> |
|
|
|
|
|
|
|
<Col xs={1}><span>Original</span></Col> |
|
|
|
|
|
|
|
<Col xs={1}> |
|
|
|
|
|
|
|
</Col> |
|
|
|
|
|
|
|
<Col xs={1}> |
|
|
|
|
|
|
|
<FormLabel> |
|
|
|
|
|
|
|
Aduana |
|
|
|
|
|
|
|
<FormControl type='text' size='sm' disabled value={AduanaH}></FormControl> |
|
|
|
|
|
|
|
</FormLabel> |
|
|
|
|
|
|
|
</Col> |
|
|
|
|
|
|
|
<Col xs={1}> |
|
|
|
|
|
|
|
<FormLabel> |
|
|
|
|
|
|
|
Patente |
|
|
|
|
|
|
|
<FormControl type='text' size='sm' disabled value={PatenteH}></FormControl> |
|
|
|
|
|
|
|
</FormLabel> |
|
|
|
|
|
|
|
</Col> |
|
|
|
|
|
|
|
<Col xs={2}> |
|
|
|
|
|
|
|
<FormLabel> |
|
|
|
|
|
|
|
Pedimento |
|
|
|
|
|
|
|
<CurrencyFormat |
|
|
|
|
|
|
|
value={PedimentoH} |
|
|
|
|
|
|
|
displayType='input' |
|
|
|
|
|
|
|
format={'### ####'} |
|
|
|
|
|
|
|
mask="_" |
|
|
|
|
|
|
|
readOnly={true} |
|
|
|
|
|
|
|
style={{ |
|
|
|
|
|
|
|
fontSize: '18px', |
|
|
|
|
|
|
|
backgroundColor: '#e9ecef', |
|
|
|
|
|
|
|
border: '2px solid #ced4da', |
|
|
|
|
|
|
|
width: '100%', |
|
|
|
|
|
|
|
textAlign: 'right', |
|
|
|
|
|
|
|
borderRadius: '10px' |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</FormLabel> |
|
|
|
|
|
|
|
</Col> |
|
|
|
|
|
|
|
<Col xs={2}> |
|
|
|
|
|
|
|
<Form.Label> |
|
|
|
|
|
|
|
Clave |
|
|
|
|
|
|
|
<FormControl type='text' size='sm' disabled value={ClavePedimentoH}></FormControl> |
|
|
|
|
|
|
|
</Form.Label> |
|
|
|
|
|
|
|
</Col> |
|
|
|
|
|
|
|
<Col xs={2}> |
|
|
|
|
|
|
|
<Form.Label> |
|
|
|
|
|
|
|
Fec. Pago |
|
|
|
|
|
|
|
<Form.Control |
|
|
|
|
|
|
|
type="date" |
|
|
|
|
|
|
|
id="FechaPago" |
|
|
|
|
|
|
|
size="sm" |
|
|
|
|
|
|
|
value={setDate(FechaPagoH)} |
|
|
|
|
|
|
|
readOnly={true} |
|
|
|
|
|
|
|
disabled={true} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</Form.Label> |
|
|
|
|
|
|
|
</Col> |
|
|
|
|
|
|
|
<Col xs={2}> |
|
|
|
|
|
|
|
<Button variant="danger" onClick={() => CancelIsRectificacion()}>Cancelar</Button> |
|
|
|
|
|
|
|
</Col> |
|
|
|
|
|
|
|
</Row> |
|
|
|
<hr /></> : ("") } |
|
|
|
<hr /></> : ("") } |
|
|
|
<div className='ag-theme-alpine' style={{ height: 400, width: '100%'}}> |
|
|
|
<div className='ag-theme-alpine' style={{ height: 400, width: '100%'}}> |
|
|
|
<AgGridReact |
|
|
|
<AgGridReact |
|
|
|