Modal anticipos formulario responsivo, fix a error al cargar archivo a un anticipo recien capturado

feature/ConsolidarPedimentos_20231229
Felix Morales 1 year ago
parent 5d56878e46
commit d513bab335
  1. 50
      src/Components/Corresponsales/Anticipos/Anticipos.tsx

@ -83,7 +83,7 @@ export const Anticipos: FC<IProps> = (props) => {
<IconContext.Provider value={{ color: 'blue', size: '18px' }}> <IconContext.Provider value={{ color: 'blue', size: '18px' }}>
<BsPencilFill <BsPencilFill
onClick={() => { onClick={() => {
loadRow(params.data.id) loadRow(params.data)
}} }}
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}
/> />
@ -92,7 +92,7 @@ export const Anticipos: FC<IProps> = (props) => {
<IconContext.Provider value={{ color: 'red', size: '20px' }}> <IconContext.Provider value={{ color: 'red', size: '20px' }}>
<BsFileEarmarkPdf <BsFileEarmarkPdf
onClick={() => { onClick={() => {
viewDoc(params.value) viewDoc(params.data)
//getFileContent(params.value) //getFileContent(params.value)
}} }}
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}
@ -189,7 +189,7 @@ export const Anticipos: FC<IProps> = (props) => {
<IconContext.Provider value={{ color: 'red', size: '18px' }}> <IconContext.Provider value={{ color: 'red', size: '18px' }}>
<BsQuestionOctagonFill <BsQuestionOctagonFill
onClick={() => { onClick={() => {
return Depto === 'Contabilidad' ? viewDocConta(params.value) : '#' return Depto === 'Contabilidad' ? viewDocConta(params.data) : '#'
}} }}
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}
/> />
@ -202,7 +202,7 @@ export const Anticipos: FC<IProps> = (props) => {
<IconContext.Provider value={{ color: 'green', size: '18px' }}> <IconContext.Provider value={{ color: 'green', size: '18px' }}>
<BsCheckCircleFill <BsCheckCircleFill
onClick={() => { onClick={() => {
viewDocConta(params.value) viewDocConta(params.data)
}} }}
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}
/> />
@ -278,28 +278,25 @@ export const Anticipos: FC<IProps> = (props) => {
}) })
} }
const loadRow = (idRow: number) => { const loadRow = (data: ICorresponsalAnticipos) => {
var tmpArray = mCAnticipos.filter(function (item) { setIdAnticipo(data.id)
return item.id === idRow setAnticipo(data.anticipo)
}) setConcepto(data.concepto)
setIdAnticipo(tmpArray[0].id) setMoneda(data.moneda)
setAnticipo(tmpArray[0].anticipo)
setConcepto(tmpArray[0].concepto)
setMoneda(tmpArray[0].moneda)
} }
const viewDoc = (idRow: number) => { const viewDoc = (data: ICorresponsalAnticipos) => {
loadRow(idRow) loadRow(data)
setMsgDialogFileManager(true) setMsgDialogFileManager(true)
} }
const viewDocConta = (idRow: number) => { const viewDocConta = (data: ICorresponsalAnticipos) => {
loadRow(idRow) loadRow(data)
setMsgDialogFileManagerConta(true) setMsgDialogFileManagerConta(true)
} }
const authorizeItem = (id: number) => { const authorizeItem = (data: ICorresponsalAnticipos) => {
loadRow(id) loadRow(data)
setMsgDialog(true) setMsgDialog(true)
} }
@ -377,10 +374,10 @@ export const Anticipos: FC<IProps> = (props) => {
</Col> </Col>
</Row> </Row>
<Row <Row
style={{ paddingBottom: '5', paddingTop: '15' }} style={{ paddingBottom: '5', paddingTop: '15', alignItems: 'center' }}
className={props.canDelete ? 'visible' : 'invisible heightZero'} className={props.canDelete ? 'visible' : 'invisible heightZero'}
> >
<Col md='auto' xs={1}> <Col md={2} lg={3}>
<Button <Button
variant='warning' variant='warning'
size='sm' size='sm'
@ -392,10 +389,7 @@ export const Anticipos: FC<IProps> = (props) => {
&nbsp;Limpiar &nbsp;Limpiar
</Button> </Button>
</Col> </Col>
<Col xs={3}> <Col md={3} lg={2}>
<Form.Control type='hidden' id='IdAnticipo' size='sm' value={IdAnticipo} placeholder='id' disabled={true} />
</Col>
<Col xs={2}>
<CurrencyFormat <CurrencyFormat
value={Anticipo} value={Anticipo}
displayType={'input'} displayType={'input'}
@ -415,7 +409,7 @@ export const Anticipos: FC<IProps> = (props) => {
}} }}
/> />
</Col> </Col>
<Col xs={1}> <Col md={2} lg={2}>
<Form.Control <Form.Control
as='select' as='select'
className='form-select form-select-sm' className='form-select form-select-sm'
@ -428,7 +422,7 @@ export const Anticipos: FC<IProps> = (props) => {
<option value='2'>Dolares</option> <option value='2'>Dolares</option>
</Form.Control> </Form.Control>
</Col> </Col>
<Col xs={2}> <Col md={3} lg={2}>
<Form.Control <Form.Control
as='select' as='select'
className='form-select form-select-sm' className='form-select form-select-sm'
@ -441,8 +435,7 @@ export const Anticipos: FC<IProps> = (props) => {
<option value='1'>Financiado</option> <option value='1'>Financiado</option>
</Form.Control> </Form.Control>
</Col> </Col>
<Col xs={2}></Col> <Col md={2} lg={3} style={{display:'flex', justifyContent:'end'}}>
<Col xs={1}>
<Button <Button
variant='primary' variant='primary'
size='sm' size='sm'
@ -454,6 +447,7 @@ export const Anticipos: FC<IProps> = (props) => {
&nbsp;Guardar &nbsp;Guardar
</Button> </Button>
</Col> </Col>
<Form.Control type='hidden' id='IdAnticipo' size='sm' value={IdAnticipo} placeholder='id' disabled={true} />
</Row> </Row>
<Row style={{ paddingBottom: 5 }}> <Row style={{ paddingBottom: 5 }}>
<Col xs={12}> <Col xs={12}>

Loading…
Cancel
Save