1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
| const handleIdem = (table, element) => {
setListId(element)
setIdem(false)
let dataT = []
table.map((item) => {
listId.includes(item.id) && dataT.push(item.MONTANT_PAIEMENT)
})
// Vérifier si tous les éléments du tableau sont identiques
if (dataT.every((val, i, arr) => val === arr[0]) == true) {
setIdem(true)
}
console.log(dataT)
return idem
}
<Formik
noValidate
initialValues={{
debut: initial.debut,
fin: initial.fin,
}}
validationSchema={schema}
onSubmit={(values, onSubmitProps) => {
MettreAJourTableau(values)
}}>
{({
values,
errors,
touched,
handleChange,
handleBlur,
handleSubmit,
isSubmitting,
}) => (
<div style={{ textAlign: 'right' }}>
<Form>
<Controls.TextInput
margin='normal'
id='debut'
type='date'
helperText={errors.debut}
error={errors.debut && true}
size='small'
name='debut'
/>
<Controls.TextInput
margin='normal'
id='fin'
type='date'
helperText={errors.fin}
error={errors.fin && true}
name='fin'
style={{ marginLeft: '5px' }}
/>
<FormControlLabel
control={
<GreenCheckbox
checked={checkedG}
onChange={handleCheck}
name='retire'
/>
}
label='Retirés'
style={{ marginLeft: '2px', paddingTop: '10px' }}
/>
<Buttons
style={{ marginTop: '16px' }}
variant='contained'
color='default'
size='large'
className={classes.button}
startIcon={<SearchIcon fontSize='large' />}></Buttons>
</Form>
</div>
)}
</Formik>
</div>
</>
}
/> |
Partager