Browse Source

puesto abc

amenpunk 2 years ago
parent
commit
3ad831415d
2 changed files with 6 additions and 7 deletions
  1. 4 1
      src/Components/Modal/AgregarManual.js
  2. 2 6
      src/Components/Puestos/ListMode.jsx

+ 4 - 1
src/Components/Modal/AgregarManual.js

50
     const [open, setOpen] = React.useState(false);
50
     const [open, setOpen] = React.useState(false);
51
     const [date, setDate] = React.useState(new Date());
51
     const [date, setDate] = React.useState(new Date());
52
     const [tab, setTab] = React.useState(0);
52
     const [tab, setTab] = React.useState(0);
53
+    const [checklist, setChecklist] = React.useState([]);
53
 
54
 
54
     const handleClose = () => false
55
     const handleClose = () => false
55
 
56
 
112
         if(check){
113
         if(check){
113
             temp = [...pruebas, {id}]
114
             temp = [...pruebas, {id}]
114
         }else{
115
         }else{
115
-            temp = pruebas.filter((test) => test.id !== id);
116
+            temp = pruebas.filter( test => test.id !== id);
116
         }
117
         }
118
+        setChecklist(  temp.map( test => test.id) )
117
         setValues({...values, pruebas: temp})
119
         setValues({...values, pruebas: temp})
118
     };
120
     };
119
 
121
 
149
                                                     key={test.id}
151
                                                     key={test.id}
150
                                                     control={
152
                                                     control={
151
                                                         <Checkbox 
153
                                                         <Checkbox 
154
+                                                            checked={checklist.includes((test.id))}
152
                                                             onChange={(event)=> addPrueba(event.target.checked,test.id)}
155
                                                             onChange={(event)=> addPrueba(event.target.checked,test.id)}
153
                                                         />
156
                                                         />
154
                                                     } 
157
                                                     } 

+ 2 - 6
src/Components/Puestos/ListMode.jsx

43
                                                 }} 
43
                                                 }} 
44
                                                 className="actions_butons_plaza"> 
44
                                                 className="actions_butons_plaza"> 
45
                                                 <Button 
45
                                                 <Button 
46
-                                                    onClick={() => {
47
-                                                        console.log("VER")
48
-                                                    }} 
46
+                                                    onClick={() => props.toggle("VER", plaza)}
49
                                                     className="ver_producto">
47
                                                     className="ver_producto">
50
                                                     {!isMovil ? <ShowI/> : "Ver"}
48
                                                     {!isMovil ? <ShowI/> : "Ver"}
51
                                                 </Button>
49
                                                 </Button>
52
                                                 <Button 
50
                                                 <Button 
53
-                                                    onClick={() => {
54
-                                                        console.log("EDITAR")
55
-                                                    }} 
51
+                                                    onClick={() => props.toggle("EDIT", plaza)}
56
                                                     className="editar_producto">
52
                                                     className="editar_producto">
57
                                                     {!isMovil ? <EditI/> : "Editar"}
53
                                                     {!isMovil ? <EditI/> : "Editar"}
58
                                                 </Button>
54
                                                 </Button>