fix cambio de estados en el tabulador

feature/ConsolidarPedimentos_20231229
Felix Morales 1 year ago
parent 8e605bae23
commit 0bf28d24eb
  1. 13
      src/Components/Corresponsales/Tabulador/Tabulador.tsx

@ -56,11 +56,12 @@ export const Tabulador: FC<IProps> = (props) => {
name: 'Costo',
width: '15%',
cell: (row: ITabuladorConceptos) => {
return row.activo === 1 ? (
return <ControlledInput id={row.id} value={row.costo} disabled={true} postCost={(id, value) => {}} />
/*return row.activo === 1 ? (
<ControlledInput id={row.id} value={row.costo} disabled={true} postCost={(id, value) => {}} />
) : (
<ControlledInput id={row.id} value={0} disabled={true} postCost={(id, value) => {}} />
)
)*/
},
},
{
@ -72,9 +73,9 @@ export const Tabulador: FC<IProps> = (props) => {
<Form.Check
type='checkbox'
label=''
checked={row.activo === 1 ? true : false}
onClick={() => {
switchConcept(row.id, 1)
defaultChecked={row.activo === 1 ? true : false}
onChange={() => {
switchConcept(row.id, row.activo ? 0 : 1)
}}
/>
</Form.Group>
@ -113,7 +114,7 @@ export const Tabulador: FC<IProps> = (props) => {
if (response.status === 200) {
let tmp = DetalleConceptos
let idx = tmp.findIndex((obj) => obj.id == id)
tmp[idx].activo = status === 1 ? 0 : 1
tmp[idx].activo = status
setDetalleConceptos(tmp)
setHeader('Confirmacion')
setMsg(response.data.respuesta)

Loading…
Cancel
Save