Browse Source

some bug fixes

amenpunk 2 years ago
parent
commit
58f02f851c
2 changed files with 30 additions and 8 deletions
  1. 29 7
      src/Components/Modal/AgregarManual.js
  2. 1 1
      src/Components/Password/Steps/resume.jsx

+ 29 - 7
src/Components/Modal/AgregarManual.js

@@ -47,6 +47,7 @@ function Manual(props) {
47 47
     })
48 48
 
49 49
     const [departamento, setDepartamento] = React.useState('');
50
+    const [puestoSup, setPuestoSup] = React.useState('');
50 51
     const [open, setOpen] = React.useState(false);
51 52
     const [date, setDate] = React.useState(new Date());
52 53
     const [tab, setTab] = React.useState(0);
@@ -57,6 +58,10 @@ function Manual(props) {
57 58
     const changeDepartamento = (event) => {
58 59
         setDepartamento(event.target.value);
59 60
     };
61
+    
62
+    const changePuestoSup = (event) => {
63
+        setPuestoSup(event.target.value);
64
+    };
60 65
 
61 66
     const agregarPuesto = async (puesto) => {
62 67
         let rest = new Service('/plaza/save');
@@ -167,6 +172,8 @@ function Manual(props) {
167 172
                         <TabPanel value={tab} index={0}>
168 173
 
169 174
                             <Stack spacing={3}>
175
+
176
+
170 177
                                 <Stack direction={{ xs: 'column', sm: 'row' }} spacing={4}>
171 178
                                     <TextField
172 179
                                         label="Nombre"
@@ -176,13 +183,28 @@ function Manual(props) {
176 183
                                         helperText={touched.nombrepuesto && errors.nombrepuesto}
177 184
                                     />
178 185
 
179
-                                    <TextField
180
-                                        label="Puesto Superior"
181
-                                        fullWidth
182
-                                        {...getFieldProps('puestosuperior')}
183
-                                        error={Boolean(touched.puestosuperior && errors.puestosuperior)}
184
-                                        helperText={touched.puestosuperior && errors.puestosuperior}
185
-                                    />
186
+                                    <FormControl fullWidth>
187
+                                        <InputLabel id="demo-simple-select-label">Puesto Superior</InputLabel>
188
+                                        <Select
189
+                                            labelId="demo-simple-select-label"
190
+                                            value={puestoSup}
191
+                                            label="Puesto Superior"
192
+                                            onChange={changePuestoSup}
193
+                                            {...getFieldProps('puestosuperior')}
194
+                                            helperText={touched.puestosuperior && errors.puestosuperior}
195
+                                            error={Boolean(touched.puestosuperior && errors.puestosuperior)} >
196
+                                            {
197
+                                                data ?
198
+                                                    data.data.map(cate => {
199
+                                                        return (
200
+                                                            <MenuItem key={cate.id} value={cate.id}>{cate.nombre}</MenuItem>
201
+                                                        )
202
+                                                    })
203
+                                                    : <MenuItem>Null</MenuItem>
204
+                                            }
205
+                                        </Select>
206
+                                    </FormControl>
207
+
186 208
                                 </Stack>
187 209
 
188 210
                                 <Stack direction={{ xs: 'column', sm: 'row' }} spacing={4}>

+ 1 - 1
src/Components/Password/Steps/resume.jsx

@@ -139,7 +139,7 @@ export function Resume(props) {
139 139
                         </tr>
140 140
                         <tr>
141 141
                             <td className="title_td">{"Puesto"}</td>
142
-                            <td colSpan={2}>{key.puesto[0].nombrepuesto}</td>
142
+                            <td colSpan={2}>{key.puesto.length > 0 ? key.puesto[0].nombrepuesto : ''}</td>
143 143
                         </tr>
144 144
                         <tr>
145 145
                             <td className="title_td">{"Empresa"}</td>