Dar acceso de visualizacion a los tabuladores de los traficos al resto de departamentos

feature/ConsolidarPedimentos_20231229
Felix Morales 11 months ago
parent b918c89d9a
commit 3951e7c8c1
  1. 25
      src/Components/Corresponsales/Tabulador/Tabulador.tsx
  2. 7
      src/Components/Corresponsales/TraficoCorresponsales.tsx
  3. 2
      src/Components/Utils/ControlledInput/ControlledInput.tsx

@ -18,6 +18,7 @@ interface IProps {
NombreCliente: string NombreCliente: string
closeTabulador: (arg: boolean) => void closeTabulador: (arg: boolean) => void
cambiaPrecuenta: (IDPrecuenta: number) => void cambiaPrecuenta: (IDPrecuenta: number) => void
Depto: string
} }
interface IselectedRows { interface IselectedRows {
@ -56,7 +57,7 @@ export const Tabulador: FC<IProps> = (props) => {
name: 'Costo', name: 'Costo',
width: '15%', width: '15%',
cell: (row: ITabuladorConceptos) => { cell: (row: ITabuladorConceptos) => {
return <ControlledInput id={row.id} value={row.costo} disabled={true} postCost={(id, value) => {}} /> return <ControlledInput id={row.id} value={row.costo.toFixed(2)} disabled={true} postCost={(id, value) => {}} />
/*return row.activo === 1 ? ( /*return row.activo === 1 ? (
<ControlledInput id={row.id} value={row.costo} disabled={true} postCost={(id, value) => {}} /> <ControlledInput id={row.id} value={row.costo} disabled={true} postCost={(id, value) => {}} />
) : ( ) : (
@ -77,6 +78,7 @@ export const Tabulador: FC<IProps> = (props) => {
onChange={() => { onChange={() => {
switchConcept(row.id, row.activo ? 0 : 1) switchConcept(row.id, row.activo ? 0 : 1)
}} }}
disabled={props.Depto !== 'Corresponsalias'}
/> />
</Form.Group> </Form.Group>
) )
@ -229,6 +231,7 @@ export const Tabulador: FC<IProps> = (props) => {
onChange={(e) => setIDTabulador(parseInt(e.target.value))} onChange={(e) => setIDTabulador(parseInt(e.target.value))}
className='form-select form-select-sm' className='form-select form-select-sm'
style={{ fontSize: '15px' }} style={{ fontSize: '15px' }}
disabled={props.Depto !== 'Corresponsalias'}
> >
<option value='0'>- No tiene tabulador asignado -</option> <option value='0'>- No tiene tabulador asignado -</option>
{Tabuladores {Tabuladores
@ -239,14 +242,18 @@ export const Tabulador: FC<IProps> = (props) => {
</Form.Control> </Form.Control>
</Col> </Col>
<Col xs={1}> <Col xs={1}>
<Button {
variant='primary' (props.Depto === 'Corresponsalias')
size='sm' ? <Button
style={{ paddingLeft: '10px', paddingRight: '10px' }} variant='primary'
onClick={() => saveForm()} size='sm'
> style={{ paddingLeft: '10px', paddingRight: '10px' }}
Guardar onClick={() => saveForm()}
</Button> >
Guardar
</Button>
: ''
}
</Col> </Col>
</Row> </Row>
</Alert> </Alert>

@ -1644,11 +1644,7 @@ export default function TraficoCorresponsales (props:IProps) {
<Col sm={6} md={6} lg={8}> <Col sm={6} md={6} lg={8}>
<Form.Label style={{ width:'100%' }}> <Form.Label style={{ width:'100%' }}>
<IconContext.Provider value={{ color: 'blue', size: '15px' }}> <IconContext.Provider value={{ color: 'blue', size: '15px' }}>
<span onClick={() => { <span onClick={() => {showModalBox(10)}}
return (Depto === 'Corresponsalias' || Depto === 'Sistemas')
? showModalBox(10)
: ''
}}
style={{ cursor: 'pointer' }}> style={{ cursor: 'pointer' }}>
<FcTimeline />&nbsp;Precuenta <FcTimeline />&nbsp;Precuenta
</span> </span>
@ -4235,6 +4231,7 @@ export default function TraficoCorresponsales (props:IProps) {
cambiaPrecuenta={function (idTab: number): void { cambiaPrecuenta={function (idTab: number): void {
setIDTabulador(idTab) setIDTabulador(idTab)
}} }}
Depto={Depto}
/> />
</div> </div>
) : null} ) : null}

@ -3,7 +3,7 @@ import { MsgInformativo } from '../Toast/msgInformativo'
interface IProps { interface IProps {
id: number id: number
value: number value: number | string
disabled?: boolean disabled?: boolean
postCost: (id: number, value: number) => void postCost: (id: number, value: number) => void
} }

Loading…
Cancel
Save