|
@@ -73,6 +73,12 @@ const CustomFormWizard = (props) => { |
|
|
console.log(data.fax) |
|
|
console.log(data.fax) |
|
|
console.log(data.phone) |
|
|
console.log(data.phone) |
|
|
const name = data.ehName +" "+ data.enName |
|
|
const name = data.ehName +" "+ data.enName |
|
|
|
|
|
const userAddress = { |
|
|
|
|
|
"addressLine1":data.address1, |
|
|
|
|
|
"addressLine2":data.address2, |
|
|
|
|
|
"addressLine3":data.address3, |
|
|
|
|
|
"country":data.address5 |
|
|
|
|
|
} |
|
|
console.log(name) |
|
|
console.log(name) |
|
|
if (data.username !==""){ |
|
|
if (data.username !==""){ |
|
|
axios.post(`${apiPath}/user/register`, { |
|
|
axios.post(`${apiPath}/user/register`, { |
|
@@ -82,13 +88,9 @@ const CustomFormWizard = (props) => { |
|
|
fullname: name, |
|
|
fullname: name, |
|
|
enName: data.enName, |
|
|
enName: data.enName, |
|
|
chName: data.chName, |
|
|
chName: data.chName, |
|
|
email: data.email, |
|
|
|
|
|
|
|
|
emailAddress: data.email, |
|
|
fax: data.fax, |
|
|
fax: data.fax, |
|
|
address1: data.address1, |
|
|
|
|
|
address2: data.address2, |
|
|
|
|
|
address3: data.address3, |
|
|
|
|
|
address4: data.address4, |
|
|
|
|
|
address5: data.address5 |
|
|
|
|
|
|
|
|
userAddress:userAddress |
|
|
}) |
|
|
}) |
|
|
.then((response) => { |
|
|
.then((response) => { |
|
|
console.log("Success") |
|
|
console.log("Success") |
|
@@ -117,6 +119,7 @@ const CustomFormWizard = (props) => { |
|
|
confirmPassword: '', |
|
|
confirmPassword: '', |
|
|
phone:'', |
|
|
phone:'', |
|
|
idNo:'', |
|
|
idNo:'', |
|
|
|
|
|
checkDigit:'', |
|
|
submit: null |
|
|
submit: null |
|
|
}} |
|
|
}} |
|
|
validationSchema={Yup.object().shape({ |
|
|
validationSchema={Yup.object().shape({ |
|
@@ -130,6 +133,7 @@ const CustomFormWizard = (props) => { |
|
|
address3: Yup.string().max(255).required('請輸入第三行地址'), |
|
|
address3: Yup.string().max(255).required('請輸入第三行地址'), |
|
|
email: Yup.string().email('Must be a valid email').max(255).required('Email is required'), |
|
|
email: Yup.string().email('Must be a valid email').max(255).required('Email is required'), |
|
|
idNo: Yup.string().max(255).required('請輸入身證件號碼'), |
|
|
idNo: Yup.string().max(255).required('請輸入身證件號碼'), |
|
|
|
|
|
checkDigit:Yup.string().max(1).required('請輸入身證件號碼'), |
|
|
idType: Yup.string().max(255).required('請輸入第三行地址'), |
|
|
idType: Yup.string().max(255).required('請輸入第三行地址'), |
|
|
})} |
|
|
})} |
|
|
> |
|
|
> |
|
@@ -175,99 +179,103 @@ const CustomFormWizard = (props) => { |
|
|
)} |
|
|
)} |
|
|
</Stack> |
|
|
</Stack> |
|
|
</Grid> |
|
|
</Grid> |
|
|
<Grid item xs={12} md={6}> |
|
|
|
|
|
<Stack spacing={1}> |
|
|
|
|
|
<Stack direction="row" justifyContent="space-between"> |
|
|
|
|
|
<InputLabel htmlFor="password-signup">密碼 |
|
|
|
|
|
<span style={{color: '#f10000'}}>*</span> |
|
|
|
|
|
</InputLabel> |
|
|
|
|
|
<InputLabel htmlFor="password-rule">密碼規則</InputLabel> |
|
|
|
|
|
</Stack> |
|
|
|
|
|
<OutlinedInput |
|
|
|
|
|
fullWidth |
|
|
|
|
|
error={Boolean(touched.password && errors.password)} |
|
|
|
|
|
id="password-signup" |
|
|
|
|
|
type={showPassword ? 'text' : 'password'} |
|
|
|
|
|
value={values.password} |
|
|
|
|
|
name="password" |
|
|
|
|
|
{...register("password")} |
|
|
|
|
|
onChange={(e) => { |
|
|
|
|
|
handleChange(e); |
|
|
|
|
|
changePassword(e.target.value); |
|
|
|
|
|
}} |
|
|
|
|
|
endAdornment={ |
|
|
|
|
|
<InputAdornment position="end"> |
|
|
|
|
|
<IconButton |
|
|
|
|
|
aria-label="toggle password visibility" |
|
|
|
|
|
onClick={handleClickShowPassword} |
|
|
|
|
|
onMouseDown={handleMouseDownPassword} |
|
|
|
|
|
edge="end" |
|
|
|
|
|
size="large" |
|
|
|
|
|
> |
|
|
|
|
|
{showPassword ? <EyeOutlined /> : <EyeInvisibleOutlined />} |
|
|
|
|
|
</IconButton> |
|
|
|
|
|
</InputAdornment> |
|
|
|
|
|
} |
|
|
|
|
|
placeholder="密碼" |
|
|
|
|
|
inputProps={{}} |
|
|
|
|
|
/> |
|
|
|
|
|
{touched.password && errors.password && ( |
|
|
|
|
|
<FormHelperText error id="helper-text-password-signup"> |
|
|
|
|
|
{errors.password} |
|
|
|
|
|
</FormHelperText> |
|
|
|
|
|
)} |
|
|
|
|
|
</Stack> |
|
|
|
|
|
<FormControl fullWidth sx={{ mt: 2 }}> |
|
|
|
|
|
<Grid container spacing={2} alignItems="center"> |
|
|
|
|
|
<Grid item> |
|
|
|
|
|
<Box sx={{ bgcolor: level?.color, width: 85, height: 8, borderRadius: '7px' }} /> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
<Grid item> |
|
|
|
|
|
<Typography variant="subtitle1" fontSize="0.75rem"> |
|
|
|
|
|
{level?.label} |
|
|
|
|
|
</Typography> |
|
|
|
|
|
|
|
|
<Grid item xs={12} md={12}> |
|
|
|
|
|
<Grid container xs={12} md={12}> |
|
|
|
|
|
<Grid item xs={12} md={6} > |
|
|
|
|
|
<Stack spacing={1} sx={{mr:{md:1},mb:{xs:1}}}> |
|
|
|
|
|
<Stack direction="row" justifyContent="space-between"> |
|
|
|
|
|
<InputLabel htmlFor="password-signup">密碼 |
|
|
|
|
|
<span style={{color: '#f10000'}}>*</span> |
|
|
|
|
|
</InputLabel> |
|
|
|
|
|
<InputLabel htmlFor="password-rule">密碼規則</InputLabel> |
|
|
|
|
|
</Stack> |
|
|
|
|
|
<OutlinedInput |
|
|
|
|
|
fullWidth |
|
|
|
|
|
error={Boolean(touched.password && errors.password)} |
|
|
|
|
|
id="password-signup" |
|
|
|
|
|
type={showPassword ? 'text' : 'password'} |
|
|
|
|
|
value={values.password} |
|
|
|
|
|
name="password" |
|
|
|
|
|
{...register("password")} |
|
|
|
|
|
onChange={(e) => { |
|
|
|
|
|
handleChange(e); |
|
|
|
|
|
changePassword(e.target.value); |
|
|
|
|
|
}} |
|
|
|
|
|
endAdornment={ |
|
|
|
|
|
<InputAdornment position="end"> |
|
|
|
|
|
<IconButton |
|
|
|
|
|
aria-label="toggle password visibility" |
|
|
|
|
|
onClick={handleClickShowPassword} |
|
|
|
|
|
onMouseDown={handleMouseDownPassword} |
|
|
|
|
|
edge="end" |
|
|
|
|
|
size="large" |
|
|
|
|
|
> |
|
|
|
|
|
{showPassword ? <EyeOutlined /> : <EyeInvisibleOutlined />} |
|
|
|
|
|
</IconButton> |
|
|
|
|
|
</InputAdornment> |
|
|
|
|
|
} |
|
|
|
|
|
placeholder="密碼" |
|
|
|
|
|
inputProps={{}} |
|
|
|
|
|
/> |
|
|
|
|
|
{touched.password && errors.password && ( |
|
|
|
|
|
<FormHelperText error id="helper-text-password-signup"> |
|
|
|
|
|
{errors.password} |
|
|
|
|
|
</FormHelperText> |
|
|
|
|
|
)} |
|
|
|
|
|
</Stack> |
|
|
|
|
|
<FormControl fullWidth sx={{ mt: 2 }}> |
|
|
|
|
|
<Grid container spacing={2} alignItems="center"> |
|
|
|
|
|
<Grid item> |
|
|
|
|
|
<Box sx={{ bgcolor: level?.color, width: 85, height: 8, borderRadius: '7px' }} /> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
<Grid item> |
|
|
|
|
|
<Typography variant="subtitle1" fontSize="0.75rem"> |
|
|
|
|
|
{level?.label} |
|
|
|
|
|
</Typography> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</FormControl> |
|
|
</Grid> |
|
|
</Grid> |
|
|
|
|
|
<Grid item xs={12} md={6} > |
|
|
|
|
|
<Stack spacing={1}> |
|
|
|
|
|
<InputLabel htmlFor="confirmPassword-signup">確認密碼 |
|
|
|
|
|
<span style={{color: '#f10000'}}>*</span> |
|
|
|
|
|
</InputLabel> |
|
|
|
|
|
<OutlinedInput |
|
|
|
|
|
id="confirmPassword-login" |
|
|
|
|
|
type={showConfirmPassword ? 'text' : 'password'} |
|
|
|
|
|
value={values.confirmPassword} |
|
|
|
|
|
name="confirmPassword" |
|
|
|
|
|
{...register("confirmPassword")} |
|
|
|
|
|
onChange={(e) => { |
|
|
|
|
|
handleChange(e); |
|
|
|
|
|
changePassword(e.target.value); |
|
|
|
|
|
}} |
|
|
|
|
|
endAdornment={ |
|
|
|
|
|
<InputAdornment position="end"> |
|
|
|
|
|
<IconButton |
|
|
|
|
|
aria-label="toggle password visibility" |
|
|
|
|
|
onClick={handleClickShowConfirmPassword} |
|
|
|
|
|
onMouseDown={handleMouseDownPassword} |
|
|
|
|
|
edge="end" |
|
|
|
|
|
size="large" |
|
|
|
|
|
> |
|
|
|
|
|
{showConfirmPassword ? <EyeOutlined /> : <EyeInvisibleOutlined />} |
|
|
|
|
|
</IconButton> |
|
|
|
|
|
</InputAdornment> |
|
|
|
|
|
} |
|
|
|
|
|
placeholder="確認密碼" |
|
|
|
|
|
fullWidth |
|
|
|
|
|
error={Boolean(touched.confirmPassword && errors.confirmPassword)} |
|
|
|
|
|
/> |
|
|
|
|
|
{touched.confirmPassword && errors.confirmPassword && ( |
|
|
|
|
|
<FormHelperText error id="helper-text-confirmPassword-signup"> |
|
|
|
|
|
{errors.confirmPassword} |
|
|
|
|
|
</FormHelperText> |
|
|
|
|
|
)} |
|
|
|
|
|
</Stack> |
|
|
|
|
|
</Grid> |
|
|
</Grid> |
|
|
</Grid> |
|
|
</FormControl> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
<Grid item xs={12} md={6} > |
|
|
|
|
|
<Stack spacing={1}> |
|
|
|
|
|
<InputLabel htmlFor="confirmPassword-signup">確認密碼 |
|
|
|
|
|
<span style={{color: '#f10000'}}>*</span> |
|
|
|
|
|
</InputLabel> |
|
|
|
|
|
<OutlinedInput |
|
|
|
|
|
id="confirmPassword-login" |
|
|
|
|
|
type={showConfirmPassword ? 'text' : 'password'} |
|
|
|
|
|
value={values.confirmPassword} |
|
|
|
|
|
name="confirmPassword" |
|
|
|
|
|
{...register("confirmPassword")} |
|
|
|
|
|
onChange={(e) => { |
|
|
|
|
|
handleChange(e); |
|
|
|
|
|
changePassword(e.target.value); |
|
|
|
|
|
}} |
|
|
|
|
|
endAdornment={ |
|
|
|
|
|
<InputAdornment position="end"> |
|
|
|
|
|
<IconButton |
|
|
|
|
|
aria-label="toggle password visibility" |
|
|
|
|
|
onClick={handleClickShowConfirmPassword} |
|
|
|
|
|
onMouseDown={handleMouseDownPassword} |
|
|
|
|
|
edge="end" |
|
|
|
|
|
size="large" |
|
|
|
|
|
> |
|
|
|
|
|
{showConfirmPassword ? <EyeOutlined /> : <EyeInvisibleOutlined />} |
|
|
|
|
|
</IconButton> |
|
|
|
|
|
</InputAdornment> |
|
|
|
|
|
} |
|
|
|
|
|
placeholder="確認密碼" |
|
|
|
|
|
fullWidth |
|
|
|
|
|
error={Boolean(touched.confirmPassword && errors.confirmPassword)} |
|
|
|
|
|
/> |
|
|
|
|
|
{touched.confirmPassword && errors.confirmPassword && ( |
|
|
|
|
|
<FormHelperText error id="helper-text-confirmPassword-signup"> |
|
|
|
|
|
{errors.confirmPassword} |
|
|
|
|
|
</FormHelperText> |
|
|
|
|
|
)} |
|
|
|
|
|
</Stack> |
|
|
|
|
|
</Grid> |
|
|
</Grid> |
|
|
<Grid item xs={12} mt={1} mb={1}> |
|
|
<Grid item xs={12} mt={1} mb={1}> |
|
|
<Stack direction="column" justifyContent="space-between" alignItems="baseline" sx={{ mb: { xs: -0.5, sm: 0.5 } }}> |
|
|
<Stack direction="column" justifyContent="space-between" alignItems="baseline" sx={{ mb: { xs: -0.5, sm: 0.5 } }}> |
|
@@ -314,7 +322,7 @@ const CustomFormWizard = (props) => { |
|
|
</Select> |
|
|
</Select> |
|
|
</Stack> |
|
|
</Stack> |
|
|
</Grid> |
|
|
</Grid> |
|
|
<Grid item xs={12} md={6}> |
|
|
|
|
|
|
|
|
<Grid item xs={12} md={5}> |
|
|
<Stack spacing={1}> |
|
|
<Stack spacing={1}> |
|
|
<OutlinedInput |
|
|
<OutlinedInput |
|
|
id="idNo-login" |
|
|
id="idNo-login" |
|
@@ -325,6 +333,7 @@ const CustomFormWizard = (props) => { |
|
|
onChange={handleChange} |
|
|
onChange={handleChange} |
|
|
placeholder="證件號碼" |
|
|
placeholder="證件號碼" |
|
|
fullWidth |
|
|
fullWidth |
|
|
|
|
|
sx={{mr:1}} |
|
|
error={Boolean(touched.idNo && errors.idNo)} |
|
|
error={Boolean(touched.idNo && errors.idNo)} |
|
|
/> |
|
|
/> |
|
|
{touched.idNo && errors.idNo && ( |
|
|
{touched.idNo && errors.idNo && ( |
|
@@ -334,6 +343,27 @@ const CustomFormWizard = (props) => { |
|
|
)} |
|
|
)} |
|
|
</Stack> |
|
|
</Stack> |
|
|
</Grid> |
|
|
</Grid> |
|
|
|
|
|
<Grid item xs={12} md={1}> |
|
|
|
|
|
<Stack spacing={1}> |
|
|
|
|
|
<OutlinedInput |
|
|
|
|
|
id="checkDigit-login" |
|
|
|
|
|
type="text" |
|
|
|
|
|
value={values.checkDigit} |
|
|
|
|
|
name="checkDigit" |
|
|
|
|
|
{...register("checkDigit")} |
|
|
|
|
|
onChange={handleChange} |
|
|
|
|
|
placeholder="( )" |
|
|
|
|
|
inputProps={{ maxLength: 1 }} |
|
|
|
|
|
fullWidth |
|
|
|
|
|
error={Boolean(touched.checkDigit && errors.checkDigit)} |
|
|
|
|
|
/> |
|
|
|
|
|
{touched.checkDigit && errors.checkDigit && ( |
|
|
|
|
|
<FormHelperText error id="helper-text-enName-signup"> |
|
|
|
|
|
{errors.checkDigit} |
|
|
|
|
|
</FormHelperText> |
|
|
|
|
|
)} |
|
|
|
|
|
</Stack> |
|
|
|
|
|
</Grid> |
|
|
</Grid> |
|
|
</Grid> |
|
|
</Grid> |
|
|
</Grid> |
|
|
|
|
|
|
|
|