|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
import {Grid, Typography, TextField, Box, InputLabel, Select, MenuItem, Avatar, SelectChangeEvent} from '@mui/material';
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
import { MuiTelInput, matchIsValidTel } from 'mui-tel-input'
|
|
|
|
|
import { useEffect, useState } from 'react';
|
|
|
|
|
import { SetStateAction, useEffect, useState } from 'react';
|
|
|
|
|
|
|
|
|
|
interface Paises {
|
|
|
|
|
|
|
|
|
@ -19,6 +19,25 @@ export const DadosPessoais = ( {formik}: any ) => {
|
|
|
|
|
|
|
|
|
|
const [selectedValue, setSelectedValue] = useState('Portugal');
|
|
|
|
|
|
|
|
|
|
const [tipoRegisto, setTipoRegisto] = useState('');
|
|
|
|
|
|
|
|
|
|
const [smValue, setSmValue] = useState(6);
|
|
|
|
|
|
|
|
|
|
const handleTipoRegistoChange = (event: { target: { value: SetStateAction<string>; }; }) => {
|
|
|
|
|
setTipoRegisto(event.target.value);
|
|
|
|
|
|
|
|
|
|
const tipoempresaValue = '';
|
|
|
|
|
|
|
|
|
|
if (event.target.value == '0') {
|
|
|
|
|
setSmValue(3);
|
|
|
|
|
} else {
|
|
|
|
|
setSmValue(6);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
formik.setFieldValue('tiporegisto', event.target.value);
|
|
|
|
|
formik.setFieldValue('tipoempresa', tipoempresaValue);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleChange2 = (event: SelectChangeEvent<unknown>) => {
|
|
|
|
|
setSelectedValue(event.target.value as string);
|
|
|
|
|
formik.setFieldValue( 'pais', event.target.value);
|
|
|
|
@ -57,7 +76,46 @@ export const DadosPessoais = ( {formik}: any ) => {
|
|
|
|
|
Dados Pessoais
|
|
|
|
|
</Typography>
|
|
|
|
|
<Grid container spacing={3}>
|
|
|
|
|
<Grid item xs={12} sm={6}>
|
|
|
|
|
|
|
|
|
|
<Grid item xs={12} sm={smValue}>
|
|
|
|
|
<InputLabel id="labeltiporegisto">Tipo de registo</InputLabel>
|
|
|
|
|
<Select
|
|
|
|
|
{...formik.getFieldProps('tiporegisto')}
|
|
|
|
|
required
|
|
|
|
|
labelId="labeltiporegisto"
|
|
|
|
|
id="tiporegisto"
|
|
|
|
|
name="tiporegisto"
|
|
|
|
|
label="tiporegisto"
|
|
|
|
|
variant="standard"
|
|
|
|
|
fullWidth
|
|
|
|
|
value={tipoRegisto}
|
|
|
|
|
onChange={handleTipoRegistoChange}
|
|
|
|
|
>
|
|
|
|
|
<MenuItem value={0}>Empresa</MenuItem>
|
|
|
|
|
<MenuItem value={1}>Particular</MenuItem>
|
|
|
|
|
</Select>
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
{tipoRegisto == '0' && (
|
|
|
|
|
<Grid item xs={12} sm={3}>
|
|
|
|
|
<InputLabel id="labeltipoempresa">Tipo de empresa</InputLabel>
|
|
|
|
|
<Select
|
|
|
|
|
{...formik.getFieldProps('tipoempresa')}
|
|
|
|
|
labelId="labeltipoempresa"
|
|
|
|
|
id="tipoempresa"
|
|
|
|
|
name="tipoempresa"
|
|
|
|
|
label="tipoempresa"
|
|
|
|
|
variant="standard"
|
|
|
|
|
fullWidth
|
|
|
|
|
>
|
|
|
|
|
<MenuItem value={0}>Empresa</MenuItem>
|
|
|
|
|
<MenuItem value={1}>Particular</MenuItem>
|
|
|
|
|
<MenuItem value={2}>Park</MenuItem>
|
|
|
|
|
</Select>
|
|
|
|
|
</Grid>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
<Grid item xs={12} sm={6} sx={{ mt: 0.9 }}>
|
|
|
|
|
<TextField
|
|
|
|
|
{...formik.getFieldProps('empresa')}
|
|
|
|
|
required
|
|
|
|
@ -70,18 +128,8 @@ export const DadosPessoais = ( {formik}: any ) => {
|
|
|
|
|
helperText={formik.touched.empresa && formik.errors.empresa}
|
|
|
|
|
/>
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
<Grid item xs={12} sm={6}>
|
|
|
|
|
<TextField
|
|
|
|
|
{...formik.getFieldProps('nif')}
|
|
|
|
|
type='text'
|
|
|
|
|
id="nif"
|
|
|
|
|
name="nif"
|
|
|
|
|
label="NIF/NIPC"
|
|
|
|
|
fullWidth
|
|
|
|
|
variant="standard"
|
|
|
|
|
/>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={12} sm={12}>
|
|
|
|
|
<TextField
|
|
|
|
|
{...formik.getFieldProps('representante')}
|
|
|
|
|
required
|
|
|
|
@ -95,6 +143,19 @@ export const DadosPessoais = ( {formik}: any ) => {
|
|
|
|
|
helperText={formik.touched.representante && formik.errors.representante}
|
|
|
|
|
/>
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
<Grid item xs={12} sm={6}>
|
|
|
|
|
<TextField
|
|
|
|
|
{...formik.getFieldProps('nif')}
|
|
|
|
|
type='text'
|
|
|
|
|
id="nif"
|
|
|
|
|
name="nif"
|
|
|
|
|
label="NIF/NIPC"
|
|
|
|
|
fullWidth
|
|
|
|
|
variant="standard"
|
|
|
|
|
/>
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
<Grid item xs={12} sm={6}>
|
|
|
|
|
<MuiTelInput
|
|
|
|
|
{...formik.getFieldProps('telemovelDP')}
|
|
|
|
@ -110,6 +171,7 @@ export const DadosPessoais = ( {formik}: any ) => {
|
|
|
|
|
helperText={formik.touched.telemovelDP && formik.errors.telemovelDP}
|
|
|
|
|
/>
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
<Grid item xs={12} sm={6}>
|
|
|
|
|
<TextField
|
|
|
|
|
{...formik.getFieldProps('emailDP')}
|
|
|
|
|