|
@@ -1,8 +1,8 @@
|
1
|
1
|
import React, { memo } from 'react';
|
2
|
2
|
import * as Yup from 'yup';
|
3
|
3
|
import { useFormik, Form, FormikProvider } from 'formik';
|
4
|
|
-import { Dialog,DialogContent, DialogTitle,DialogActions } from '@mui/material'
|
5
|
|
-import toast, { Toaster } from 'react-hot-toast';
|
|
4
|
+import { Dialog, DialogContent, DialogTitle, DialogActions } from '@mui/material'
|
|
5
|
+import toast from 'react-hot-toast';
|
6
|
6
|
|
7
|
7
|
import { AdapterDateFns as DateFnsUtils } from '@mui/x-date-pickers/AdapterDateFns';
|
8
|
8
|
import { DesktopDatePicker } from '@mui/x-date-pickers/DesktopDatePicker';
|
|
@@ -83,6 +83,12 @@ function Manual(props) {
|
83
|
83
|
},
|
84
|
84
|
onSubmit: (fields, { resetForm }) => {
|
85
|
85
|
|
|
86
|
+ if(fields.tests.length === 0){
|
|
87
|
+ toast.error("Recuerda que seleccionar al menos un test")
|
|
88
|
+ setTab(1)
|
|
89
|
+ return
|
|
90
|
+ }
|
|
91
|
+
|
86
|
92
|
setOpen(true)
|
87
|
93
|
fields['fecha'] = new Date(fields.fecha).toISOString();
|
88
|
94
|
fields['areadeptoplz_id'] = 1;
|
|
@@ -126,11 +132,11 @@ function Manual(props) {
|
126
|
132
|
|
127
|
133
|
return (
|
128
|
134
|
|
129
|
|
- <Dialog
|
130
|
|
- open={visible}
|
131
|
|
- fullWidth="lg"
|
132
|
|
- maxWidth="md"
|
133
|
|
- aria-labelledby="contained-modal-title-vcenter"
|
|
135
|
+ <Dialog
|
|
136
|
+ open={visible}
|
|
137
|
+ fullWidth={true}
|
|
138
|
+ maxWidth="md"
|
|
139
|
+ aria-labelledby="contained-modal-title-vcenter"
|
134
|
140
|
onClose={onClose}>
|
135
|
141
|
|
136
|
142
|
<DialogTitle>
|
|
@@ -152,7 +158,7 @@ function Manual(props) {
|
152
|
158
|
<Stack spacing={1}>
|
153
|
159
|
<Box style={{ paddingTop: 5, paddingLeft: 15 }}>
|
154
|
160
|
<Divider />
|
155
|
|
- <h4 style={{ paddingTop: 10, paddingBottom: 10 }}>Seleciona los test a realizar</h4>
|
|
161
|
+ <h4 style={{ paddingTop: 10, paddingBottom: 10 }}>Selecciona los test a realizar</h4>
|
156
|
162
|
<Divider />
|
157
|
163
|
<FormGroup>
|
158
|
164
|
{
|
|
@@ -296,7 +302,6 @@ function Manual(props) {
|
296
|
302
|
onClick={handleClose} >
|
297
|
303
|
<CircularProgress color="inherit" />
|
298
|
304
|
</Backdrop>
|
299
|
|
- <Toaster position="top-right" />
|
300
|
305
|
</Dialog>
|
301
|
306
|
)
|
302
|
307
|
}
|