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
     })
47
     })
48
 
48
 
49
     const [departamento, setDepartamento] = React.useState('');
49
     const [departamento, setDepartamento] = React.useState('');
50
+    const [puestoSup, setPuestoSup] = React.useState('');
50
     const [open, setOpen] = React.useState(false);
51
     const [open, setOpen] = React.useState(false);
51
     const [date, setDate] = React.useState(new Date());
52
     const [date, setDate] = React.useState(new Date());
52
     const [tab, setTab] = React.useState(0);
53
     const [tab, setTab] = React.useState(0);
57
     const changeDepartamento = (event) => {
58
     const changeDepartamento = (event) => {
58
         setDepartamento(event.target.value);
59
         setDepartamento(event.target.value);
59
     };
60
     };
61
+    
62
+    const changePuestoSup = (event) => {
63
+        setPuestoSup(event.target.value);
64
+    };
60
 
65
 
61
     const agregarPuesto = async (puesto) => {
66
     const agregarPuesto = async (puesto) => {
62
         let rest = new Service('/plaza/save');
67
         let rest = new Service('/plaza/save');
167
                         <TabPanel value={tab} index={0}>
172
                         <TabPanel value={tab} index={0}>
168
 
173
 
169
                             <Stack spacing={3}>
174
                             <Stack spacing={3}>
175
+
176
+
170
                                 <Stack direction={{ xs: 'column', sm: 'row' }} spacing={4}>
177
                                 <Stack direction={{ xs: 'column', sm: 'row' }} spacing={4}>
171
                                     <TextField
178
                                     <TextField
172
                                         label="Nombre"
179
                                         label="Nombre"
176
                                         helperText={touched.nombrepuesto && errors.nombrepuesto}
183
                                         helperText={touched.nombrepuesto && errors.nombrepuesto}
177
                                     />
184
                                     />
178
 
185
 
179
-                                    <TextField
186
+                                    <FormControl fullWidth>
180
-                                        label="Puesto Superior"
187
+                                        <InputLabel id="demo-simple-select-label">Puesto Superior</InputLabel>
181
-                                        fullWidth
188
+                                        <Select
182
-                                        {...getFieldProps('puestosuperior')}
189
+                                            labelId="demo-simple-select-label"
183
-                                        error={Boolean(touched.puestosuperior && errors.puestosuperior)}
190
+                                            value={puestoSup}
184
-                                        helperText={touched.puestosuperior && errors.puestosuperior}
191
+                                            label="Puesto Superior"
185
-                                    />
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
                                 </Stack>
208
                                 </Stack>
187
 
209
 
188
                                 <Stack direction={{ xs: 'column', sm: 'row' }} spacing={4}>
210
                                 <Stack direction={{ xs: 'column', sm: 'row' }} spacing={4}>

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

139
                         </tr>
139
                         </tr>
140
                         <tr>
140
                         <tr>
141
                             <td className="title_td">{"Puesto"}</td>
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
                         </tr>
143
                         </tr>
144
                         <tr>
144
                         <tr>
145
                             <td className="title_td">{"Empresa"}</td>
145
                             <td className="title_td">{"Empresa"}</td>