|
@@ -1,8 +1,8 @@
|
|
|
import React, { memo } from 'react';
|
|
import React, { memo } from 'react';
|
|
|
import * as Yup from 'yup';
|
|
import * as Yup from 'yup';
|
|
|
import { useFormik, Form, FormikProvider } from 'formik';
|
|
import { useFormik, Form, FormikProvider } from 'formik';
|
|
|
-import { Dialog,DialogContent, DialogTitle,DialogActions } from '@mui/material'
|
|
|
|
|
-import toast, { Toaster } from 'react-hot-toast';
|
|
|
|
|
|
|
+import { Dialog, DialogContent, DialogTitle, DialogActions } from '@mui/material'
|
|
|
|
|
+import toast from 'react-hot-toast';
|
|
|
|
|
|
|
|
import { AdapterDateFns as DateFnsUtils } from '@mui/x-date-pickers/AdapterDateFns';
|
|
import { AdapterDateFns as DateFnsUtils } from '@mui/x-date-pickers/AdapterDateFns';
|
|
|
import { DesktopDatePicker } from '@mui/x-date-pickers/DesktopDatePicker';
|
|
import { DesktopDatePicker } from '@mui/x-date-pickers/DesktopDatePicker';
|
|
@@ -83,6 +83,12 @@ function Manual(props) {
|
|
|
},
|
|
},
|
|
|
onSubmit: (fields, { resetForm }) => {
|
|
onSubmit: (fields, { resetForm }) => {
|
|
|
|
|
|
|
|
|
|
+ if(fields.tests.length === 0){
|
|
|
|
|
+ toast.error("Recuerda que seleccionar al menos un test")
|
|
|
|
|
+ setTab(1)
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
setOpen(true)
|
|
setOpen(true)
|
|
|
fields['fecha'] = new Date(fields.fecha).toISOString();
|
|
fields['fecha'] = new Date(fields.fecha).toISOString();
|
|
|
fields['areadeptoplz_id'] = 1;
|
|
fields['areadeptoplz_id'] = 1;
|
|
@@ -126,11 +132,11 @@ function Manual(props) {
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
|
|
|
|
|
- <Dialog
|
|
|
|
|
- open={visible}
|
|
|
|
|
- fullWidth="lg"
|
|
|
|
|
- maxWidth="md"
|
|
|
|
|
- aria-labelledby="contained-modal-title-vcenter"
|
|
|
|
|
|
|
+ <Dialog
|
|
|
|
|
+ open={visible}
|
|
|
|
|
+ fullWidth={true}
|
|
|
|
|
+ maxWidth="md"
|
|
|
|
|
+ aria-labelledby="contained-modal-title-vcenter"
|
|
|
onClose={onClose}>
|
|
onClose={onClose}>
|
|
|
|
|
|
|
|
<DialogTitle>
|
|
<DialogTitle>
|
|
@@ -152,7 +158,7 @@ function Manual(props) {
|
|
|
<Stack spacing={1}>
|
|
<Stack spacing={1}>
|
|
|
<Box style={{ paddingTop: 5, paddingLeft: 15 }}>
|
|
<Box style={{ paddingTop: 5, paddingLeft: 15 }}>
|
|
|
<Divider />
|
|
<Divider />
|
|
|
- <h4 style={{ paddingTop: 10, paddingBottom: 10 }}>Seleciona los test a realizar</h4>
|
|
|
|
|
|
|
+ <h4 style={{ paddingTop: 10, paddingBottom: 10 }}>Selecciona los test a realizar</h4>
|
|
|
<Divider />
|
|
<Divider />
|
|
|
<FormGroup>
|
|
<FormGroup>
|
|
|
{
|
|
{
|
|
@@ -296,7 +302,6 @@ function Manual(props) {
|
|
|
onClick={handleClose} >
|
|
onClick={handleClose} >
|
|
|
<CircularProgress color="inherit" />
|
|
<CircularProgress color="inherit" />
|
|
|
</Backdrop>
|
|
</Backdrop>
|
|
|
- <Toaster position="top-right" />
|
|
|
|
|
</Dialog>
|
|
</Dialog>
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|