Merge branch 'develop' of https://gitlab.com/witel-front-end/loan-facilities/user into bugfix/mohammad_show_debug
This commit is contained in:
@@ -16,6 +16,7 @@ import DoneIcon from '@mui/icons-material/Done';
|
||||
import {NextLinkComposed} from "@witel/webapp-builder/dist/utils/linkRouting";
|
||||
import SvgDone from "@/core/components/svgs/SvgDone";
|
||||
import {SEND_LOAN_REQUEST_NAVGAN} from "@/core/data/apiRoutes";
|
||||
import moment from "jalali-moment";
|
||||
|
||||
const AddFormComponent = () => {
|
||||
const t = useTranslations();
|
||||
@@ -42,7 +43,7 @@ const AddFormComponent = () => {
|
||||
plate_part3: "",
|
||||
plate_part4: "",
|
||||
address: "",
|
||||
birthday: "",
|
||||
birthday: moment(),
|
||||
education_id: "",
|
||||
occupation_id: "",
|
||||
checkedBox: false
|
||||
@@ -169,9 +170,21 @@ const AddFormComponent = () => {
|
||||
name="national_id"
|
||||
variant="outlined"
|
||||
size="small"
|
||||
value={formik.values.national_id}
|
||||
inputProps={{inputMode: 'numeric', pattern: '[0-9]*'}}
|
||||
type={'tel'}
|
||||
onChange={formik.handleChange}
|
||||
onChange={(event) => {
|
||||
const inputValue = event.target.value;
|
||||
if (isNaN(Number(inputValue))) {
|
||||
return;
|
||||
}
|
||||
formik.handleChange({
|
||||
target: {
|
||||
name: "national_id",
|
||||
value: inputValue,
|
||||
},
|
||||
});
|
||||
}}
|
||||
label={t("LoanRequest.text_field_national_code")}
|
||||
placeholder={t(
|
||||
"LoanRequest.text_field_enter_your_national_code"
|
||||
@@ -189,6 +202,7 @@ const AddFormComponent = () => {
|
||||
name="national_serial_number"
|
||||
variant="outlined"
|
||||
size="small"
|
||||
value={formik.values.national_serial_number}
|
||||
label={t("LoanRequest.text_field_shenasname_serial")}
|
||||
placeholder={t(
|
||||
"LoanRequest.text_field_enter_your_shenasname_serial")}
|
||||
@@ -214,9 +228,21 @@ const AddFormComponent = () => {
|
||||
sx={{width: "100%"}}
|
||||
name="postal_code"
|
||||
variant="outlined"
|
||||
value={formik.values.postal_code}
|
||||
inputProps={{inputMode: 'numeric', pattern: '[0-9]*'}}
|
||||
type={'tel'}
|
||||
onChange={formik.handleChange}
|
||||
onChange={(event) => {
|
||||
const inputValue = event.target.value;
|
||||
if (isNaN(Number(inputValue))) {
|
||||
return;
|
||||
}
|
||||
formik.handleChange({
|
||||
target: {
|
||||
name: "postal_code",
|
||||
value: inputValue,
|
||||
},
|
||||
});
|
||||
}}
|
||||
size="small"
|
||||
label={t("LoanRequest.text_field_postal_code")}
|
||||
placeholder={t("LoanRequest.text_field_enter_your_postal_code")}
|
||||
@@ -264,6 +290,7 @@ const AddFormComponent = () => {
|
||||
name="navgan_type"
|
||||
label={t("LoanRequest.text_field_navgan_type")}
|
||||
size="small"
|
||||
value={formik.values.navgan_type}
|
||||
selectType="navgan_type"
|
||||
selectors={[
|
||||
{
|
||||
@@ -300,6 +327,7 @@ const AddFormComponent = () => {
|
||||
variant="outlined"
|
||||
inputProps={{inputMode: 'numeric', pattern: '[0-9]*'}}
|
||||
type={'tel'}
|
||||
value={formik.values.navgan_id}
|
||||
onChange={formik.handleChange}
|
||||
size="small"
|
||||
label={t("LoanRequest.text_field_navgan_id")}
|
||||
@@ -323,6 +351,7 @@ const AddFormComponent = () => {
|
||||
selectors={provinceList}
|
||||
schema={{value: 'value', name: 'name'}}
|
||||
select={formik.values.province_id}
|
||||
value={formik.values.province_id}
|
||||
handleChange={(event) => {
|
||||
formik.setFieldValue('province_id', event.target.value);
|
||||
setProvinceID(event.target.value)
|
||||
@@ -345,6 +374,7 @@ const AddFormComponent = () => {
|
||||
disabled={cityList.length === 0}
|
||||
selectors={cityList}
|
||||
select={formik.values.city_id}
|
||||
value={formik.values.city_id}
|
||||
handleChange={(event) => formik.setFieldValue('city_id', event.target.value)}
|
||||
setFieldTouched={formik.setFieldTouched}
|
||||
error={formik.touched.city_id && Boolean(formik.errors.city_id)}
|
||||
@@ -359,6 +389,7 @@ const AddFormComponent = () => {
|
||||
name="vehicle_type"
|
||||
label={t("LoanRequest.text_field_vehicle_type")}
|
||||
size="small"
|
||||
value={formik.values.vehicle_type}
|
||||
schema={{value: 'value', name: 'name'}}
|
||||
selectType="vehicle_type"
|
||||
selectors={[
|
||||
@@ -400,6 +431,7 @@ const AddFormComponent = () => {
|
||||
selectType="education_id"
|
||||
selectors={educationsList}
|
||||
select={formik.values.education_id}
|
||||
value={formik.values.education_id}
|
||||
schema={{value: 'id', name: 'title'}}
|
||||
handleChange={(event) => {
|
||||
formik.setFieldValue('education_id', event.target.value)
|
||||
@@ -421,6 +453,7 @@ const AddFormComponent = () => {
|
||||
schema={{value: 'id', name: 'title'}}
|
||||
selectors={occupationsList}
|
||||
select={formik.values.occupation_id}
|
||||
value={formik.values.occupation_id}
|
||||
handleChange={(event) => {
|
||||
formik.setFieldValue('occupation_id', event.target.value)
|
||||
}}
|
||||
@@ -443,6 +476,7 @@ const AddFormComponent = () => {
|
||||
label={t("LoanRequest.text_field_address")}
|
||||
placeholder={t("LoanRequest.text_field_enter_your_address")}
|
||||
fullWidth
|
||||
value={formik.values.address}
|
||||
onChange={formik.handleChange}
|
||||
onBlur={formik.handleBlur("address")}
|
||||
error={formik.touched.address && Boolean(formik.errors.address)}
|
||||
|
||||
@@ -142,7 +142,12 @@ const PlateNumber = ({formik, disabled}) => {
|
||||
size={'small'}
|
||||
placeholder={'xx'} sx={{flexGrow: 2, "& fieldset": {border: 'none'}}}
|
||||
inputProps={{sx: {textAlign: 'center'}}}
|
||||
onChange={(event) => event.target.value.length <= 2 ? formik.setFieldValue("plate_part4", event.target.value) : null}
|
||||
onChange={(event) => {
|
||||
if (isNaN(Number(event.target.value))) {
|
||||
return;
|
||||
}
|
||||
event.target.value.length <= 2 ? formik.setFieldValue("plate_part4", event.target.value) : null
|
||||
}}
|
||||
onBlur={formik.handleBlur}
|
||||
error={formik.touched.plate_part4 && Boolean(formik.errors.plate_part4)}
|
||||
/>
|
||||
@@ -161,7 +166,12 @@ const PlateNumber = ({formik, disabled}) => {
|
||||
"& fieldset": {border: 'none'}
|
||||
}}
|
||||
inputProps={{sx: {textAlign: 'center'}}}
|
||||
onChange={(event) => event.target.value.length <= 3 ? formik.setFieldValue("plate_part3", event.target.value) : null}
|
||||
onChange={(event) => {
|
||||
if (isNaN(Number(event.target.value))) {
|
||||
return;
|
||||
}
|
||||
event.target.value.length <= 3 ? formik.setFieldValue("plate_part3", event.target.value) : null
|
||||
}}
|
||||
onBlur={formik.handleBlur}
|
||||
error={formik.touched.plate_part3 && Boolean(formik.errors.plate_part3)}
|
||||
/>
|
||||
@@ -217,7 +227,12 @@ const PlateNumber = ({formik, disabled}) => {
|
||||
placeholder={'xx'}
|
||||
sx={{flexGrow: 2, "& fieldset": {border: 'none'}}}
|
||||
inputProps={{sx: {textAlign: 'center'}}}
|
||||
onChange={(event) => event.target.value.length <= 2 ? formik.setFieldValue("plate_part1", event.target.value) : null}
|
||||
onChange={(event) => {
|
||||
if (isNaN(Number(event.target.value))) {
|
||||
return;
|
||||
}
|
||||
event.target.value.length <= 2 ? formik.setFieldValue("plate_part1", event.target.value) : null
|
||||
}}
|
||||
onBlur={formik.handleBlur}
|
||||
error={true}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user