validation on national traking code
This commit is contained in:
@@ -161,6 +161,9 @@
|
||||
"national_number_number": "شناسه ملی شرکت می بایست شامل اعداد باشد",
|
||||
"national_code_max": "کد ملی می بایست 10 رقم باشد",
|
||||
"national_serial_number_max": "سریال پشت کارت ملی می بایست 10 رقم باشد",
|
||||
"boss_national_serial_number_max": "سریال پشت کارت ملی مدیر عامل می بایست 10 رقم باشد",
|
||||
"national_tracking_code_max": "کد رهگیری کارت ملی می بایست 10 رقم باشد",
|
||||
"national_boss_tracking_code_max": "کد رهگیری کارت ملی مدیر عامل می بایست 10 رقم باشد",
|
||||
"boss_national_code_max": "کد ملی مدیر عامل می بایست 10 رقم باشد",
|
||||
"national_number_max": "شناسه ملی شرکت می بایست 11 رقم باشد",
|
||||
"shenasname_serial_max": "سریال پشت کارت ملی می بایست شامل 10 بخش باشد",
|
||||
@@ -196,6 +199,7 @@
|
||||
"error_message_national_number": "لطفا شناسه ملی شرکت خود را وارد کنید!",
|
||||
"error_message_date_of_birth": "لطفا تاریخ تولد خود را وارد کنید!",
|
||||
"error_message_shenasname_serial": "لطفا سریال پشت کارت ملی خود را وارد کنید!",
|
||||
"error_message_boss_shenasname_serial": "لطفا سریال پشت کارت ملی مدیر عامل را وارد کنید!",
|
||||
"error_message_boss_national_serial_number": "لطفا سریال پشت کارت ملی مدیر عامل را وارد کنید!",
|
||||
"error_message_tracking_code": "لطفا کد رهگیری کارت ملی خود را وارد کنید!",
|
||||
"error_message_boss_national_card_tracking_code": "لطفا کد رهگیری کارت ملی مدیر عامل را وارد کنید!",
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
ToggleButton,
|
||||
ToggleButtonGroup,
|
||||
} from "@mui/material";
|
||||
import { useTranslations } from "next-intl";
|
||||
import {useTranslations} from "next-intl";
|
||||
import useCities from "@/lib/app/hooks/useCities";
|
||||
import UseEducations from "@/lib/app/hooks/useEducations";
|
||||
import useOccupations from "@/lib/app/hooks/useOccupations";
|
||||
@@ -16,29 +16,29 @@ import * as React from "react";
|
||||
import SelectBox from "@/core/components/SelectBox";
|
||||
import useLimitedProvince from "@/lib/app/hooks/useLimitedProvince";
|
||||
import PlateNumber from "@/core/components/PlateNumber";
|
||||
import { useRouter } from "next/router";
|
||||
import { useRequest, useUser } from "@witel/webapp-builder";
|
||||
import {useRouter} from "next/router";
|
||||
import {useRequest, useUser} from "@witel/webapp-builder";
|
||||
import * as Yup from "yup";
|
||||
import { SEND_LOAN_REQUEST_NAVGAN } from "@/core/data/apiRoutes";
|
||||
import {SEND_LOAN_REQUEST_NAVGAN} from "@/core/data/apiRoutes";
|
||||
import DataSaverOnIcon from "@mui/icons-material/DataSaverOn";
|
||||
import { useFormik } from "formik";
|
||||
import {useFormik} from "formik";
|
||||
import LegalPersonDatePicker from "@/components/dashboard/navgan/add-request-loan/forms/LegalPersonDatePicker";
|
||||
import useProjectTitle from "@/lib/app/hooks/useProjectTitle";
|
||||
import useActivityType from "@/lib/app/hooks/useActivityType";
|
||||
import usePriorityLists from "@/lib/app/hooks/usePriorityLists";
|
||||
|
||||
const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
const LegalPersonForm = ({setFinishLoanRequest}) => {
|
||||
const t = useTranslations();
|
||||
const router = useRouter();
|
||||
const requestServer = useRequest();
|
||||
const { getUser, changeUser } = useUser();
|
||||
const { cityTextField, cityList, setProvinceID, isLoadingCityList } = useCities();
|
||||
const { provinceList, isLoadingProvinceList, errorProvinceList } = useLimitedProvince();
|
||||
const { educationsList, isLoadingEducationsList, errorEducationsList } = UseEducations();
|
||||
const { occupationsList, isLoadingOccupationsList, errorOccupationsList } = useOccupations();
|
||||
const { activityType, isLoadingActivityType, errorActivityType } = useActivityType();
|
||||
const { priorityLists, isLoadingPriorityLists, errorPriorityLists } = usePriorityLists();
|
||||
const { projectTitle, isLoadingProjectTitle, errorProjectTitle } = useProjectTitle();
|
||||
const {getUser, changeUser} = useUser();
|
||||
const {cityTextField, cityList, setProvinceID, isLoadingCityList} = useCities();
|
||||
const {provinceList, isLoadingProvinceList, errorProvinceList} = useLimitedProvince();
|
||||
const {educationsList, isLoadingEducationsList, errorEducationsList} = UseEducations();
|
||||
const {occupationsList, isLoadingOccupationsList, errorOccupationsList} = useOccupations();
|
||||
const {activityType, isLoadingActivityType, errorActivityType} = useActivityType();
|
||||
const {priorityLists, isLoadingPriorityLists, errorPriorityLists} = usePriorityLists();
|
||||
const {projectTitle, isLoadingProjectTitle, errorProjectTitle} = useProjectTitle();
|
||||
|
||||
const initialValues = {
|
||||
person_type: "legal",
|
||||
@@ -120,32 +120,35 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
national_number: Yup.mixed().when("person_type", ([person_type], schema) => {
|
||||
return person_type === "legal"
|
||||
? schema
|
||||
.test("is-number", `${t("LoanRequest.national_number_number")}`, (value) => !isNaN(value))
|
||||
.test("positive", `${t("LoanRequest.national_number_positive")}`, (value) => value >= 0)
|
||||
.test(
|
||||
"max",
|
||||
`${t("LoanRequest.national_number_max")}`,
|
||||
(value) => value && value.toString().length === 11
|
||||
)
|
||||
.required(t("LoanRequest.error_message_national_number"))
|
||||
.test("is-number", `${t("LoanRequest.national_number_number")}`, (value) => !isNaN(value))
|
||||
.test("positive", `${t("LoanRequest.national_number_positive")}`, (value) => value >= 0)
|
||||
.test(
|
||||
"max",
|
||||
`${t("LoanRequest.national_number_max")}`,
|
||||
(value) => value && value.toString().length === 11
|
||||
)
|
||||
.required(t("LoanRequest.error_message_national_number"))
|
||||
: schema;
|
||||
}),
|
||||
boss_national_serial_number: Yup.string()
|
||||
.test(
|
||||
"max",
|
||||
`${t("LoanRequest.national_serial_number_max")}`,
|
||||
(value) => value && value.toString().length === 10
|
||||
)
|
||||
.when("national_serial_number_or_tracking_code", ([national_serial_number_or_tracking_code], schema) => {
|
||||
return national_serial_number_or_tracking_code === "national_serial_number"
|
||||
? schema.required(t("LoanRequest.error_message_shenasname_serial"))
|
||||
? schema.test(
|
||||
"max",
|
||||
`${t("LoanRequest.boss_national_serial_number_max")}`,
|
||||
(value) => value && value.toString().length === 10
|
||||
).required(t("LoanRequest.error_message_boss_shenasname_serial"))
|
||||
: schema;
|
||||
}),
|
||||
boss_national_card_tracking_code: Yup.string().when(
|
||||
"national_serial_number_or_tracking_code",
|
||||
([national_serial_number_or_tracking_code], schema) => {
|
||||
return national_serial_number_or_tracking_code === "national_card_tracking_code"
|
||||
? schema.required(t("LoanRequest.error_message_boss_national_card_tracking_code"))
|
||||
? schema.test(
|
||||
"max",
|
||||
`${t("LoanRequest.national_boss_tracking_code_max")}`,
|
||||
(value) => value && value.toString().length === 10
|
||||
).required(t("LoanRequest.error_message_boss_national_card_tracking_code"))
|
||||
: schema;
|
||||
}
|
||||
),
|
||||
@@ -156,18 +159,18 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
let _national_number =
|
||||
values.person_type === "legal"
|
||||
? {
|
||||
shenase_meli: values.national_number,
|
||||
}
|
||||
shenase_meli: values.national_number,
|
||||
}
|
||||
: {};
|
||||
|
||||
const _national_card =
|
||||
values.national_serial_number_or_tracking_code === "national_serial_number"
|
||||
? {
|
||||
national_serial_number: values.boss_national_serial_number,
|
||||
}
|
||||
national_serial_number: values.boss_national_serial_number,
|
||||
}
|
||||
: {
|
||||
national_tracking_code: values.boss_national_card_tracking_code,
|
||||
};
|
||||
national_tracking_code: values.boss_national_card_tracking_code,
|
||||
};
|
||||
|
||||
let _data = {
|
||||
is_legal_person: 1,
|
||||
@@ -194,6 +197,7 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
plate_part4: values.plate_part4,
|
||||
address: values.address,
|
||||
company_register_date: values.company_date.locale("en").format("YYYY-MM-DD"),
|
||||
birthday: values.company_date.locale("en").format("YYYY-MM-DD"),
|
||||
education_id: values.education_id,
|
||||
occupation_id: values.occupation_id,
|
||||
..._national_card,
|
||||
@@ -211,7 +215,8 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
changeUser(data);
|
||||
});
|
||||
})
|
||||
.catch(() => {})
|
||||
.catch(() => {
|
||||
})
|
||||
.finally(() => {
|
||||
props.setSubmitting(false);
|
||||
});
|
||||
@@ -224,7 +229,7 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
});
|
||||
return (
|
||||
<>
|
||||
<Grid container spacing={2} sx={{ p: 2 }}>
|
||||
<Grid container spacing={2} sx={{p: 2}}>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<SelectBox
|
||||
name="project_title"
|
||||
@@ -234,7 +239,7 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
isLoading={isLoadingProjectTitle}
|
||||
errorEcured={errorProjectTitle}
|
||||
selectors={projectTitle}
|
||||
schema={{ value: "name", name: "name" }}
|
||||
schema={{value: "name", name: "name"}}
|
||||
select={formik.values.project_title}
|
||||
value={formik.values.project_title}
|
||||
handleChange={(event) => {
|
||||
@@ -255,7 +260,7 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
isLoading={isLoadingActivityType}
|
||||
errorEcured={errorActivityType}
|
||||
selectors={activityType}
|
||||
schema={{ value: "value", name: "name" }}
|
||||
schema={{value: "value", name: "name"}}
|
||||
select={formik.values.activity_type}
|
||||
value={formik.values.activity_type}
|
||||
handleChange={(event) => {
|
||||
@@ -276,7 +281,7 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
isLoading={isLoadingPriorityLists}
|
||||
errorEcured={errorPriorityLists}
|
||||
selectors={priorityLists}
|
||||
schema={{ value: "value", name: "name" }}
|
||||
schema={{value: "value", name: "name"}}
|
||||
select={formik.values.priority_list}
|
||||
value={formik.values.priority_list}
|
||||
handleChange={(event) => {
|
||||
@@ -289,15 +294,15 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ p: 2 }}>
|
||||
<Grid container spacing={2} sx={{p: 2}}>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
sx={{width: "100%"}}
|
||||
name="national_number"
|
||||
variant="outlined"
|
||||
size="small"
|
||||
value={formik.values.national_number}
|
||||
inputProps={{ inputMode: "numeric", pattern: "[0-9]*" }}
|
||||
inputProps={{inputMode: "numeric", pattern: "[0-9]*"}}
|
||||
type={"tel"}
|
||||
onChange={(event) => {
|
||||
const inputValue = event.target.value;
|
||||
@@ -321,7 +326,7 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
sx={{width: "100%"}}
|
||||
name="company_name"
|
||||
variant="outlined"
|
||||
size="small"
|
||||
@@ -337,12 +342,12 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
sx={{width: "100%"}}
|
||||
name="register_number"
|
||||
variant="outlined"
|
||||
size="small"
|
||||
value={formik.values.register_number}
|
||||
inputProps={{ inputMode: "numeric", pattern: "[0-9]*" }}
|
||||
inputProps={{inputMode: "numeric", pattern: "[0-9]*"}}
|
||||
type={"tel"}
|
||||
onChange={(event) => {
|
||||
const inputValue = event.target.value;
|
||||
@@ -365,14 +370,14 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid container spacing={2} sx={{padding: 2}}>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
sx={{width: "100%"}}
|
||||
name="company_postal_code"
|
||||
variant="outlined"
|
||||
value={formik.values.company_postal_code}
|
||||
inputProps={{ inputMode: "numeric", pattern: "[0-9]*" }}
|
||||
inputProps={{inputMode: "numeric", pattern: "[0-9]*"}}
|
||||
type={"tel"}
|
||||
onChange={(event) => {
|
||||
const inputValue = event.target.value;
|
||||
@@ -397,11 +402,11 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
sx={{width: "100%"}}
|
||||
name="company_tel_number"
|
||||
variant="outlined"
|
||||
value={formik.values.company_tel_number}
|
||||
inputProps={{ inputMode: "numeric", pattern: "[0-9]*" }}
|
||||
inputProps={{inputMode: "numeric", pattern: "[0-9]*"}}
|
||||
type={"tel"}
|
||||
size="small"
|
||||
onChange={(event) => {
|
||||
@@ -433,7 +438,7 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid container spacing={2} sx={{padding: 2}}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<SelectBox
|
||||
name="province_id"
|
||||
@@ -443,7 +448,7 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
isLoading={isLoadingProvinceList}
|
||||
errorEcured={errorProvinceList}
|
||||
selectors={provinceList}
|
||||
schema={{ value: "value", name: "name" }}
|
||||
schema={{value: "value", name: "name"}}
|
||||
select={formik.values.province_id}
|
||||
value={formik.values.province_id}
|
||||
handleChange={(event) => {
|
||||
@@ -465,12 +470,12 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
isLoadingCityList
|
||||
? `${t("LoanRequest.cityList_loading")}`
|
||||
: cityList.length === 0
|
||||
? `${t("LoanRequest.cityList_empty")}`
|
||||
: cityTextField
|
||||
? `${t("LoanRequest.cityList_empty")}`
|
||||
: cityTextField
|
||||
}
|
||||
size="small"
|
||||
selectType="city_id"
|
||||
schema={{ value: "value", name: "name" }}
|
||||
schema={{value: "value", name: "name"}}
|
||||
disabled={cityList.length === 0}
|
||||
selectors={cityList}
|
||||
select={formik.values.city_id}
|
||||
@@ -483,15 +488,15 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid container spacing={2} sx={{padding: 2}}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
sx={{width: "100%"}}
|
||||
name="boss_national_code"
|
||||
variant="outlined"
|
||||
size="small"
|
||||
value={formik.values.boss_national_code}
|
||||
inputProps={{ inputMode: "numeric", pattern: "[0-9]*" }}
|
||||
inputProps={{inputMode: "numeric", pattern: "[0-9]*"}}
|
||||
type={"tel"}
|
||||
onChange={(event) => {
|
||||
const inputValue = event.target.value;
|
||||
@@ -532,7 +537,7 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
name: "مرد",
|
||||
},
|
||||
]}
|
||||
schema={{ value: "value", name: "name" }}
|
||||
schema={{value: "value", name: "name"}}
|
||||
select={formik.values.boss_gender}
|
||||
handleChange={(event) => {
|
||||
formik.setFieldValue("boss_gender", event.target.value);
|
||||
@@ -544,10 +549,10 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid container spacing={2} sx={{padding: 2}}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
sx={{width: "100%"}}
|
||||
name="boss_first_name"
|
||||
variant="outlined"
|
||||
size="small"
|
||||
@@ -563,7 +568,7 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
sx={{width: "100%"}}
|
||||
name="boss_last_name"
|
||||
variant="outlined"
|
||||
size="small"
|
||||
@@ -578,7 +583,7 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid container spacing={2} sx={{padding: 2}}>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<ToggleButtonGroup
|
||||
color="primary"
|
||||
@@ -607,7 +612,7 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
{formik.values.national_serial_number_or_tracking_code === "national_serial_number" ? (
|
||||
<Grid item xs={12} sm={4}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
sx={{width: "100%"}}
|
||||
name="boss_national_serial_number"
|
||||
variant="outlined"
|
||||
size="small"
|
||||
@@ -629,7 +634,7 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
) : (
|
||||
<Grid item xs={12} sm={4}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
sx={{width: "100%"}}
|
||||
name="boss_national_card_tracking_code"
|
||||
variant="outlined"
|
||||
size="small"
|
||||
@@ -652,7 +657,7 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
)}
|
||||
<Grid item xs={12} sm={4}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
sx={{width: "100%"}}
|
||||
name="boss_father_name"
|
||||
variant="outlined"
|
||||
value={formik.values.boss_father_name}
|
||||
@@ -667,7 +672,7 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid container spacing={2} sx={{padding: 2}}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<SelectBox
|
||||
name="navgan_type"
|
||||
@@ -692,7 +697,7 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
name: "منطقه آزاد",
|
||||
},
|
||||
]}
|
||||
schema={{ value: "value", name: "name" }}
|
||||
schema={{value: "value", name: "name"}}
|
||||
select={formik.values.navgan_type}
|
||||
handleChange={(event) => {
|
||||
formik.setFieldValue("navgan_type", event.target.value);
|
||||
@@ -705,10 +710,10 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
sx={{width: "100%"}}
|
||||
name="navgan_id"
|
||||
variant="outlined"
|
||||
inputProps={{ inputMode: "numeric", pattern: "[0-9]*" }}
|
||||
inputProps={{inputMode: "numeric", pattern: "[0-9]*"}}
|
||||
type={"tel"}
|
||||
value={formik.values.navgan_id}
|
||||
onChange={formik.handleChange}
|
||||
@@ -722,14 +727,14 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid container spacing={2} sx={{padding: 2}}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<SelectBox
|
||||
name="vehicle_type"
|
||||
label={t("LoanRequest.text_field_vehicle_type")}
|
||||
size="small"
|
||||
value={formik.values.vehicle_type}
|
||||
schema={{ value: "value", name: "name" }}
|
||||
schema={{value: "value", name: "name"}}
|
||||
selectType="vehicle_type"
|
||||
selectors={[
|
||||
{
|
||||
@@ -751,10 +756,10 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<PlateNumber formik={formik} />
|
||||
<PlateNumber formik={formik}/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid container spacing={2} sx={{padding: 2}}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<SelectBox
|
||||
name="education_id"
|
||||
@@ -766,7 +771,7 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
selectors={educationsList}
|
||||
select={formik.values.education_id}
|
||||
value={formik.values.education_id}
|
||||
schema={{ value: "id", name: "title" }}
|
||||
schema={{value: "id", name: "title"}}
|
||||
handleChange={(event) => {
|
||||
formik.setFieldValue("education_id", event.target.value);
|
||||
}}
|
||||
@@ -784,7 +789,7 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
isLoading={isLoadingOccupationsList}
|
||||
errorEcured={errorOccupationsList}
|
||||
selectType="occupation_id"
|
||||
schema={{ value: "id", name: "title" }}
|
||||
schema={{value: "id", name: "title"}}
|
||||
selectors={occupationsList}
|
||||
select={formik.values.occupation_id}
|
||||
value={formik.values.occupation_id}
|
||||
@@ -798,12 +803,12 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid container spacing={2} sx={{padding: 2}}>
|
||||
<Grid item xs={12}>
|
||||
<TextField
|
||||
multiline
|
||||
rows={4}
|
||||
sx={{ width: "100%" }}
|
||||
sx={{width: "100%"}}
|
||||
name="address"
|
||||
variant="outlined"
|
||||
size="small"
|
||||
@@ -818,7 +823,7 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid container spacing={2} sx={{padding: 2}}>
|
||||
<Grid item xs={12}>
|
||||
<FormControlLabel
|
||||
color={"error.main"}
|
||||
@@ -837,10 +842,10 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
flexDirection: { xs: "column", sm: "row" },
|
||||
flexDirection: {xs: "column", sm: "row"},
|
||||
alignItems: "center",
|
||||
mx: "auto",
|
||||
width: { xs: "100%", sm: "30%", md: "25%" },
|
||||
width: {xs: "100%", sm: "30%", md: "25%"},
|
||||
}}
|
||||
>
|
||||
<Button
|
||||
@@ -849,8 +854,8 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
type="submit"
|
||||
variant="contained"
|
||||
size="large"
|
||||
sx={{ my: 4 }}
|
||||
endIcon={<DataSaverOnIcon />}
|
||||
sx={{my: 4}}
|
||||
endIcon={<DataSaverOnIcon/>}
|
||||
disabled={formik.values.checkedBox ? formik.isSubmitting || !formik.dirty || !formik.isValid : true}
|
||||
>
|
||||
{formik.isSubmitting ? t("LoanRequest.button_while_submit") : t("LoanRequest.button_submit")}
|
||||
|
||||
@@ -10,15 +10,15 @@ import {
|
||||
} from "@mui/material";
|
||||
import SelectBox from "@/core/components/SelectBox";
|
||||
import MuiDatePicker from "@/core/components/MuiDatePicker";
|
||||
import { useTranslations } from "next-intl";
|
||||
import {useTranslations} from "next-intl";
|
||||
import useLimitedProvince from "@/lib/app/hooks/useLimitedProvince";
|
||||
import useCities from "@/lib/app/hooks/useCities";
|
||||
import { useFormik } from "formik";
|
||||
import {useFormik} from "formik";
|
||||
import * as Yup from "yup";
|
||||
import DataSaverOnIcon from "@mui/icons-material/DataSaverOn";
|
||||
import { SEND_LOAN_REQUEST_NAVGAN } from "@/core/data/apiRoutes";
|
||||
import { useRequest, useUser } from "@witel/webapp-builder";
|
||||
import { useRouter } from "next/router";
|
||||
import {SEND_LOAN_REQUEST_NAVGAN} from "@/core/data/apiRoutes";
|
||||
import {useRequest, useUser} from "@witel/webapp-builder";
|
||||
import {useRouter} from "next/router";
|
||||
import PlateNumber from "@/core/components/PlateNumber";
|
||||
import * as React from "react";
|
||||
import UseEducations from "@/lib/app/hooks/useEducations";
|
||||
@@ -27,17 +27,17 @@ import useActivityType from "@/lib/app/hooks/useActivityType";
|
||||
import usePriorityLists from "@/lib/app/hooks/usePriorityLists";
|
||||
import useProjectTitle from "@/lib/app/hooks/useProjectTitle";
|
||||
|
||||
const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
const RealPersonForm = ({setFinishLoanRequest}) => {
|
||||
const t = useTranslations();
|
||||
const { provinceList, isLoadingProvinceList, errorProvinceList } = useLimitedProvince();
|
||||
const { cityTextField, cityList, setProvinceID, isLoadingCityList } = useCities();
|
||||
const { educationsList, isLoadingEducationsList, errorEducationsList } = UseEducations();
|
||||
const { occupationsList, isLoadingOccupationsList, errorOccupationsList } = useOccupations();
|
||||
const { activityType, isLoadingActivityType, errorActivityType } = useActivityType();
|
||||
const { priorityLists, isLoadingPriorityLists, errorPriorityLists } = usePriorityLists();
|
||||
const { projectTitle, isLoadingProjectTitle, errorProjectTitle } = useProjectTitle();
|
||||
const {provinceList, isLoadingProvinceList, errorProvinceList} = useLimitedProvince();
|
||||
const {cityTextField, cityList, setProvinceID, isLoadingCityList} = useCities();
|
||||
const {educationsList, isLoadingEducationsList, errorEducationsList} = UseEducations();
|
||||
const {occupationsList, isLoadingOccupationsList, errorOccupationsList} = useOccupations();
|
||||
const {activityType, isLoadingActivityType, errorActivityType} = useActivityType();
|
||||
const {priorityLists, isLoadingPriorityLists, errorPriorityLists} = usePriorityLists();
|
||||
const {projectTitle, isLoadingProjectTitle, errorProjectTitle} = useProjectTitle();
|
||||
const requestServer = useRequest();
|
||||
const { getUser, changeUser } = useUser();
|
||||
const {getUser, changeUser} = useUser();
|
||||
const router = useRouter();
|
||||
|
||||
const initialValues = {
|
||||
@@ -115,32 +115,35 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
national_number: Yup.mixed().when("person_type", ([person_type], schema) => {
|
||||
return person_type === "legal"
|
||||
? schema
|
||||
.test("is-number", `${t("LoanRequest.national_number_number")}`, (value) => !isNaN(value))
|
||||
.test("positive", `${t("LoanRequest.national_number_positive")}`, (value) => value >= 0)
|
||||
.test(
|
||||
"max",
|
||||
`${t("LoanRequest.national_number_max")}`,
|
||||
(value) => value && value.toString().length === 11
|
||||
)
|
||||
.required(t("LoanRequest.error_message_national_number"))
|
||||
.test("is-number", `${t("LoanRequest.national_number_number")}`, (value) => !isNaN(value))
|
||||
.test("positive", `${t("LoanRequest.national_number_positive")}`, (value) => value >= 0)
|
||||
.test(
|
||||
"max",
|
||||
`${t("LoanRequest.national_number_max")}`,
|
||||
(value) => value && value.toString().length === 11
|
||||
)
|
||||
.required(t("LoanRequest.error_message_national_number"))
|
||||
: schema;
|
||||
}),
|
||||
national_serial_number: Yup.string()
|
||||
.test(
|
||||
"max",
|
||||
`${t("LoanRequest.national_serial_number_max")}`,
|
||||
(value) => value && value.toString().length === 10
|
||||
)
|
||||
.when("national_serial_number_or_tracking_code", ([national_serial_number_or_tracking_code], schema) => {
|
||||
return national_serial_number_or_tracking_code === "national_serial_number"
|
||||
? schema.required(t("LoanRequest.error_message_shenasname_serial"))
|
||||
? schema.test(
|
||||
"max",
|
||||
`${t("LoanRequest.national_serial_number_max")}`,
|
||||
(value) => value && value.toString().length === 10
|
||||
).required(t("LoanRequest.error_message_shenasname_serial"))
|
||||
: schema;
|
||||
}),
|
||||
national_card_tracking_code: Yup.string().when(
|
||||
"national_serial_number_or_tracking_code",
|
||||
([national_serial_number_or_tracking_code], schema) => {
|
||||
return national_serial_number_or_tracking_code === "national_card_tracking_code"
|
||||
? schema.required(t("LoanRequest.error_message_tracking_code"))
|
||||
? schema.test(
|
||||
"max",
|
||||
`${t("LoanRequest.national_tracking_code_max")}`,
|
||||
(value) => value && value.toString().length === 10
|
||||
).required(t("LoanRequest.error_message_tracking_code"))
|
||||
: schema;
|
||||
}
|
||||
),
|
||||
@@ -151,18 +154,18 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
let _national_number =
|
||||
values.person_type === "legal"
|
||||
? {
|
||||
shenase_meli: values.national_number,
|
||||
}
|
||||
shenase_meli: values.national_number,
|
||||
}
|
||||
: {};
|
||||
|
||||
const _national_card =
|
||||
values.national_serial_number_or_tracking_code === "national_serial_number"
|
||||
? {
|
||||
national_serial_number: values.national_serial_number,
|
||||
}
|
||||
national_serial_number: values.national_serial_number,
|
||||
}
|
||||
: {
|
||||
national_tracking_code: values.national_card_tracking_code,
|
||||
};
|
||||
national_tracking_code: values.national_card_tracking_code,
|
||||
};
|
||||
|
||||
let _data = {
|
||||
is_legal_person: 0,
|
||||
@@ -204,7 +207,8 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
changeUser(data);
|
||||
});
|
||||
})
|
||||
.catch(() => {})
|
||||
.catch(() => {
|
||||
})
|
||||
.finally(() => {
|
||||
props.setSubmitting(false);
|
||||
});
|
||||
@@ -216,9 +220,10 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
onSubmit: handleSubmit,
|
||||
});
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<Grid container spacing={2} sx={{ p: 2 }}>
|
||||
<Grid container spacing={2} sx={{p: 2}}>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<SelectBox
|
||||
name="project_title"
|
||||
@@ -228,7 +233,7 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
isLoading={isLoadingProjectTitle}
|
||||
errorEcured={errorProjectTitle}
|
||||
selectors={projectTitle}
|
||||
schema={{ value: "name", name: "name" }}
|
||||
schema={{value: "name", name: "name"}}
|
||||
select={formik.values.project_title}
|
||||
value={formik.values.project_title}
|
||||
handleChange={(event) => {
|
||||
@@ -249,7 +254,7 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
isLoading={isLoadingActivityType}
|
||||
errorEcured={errorActivityType}
|
||||
selectors={activityType}
|
||||
schema={{ value: "value", name: "name" }}
|
||||
schema={{value: "value", name: "name"}}
|
||||
select={formik.values.activity_type}
|
||||
value={formik.values.activity_type}
|
||||
handleChange={(event) => {
|
||||
@@ -270,7 +275,7 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
isLoading={isLoadingPriorityLists}
|
||||
errorEcured={errorPriorityLists}
|
||||
selectors={priorityLists}
|
||||
schema={{ value: "value", name: "name" }}
|
||||
schema={{value: "value", name: "name"}}
|
||||
select={formik.values.priority_list}
|
||||
value={formik.values.priority_list}
|
||||
handleChange={(event) => {
|
||||
@@ -283,7 +288,7 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid container spacing={2} sx={{padding: 2}}>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<ToggleButtonGroup
|
||||
color="primary"
|
||||
@@ -312,7 +317,7 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
{formik.values.national_serial_number_or_tracking_code === "national_serial_number" ? (
|
||||
<Grid item xs={12} sm={4}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
sx={{width: "100%"}}
|
||||
name="national_serial_number"
|
||||
variant="outlined"
|
||||
size="small"
|
||||
@@ -331,7 +336,7 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
) : (
|
||||
<Grid item xs={12} sm={4}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
sx={{width: "100%"}}
|
||||
name="national_card_tracking_code"
|
||||
variant="outlined"
|
||||
size="small"
|
||||
@@ -353,12 +358,12 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
)}
|
||||
<Grid item xs={12} sm={4}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
sx={{width: "100%"}}
|
||||
name="national_code"
|
||||
variant="outlined"
|
||||
size="small"
|
||||
value={formik.values.national_code}
|
||||
inputProps={{ inputMode: "numeric", pattern: "[0-9]*" }}
|
||||
inputProps={{inputMode: "numeric", pattern: "[0-9]*"}}
|
||||
type={"tel"}
|
||||
onChange={(event) => {
|
||||
const inputValue = event.target.value;
|
||||
@@ -381,10 +386,10 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid container spacing={2} sx={{padding: 2}}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
sx={{width: "100%"}}
|
||||
name="first_name"
|
||||
variant="outlined"
|
||||
size="small"
|
||||
@@ -400,7 +405,7 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
sx={{width: "100%"}}
|
||||
name="last_name"
|
||||
variant="outlined"
|
||||
size="small"
|
||||
@@ -415,10 +420,10 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid container spacing={2} sx={{padding: 2}}>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
sx={{width: "100%"}}
|
||||
name="father_name"
|
||||
variant="outlined"
|
||||
value={formik.values.father_name}
|
||||
@@ -451,7 +456,7 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
name: "مرد",
|
||||
},
|
||||
]}
|
||||
schema={{ value: "value", name: "name" }}
|
||||
schema={{value: "value", name: "name"}}
|
||||
select={formik.values.gender}
|
||||
handleChange={(event) => {
|
||||
formik.setFieldValue("gender", event.target.value);
|
||||
@@ -471,14 +476,14 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid container spacing={2} sx={{padding: 2}}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
sx={{width: "100%"}}
|
||||
name="postal_code"
|
||||
variant="outlined"
|
||||
value={formik.values.postal_code}
|
||||
inputProps={{ inputMode: "numeric", pattern: "[0-9]*" }}
|
||||
inputProps={{inputMode: "numeric", pattern: "[0-9]*"}}
|
||||
type={"tel"}
|
||||
onChange={(event) => {
|
||||
const inputValue = event.target.value;
|
||||
@@ -503,11 +508,11 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
sx={{width: "100%"}}
|
||||
name="telephone_number"
|
||||
variant="outlined"
|
||||
value={formik.values.telephone_number}
|
||||
inputProps={{ inputMode: "numeric", pattern: "[0-9]*" }}
|
||||
inputProps={{inputMode: "numeric", pattern: "[0-9]*"}}
|
||||
type={"tel"}
|
||||
size="small"
|
||||
onChange={(event) => {
|
||||
@@ -531,7 +536,7 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid container spacing={2} sx={{padding: 2}}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<SelectBox
|
||||
name="navgan_type"
|
||||
@@ -556,7 +561,7 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
name: "منطقه آزاد",
|
||||
},
|
||||
]}
|
||||
schema={{ value: "value", name: "name" }}
|
||||
schema={{value: "value", name: "name"}}
|
||||
select={formik.values.navgan_type}
|
||||
handleChange={(event) => {
|
||||
formik.setFieldValue("navgan_type", event.target.value);
|
||||
@@ -569,10 +574,10 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
sx={{width: "100%"}}
|
||||
name="navgan_id"
|
||||
variant="outlined"
|
||||
inputProps={{ inputMode: "numeric", pattern: "[0-9]*" }}
|
||||
inputProps={{inputMode: "numeric", pattern: "[0-9]*"}}
|
||||
type={"tel"}
|
||||
value={formik.values.navgan_id}
|
||||
onChange={formik.handleChange}
|
||||
@@ -586,7 +591,7 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid container spacing={2} sx={{padding: 2}}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<SelectBox
|
||||
name="province_id"
|
||||
@@ -596,7 +601,7 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
isLoading={isLoadingProvinceList}
|
||||
errorEcured={errorProvinceList}
|
||||
selectors={provinceList}
|
||||
schema={{ value: "value", name: "name" }}
|
||||
schema={{value: "value", name: "name"}}
|
||||
select={formik.values.province_id}
|
||||
value={formik.values.province_id}
|
||||
handleChange={(event) => {
|
||||
@@ -618,12 +623,12 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
isLoadingCityList
|
||||
? `${t("LoanRequest.cityList_loading")}`
|
||||
: cityList.length === 0
|
||||
? `${t("LoanRequest.cityList_empty")}`
|
||||
: cityTextField
|
||||
? `${t("LoanRequest.cityList_empty")}`
|
||||
: cityTextField
|
||||
}
|
||||
size="small"
|
||||
selectType="city_id"
|
||||
schema={{ value: "value", name: "name" }}
|
||||
schema={{value: "value", name: "name"}}
|
||||
disabled={cityList.length === 0}
|
||||
selectors={cityList}
|
||||
select={formik.values.city_id}
|
||||
@@ -636,14 +641,14 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid container spacing={2} sx={{padding: 2}}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<SelectBox
|
||||
name="vehicle_type"
|
||||
label={t("LoanRequest.text_field_vehicle_type")}
|
||||
size="small"
|
||||
value={formik.values.vehicle_type}
|
||||
schema={{ value: "value", name: "name" }}
|
||||
schema={{value: "value", name: "name"}}
|
||||
selectType="vehicle_type"
|
||||
selectors={[
|
||||
{
|
||||
@@ -665,10 +670,10 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<PlateNumber formik={formik} />
|
||||
<PlateNumber formik={formik}/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid container spacing={2} sx={{padding: 2}}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<SelectBox
|
||||
name="education_id"
|
||||
@@ -680,7 +685,7 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
selectors={educationsList}
|
||||
select={formik.values.education_id}
|
||||
value={formik.values.education_id}
|
||||
schema={{ value: "id", name: "title" }}
|
||||
schema={{value: "id", name: "title"}}
|
||||
handleChange={(event) => {
|
||||
formik.setFieldValue("education_id", event.target.value);
|
||||
}}
|
||||
@@ -698,7 +703,7 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
isLoading={isLoadingOccupationsList}
|
||||
errorEcured={errorOccupationsList}
|
||||
selectType="occupation_id"
|
||||
schema={{ value: "id", name: "title" }}
|
||||
schema={{value: "id", name: "title"}}
|
||||
selectors={occupationsList}
|
||||
select={formik.values.occupation_id}
|
||||
value={formik.values.occupation_id}
|
||||
@@ -712,12 +717,12 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid container spacing={2} sx={{padding: 2}}>
|
||||
<Grid item xs={12}>
|
||||
<TextField
|
||||
multiline
|
||||
rows={4}
|
||||
sx={{ width: "100%" }}
|
||||
sx={{width: "100%"}}
|
||||
name="address"
|
||||
variant="outlined"
|
||||
size="small"
|
||||
@@ -732,7 +737,7 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid container spacing={2} sx={{padding: 2}}>
|
||||
<Grid item xs={12}>
|
||||
<FormControlLabel
|
||||
color={"error.main"}
|
||||
@@ -751,10 +756,10 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
flexDirection: { xs: "column", sm: "row" },
|
||||
flexDirection: {xs: "column", sm: "row"},
|
||||
alignItems: "center",
|
||||
mx: "auto",
|
||||
width: { xs: "100%", sm: "30%", md: "25%" },
|
||||
width: {xs: "100%", sm: "30%", md: "25%"},
|
||||
}}
|
||||
>
|
||||
<Button
|
||||
@@ -763,8 +768,8 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
type="submit"
|
||||
variant="contained"
|
||||
size="large"
|
||||
sx={{ my: 4 }}
|
||||
endIcon={<DataSaverOnIcon />}
|
||||
sx={{my: 4}}
|
||||
endIcon={<DataSaverOnIcon/>}
|
||||
disabled={formik.values.checkedBox ? formik.isSubmitting || !formik.dirty || !formik.isValid : true}
|
||||
>
|
||||
{formik.isSubmitting ? t("LoanRequest.button_while_submit") : t("LoanRequest.button_submit")}
|
||||
|
||||
Reference in New Issue
Block a user