merge mohammad changes
This commit is contained in:
@@ -131,6 +131,8 @@
|
|||||||
"personal_info": "اطلاعات شخصی",
|
"personal_info": "اطلاعات شخصی",
|
||||||
"national_code_number": "کد ملی می بایست شامل اعداد باشد",
|
"national_code_number": "کد ملی می بایست شامل اعداد باشد",
|
||||||
"national_code_max": "کد ملی می بایست 10 رقم باشد",
|
"national_code_max": "کد ملی می بایست 10 رقم باشد",
|
||||||
|
"shenasname_serial_max": "سریال پشت کارت ملی می بایست 10 رقم باشد",
|
||||||
|
"postal_code_max": "کد پستی می بایست 10 رقم باشد",
|
||||||
"tel_number_max": "شماره ثابت می بایست 11 رقم باشد",
|
"tel_number_max": "شماره ثابت می بایست 11 رقم باشد",
|
||||||
"national_code_positive": "کد ملی می بایست مثبت باشد",
|
"national_code_positive": "کد ملی می بایست مثبت باشد",
|
||||||
"uploading_documents": "اسناد",
|
"uploading_documents": "اسناد",
|
||||||
@@ -141,8 +143,11 @@
|
|||||||
"error_message_navgan_id": "لطفا کد هوشمند خود را وارد کنید!",
|
"error_message_navgan_id": "لطفا کد هوشمند خود را وارد کنید!",
|
||||||
"error_message_province_id": "لطفا استان خود را وارد کنید!",
|
"error_message_province_id": "لطفا استان خود را وارد کنید!",
|
||||||
"error_message_national_id": "لطفا کد ملی خود را وارد کنید!",
|
"error_message_national_id": "لطفا کد ملی خود را وارد کنید!",
|
||||||
"error_message_shenasname_id": "لطفا شماره شناسنامه خود را وارد کنید!",
|
"error_message_shenasname_serial": "لطفا سریال پشت کارت ملی خود را وارد کنید!",
|
||||||
|
"error_message_postal_code": "لطفا کد پستی خود را وارد کنید!",
|
||||||
"error_message_national_code": "لطفا کد ملی خود را وارد کنید!",
|
"error_message_national_code": "لطفا کد ملی خود را وارد کنید!",
|
||||||
|
"error_message_navgan_type": "لطفا نوع ناوگان خود را وارد کنید!",
|
||||||
|
"error_message_address": "لطفا آدرس خود را وارد کنید!",
|
||||||
"text_field_tel_number": "شماره ثابت (با پیش شماره استان)",
|
"text_field_tel_number": "شماره ثابت (با پیش شماره استان)",
|
||||||
"text_field_enter_your_tel_number": "شماره ثابت (با پیش شماره استان) خود را وارد کنید",
|
"text_field_enter_your_tel_number": "شماره ثابت (با پیش شماره استان) خود را وارد کنید",
|
||||||
"text_field_name": "نام",
|
"text_field_name": "نام",
|
||||||
@@ -150,13 +155,18 @@
|
|||||||
"text_field_plate_part3": "بخش سوم",
|
"text_field_plate_part3": "بخش سوم",
|
||||||
"text_field_plate_part2": "بخش دوم",
|
"text_field_plate_part2": "بخش دوم",
|
||||||
"text_field_plate_part1": "بخش اول",
|
"text_field_plate_part1": "بخش اول",
|
||||||
|
"text_field_postal_code": "کد پستی",
|
||||||
|
"text_field_navgan_type": "نوع ناوگان",
|
||||||
|
"text_field_address": "آدرس",
|
||||||
"text_field_enter_your_plate_part1": "بخش اول پلاک را وارد کنید",
|
"text_field_enter_your_plate_part1": "بخش اول پلاک را وارد کنید",
|
||||||
"text_field_enter_your_plate_part2": "بخش دوم پلاک را وارد کنید",
|
"text_field_enter_your_plate_part2": "بخش دوم پلاک را وارد کنید",
|
||||||
"text_field_enter_your_plate_part3": "بخش سوم پلاک را وارد کنید",
|
"text_field_enter_your_plate_part3": "بخش سوم پلاک را وارد کنید",
|
||||||
"text_field_enter_your_plate_part4": "بخش چهارم پلاک راوارد کنید",
|
"text_field_enter_your_plate_part4": "بخش چهارم پلاک راوارد کنید",
|
||||||
|
"text_field_enter_your_address": "آدرس خود راوارد کنید",
|
||||||
"text_field_loading_cities_list": "درحال دریافت اطلاعات شهر ها...",
|
"text_field_loading_cities_list": "درحال دریافت اطلاعات شهر ها...",
|
||||||
"text_field_city_id": "شهر",
|
"text_field_city_id": "شهر",
|
||||||
"text_field_enter_your_name": "نام خود را وارد کنید",
|
"text_field_enter_your_name": "نام خود را وارد کنید",
|
||||||
|
"text_field_enter_your_postal_code": "کد پستی خود را وارد کنید",
|
||||||
"text_field_vehicle_type": "نوع وسیله نقلیه",
|
"text_field_vehicle_type": "نوع وسیله نقلیه",
|
||||||
"text_field_enter_your_vehicle_type": "نوع وسیله نقلیه خود را وارد کنید",
|
"text_field_enter_your_vehicle_type": "نوع وسیله نقلیه خود را وارد کنید",
|
||||||
"text_field_province_id": "استان",
|
"text_field_province_id": "استان",
|
||||||
@@ -169,8 +179,8 @@
|
|||||||
"text_field_enter_your_navgan_id": "کد هوشمند ناوگان خود را وارد کنید",
|
"text_field_enter_your_navgan_id": "کد هوشمند ناوگان خود را وارد کنید",
|
||||||
"text_field_national_code": "کد ملی",
|
"text_field_national_code": "کد ملی",
|
||||||
"text_field_enter_your_national_id": "کد ملی خود را وارد کنید",
|
"text_field_enter_your_national_id": "کد ملی خود را وارد کنید",
|
||||||
"text_field_shenasname_id": "شماره شناسنامه",
|
"text_field_shenasname_serial": "سریال پشت کارت ملی",
|
||||||
"text_field_enter_your_shenasname_id": "شماره شناسنامه خود را وارد کنید",
|
"text_field_enter_your_shenasname_serial": "سریال پشت کارت ملی خود را وارد کنید",
|
||||||
"text_field_plate_number": "شماره پلاک",
|
"text_field_plate_number": "شماره پلاک",
|
||||||
"text_field_enter_your_plate_number": "شماره پلاک خود را وارد کنید",
|
"text_field_enter_your_plate_number": "شماره پلاک خود را وارد کنید",
|
||||||
"text_field_error_fetching_cities": "شهر خود را وارد کنید!",
|
"text_field_error_fetching_cities": "شهر خود را وارد کنید!",
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {useRequest, useUser} from "@witel/webapp-builder";
|
|||||||
import useProvince from "@/lib/app/hooks/useProvince";
|
import useProvince from "@/lib/app/hooks/useProvince";
|
||||||
import useCities from "@/lib/app/hooks/useCities";
|
import useCities from "@/lib/app/hooks/useCities";
|
||||||
import PlateNumber from "@/core/components/PlateNumber";
|
import PlateNumber from "@/core/components/PlateNumber";
|
||||||
|
import MuiDatePicker from "@/core/MuiDatePicker";
|
||||||
|
|
||||||
const AddFormComponent = () => {
|
const AddFormComponent = () => {
|
||||||
const t = useTranslations();
|
const t = useTranslations();
|
||||||
@@ -25,13 +26,14 @@ const AddFormComponent = () => {
|
|||||||
city_id: "",
|
city_id: "",
|
||||||
navgan_id: "",
|
navgan_id: "",
|
||||||
national_code: "",
|
national_code: "",
|
||||||
shenasname_id: "",
|
shenasname_serial: "",
|
||||||
postal_code: "",
|
postal_code: "",
|
||||||
navgan_type: "",
|
navgan_type: "",
|
||||||
plate_part1 : "",
|
plate_part1 : "",
|
||||||
plate_part2 : "",
|
plate_part2 : "",
|
||||||
plate_part3 : "",
|
plate_part3 : "",
|
||||||
plate_part4 : "",
|
plate_part4 : "",
|
||||||
|
address : "",
|
||||||
};
|
};
|
||||||
|
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
@@ -44,6 +46,9 @@ const AddFormComponent = () => {
|
|||||||
navgan_type: Yup.string().required(
|
navgan_type: Yup.string().required(
|
||||||
t("LoanRequest.error_message_navgan_type")
|
t("LoanRequest.error_message_navgan_type")
|
||||||
),
|
),
|
||||||
|
address: Yup.string().required(
|
||||||
|
t("LoanRequest.error_message_address")
|
||||||
|
),
|
||||||
postal_code : Yup.mixed()
|
postal_code : Yup.mixed()
|
||||||
.test("max", `${t("LoanRequest.postal_code_max")}`, (value) => value.toString().length === 10)
|
.test("max", `${t("LoanRequest.postal_code_max")}`, (value) => value.toString().length === 10)
|
||||||
.required(
|
.required(
|
||||||
@@ -77,8 +82,9 @@ const AddFormComponent = () => {
|
|||||||
.test("positive", `${t("LoanRequest.national_code_positive")}`, (value) => value >= 0)
|
.test("positive", `${t("LoanRequest.national_code_positive")}`, (value) => value >= 0)
|
||||||
.test("max", `${t("LoanRequest.national_code_max")}`, (value) => value.toString().length === 10)
|
.test("max", `${t("LoanRequest.national_code_max")}`, (value) => value.toString().length === 10)
|
||||||
.required(t("LoanRequest.error_message_national_id")),
|
.required(t("LoanRequest.error_message_national_id")),
|
||||||
shenasname_id: Yup.string().required(
|
shenasname_serial: Yup.mixed()
|
||||||
t("LoanRequest.error_message_shenasname_id")
|
.test("max", `${t("LoanRequest.shenasname_serial_max")}`, (value) => value.toString().length === 11)
|
||||||
|
.required(t("LoanRequest.error_message_shenasname_serial")
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -92,9 +98,10 @@ const AddFormComponent = () => {
|
|||||||
formData.append("plate_number", values.plate_number);
|
formData.append("plate_number", values.plate_number);
|
||||||
formData.append("province_id", values.province_id);
|
formData.append("province_id", values.province_id);
|
||||||
formData.append("city_id", values.city_id);
|
formData.append("city_id", values.city_id);
|
||||||
|
formData.append("address", values.address);
|
||||||
formData.append("navgan_id", values.navgan_id);
|
formData.append("navgan_id", values.navgan_id);
|
||||||
formData.append("national_code", values.national_code);
|
formData.append("national_code", values.national_code);
|
||||||
formData.append("shenasname_id", values.shenasname_id);
|
formData.append("shenasname_serial", values.shenasname_serial);
|
||||||
|
|
||||||
requestServer(SEND_LOAN_REQUEST_NAVGAN, "post", {auth : true, notification : true}).then().catch(() => {
|
requestServer(SEND_LOAN_REQUEST_NAVGAN, "post", {auth : true, notification : true}).then().catch(() => {
|
||||||
props.setSubmitting(false)
|
props.setSubmitting(false)
|
||||||
@@ -131,19 +138,17 @@ const AddFormComponent = () => {
|
|||||||
>
|
>
|
||||||
<TextField
|
<TextField
|
||||||
sx={{width: "100%"}}
|
sx={{width: "100%"}}
|
||||||
name="tel_number"
|
name="postal_code"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
type={'number'}
|
type={'number'}
|
||||||
size="small"
|
|
||||||
onChange={formik.handleChange}
|
onChange={formik.handleChange}
|
||||||
label={t("LoanRequest.text_field_tel_number")}
|
size="small"
|
||||||
placeholder={t(
|
label={t("LoanRequest.text_field_postal_code")}
|
||||||
"LoanRequest.text_field_enter_your_tel_number"
|
placeholder={t("LoanRequest.text_field_enter_your_postal_code")}
|
||||||
)}
|
|
||||||
fullWidth
|
fullWidth
|
||||||
onBlur={formik.handleBlur("tel_number")}
|
onBlur={formik.handleBlur("postal_code")}
|
||||||
error={formik.touched.tel_number && Boolean(formik.errors.tel_number)}
|
error={formik.touched.postal_code && Boolean(formik.errors.postal_code)}
|
||||||
helperText={formik.touched.tel_number && formik.errors.tel_number}
|
helperText={formik.touched.postal_code && formik.errors.postal_code}
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -184,17 +189,19 @@ const AddFormComponent = () => {
|
|||||||
<Grid item xs={12} sm={6}>
|
<Grid item xs={12} sm={6}>
|
||||||
<TextField
|
<TextField
|
||||||
sx={{width: "100%"}}
|
sx={{width: "100%"}}
|
||||||
name="postal_code"
|
name="tel_number"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
type={'number'}
|
type={'number'}
|
||||||
onChange={formik.handleChange}
|
|
||||||
size="small"
|
size="small"
|
||||||
label={t("LoanRequest.text_field_postal_code")}
|
onChange={formik.handleChange}
|
||||||
placeholder={t("LoanRequest.text_field_enter_your_postal_code")}
|
label={t("LoanRequest.text_field_tel_number")}
|
||||||
|
placeholder={t(
|
||||||
|
"LoanRequest.text_field_enter_your_tel_number"
|
||||||
|
)}
|
||||||
fullWidth
|
fullWidth
|
||||||
onBlur={formik.handleBlur("postal_code")}
|
onBlur={formik.handleBlur("tel_number")}
|
||||||
error={formik.touched.postal_code && Boolean(formik.errors.postal_code)}
|
error={formik.touched.tel_number && Boolean(formik.errors.tel_number)}
|
||||||
helperText={formik.touched.postal_code && formik.errors.postal_code}
|
helperText={formik.touched.tel_number && formik.errors.tel_number}
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} sm={6}>
|
<Grid item xs={12} sm={6}>
|
||||||
@@ -255,19 +262,21 @@ const AddFormComponent = () => {
|
|||||||
<Grid item xs={12} sm={6}>
|
<Grid item xs={12} sm={6}>
|
||||||
<TextField
|
<TextField
|
||||||
sx={{width: "100%"}}
|
sx={{width: "100%"}}
|
||||||
name="shenasname_id"
|
name="shenasname_serial"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
size="small"
|
size="small"
|
||||||
label={t("LoanRequest.text_field_shenasname_id")}
|
label={t("LoanRequest.text_field_shenasname_serial")}
|
||||||
placeholder={t(
|
placeholder={t(
|
||||||
"LoanRequest.text_field_enter_your_shenasname_id")}
|
"LoanRequest.text_field_enter_your_shenasname_serial")}
|
||||||
fullWidth
|
fullWidth
|
||||||
onBlur={formik.handleBlur("shenasname_id")}
|
onChange={formik.handleChange}
|
||||||
error={formik.touched.shenasname_id && Boolean(formik.errors.shenasname_id)}
|
onBlur={formik.handleBlur("shenasname_serial")}
|
||||||
helperText={formik.touched.shenasname_id && formik.errors.shenasname_id}
|
error={formik.touched.shenasname_serial && Boolean(formik.errors.shenasname_serial)}
|
||||||
|
helperText={formik.touched.shenasname_serial && formik.errors.shenasname_serial}
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} sm={6}>
|
<Grid item xs={12} sm={6}>
|
||||||
|
{/*<MuiDatePicker />*/}
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid container spacing={2} sx={{padding : 2}}>
|
<Grid container spacing={2} sx={{padding : 2}}>
|
||||||
@@ -275,6 +284,25 @@ const AddFormComponent = () => {
|
|||||||
<PlateNumber formik={formik} />
|
<PlateNumber formik={formik} />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<Grid container spacing={2} sx={{padding : 2}}>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<TextField
|
||||||
|
multiline
|
||||||
|
rows={8}
|
||||||
|
sx={{width: "100%"}}
|
||||||
|
name="address"
|
||||||
|
variant="outlined"
|
||||||
|
size="small"
|
||||||
|
label={t("LoanRequest.text_field_address")}
|
||||||
|
placeholder={t("LoanRequest.text_field_enter_your_address")}
|
||||||
|
fullWidth
|
||||||
|
onChange={formik.handleChange}
|
||||||
|
onBlur={formik.handleBlur("address")}
|
||||||
|
error={formik.touched.address && Boolean(formik.errors.address)}
|
||||||
|
helperText={formik.touched.address && formik.errors.address}
|
||||||
|
/>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
|
|||||||
0
src/core/MuiDatePicker.jsx
Normal file
0
src/core/MuiDatePicker.jsx
Normal file
Reference in New Issue
Block a user