Merge branch 'release/v2.6.5'
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
NEXT_PUBLIC_API_NAME = "Loan Facilities Dashboard"
|
||||
NEXT_PUBLIC_API_VERSION = "2.6.4"
|
||||
NEXT_PUBLIC_API_VERSION = "2.6.5"
|
||||
NEXT_PUBLIC_DEFAULT_LANGUAGE = "fa"
|
||||
NEXT_PUBLIC_DEFAULT_DIRECTION = "rtl"
|
||||
|
||||
|
||||
@@ -179,6 +179,7 @@
|
||||
"building_facilities": "تسهیلات ساخت مجتمع رفاهی",
|
||||
"restore_facilities_description": "درخواست تسهیلات مرمت و بازسازی مجتمع رفاهی",
|
||||
"building_facilities_description": "درخواست تسهیلات ساخت مجتمع رفاهی",
|
||||
"text_field_work_year": "منابع بازگشتی",
|
||||
"restore_facilities_request": "درخواست تسهیلات مرمت و بازسازی مجتمع رفاهی",
|
||||
"building_facilities_request": "درخواست تسهیلات ساخت مجتمع رفاهی",
|
||||
"upload_principle_agreement_img": "تصویر موافقت اصولی",
|
||||
@@ -192,6 +193,7 @@
|
||||
"upload_refresh_date_img_unit": "فایل بارگذاری شده باید حداکثر 2Mb باشد",
|
||||
"upload_principle_agreement_img_format": "فرمت قابل قبول : png,jpg",
|
||||
"upload_refresh_date_img_format": "فرمت قابل قبول : png,jpg",
|
||||
"error_message_work_year": "لطفا منابع بازگشتی را وارد کنید!",
|
||||
"upload_operating_license_img_format": "فرمت قابل قبول : png,jpg",
|
||||
"back-button": "بازگشت",
|
||||
"next-button": "تایید و مرحله بعد",
|
||||
@@ -233,6 +235,7 @@
|
||||
"submit_rules": "پذیرش شرایط",
|
||||
"principle_agreement_number": "شماره موافقت اصولی",
|
||||
"text_field_phone_number": "تلفن همراه",
|
||||
"text_field_work_year": "منابع بازگشتی",
|
||||
"text_field_money_investment": "میزان سرمایه گذاری انجام شده(ریال)",
|
||||
"text_field_enter_your_money_investment": "لطفا میزان سرمایه گذاری انجام شده را وارد کنید!",
|
||||
"text_field_enter_your_phone_number": "تلفن همراه خود را واردکنید!",
|
||||
@@ -251,6 +254,7 @@
|
||||
"error_message_user_committed_employment": " لطفا تعداد اشتغال متعهد متقاضی را وارد کنید!",
|
||||
"error_message_user_existing_employment": " لطفا تعداد اشتغال موجود متقاضی را وارد کنید!",
|
||||
"text_field_requested_facilities": "تسهیلات مورد تقاضا(ریال)",
|
||||
"error_message_work_year": "لطفا منابع بازگشتی را وارد کنید!",
|
||||
"text_field_investment": "ارزش ناوگان(ریال)",
|
||||
"text_field_applicant_payment": "آورده متقاضی(ریال)",
|
||||
"text_field_progress_percentage": "درصد پیشرفت پروژه",
|
||||
@@ -437,6 +441,7 @@
|
||||
"error_message_national_number": "لطفا شناسه ملی خود را وارد کنید!",
|
||||
"error_message_shenasname_serial": "لطفا سریال پشت کارت ملی خود را وارد کنید!",
|
||||
"error_message_tracking_code": "لطفا کد رهگیری کارت ملی خود را وارد کنید!",
|
||||
"error_message_work_year": "لطفا منابع بازگشتی را وارد کنید!",
|
||||
"text_field_shenasname_serial": "سریال پشت کارت ملی",
|
||||
"text_field_national_trackin_code": "کد رهگیری کارت ملی",
|
||||
"user_committed_employment": "تعداد اشتغال متعهد متقاضی",
|
||||
|
||||
@@ -28,6 +28,7 @@ import MuiDatePicker from "@/core/components/MuiDatePicker";
|
||||
import LegalPersonDatePicker from "@/core/components/LegalPersonDatePicker";
|
||||
import PriceField from "@/core/components/PriceField";
|
||||
import { useState } from "react";
|
||||
import useWorkYear from "@/lib/app/hooks/useWorkYear";
|
||||
|
||||
const vehicle_amount = {
|
||||
اتوبوس: parseInt(process.env.NEXT_PUBLIC_BUS_AMOUNT),
|
||||
@@ -39,6 +40,8 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
const requestServer = useRequest();
|
||||
const [vehicleType, setVehicleType] = useState("");
|
||||
const { getUser, changeUser } = useUser();
|
||||
const { workYear, isLoadingWorkYear, errorWorkYear } = useWorkYear();
|
||||
|
||||
const { cityTextField, cityList, setProvinceID, isLoadingCityList } = useCities();
|
||||
const { provinceList, isLoadingProvinceList, errorProvinceList } = useLimitedProvince();
|
||||
const { educationsList, isLoadingEducationsList, errorEducationsList } = UseEducations();
|
||||
@@ -77,6 +80,7 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
plate_part2: "ع",
|
||||
plate_part3: "",
|
||||
plate_part4: "",
|
||||
work_year: "",
|
||||
address: "",
|
||||
company_register_date: "",
|
||||
education_id: "",
|
||||
@@ -103,6 +107,7 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
)
|
||||
.required(t("LoanRequest.error_message_requested_facilities")),
|
||||
investment: Yup.string().required(t("LoanRequest.error_message_investment")),
|
||||
work_year: Yup.string().required(t("LoanRequest.error_message_work_year")),
|
||||
user_committed_employment: Yup.string().required(t("LoanRequest.error_message_user_committed_employment")),
|
||||
user_existing_employment: Yup.string().required(t("LoanRequest.error_message_user_existing_employment")),
|
||||
activity_type: Yup.string().required(t("LoanRequest.error_message_activity_type")),
|
||||
@@ -206,6 +211,7 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
register_number: values.register_number,
|
||||
national_id: values.boss_national_code,
|
||||
vehicle_type: values.vehicle_type,
|
||||
work_year: values.work_year,
|
||||
company_name: values.company_name,
|
||||
province_id: values.province_id,
|
||||
city_id: values.city_id,
|
||||
@@ -756,7 +762,7 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
name="navgan_id"
|
||||
@@ -774,7 +780,7 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
helperText={formik.touched.navgan_id && formik.errors.navgan_id}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<SelectBox
|
||||
name="education_id"
|
||||
label={t("LoanRequest.text_field_education_id")}
|
||||
@@ -795,7 +801,9 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
onBlur={formik.handleBlur("education_id")}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={4}>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ p: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<SelectBox
|
||||
name="occupation_id"
|
||||
label={t("LoanRequest.text_field_occupation_id")}
|
||||
@@ -816,6 +824,27 @@ const LegalPersonForm = ({ setFinishLoanRequest }) => {
|
||||
onBlur={formik.handleBlur("occupation_id")}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<SelectBox
|
||||
name="work_year"
|
||||
label={t("LoanRequest.text_field_work_year")}
|
||||
size="small"
|
||||
value={formik.values.work_year}
|
||||
selectType="work_year"
|
||||
selectors={workYear}
|
||||
isLoading={isLoadingWorkYear}
|
||||
errorEcured={errorWorkYear}
|
||||
schema={{ value: "name", name: "name" }}
|
||||
select={formik.values.work_year}
|
||||
handleChange={(event) => {
|
||||
formik.setFieldValue("work_year", event.target.value);
|
||||
}}
|
||||
setFieldTouched={formik.setFieldTouched}
|
||||
error={formik.touched.work_year && Boolean(formik.errors.work_year)}
|
||||
helperText={formik.touched.work_year && formik.errors.work_year}
|
||||
onBlur={formik.handleBlur("work_year")}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ p: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
|
||||
@@ -27,6 +27,7 @@ import useActivityType from "@/lib/app/hooks/useActivityType";
|
||||
import useProjectTitle from "@/lib/app/hooks/useProjectTitle";
|
||||
import PriceField from "@/core/components/PriceField";
|
||||
import { useState } from "react";
|
||||
import useWorkYear from "@/lib/app/hooks/useWorkYear";
|
||||
|
||||
const vehicle_amount = {
|
||||
اتوبوس: parseInt(process.env.NEXT_PUBLIC_BUS_AMOUNT),
|
||||
@@ -36,6 +37,7 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
const t = useTranslations();
|
||||
const [vehicleType, setVehicleType] = useState("");
|
||||
const { provinceList, isLoadingProvinceList, errorProvinceList } = useLimitedProvince();
|
||||
const { workYear, isLoadingWorkYear, errorWorkYear } = useWorkYear();
|
||||
const { cityTextField, cityList, setProvinceID, isLoadingCityList } = useCities();
|
||||
const { educationsList, isLoadingEducationsList, errorEducationsList } = UseEducations();
|
||||
const { occupationsList, isLoadingOccupationsList, errorOccupationsList } = useOccupations();
|
||||
@@ -75,6 +77,7 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
plate_part2: "ع",
|
||||
plate_part3: "",
|
||||
plate_part4: "",
|
||||
work_year: "",
|
||||
birthday: "",
|
||||
checkedBox: false,
|
||||
history_facilities: false,
|
||||
@@ -98,6 +101,7 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
)
|
||||
.required(t("LoanRequest.error_message_requested_facilities")),
|
||||
investment: Yup.string().required(t("LoanRequest.error_message_investment")),
|
||||
work_year: Yup.string().required(t("LoanRequest.error_message_work_year")),
|
||||
user_committed_employment: Yup.string().required(t("LoanRequest.error_message_user_committed_employment")),
|
||||
user_existing_employment: Yup.string().required(t("LoanRequest.error_message_user_existing_employment")),
|
||||
activity_type: Yup.string().required(t("LoanRequest.error_message_activity_type")),
|
||||
@@ -181,6 +185,7 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
city_id: values.city_id,
|
||||
first_name: values.first_name,
|
||||
last_name: values.last_name,
|
||||
work_year: values.work_year,
|
||||
navgan_id: values.navgan_id,
|
||||
postal_code: values.postal_code,
|
||||
navgan_type: "عمومی",
|
||||
@@ -491,7 +496,7 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
name="navgan_id"
|
||||
@@ -509,7 +514,7 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
helperText={formik.touched.navgan_id && formik.errors.navgan_id}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
name="postal_code"
|
||||
@@ -538,7 +543,9 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
helperText={formik.touched.postal_code && formik.errors.postal_code}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={4}>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
name="telephone_number"
|
||||
@@ -567,6 +574,27 @@ const RealPersonForm = ({ setFinishLoanRequest }) => {
|
||||
helperText={formik.touched.telephone_number && formik.errors.telephone_number}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<SelectBox
|
||||
name="work_year"
|
||||
label={t("LoanRequest.text_field_work_year")}
|
||||
size="small"
|
||||
value={formik.values.work_year}
|
||||
selectType="work_year"
|
||||
selectors={workYear}
|
||||
isLoading={isLoadingWorkYear}
|
||||
errorEcured={errorWorkYear}
|
||||
schema={{ value: "name", name: "name" }}
|
||||
select={formik.values.work_year}
|
||||
handleChange={(event) => {
|
||||
formik.setFieldValue("work_year", event.target.value);
|
||||
}}
|
||||
setFieldTouched={formik.setFieldTouched}
|
||||
error={formik.touched.work_year && Boolean(formik.errors.work_year)}
|
||||
helperText={formik.touched.work_year && formik.errors.work_year}
|
||||
onBlur={formik.handleBlur("work_year")}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
|
||||
@@ -20,6 +20,7 @@ import useProjectTitle from "@/lib/app/hooks/useProjectTitle";
|
||||
import useActivityType from "@/lib/app/hooks/useActivityType";
|
||||
import LegalPersonDatePicker from "@/core/components/LegalPersonDatePicker";
|
||||
import PriceField from "@/core/components/PriceField";
|
||||
import useWorkYear from "@/lib/app/hooks/useWorkYear";
|
||||
const vehicle_amount = {
|
||||
اتوبوس: parseInt(process.env.NEXT_PUBLIC_BUS_AMOUNT),
|
||||
"مینی بوس": parseInt(process.env.NEXT_PUBLIC_MINIBUS_AMOUNT),
|
||||
@@ -33,6 +34,7 @@ const UpdateFormLegal = ({ LoanDetails, LoanId }) => {
|
||||
const { activityType, isLoadingActivityType, errorActivityType } = useActivityType();
|
||||
const { educationsList, isLoadingEducationsList, errorEducationsList } = UseEducations();
|
||||
const { occupationsList, isLoadingOccupationsList, errorOccupationsList } = useOccupations();
|
||||
const { workYear, isLoadingWorkYear, errorWorkYear } = useWorkYear();
|
||||
const requestServer = useRequest();
|
||||
const initialValues = {
|
||||
is_legal_person: 1,
|
||||
@@ -43,6 +45,7 @@ const UpdateFormLegal = ({ LoanDetails, LoanId }) => {
|
||||
postal_code: LoanDetails.postal_code || "",
|
||||
address: LoanDetails.address || "",
|
||||
company_name: LoanDetails.company_name || "",
|
||||
work_year: LoanDetails.work_year || "",
|
||||
investment: LoanDetails.investment_amount || "",
|
||||
requested_facilities: LoanDetails.requested_facility_amount || "",
|
||||
user_existing_employment: LoanDetails.user_existing_employment || "",
|
||||
@@ -93,6 +96,7 @@ const UpdateFormLegal = ({ LoanDetails, LoanId }) => {
|
||||
user_committed_employment: Yup.string().required(t("ShowLoan.error_message_user_committed_employment")),
|
||||
user_existing_employment: Yup.string().required(t("ShowLoan.error_message_user_existing_employment")),
|
||||
address: Yup.string().required(t("ShowLoan.error_message_address")),
|
||||
work_year: Yup.string().required(t("ShowLoan.error_message_work_year")),
|
||||
province_id: Yup.string().required(t("ShowLoan.error_message_province_id")),
|
||||
activity_type: Yup.string().required(t("ShowLoan.error_message_activity_type")),
|
||||
navgan_plan_id: Yup.string().required(t("ShowLoan.error_message_navgan_plan_id")),
|
||||
@@ -182,6 +186,7 @@ const UpdateFormLegal = ({ LoanDetails, LoanId }) => {
|
||||
formData.append("postal_code", values.postal_code);
|
||||
formData.append("navgan_plan_id", values.navgan_plan_id);
|
||||
formData.append("activity_type_id", values.activity_type);
|
||||
formData.append("work_year", values.work_year);
|
||||
formData.append("first_name", values.boss_first_name);
|
||||
formData.append("last_name", values.boss_last_name);
|
||||
formData.append("father_name", values.boss_father_name);
|
||||
@@ -759,7 +764,7 @@ const UpdateFormLegal = ({ LoanDetails, LoanId }) => {
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ p: 2 }}>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
name="telephone_number"
|
||||
@@ -788,7 +793,31 @@ const UpdateFormLegal = ({ LoanDetails, LoanId }) => {
|
||||
helperText={formik.touched.telephone_number && formik.errors.telephone_number}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<SelectBox
|
||||
name="work_year"
|
||||
label={t("LoanRequest.text_field_work_year")}
|
||||
size="small"
|
||||
value={formik.values.work_year}
|
||||
disabled={LoanDetails.state_id !== 17}
|
||||
selectType="work_year"
|
||||
selectors={workYear}
|
||||
isLoading={isLoadingWorkYear}
|
||||
errorEcured={errorWorkYear}
|
||||
schema={{ value: "name", name: "name" }}
|
||||
select={formik.values.work_year}
|
||||
handleChange={(event) => {
|
||||
formik.setFieldValue("work_year", event.target.value);
|
||||
}}
|
||||
setFieldTouched={formik.setFieldTouched}
|
||||
error={formik.touched.work_year && Boolean(formik.errors.work_year)}
|
||||
helperText={formik.touched.work_year && formik.errors.work_year}
|
||||
onBlur={formik.handleBlur("work_year")}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ p: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<SelectBox
|
||||
name="education_id"
|
||||
label={t("ShowLoan.text_field_education_id")}
|
||||
@@ -810,7 +839,7 @@ const UpdateFormLegal = ({ LoanDetails, LoanId }) => {
|
||||
onBlur={formik.handleBlur("education_id")}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<SelectBox
|
||||
name="occupation_id"
|
||||
label={t("ShowLoan.text_field_occupation_id")}
|
||||
|
||||
@@ -19,6 +19,7 @@ import * as React from "react";
|
||||
import useProjectTitle from "@/lib/app/hooks/useProjectTitle";
|
||||
import useActivityType from "@/lib/app/hooks/useActivityType";
|
||||
import PriceField from "@/core/components/PriceField";
|
||||
import useWorkYear from "@/lib/app/hooks/useWorkYear";
|
||||
const vehicle_amount = {
|
||||
اتوبوس: parseInt(process.env.NEXT_PUBLIC_BUS_AMOUNT),
|
||||
"مینی بوس": parseInt(process.env.NEXT_PUBLIC_MINIBUS_AMOUNT),
|
||||
@@ -31,6 +32,7 @@ const UpdateFormReal = ({ LoanDetails, LoanId }) => {
|
||||
const citiesStates = useCities();
|
||||
const { projectTitle, isLoadingProjectTitle, errorProjectTitle } = useProjectTitle();
|
||||
const { activityType, isLoadingActivityType, errorActivityType } = useActivityType();
|
||||
const { workYear, isLoadingWorkYear, errorWorkYear } = useWorkYear();
|
||||
const educationStates = UseEducations();
|
||||
const occupationStates = useOccupations();
|
||||
const requestServer = useRequest();
|
||||
@@ -58,6 +60,7 @@ const UpdateFormReal = ({ LoanDetails, LoanId }) => {
|
||||
occupation_id: LoanDetails.occupation_id || "",
|
||||
navgan_type: LoanDetails.navgan_type || "",
|
||||
vehicle_type: LoanDetails.vehicle_type || "",
|
||||
work_year: LoanDetails.work_year || "",
|
||||
telephone_number: LoanDetails.telephone_number || "",
|
||||
plate_part1: LoanDetails.plate_number.split("-")[0] || "",
|
||||
plate_part2: LoanDetails.plate_number.split("-")[1] || "",
|
||||
@@ -77,6 +80,7 @@ const UpdateFormReal = ({ LoanDetails, LoanId }) => {
|
||||
.required(t("ShowLoan.error_message_postal_code")),
|
||||
address: Yup.string().required(t("ShowLoan.error_message_address")),
|
||||
province_id: Yup.string().required(t("ShowLoan.error_message_province_id")),
|
||||
work_year: Yup.string().required(t("ShowLoan.error_message_work_year")),
|
||||
activity_type: Yup.string().required(t("ShowLoan.error_message_activity_type")),
|
||||
requested_facilities: Yup.mixed()
|
||||
.test(
|
||||
@@ -145,6 +149,7 @@ const UpdateFormReal = ({ LoanDetails, LoanId }) => {
|
||||
}
|
||||
formData.append("birthday", values.birthday.locale("en").format("YYYY-MM-DD"));
|
||||
formData.append("postal_code", values.postal_code);
|
||||
formData.append("work_year", values.work_year);
|
||||
formData.append("navgan_plan_id", values.navgan_plan_id);
|
||||
formData.append("activity_type_id", values.activity_type);
|
||||
formData.append("first_name", values.first_name);
|
||||
@@ -660,7 +665,7 @@ const UpdateFormReal = ({ LoanDetails, LoanId }) => {
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ p: 2 }}>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<TextField
|
||||
sx={{ width: "100%" }}
|
||||
name="telephone_number"
|
||||
@@ -689,7 +694,31 @@ const UpdateFormReal = ({ LoanDetails, LoanId }) => {
|
||||
helperText={formik.touched.telephone_number && formik.errors.telephone_number}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<SelectBox
|
||||
name="work_year"
|
||||
label={t("LoanRequest.text_field_work_year")}
|
||||
size="small"
|
||||
value={formik.values.work_year}
|
||||
disabled={LoanDetails.state_id !== 17}
|
||||
selectType="work_year"
|
||||
selectors={workYear}
|
||||
isLoading={isLoadingWorkYear}
|
||||
errorEcured={errorWorkYear}
|
||||
schema={{ value: "name", name: "name" }}
|
||||
select={formik.values.work_year}
|
||||
handleChange={(event) => {
|
||||
formik.setFieldValue("work_year", event.target.value);
|
||||
}}
|
||||
setFieldTouched={formik.setFieldTouched}
|
||||
error={formik.touched.work_year && Boolean(formik.errors.work_year)}
|
||||
helperText={formik.touched.work_year && formik.errors.work_year}
|
||||
onBlur={formik.handleBlur("work_year")}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ p: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
{educationStates.educationsList.length !== 0 ? (
|
||||
<SelectBox
|
||||
name="education_id"
|
||||
@@ -722,7 +751,7 @@ const UpdateFormReal = ({ LoanDetails, LoanId }) => {
|
||||
/>
|
||||
)}
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
{occupationStates.occupationsList.length !== 0 ? (
|
||||
<SelectBox
|
||||
name="occupation_id"
|
||||
|
||||
@@ -8,13 +8,17 @@ import * as Yup from "yup";
|
||||
import { useFormik } from "formik";
|
||||
import PickerWithDynamicField from "@/core/components/EditedDatePicker";
|
||||
import UploadImage from "./UploadImage";
|
||||
import SelectBox from "@/core/components/SelectBox";
|
||||
import useWorkYear from "@/lib/app/hooks/useWorkYear";
|
||||
|
||||
const BuildRequestDetail = ({ state, handleBack, handleSubmit, submitting, canRequest }) => {
|
||||
const t = useTranslations();
|
||||
const { workYear, isLoadingWorkYear, errorWorkYear } = useWorkYear();
|
||||
|
||||
const initialValues = {
|
||||
requested_facility_amount: state.requested_facility_amount,
|
||||
person_share: state.person_share,
|
||||
work_year: state.work_year,
|
||||
investment_amount: state.investment_amount,
|
||||
basic_approval_renewal_date: state.basic_approval_renewal_date,
|
||||
basic_approval_number: state.basic_approval_number,
|
||||
@@ -34,6 +38,7 @@ const BuildRequestDetail = ({ state, handleBack, handleSubmit, submitting, canRe
|
||||
parseInt(process.env.NEXT_PUBLIC_BUILD_LOAN_AMOUNT),
|
||||
t("LoanRequest.error_message_max_loan_refahi_build")
|
||||
),
|
||||
work_year: Yup.string().required(t("LoanRequest.error_message_work_year")),
|
||||
person_share: Yup.string().required(t("LoanRequest.error_message_applicant_payment")),
|
||||
investment_amount: Yup.string().required(t("LoanRequest.error_message_money_investment")),
|
||||
basic_approval_number: Yup.string().required(t("LoanRequest.error_message_principle_agreement_number")),
|
||||
@@ -86,7 +91,7 @@ const BuildRequestDetail = ({ state, handleBack, handleSubmit, submitting, canRe
|
||||
return (
|
||||
<>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<PriceField
|
||||
name="investment_amount"
|
||||
label={t("LoanRequest.text_field_money_investment")}
|
||||
@@ -117,7 +122,7 @@ const BuildRequestDetail = ({ state, handleBack, handleSubmit, submitting, canRe
|
||||
fullWidth
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<PriceField
|
||||
name="requested_facility_amount"
|
||||
label={t("LoanRequest.text_field_requested_facilities")}
|
||||
@@ -139,7 +144,9 @@ const BuildRequestDetail = ({ state, handleBack, handleSubmit, submitting, canRe
|
||||
fullWidth
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={4}>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ p: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<PriceField
|
||||
name="person_share"
|
||||
label={t("LoanRequest.text_field_applicant_payment")}
|
||||
@@ -156,6 +163,27 @@ const BuildRequestDetail = ({ state, handleBack, handleSubmit, submitting, canRe
|
||||
fullWidth
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<SelectBox
|
||||
name="work_year"
|
||||
label={t("LoanRequest.text_field_work_year")}
|
||||
size="small"
|
||||
value={formik.values.work_year}
|
||||
selectType="work_year"
|
||||
selectors={workYear}
|
||||
isLoading={isLoadingWorkYear}
|
||||
errorEcured={errorWorkYear}
|
||||
schema={{ value: "name", name: "name" }}
|
||||
select={formik.values.work_year}
|
||||
handleChange={(event) => {
|
||||
formik.setFieldValue("work_year", event.target.value);
|
||||
}}
|
||||
setFieldTouched={formik.setFieldTouched}
|
||||
error={formik.touched.work_year && Boolean(formik.errors.work_year)}
|
||||
helperText={formik.touched.work_year && formik.errors.work_year}
|
||||
onBlur={formik.handleBlur("work_year")}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ p: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
|
||||
@@ -22,6 +22,7 @@ const _data = {
|
||||
project_city_id: "",
|
||||
province_id: "",
|
||||
project_province_id: "",
|
||||
work_year: "",
|
||||
education_id: "",
|
||||
occupation_id: "",
|
||||
national_id: "",
|
||||
|
||||
@@ -8,13 +8,17 @@ import * as Yup from "yup";
|
||||
import { useFormik } from "formik";
|
||||
import PickerWithDynamicField from "@/core/components/EditedDatePicker";
|
||||
import UploadImage from "@/components/dashboard/refahi/add-request-loan/forms/BuildForm/UploadImage";
|
||||
import SelectBox from "@/core/components/SelectBox";
|
||||
import useWorkYear from "@/lib/app/hooks/useWorkYear";
|
||||
|
||||
const RestoreRequestDetail = ({ state, handleBack, handleSubmit, submitting, canRequest }) => {
|
||||
const t = useTranslations();
|
||||
const { workYear, isLoadingWorkYear, errorWorkYear } = useWorkYear();
|
||||
|
||||
const initialValues = {
|
||||
requested_facility_amount: state.requested_facility_amount,
|
||||
person_share: state.person_share,
|
||||
work_year: state.work_year,
|
||||
investment_amount: state.investment_amount,
|
||||
exploitation_date: state.exploitation_date,
|
||||
exploitation_license_renewal_date: state.exploitation_license_renewal_date,
|
||||
@@ -33,6 +37,7 @@ const RestoreRequestDetail = ({ state, handleBack, handleSubmit, submitting, can
|
||||
t("LoanRequest.error_message_max_loan_refahi_restore")
|
||||
),
|
||||
person_share: Yup.string().required(t("LoanRequest.error_message_applicant_payment")),
|
||||
work_year: Yup.string().required(t("LoanRequest.error_message_work_year")),
|
||||
investment_amount: Yup.string().required(t("LoanRequest.error_message_money_investment")),
|
||||
exploitation_date: Yup.string().required(t("LoanRequest.error_message_operation_date")),
|
||||
exploitation_license_renewal_date: Yup.string().required(t("LoanRequest.error_message_refresh_date")),
|
||||
@@ -80,7 +85,7 @@ const RestoreRequestDetail = ({ state, handleBack, handleSubmit, submitting, can
|
||||
return (
|
||||
<>
|
||||
<Grid container spacing={2} sx={{ padding: 2 }}>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<PriceField
|
||||
name="investment_amount"
|
||||
label={t("LoanRequest.text_field_money_investment")}
|
||||
@@ -111,7 +116,7 @@ const RestoreRequestDetail = ({ state, handleBack, handleSubmit, submitting, can
|
||||
fullWidth
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={4}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<PriceField
|
||||
name="requested_facility_amount"
|
||||
label={t("LoanRequest.text_field_requested_facilities")}
|
||||
@@ -133,7 +138,9 @@ const RestoreRequestDetail = ({ state, handleBack, handleSubmit, submitting, can
|
||||
fullWidth
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={4}>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ p: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<PriceField
|
||||
name="person_share"
|
||||
label={t("LoanRequest.text_field_applicant_payment")}
|
||||
@@ -150,6 +157,27 @@ const RestoreRequestDetail = ({ state, handleBack, handleSubmit, submitting, can
|
||||
fullWidth
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<SelectBox
|
||||
name="work_year"
|
||||
label={t("LoanRequest.text_field_work_year")}
|
||||
size="small"
|
||||
value={formik.values.work_year}
|
||||
selectType="work_year"
|
||||
selectors={workYear}
|
||||
isLoading={isLoadingWorkYear}
|
||||
errorEcured={errorWorkYear}
|
||||
schema={{ value: "name", name: "name" }}
|
||||
select={formik.values.work_year}
|
||||
handleChange={(event) => {
|
||||
formik.setFieldValue("work_year", event.target.value);
|
||||
}}
|
||||
setFieldTouched={formik.setFieldTouched}
|
||||
error={formik.touched.work_year && Boolean(formik.errors.work_year)}
|
||||
helperText={formik.touched.work_year && formik.errors.work_year}
|
||||
onBlur={formik.handleBlur("work_year")}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ p: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
|
||||
@@ -19,6 +19,7 @@ const _data = {
|
||||
last_name: "",
|
||||
city_id: "",
|
||||
project_city_id: "",
|
||||
work_year: "",
|
||||
province_id: "",
|
||||
project_province_id: "",
|
||||
education_id: "",
|
||||
|
||||
@@ -29,8 +29,9 @@ const ShowLoan = () => {
|
||||
father_name: LoanDetails?.father_name || "",
|
||||
gender: LoanDetails?.gender || "",
|
||||
welfare_complex_degree: LoanDetails?.welfare_complex_degree || "",
|
||||
first_name: LoanDetails?.first_name || "",
|
||||
last_name: LoanDetails?.last_name || "",
|
||||
first_name: LoanDetails?.first_name || "",
|
||||
work_year: LoanDetails?.work_year || "",
|
||||
city_id: LoanDetails?.city_id || "",
|
||||
project_city_id: LoanDetails?.project_city_id || "",
|
||||
province_id: LoanDetails?.province_id || "",
|
||||
|
||||
@@ -21,6 +21,7 @@ function SelectBox({
|
||||
<FormControl disabled={disabled || false} fullWidth variant={variant} size="small" error={error}>
|
||||
<InputLabel>{label}</InputLabel>
|
||||
<Select
|
||||
variant={"outlined"}
|
||||
label={label}
|
||||
name={name}
|
||||
size="small"
|
||||
|
||||
@@ -29,5 +29,6 @@ export const UPDATE_LOAN_REFAHI = BASE_URL + "/refahi/loan/update/";
|
||||
|
||||
export const GET_PROJECT_TITLE = BASE_URL + "/navgan_plans";
|
||||
export const GET_ACTIVITY_LIST = BASE_URL + "/activity_types";
|
||||
export const GET_WORK_YEAR_LIST = BASE_URL + "/work_years";
|
||||
export const GET_PRIORITY_LIST = BASE_URL + "/activity_priorities";
|
||||
export const SEND_LOAN_REQUEST_REFAHI = BASE_URL + "/refahi/loan/store";
|
||||
|
||||
36
src/lib/app/hooks/useWorkYear.jsx
Normal file
36
src/lib/app/hooks/useWorkYear.jsx
Normal file
@@ -0,0 +1,36 @@
|
||||
import { GET_WORK_YEAR_LIST } from "@/core/data/apiRoutes";
|
||||
import { useRequest } from "@witel/webapp-builder";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
const useWorkYear = () => {
|
||||
const [isLoadingWorkYear, setIsLoadingWorkYear] = useState(true);
|
||||
const [errorWorkYear, setErrorWorkYear] = useState(false);
|
||||
const [workYear, setWorkYear] = useState([]);
|
||||
const requestServer = useRequest({ auth: true, notification: false });
|
||||
|
||||
useEffect(() => {
|
||||
setIsLoadingWorkYear(true);
|
||||
requestServer(GET_WORK_YEAR_LIST, "get", { auth: true, notification: false })
|
||||
.then(({ data }) => {
|
||||
const formattedData = data.data.map((activityList, index) => ({
|
||||
id: index,
|
||||
name: activityList.year,
|
||||
value: activityList.id,
|
||||
}));
|
||||
setIsLoadingWorkYear(false);
|
||||
setWorkYear(formattedData);
|
||||
})
|
||||
.catch(() => {
|
||||
setIsLoadingWorkYear(false);
|
||||
setErrorWorkYear(true);
|
||||
});
|
||||
}, []);
|
||||
|
||||
return {
|
||||
workYear,
|
||||
isLoadingWorkYear,
|
||||
errorWorkYear,
|
||||
};
|
||||
};
|
||||
|
||||
export default useWorkYear;
|
||||
Reference in New Issue
Block a user