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,6 +50,7 @@ function Manual(props) {
50 50
     const [open, setOpen] = React.useState(false);
51 51
     const [date, setDate] = React.useState(new Date());
52 52
     const [tab, setTab] = React.useState(0);
53
+    const [checklist, setChecklist] = React.useState([]);
53 54
 
54 55
     const handleClose = () => false
55 56
 
@@ -112,8 +113,9 @@ function Manual(props) {
112 113
         if(check){
113 114
             temp = [...pruebas, {id}]
114 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 119
         setValues({...values, pruebas: temp})
118 120
     };
119 121
 
@@ -149,6 +151,7 @@ function Manual(props) {
149 151
                                                     key={test.id}
150 152
                                                     control={
151 153
                                                         <Checkbox 
154
+                                                            checked={checklist.includes((test.id))}
152 155
                                                             onChange={(event)=> addPrueba(event.target.checked,test.id)}
153 156
                                                         />
154 157
                                                     } 

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

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