From 4dc7972b27e2c7611aef1b3a9c1a0a9f6e4af261 Mon Sep 17 00:00:00 2001 From: Amin Ghasempoor Date: Tue, 8 Apr 2025 10:40:10 +0000 Subject: [PATCH] Feature/followup refahi --- public/locales/fa/app.json | 61 +++ .../ApprovedBankLoanContent.jsx | 131 ++++++ .../Form/ApprovedBankLoan/index.jsx | 43 ++ .../Form/BankPayment/BankPaymentContent.jsx | 96 +++++ .../loan-followup/Form/BankPayment/index.jsx | 43 ++ .../ComebackLoanDetailContent.jsx | 94 +++++ .../Form/ComebackLoanDetail/index.jsx | 43 ++ .../PlanningCouncilTable.jsx | 151 +++++++ .../Form/PlanningCouncilForm/index.jsx | 43 ++ .../ReferPassengerBossContent.jsx | 89 ++++ .../Form/ReferPassengerBoss/index.jsx | 32 ++ .../Form/UserInfoForm/BuildTableUserInfo.jsx | 81 ++++ .../Form/UserInfoForm/LegalTableContent.jsx | 390 ++++++++++++++++++ .../Form/UserInfoForm/RealTableContent.jsx | 347 ++++++++++++++++ .../UserInfoForm/RestoreTableUserInfo.jsx | 70 ++++ .../loan-followup/Form/UserInfoForm/index.jsx | 57 +++ .../refahi/loan-followup/TableRowActions.jsx | 31 ++ .../refahi/loan-followup/TableToolbar.jsx | 7 + .../dashboard/refahi/loan-followup/index.jsx | 225 ++++++++++ .../Form/ConfirmForm/ConfirmContent.jsx | 6 +- .../Form/UserInfoForm/BuildTableUserInfo.jsx | 10 +- .../Form/UserInfoForm/LegalTableContent.jsx | 26 +- .../Form/UserInfoForm/RealTableContent.jsx | 16 +- .../UserInfoForm/RestoreTableUserInfo.jsx | 10 +- .../Form/UserInfoForm/index.jsx | 9 +- .../passenger-boss/print-report/index.jsx | 8 +- .../Buttons/PrintExcel.jsx | 69 ++++ .../refahi-loan-management/TableToolbar.jsx | 12 + .../refahi/refahi-loan-management/index.jsx | 71 +++- .../Form/ConfirmForm/ConfirmContent.jsx | 4 +- .../Form/UserInfoForm/BuildTableUserInfo.jsx | 10 +- .../Form/UserInfoForm/LegalTableContent.jsx | 26 +- .../Form/UserInfoForm/RealTableContent.jsx | 16 +- .../UserInfoForm/RestoreTableUserInfo.jsx | 10 +- .../Form/UserInfoForm/index.jsx | 9 +- .../refahi-province-manager/restore/index.jsx | 6 +- .../Form/ConfirmForm/ConfirmContent.jsx | 2 +- .../Form/UserInfoForm/BuildTableUserInfo.jsx | 10 +- .../Form/UserInfoForm/LegalTableContent.jsx | 26 +- .../Form/UserInfoForm/RealTableContent.jsx | 16 +- .../UserInfoForm/RestoreTableUserInfo.jsx | 10 +- .../Form/UserInfoForm/index.jsx | 9 +- .../restore/index.jsx | 2 +- src/core/data/apiRoutes.js | 17 +- src/core/data/sidebarMenu.jsx | 20 + .../dashboard/refahi/loan-followup/index.jsx | 19 + .../refahi-province-manager/build/index.jsx | 2 +- .../refahi/refahi-province-manager/index.jsx | 2 +- .../refahi-province-manager/restore/index.jsx | 2 +- 49 files changed, 2350 insertions(+), 139 deletions(-) create mode 100644 src/components/dashboard/refahi/loan-followup/Form/ApprovedBankLoan/ApprovedBankLoanContent.jsx create mode 100644 src/components/dashboard/refahi/loan-followup/Form/ApprovedBankLoan/index.jsx create mode 100644 src/components/dashboard/refahi/loan-followup/Form/BankPayment/BankPaymentContent.jsx create mode 100644 src/components/dashboard/refahi/loan-followup/Form/BankPayment/index.jsx create mode 100644 src/components/dashboard/refahi/loan-followup/Form/ComebackLoanDetail/ComebackLoanDetailContent.jsx create mode 100644 src/components/dashboard/refahi/loan-followup/Form/ComebackLoanDetail/index.jsx create mode 100644 src/components/dashboard/refahi/loan-followup/Form/PlanningCouncilForm/PlanningCouncilTable.jsx create mode 100644 src/components/dashboard/refahi/loan-followup/Form/PlanningCouncilForm/index.jsx create mode 100644 src/components/dashboard/refahi/loan-followup/Form/ReferPassengerBoss/ReferPassengerBossContent.jsx create mode 100644 src/components/dashboard/refahi/loan-followup/Form/ReferPassengerBoss/index.jsx create mode 100644 src/components/dashboard/refahi/loan-followup/Form/UserInfoForm/BuildTableUserInfo.jsx create mode 100644 src/components/dashboard/refahi/loan-followup/Form/UserInfoForm/LegalTableContent.jsx create mode 100644 src/components/dashboard/refahi/loan-followup/Form/UserInfoForm/RealTableContent.jsx create mode 100644 src/components/dashboard/refahi/loan-followup/Form/UserInfoForm/RestoreTableUserInfo.jsx create mode 100644 src/components/dashboard/refahi/loan-followup/Form/UserInfoForm/index.jsx create mode 100644 src/components/dashboard/refahi/loan-followup/TableRowActions.jsx create mode 100644 src/components/dashboard/refahi/loan-followup/TableToolbar.jsx create mode 100644 src/components/dashboard/refahi/loan-followup/index.jsx create mode 100644 src/components/dashboard/refahi/refahi-loan-management/Buttons/PrintExcel.jsx create mode 100644 src/components/dashboard/refahi/refahi-loan-management/TableToolbar.jsx create mode 100644 src/pages/dashboard/refahi/loan-followup/index.jsx diff --git a/public/locales/fa/app.json b/public/locales/fa/app.json index cc320fd..824f252 100644 --- a/public/locales/fa/app.json +++ b/public/locales/fa/app.json @@ -73,6 +73,7 @@ "edit-profile": "ویرایش پروفایل", "loan-history": "کارتابل نظارت", "loan-followup": "پیگیری وام", + "refahi-loan-followup": "پیگیری وام", "loan-history-province": "کارتابل نظارت استانی", "reserve-loan": "وام های رزرو" }, @@ -84,6 +85,7 @@ "refahi-transportation": "رفاهی", "refahi-province-working-group": "رفاهی", "navgan-loan-management": "ناوگان", + "refahi-loan-followup": "رفاهی", "navgan-province-manager": "ناوگان", "admin-management": "ادمین" }, @@ -343,6 +345,59 @@ "first_form": "فرم الف را بارگذاری کنید", "second_form": "فرم ب را بارگذاری کنید" }, + "RefahiLoanFollowUp": { + "name": "نام", + "birthday": "تاریخ تولد", + "approved_amount": "مبلغ مصوب", + "branch_name": "نام شعبه", + "project_title": "نام پروژه", + "first_name": "نام", + "last_name": "نام خانوادگی", + "bank_state": "وضعیت پیگیری بانک", + "button-reserve-confirm": "رزرو", + "reserve-loan-title": "رزرو وام", + "description-reserve-loan-first": "آیا از رزرو وام به کد یکتا", + "description-reserve-loan-second": "اطمینان دارید؟", + "button-reserve-cancel": "بستن", + "national_serial_number": "سریال پشت کارت ملی", + "national_tracking_code": "کد رهگیری کارت ملی", + "city_name": "شهرستان", + "plate_number": "پلاک", + "refer_reason": "علت ارجاع", + "statement_count": "تعداد صورت وضعیت", + "id": "کد یکتا", + "score": "اولویت", + "navgan_capacity": "ظرفیت", + "manufacture_date": "سال ساخت", + "shenase_meli": "شناسه ملی", + "is_legal_person": "نوع شخص", + "haghighi": "حقیقی", + "hoghoghi": "حقوقی", + "province_name": "استان", + "sakht_period": "دوره ساخت", + "tanafos_period": "دوره تنفس", + "national_id": "کد ملی", + "phone_number": "موبایل", + "proposed_amount": "مبلغ پیشنهادی", + "created_at": "تاریخ درخواست", + "updated_at": "تاریخ بروزرسانی", + "navgan_id": "کد ناوگان", + "vehicle_type": "نوع ماشین", + "state_name": "وضعیت درخواست", + "confirm": "تایید و ارجاع به معاون حمل و نقل", + "upload_file": "فایل خود را بارگذاری کنید(اختیاری)", + "upload_expert_img": "فایل گزارش کارشناسی را بارگذاری کنید", + "upload_file_required": "وارد کردن گزارش کارشناسی الزامیست", + "upload_file_unit": "فایل بارگذاری شده باید حداکثر 5Mb باشد", + "upload_file_format": "فرمت قابل قبول : png,jpg,pdf", + "upload_expert_file_required": "وارد کردن گزارش کارشناسی الزامیست", + "upload_expert_file_unit": "فایل بارگذاری شده باید حداکثر 5Mb باشد", + "upload_expert_file_format": "فرمت قابل قبول : png,jpg,pdf", + "max_amount": "حداکثر مبلغ تصویب شده {value} میلیون ریال می باشد", + "excel_report": "گزارش اکسل", + "first_form": "فرم الف را بارگذاری کنید", + "second_form": "فرم ب را بارگذاری کنید" + }, "RefahiProvinceManager": { "name": "نام", "id": "کد یکتا", @@ -357,9 +412,15 @@ "RefahiLoanManagement": { "name": "نام", "id": "کد یکتا", + "project_title": "نام پروژه", + "first_name": "نام", + "last_name": "نام خانوادگی", + "shenase_meli": "شناسه ملی", + "is_legal_person": "نوع شخص", "national_id": "کد ملی", "phone_number": "موبایل", "province_name": "استان", + "city_name": "شهر", "created_at": "تاریخ درخواست", "updated_at": "تاریخ بروزرسانی", "navgan_id": "کد ناوگان", diff --git a/src/components/dashboard/refahi/loan-followup/Form/ApprovedBankLoan/ApprovedBankLoanContent.jsx b/src/components/dashboard/refahi/loan-followup/Form/ApprovedBankLoan/ApprovedBankLoanContent.jsx new file mode 100644 index 0000000..cec1f2e --- /dev/null +++ b/src/components/dashboard/refahi/loan-followup/Form/ApprovedBankLoan/ApprovedBankLoanContent.jsx @@ -0,0 +1,131 @@ +import { + Box, + DialogContent, + LinearProgress, + Paper, + Table, + TableBody, + TableCell, + TableContainer, + TableHead, + TableRow, + Typography, +} from "@mui/material"; +import { useTranslations } from "next-intl"; +import { useEffect, useState } from "react"; +import useRequest from "@/lib/app/hooks/useRequest"; +import { GET_REFAHI_APPROVED_BANK_LOAN } from "@/core/data/apiRoutes"; +import moment from "jalali-moment"; + +const ApprovedBankLoanContent = ({ rowId }) => { + const t = useTranslations(); + const requestServer = useRequest({ auth: true, notification: false }); + const [ApprovedBankDetail, setApprovedBankDetail] = useState([]); + const [isLoading, setIsLoading] = useState(true); + const [error, setError] = useState(false); + useEffect(() => { + requestServer(`${GET_REFAHI_APPROVED_BANK_LOAN}/${rowId}`, "get") + .then((res) => { + setApprovedBankDetail(res.data.data); + setIsLoading(false); + }) + .catch((error) => { + setError(true); + }); + }, []); + + return ( + + {error ? ( + + {t("LoanHistory.Table_history_error")} + + ) : isLoading ? ( + + ) : ( + + + + + + {t("ApprovedBankLoanDialog.Table_head_approved_date")} + + {t("ApprovedBankLoanDialog.Table_head_approved_facility_bank")} + + + {t("ApprovedBankLoanDialog.Table_head_approved_facility_gov")} + + + {t("ApprovedBankLoanDialog.Table_head_approved_facility_person")} + + {t("ApprovedBankLoanDialog.Table_head_contract_date")} + + {t("ApprovedBankLoanDialog.Table_head_contract_facility_bank")} + + + {t("ApprovedBankLoanDialog.Table_head_contract_facility_gov")} + + + {t("ApprovedBankLoanDialog.Table_head_contract_facility_person")} + + {t("ApprovedBankLoanDialog.Table_head_due_date")} + + + + + + {ApprovedBankDetail.approved_date + ? moment(ApprovedBankDetail.approved_date) + .locale("fa") + .format("HH:mm | yyyy/MM/DD") + : null} + + {ApprovedBankDetail?.approved_facility_bank} + {ApprovedBankDetail?.approved_facility_gov} + {ApprovedBankDetail?.approved_facility_person} + + {ApprovedBankDetail.contract_date + ? moment(ApprovedBankDetail.contract_date) + .locale("fa") + .format("HH:mm | yyyy/MM/DD") + : null} + + {ApprovedBankDetail?.contract_facility_bank} + {ApprovedBankDetail?.contract_facility_gov} + {ApprovedBankDetail?.contract_facility_person} + + {ApprovedBankDetail.due_date + ? moment(ApprovedBankDetail.due_date) + .locale("fa") + .format("HH:mm | yyyy/MM/DD") + : null} + + + +
+
+
+ )} +
+ ); +}; +export default ApprovedBankLoanContent; diff --git a/src/components/dashboard/refahi/loan-followup/Form/ApprovedBankLoan/index.jsx b/src/components/dashboard/refahi/loan-followup/Form/ApprovedBankLoan/index.jsx new file mode 100644 index 0000000..95aa169 --- /dev/null +++ b/src/components/dashboard/refahi/loan-followup/Form/ApprovedBankLoan/index.jsx @@ -0,0 +1,43 @@ +import { Button, Dialog, DialogActions, DialogTitle, IconButton, Tooltip } from "@mui/material"; +import { useTranslations } from "next-intl"; +import { useState } from "react"; +import GavelIcon from "@mui/icons-material/Gavel"; +import ApprovedBankLoanContent from "./ApprovedBankLoanContent"; + +const ApprovedBankLoan = ({ rowId }) => { + const t = useTranslations(); + const [openApprovedBankLoanDialog, setOpenApprovedBankLoanDialog] = useState(false); + return ( + <> + + setOpenApprovedBankLoanDialog(true)}> + + + + + {t("ApprovedBankLoanDialog.approved-bank-loan")} + + + + + + + ); +}; +export default ApprovedBankLoan; diff --git a/src/components/dashboard/refahi/loan-followup/Form/BankPayment/BankPaymentContent.jsx b/src/components/dashboard/refahi/loan-followup/Form/BankPayment/BankPaymentContent.jsx new file mode 100644 index 0000000..c4f9f9e --- /dev/null +++ b/src/components/dashboard/refahi/loan-followup/Form/BankPayment/BankPaymentContent.jsx @@ -0,0 +1,96 @@ +import { + Box, + LinearProgress, + Paper, + Table, + TableBody, + TableCell, + TableContainer, + TableHead, + TableRow, + Typography, +} from "@mui/material"; +import { useTranslations } from "next-intl"; +import { useEffect, useState } from "react"; +import useRequest from "@/lib/app/hooks/useRequest"; +import { GET_REFAHI_BANK_PAYMENT } from "@/core/data/apiRoutes"; +import moment from "jalali-moment"; + +const BankPaymentContent = ({ rowId }) => { + const t = useTranslations(); + const requestServer = useRequest({ auth: true, notification: false }); + const [BankPaymentDetail, setBankPaymentDetail] = useState([]); + const [isLoading, setIsLoading] = useState(true); + const [error, setError] = useState(false); + useEffect(() => { + requestServer(`${GET_REFAHI_BANK_PAYMENT}/${rowId}`, "get") + .then((res) => { + setBankPaymentDetail(res.data.data); + setIsLoading(false); + }) + .catch((error) => { + setError(true); + }); + }, []); + + return ( + + {error ? ( + + {t("LoanHistory.Table_history_error")} + + ) : isLoading ? ( + + ) : ( + + + + + + {t("BankPaymentDialog.Table_head_installment_number")} + {t("BankPaymentDialog.Table_head_remaining_facility")} + {t("BankPaymentDialog.Table_head_paid_facility")} + {t("BankPaymentDialog.Table_head_paid_date")} + + + + + {BankPaymentDetail?.installment_number} + {BankPaymentDetail?.paid_facility} + {BankPaymentDetail?.remaining_facility} + + {BankPaymentDetail.paid_date + ? moment(BankPaymentDetail.paid_date) + .locale("fa") + .format("HH:mm | yyyy/MM/DD") + : null} + + + +
+
+
+ )} +
+ ); +}; +export default BankPaymentContent; diff --git a/src/components/dashboard/refahi/loan-followup/Form/BankPayment/index.jsx b/src/components/dashboard/refahi/loan-followup/Form/BankPayment/index.jsx new file mode 100644 index 0000000..8a35acf --- /dev/null +++ b/src/components/dashboard/refahi/loan-followup/Form/BankPayment/index.jsx @@ -0,0 +1,43 @@ +import { Button, Dialog, DialogActions, DialogTitle, IconButton, Tooltip } from "@mui/material"; +import { useTranslations } from "next-intl"; +import { useState } from "react"; +import PaidIcon from "@mui/icons-material/Paid"; +import BankPaymentContent from "./BankPaymentContent"; + +const BankPayment = ({ rowId }) => { + const t = useTranslations(); + const [openBankPaymentDialog, setOpenBankPaymentDialog] = useState(false); + return ( + <> + + setOpenBankPaymentDialog(true)}> + + + + + {t("BankPaymentDialog.bank-payment")} + + + + + + + ); +}; +export default BankPayment; diff --git a/src/components/dashboard/refahi/loan-followup/Form/ComebackLoanDetail/ComebackLoanDetailContent.jsx b/src/components/dashboard/refahi/loan-followup/Form/ComebackLoanDetail/ComebackLoanDetailContent.jsx new file mode 100644 index 0000000..0f055ed --- /dev/null +++ b/src/components/dashboard/refahi/loan-followup/Form/ComebackLoanDetail/ComebackLoanDetailContent.jsx @@ -0,0 +1,94 @@ +import { + Box, + LinearProgress, + Paper, + Table, + TableBody, + TableCell, + TableContainer, + TableHead, + TableRow, + Typography, +} from "@mui/material"; +import { useTranslations } from "next-intl"; +import { useEffect, useState } from "react"; +import useRequest from "@/lib/app/hooks/useRequest"; +import { GET_REFAHI_COMEBACK_LOAN_DETAIL } from "@/core/data/apiRoutes"; +import moment from "jalali-moment"; + +const ComebackLoanDetailContent = ({ rowId }) => { + const t = useTranslations(); + const requestServer = useRequest({ auth: true, notification: false }); + const [ComebackLoanDetail, setComebackLoanDetail] = useState([]); + const [isLoading, setIsLoading] = useState(true); + const [error, setError] = useState(false); + useEffect(() => { + requestServer(`${GET_REFAHI_COMEBACK_LOAN_DETAIL}/${rowId}`, "get") + .then((res) => { + setComebackLoanDetail(res.data.data); + setIsLoading(false); + }) + .catch((error) => { + setError(true); + }); + }, []); + + return ( + + {error ? ( + + {t("LoanHistory.Table_history_error")} + + ) : isLoading ? ( + + ) : ( + + + + + + {t("ComebackLoanDetailDialog.Table_head_comeback_name")} + {t("ComebackLoanDetailDialog.Table_head_comeback_comment")} + {t("ComebackLoanDetailDialog.Table_head_comeback_date")} + + + + + {ComebackLoanDetail.comeback_name} + {ComebackLoanDetail.comeback_comment} + + {ComebackLoanDetail.comeback_date + ? moment(ComebackLoanDetail.comeback_date) + .locale("fa") + .format("HH:mm | yyyy/MM/DD") + : null} + + + +
+
+
+ )} +
+ ); +}; +export default ComebackLoanDetailContent; diff --git a/src/components/dashboard/refahi/loan-followup/Form/ComebackLoanDetail/index.jsx b/src/components/dashboard/refahi/loan-followup/Form/ComebackLoanDetail/index.jsx new file mode 100644 index 0000000..c83895c --- /dev/null +++ b/src/components/dashboard/refahi/loan-followup/Form/ComebackLoanDetail/index.jsx @@ -0,0 +1,43 @@ +import { Button, Dialog, DialogActions, DialogTitle, IconButton, Tooltip } from "@mui/material"; +import { useTranslations } from "next-intl"; +import { useState } from "react"; +import SyncAltIcon from "@mui/icons-material/SyncAlt"; +import ComebackLoanDetailContent from "./ComebackLoanDetailContent"; + +const ComebackLoanDetail = ({ rowId }) => { + const t = useTranslations(); + const [openComebackLoanDetailDialog, setOpenComebackLoanDetailDialog] = useState(false); + return ( + <> + + setOpenComebackLoanDetailDialog(true)}> + + + + + {t("ComebackLoanDetailDialog.comeback-loan-detail")} + + + + + + + ); +}; +export default ComebackLoanDetail; diff --git a/src/components/dashboard/refahi/loan-followup/Form/PlanningCouncilForm/PlanningCouncilTable.jsx b/src/components/dashboard/refahi/loan-followup/Form/PlanningCouncilForm/PlanningCouncilTable.jsx new file mode 100644 index 0000000..19d10da --- /dev/null +++ b/src/components/dashboard/refahi/loan-followup/Form/PlanningCouncilForm/PlanningCouncilTable.jsx @@ -0,0 +1,151 @@ +import { + Box, + LinearProgress, + Paper, + Table, + TableBody, + TableCell, + TableContainer, + TableHead, + TableRow, + Typography, + IconButton, + Collapse, + Button, + Stack, +} from "@mui/material"; +import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown"; +import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp"; +import { useTranslations } from "next-intl"; +import moment from "jalali-moment"; +import useRequest from "@/lib/app/hooks/useRequest"; +import { useEffect, useState } from "react"; +import { GET_REFAHI_HISTORY_COUNCIL } from "@/core/data/apiRoutes"; + +const CouncilConfirm = { + 1: "تایید", + 2: "عدم تایید", +}; + +const PlanningCouncilTable = ({ rowId }) => { + const t = useTranslations(); + const requestServer = useRequest({ auth: true, notification: false }); + const [CouncilDetails, setCouncilDetails] = useState([]); + const [isLoading, setIsLoading] = useState(true); + const [error, setError] = useState(false); + const [isCommentExpanded, setIsCommentExpanded] = useState(false); + + useEffect(() => { + requestServer(`${GET_REFAHI_HISTORY_COUNCIL}/${rowId}`, "get") + .then((response) => { + setIsLoading(false); + setCouncilDetails(response.data.data); + }) + .catch(() => { + setError(true); + }); + }, []); + const handleToggleComment = () => { + setIsCommentExpanded((prev) => !prev); + }; + + return ( + + {error ? ( + + {t("LoanHistory.Table_history_error")} + + ) : isLoading ? ( + + ) : ( + + + + + + {t("CouncilHistory.Table_head_id")} + {t("CouncilHistory.Table_head_council_confirm")} + {t("CouncilHistory.Table_head_council_comment")} + {t("CouncilHistory.Table_head_planning_council_loan")} + + + + + {CouncilDetails.id} + {CouncilConfirm[CouncilDetails.council_confirm]} + + + + {CouncilDetails.council_reason_name} + + {CouncilDetails.council_comment && ( + + {isCommentExpanded ? ( + + ) : ( + + )} + + )} + + + + + {t("CouncilHistory.council_opinion")} + + + {CouncilDetails.council_comment} + + + + + + {CouncilDetails.planning_council_loan + ? moment(CouncilDetails.planning_council_loan.date_confirm) + .locale("fa") + .format("HH:mm | yyyy/MM/DD") + : null} + + + +
+
+
+ )} +
+ ); +}; + +export default PlanningCouncilTable; diff --git a/src/components/dashboard/refahi/loan-followup/Form/PlanningCouncilForm/index.jsx b/src/components/dashboard/refahi/loan-followup/Form/PlanningCouncilForm/index.jsx new file mode 100644 index 0000000..9c589d3 --- /dev/null +++ b/src/components/dashboard/refahi/loan-followup/Form/PlanningCouncilForm/index.jsx @@ -0,0 +1,43 @@ +import { Button, Dialog, DialogActions, DialogTitle, IconButton, Tooltip } from "@mui/material"; +import { useTranslations } from "next-intl"; +import { useState } from "react"; +import Diversity3Icon from "@mui/icons-material/Diversity3"; +import PlanningCouncilTable from "./PlanningCouncilTable"; + +const PlanningCouncilForm = ({ rowId }) => { + const t = useTranslations(); + const [openPlanningCouncilDialog, setOpenPlanningCouncilDialog] = useState(false); + return ( + <> + + setOpenPlanningCouncilDialog(true)}> + + + + + {t("CouncilHistory.council_history_detail")} + + + + + + + ); +}; +export default PlanningCouncilForm; diff --git a/src/components/dashboard/refahi/loan-followup/Form/ReferPassengerBoss/ReferPassengerBossContent.jsx b/src/components/dashboard/refahi/loan-followup/Form/ReferPassengerBoss/ReferPassengerBossContent.jsx new file mode 100644 index 0000000..985b1be --- /dev/null +++ b/src/components/dashboard/refahi/loan-followup/Form/ReferPassengerBoss/ReferPassengerBossContent.jsx @@ -0,0 +1,89 @@ +import useNotification from "@/lib/app/hooks/useNotification"; +import useRequest from "@/lib/app/hooks/useRequest"; +import { Button, DialogActions, DialogContent, Stack, TextField } from "@mui/material"; +import { useFormik } from "formik"; +import { useTranslations } from "next-intl"; +import * as Yup from "yup"; +import { REFER_REFAHI_LOAN_FOLLOWUP_PASSENGERBOSS } from "@/core/data/apiRoutes"; + +const ReferPassengerBossContent = ({ rowId, mutate, setOpenReferDialog }) => { + const t = useTranslations(); + const requestServer = useRequest({ auth: true }); + const { update_notification } = useNotification(); + + const validationSchema = Yup.object().shape({ + description: Yup.string().required(t("ReferDialog.description_error")), + }); + + const formik = useFormik({ + initialValues: { + description: "", + }, + validationSchema, + onSubmit: (values, { setSubmitting }) => { + const formData = new FormData(); + formData.append("expert_description", values.description); + requestServer(`${REFER_REFAHI_LOAN_FOLLOWUP_PASSENGERBOSS}/${rowId}`, "post", { + data: formData, + }) + .then((response) => { + setOpenReferDialog(false); + mutate(); + update_notification(); + }) + .catch(() => {}) + .finally(() => { + setSubmitting(false); + }); + }, + }); + + const handleDescriptionChange = (event) => { + formik.setFieldValue("description", event.target.value); + formik.handleChange(event); + }; + return ( + <> + + + + + + + + + + + + + ); +}; +export default ReferPassengerBossContent; diff --git a/src/components/dashboard/refahi/loan-followup/Form/ReferPassengerBoss/index.jsx b/src/components/dashboard/refahi/loan-followup/Form/ReferPassengerBoss/index.jsx new file mode 100644 index 0000000..f31f153 --- /dev/null +++ b/src/components/dashboard/refahi/loan-followup/Form/ReferPassengerBoss/index.jsx @@ -0,0 +1,32 @@ +import { Dialog, DialogTitle, IconButton, Tooltip } from "@mui/material"; +import { useTranslations } from "next-intl"; +import { useState } from "react"; +import UTurnRightIcon from "@mui/icons-material/UTurnRight"; +import ReferPassengerBossContent from "./ReferPassengerBossContent"; + +const ReferPassengerBoss = ({ rowId, mutate }) => { + const t = useTranslations(); + const [openReferDialog, setOpenReferDialog] = useState(false); + return ( + <> + + setOpenReferDialog(true)}> + + + + + {t("ReferDialog.refer-passenger-boss")} + + + + ); +}; +export default ReferPassengerBoss; diff --git a/src/components/dashboard/refahi/loan-followup/Form/UserInfoForm/BuildTableUserInfo.jsx b/src/components/dashboard/refahi/loan-followup/Form/UserInfoForm/BuildTableUserInfo.jsx new file mode 100644 index 0000000..b4e55bb --- /dev/null +++ b/src/components/dashboard/refahi/loan-followup/Form/UserInfoForm/BuildTableUserInfo.jsx @@ -0,0 +1,81 @@ +import { Button, Chip, Divider, Grid, Link, Stack, Typography } from "@mui/material"; +import DownloadIcon from "@mui/icons-material/Download"; +import { useTranslations } from "next-intl"; + +const BuildTableUserInfo = ({ row }) => { + const t = useTranslations(); + return ( + <> + + + + + + + {row.original.project_physical_progress || t("UserInfoDialog.no_info")} + + + + + + + + + {row.original.basic_approval_number || t("UserInfoDialog.no_info")} + + + + + + + + + + + + + + + + + + + + + + + + + + + {row.original.basic_approval_renewal_date || t("UserInfoDialog.no_info")} + + + + + + ); +}; +export default BuildTableUserInfo; diff --git a/src/components/dashboard/refahi/loan-followup/Form/UserInfoForm/LegalTableContent.jsx b/src/components/dashboard/refahi/loan-followup/Form/UserInfoForm/LegalTableContent.jsx new file mode 100644 index 0000000..2646c62 --- /dev/null +++ b/src/components/dashboard/refahi/loan-followup/Form/UserInfoForm/LegalTableContent.jsx @@ -0,0 +1,390 @@ +import { Chip, DialogContent, DialogTitle, Divider, Grid, Stack, Typography } from "@mui/material"; +import { useTranslations } from "next-intl"; +import moment from "jalali-moment"; +import BuildTableUserInfo from "./BuildTableUserInfo"; +import RestoreTableUserInfo from "./RestoreTableUserInfo"; + +const LegalTableContent = ({ rowId, row }) => { + const t = useTranslations(); + return ( + <> + {t("UserInfoDialog.user_info")} + + + + + + + {t("UserInfoDialog.legal_person")} + + + + + + + {row.original.id || t("UserInfoDialog.no_info")} + + + + + + + + + + {row.original.activity_category_name || t("UserInfoDialog.no_info")} + + + + + + + + + {row.original.project_title || t("UserInfoDialog.no_info")} + + + + + + + + + + + {row.original.first_name || t("UserInfoDialog.no_info")} + + + + + + + + + {row.original.last_name || t("UserInfoDialog.no_info")} + + + + + + + + + + + {row.original.father_name || t("UserInfoDialog.no_info")} + + + + + + + + + {row.original.gender ? t("UserInfoDialog.female") : t("UserInfoDialog.male")} + + + + + + + + + + + {row.original.national_id || t("UserInfoDialog.no_info")} + + + + + + + + + {row.original.national_serial_number || + row.original.national_tracking_code || + t("UserInfoDialog.no_info")} + + + + + + + + + + + {row.original.education_title || t("UserInfoDialog.no_info")} + + + + + + + + + {row.original.occupation_title || t("UserInfoDialog.no_info")} + + + + + + + + + + + {row.original.phone_number || t("UserInfoDialog.no_info")} + + + + + + + + + {row.original.birthday + ? moment(row.original.birthday).locale("fa").format("YYYY/MM/DD") + : t("UserInfoDialog.no_info")} + + + + + + + + + + + {row.original.province_name || t("UserInfoDialog.no_info")} + + + + + + + + + {row.original.city_name || t("UserInfoDialog.no_info")} + + + + + + + + + + + {row.original.shenase_meli || t("UserInfoDialog.no_info")} + + + + + + + + + {row.original.postal_code || t("UserInfoDialog.no_info")} + + + + + + + + + + + {row.original.company_register_date + ? moment(row.original.company_register_date).locale("fa").format("YYYY/MM/DD") + : t("UserInfoDialog.no_info")} + + + + + + + + + {row.original.register_number || t("UserInfoDialog.no_info")} + + + + + + + + + + + {row.original.company_name || t("UserInfoDialog.no_info")} + + + + + + + + + {row.original.telephone_number || t("UserInfoDialog.no_info")} + + + + + + + + + + + {row.original.project_province_name || t("UserInfoDialog.no_info")} + + + + + + + + {row.original.project_city_name} + + + + + + + + + + {row.original.investment_amount / 1000000 >= 1000 + ? t("UserInfoDialog.milyard", { + value: row.original.investment_amount / 1000000000, + }) + : t("UserInfoDialog.toman", { value: row.original.investment_amount / 1000000 })} + + + + + + + + + {row.original.welfare_complex_degree || t("UserInfoDialog.no_info")} + + + + + + + + + + + {row.original.requested_facility_amount / 1000000 >= 1000 + ? t("UserInfoDialog.milyard", { + value: row.original.requested_facility_amount / 1000000000, + }) + : t("UserInfoDialog.toman", { + value: row.original.requested_facility_amount / 1000000, + })} + + + + + + + + + {row.original.person_share / 1000000 >= 1000 + ? t("UserInfoDialog.milyard", { value: row.original.person_share / 1000000000 }) + : t("UserInfoDialog.toman", { value: row.original.person_share / 1000000 })} + + + + + + + + + + + {row.original.user_committed_employment || t("UserInfoDialog.no_info")} + + + + + + + + + {row.original.user_existing_employment || t("UserInfoDialog.no_info")} + + + + + + + + + + + {row.original.project_axis || t("UserInfoDialog.no_info")} + + + + + + + + + {row.original.project_direction || t("UserInfoDialog.no_info")} + + + + + {row.original.refahi_type === 1 ? : } + + + + + + + {row.original.project_kilometer_marker || t("UserInfoDialog.no_info")} + + + + + + + + + + + {row.original.project_address || t("UserInfoDialog.no_info")} + + + + + + + + + + + {row.original.address || t("UserInfoDialog.no_info")} + + + + + + + ); +}; +export default LegalTableContent; diff --git a/src/components/dashboard/refahi/loan-followup/Form/UserInfoForm/RealTableContent.jsx b/src/components/dashboard/refahi/loan-followup/Form/UserInfoForm/RealTableContent.jsx new file mode 100644 index 0000000..2a2bc4b --- /dev/null +++ b/src/components/dashboard/refahi/loan-followup/Form/UserInfoForm/RealTableContent.jsx @@ -0,0 +1,347 @@ +import { Button, Chip, DialogContent, DialogTitle, Divider, Grid, Link, Stack, Typography } from "@mui/material"; +import { useTranslations } from "next-intl"; +import moment from "jalali-moment"; +import DownloadIcon from "@mui/icons-material/Download"; +import BuildTableUserInfo from "./BuildTableUserInfo"; +import RestoreTableUserInfo from "./RestoreTableUserInfo"; + +const RealTableContent = ({ rowId, row }) => { + const t = useTranslations(); + return ( + <> + {t("UserInfoDialog.user_info")} + + + + + + + {t("UserInfoDialog.real_person")} + + + + + + + {row.original.id || t("UserInfoDialog.no_info")} + + + + + + + + + + {row.original.activity_category_name || t("UserInfoDialog.no_info")} + + + + + + + + + {row.original.project_title || t("UserInfoDialog.no_info")} + + + + + + + + + + + {row.original.first_name || t("UserInfoDialog.no_info")} + + + + + + + + + {row.original.last_name || t("UserInfoDialog.no_info")} + + + + + + + + + + + {row.original.national_id || t("UserInfoDialog.no_info")} + + + + + + + + + {row.original.national_serial_number || + row.original.national_tracking_code || + t("UserInfoDialog.no_info")} + + + + + + + + + + + {row.original.education_title || t("UserInfoDialog.no_info")} + + + + + + + + + {row.original.occupation_title || t("UserInfoDialog.no_info")} + + + + + + + + + + + {row.original.phone_number || t("UserInfoDialog.no_info")} + + + + + + + + + {row.original.telephone_number || t("UserInfoDialog.no_info")} + + + + + + + + + + + {row.original.birthday + ? moment(row.original.birthday).locale("fa").format("YYYY/MM/DD") + : t("UserInfoDialog.no_info")} + + + + + + + + + {row.original.postal_code || t("UserInfoDialog.no_info")} + + + + + + + + + + + {row.original.father_name || t("UserInfoDialog.no_info")} + + + + + + + + + {row.original.gender ? t("UserInfoDialog.female") : t("UserInfoDialog.male")} + + + + + + + + + + + {row.original.province_name || t("UserInfoDialog.no_info")} + + + + + + + + {row.original.city_name} + + + + + + + + + + {row.original.user_committed_employment || t("UserInfoDialog.no_info")} + + + + + + + + + {row.original.user_existing_employment || t("UserInfoDialog.no_info")} + + + + + + + + + + + {row.original.project_province_name || t("UserInfoDialog.no_info")} + + + + + + + + {row.original.project_city_name} + + + + + + + + + + {row.original.investment_amount / 1000000 >= 1000 + ? t("UserInfoDialog.milyard", { + value: row.original.investment_amount / 1000000000, + }) + : t("UserInfoDialog.toman", { value: row.original.investment_amount / 1000000 })} + + + + + + + + + {row.original.welfare_complex_degree || t("UserInfoDialog.no_info")} + + + + + + + + + + + {row.original.requested_facility_amount / 1000000 >= 1000 + ? t("UserInfoDialog.milyard", { + value: row.original.requested_facility_amount / 1000000000, + }) + : t("UserInfoDialog.toman", { + value: row.original.requested_facility_amount / 1000000, + })} + + + + + + + + + {row.original.person_share / 1000000 >= 1000 + ? t("UserInfoDialog.milyard", { value: row.original.person_share / 1000000000 }) + : t("UserInfoDialog.toman", { value: row.original.person_share / 1000000 })} + + + + + + + + + + + {row.original.project_axis || t("UserInfoDialog.no_info")} + + + + + + + + + {row.original.project_direction || t("UserInfoDialog.no_info")} + + + + + {row.original.refahi_type === 1 ? : } + + + + + + + {row.original.project_kilometer_marker || t("UserInfoDialog.no_info")} + + + + + + + + + + + {row.original.project_address || t("UserInfoDialog.no_info")} + + + + + + + + + + + {row.original.address || t("UserInfoDialog.no_info")} + + + + + + + ); +}; +export default RealTableContent; diff --git a/src/components/dashboard/refahi/loan-followup/Form/UserInfoForm/RestoreTableUserInfo.jsx b/src/components/dashboard/refahi/loan-followup/Form/UserInfoForm/RestoreTableUserInfo.jsx new file mode 100644 index 0000000..54692cd --- /dev/null +++ b/src/components/dashboard/refahi/loan-followup/Form/UserInfoForm/RestoreTableUserInfo.jsx @@ -0,0 +1,70 @@ +import { Button, Chip, Divider, Grid, Link, Stack, Typography } from "@mui/material"; +import DownloadIcon from "@mui/icons-material/Download"; +import { useTranslations } from "next-intl"; + +const RestoreTableUserInfo = ({ row }) => { + const t = useTranslations(); + return ( + <> + + + + + + + {row.original.exploitation_date || t("UserInfoDialog.no_info")} + + + + + + + + + {row.original.exploitation_license_renewal_date || t("UserInfoDialog.no_info")} + + + + + + + + + + + + + + + + + + + + + + ); +}; +export default RestoreTableUserInfo; diff --git a/src/components/dashboard/refahi/loan-followup/Form/UserInfoForm/index.jsx b/src/components/dashboard/refahi/loan-followup/Form/UserInfoForm/index.jsx new file mode 100644 index 0000000..d0e47ea --- /dev/null +++ b/src/components/dashboard/refahi/loan-followup/Form/UserInfoForm/index.jsx @@ -0,0 +1,57 @@ +import { Button, Dialog, DialogActions, IconButton, Tooltip } from "@mui/material"; +import { useTranslations } from "next-intl"; +import { useState } from "react"; +import ContactPageIcon from "@mui/icons-material/ContactPage"; +import LegalTableContent from "./LegalTableContent"; +import RealTableContent from "./RealTableContent"; +const UserInfoForm = ({ rowId, row }) => { + const t = useTranslations(); + const [openUserInfoDialog, setOpenUserInfoDialog] = useState(false); + return ( + <> + + { + setOpenUserInfoDialog(true); + }} + > + + + + + {row.original.is_legal_person === 1 ? ( + + ) : ( + + )} + + + + + + + ); +}; +export default UserInfoForm; diff --git a/src/components/dashboard/refahi/loan-followup/TableRowActions.jsx b/src/components/dashboard/refahi/loan-followup/TableRowActions.jsx new file mode 100644 index 0000000..7a2cfb3 --- /dev/null +++ b/src/components/dashboard/refahi/loan-followup/TableRowActions.jsx @@ -0,0 +1,31 @@ +import { Box } from "@mui/material"; +import ReferPassengerBoss from "./Form/ReferPassengerBoss"; +import UserInfoForm from "./Form/UserInfoForm"; +import PlanningCouncilForm from "./Form/PlanningCouncilForm"; +import ComebackLoanDetail from "./Form/ComebackLoanDetail"; +import BankPayment from "./Form/BankPayment"; +import ApprovedBankLoan from "./Form/ApprovedBankLoan"; + +const TableRow = ({ row, mutate }) => { + return ( + + + {[11, 12, 13, 14, 15, 16].includes(row.original.state_id) && ( + + )} + + {row.original.state_id === 16 && } + + {row.original.state_id === 15 && } + + {row.original.state_id === 14 || row.original.state_id === 15 ? ( + + ) : null} + + {row.original.state_id === 11 || row.original.state_id === 16 ? ( + + ) : null} + + ); +}; +export default TableRow; diff --git a/src/components/dashboard/refahi/loan-followup/TableToolbar.jsx b/src/components/dashboard/refahi/loan-followup/TableToolbar.jsx new file mode 100644 index 0000000..7be1e50 --- /dev/null +++ b/src/components/dashboard/refahi/loan-followup/TableToolbar.jsx @@ -0,0 +1,7 @@ +import { Stack } from "@mui/material"; + +const TableToolbar = ({ table }) => { + return ; +}; + +export default TableToolbar; diff --git a/src/components/dashboard/refahi/loan-followup/index.jsx b/src/components/dashboard/refahi/loan-followup/index.jsx new file mode 100644 index 0000000..0c08f12 --- /dev/null +++ b/src/components/dashboard/refahi/loan-followup/index.jsx @@ -0,0 +1,225 @@ +import { useTranslations } from "next-intl"; +import { useMemo } from "react"; +import { Box, Typography } from "@mui/material"; +import moment from "jalali-moment"; +import MuiDatePicker from "@/core/components/MuiDatePicker"; +import DataTable from "@/core/components/DataTable"; +import { GET_REFAHI_LOAN_FOLLOWUP } from "@/core/data/apiRoutes"; +import TableToolbar from "./TableToolbar"; +import TableRowActions from "./TableRowActions"; + +function DashboardLoanFollowUpComponent() { + const t = useTranslations(); + const columns = useMemo( + () => [ + { + accessorFn: (row) => row.id, + id: "id", + header: t("RefahiLoanFollowUp.id"), + enableColumnFilter: true, + datatype: "numeric", + filterFn: "equals", + columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"], + Cell: ({ renderedCellValue }) => {renderedCellValue}, + }, + { + accessorFn: (row) => row.project_title, + id: "project_title", + header: t("RefahiLoanFollowUp.project_title"), + enableColumnFilter: false, + datatype: "text", + filterFn: "equals", + columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"], + Cell: ({ renderedCellValue }) => {renderedCellValue}, + }, + { + accessorFn: (row) => row.is_legal_person, + id: "is_legal_person", + header: t("RefahiLoanFollowUp.is_legal_person"), + enableColumnFilter: false, + datatype: "numeric", + filterFn: "equals", + columnFilterModeOptions: ["equals"], + Cell: ({ renderedCellValue }) => ( + + {renderedCellValue === 1 ? `${t("PassengerBoss.hoghoghi")}` : `${t("PassengerBoss.haghighi")}`} + + ), + }, + { + accessorFn: (row) => row.first_name, + id: "first_name", + header: t("RefahiLoanFollowUp.first_name"), + enableColumnFilter: true, + datatype: "text", + filterFn: "contains", + columnFilterModeOptions: ["contains", "equals", "notEquals"], + Cell: ({ renderedCellValue }) => {renderedCellValue}, + }, + { + accessorFn: (row) => row.last_name, + id: "last_name", + header: t("RefahiLoanFollowUp.last_name"), + enableColumnFilter: true, + datatype: "text", + filterFn: "contains", + columnFilterModeOptions: ["contains", "equals", "notEquals"], + Cell: ({ renderedCellValue }) => {renderedCellValue}, + }, + { + accessorFn: (row) => row.national_id, + id: "national_id", + header: t("RefahiLoanFollowUp.national_id"), + enableColumnFilter: true, + datatype: "numeric", + filterFn: "equals", + columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"], + Cell: ({ renderedCellValue }) => {renderedCellValue}, + }, + { + accessorFn: (row) => row.shenase_meli, + id: "shenase_meli", + header: t("RefahiLoanFollowUp.shenase_meli"), + enableColumnFilter: true, + datatype: "numeric", + filterFn: "equals", + columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"], + Cell: ({ renderedCellValue }) => {renderedCellValue}, + }, + { + accessorFn: (row) => row.national_serial_number, + id: "national_serial_number", + header: t("RefahiLoanFollowUp.national_serial_number"), + enableColumnFilter: true, + datatype: "numeric", + filterFn: "equals", + columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"], + Cell: ({ renderedCellValue }) => {renderedCellValue}, + }, + { + accessorFn: (row) => row.national_tracking_code, + id: "national_tracking_code", + header: t("RefahiLoanFollowUp.national_tracking_code"), + enableColumnFilter: true, + datatype: "text", + filterFn: "equals", + columnFilterModeOptions: ["equals", "notEquals", "contains"], + Cell: ({ renderedCellValue }) => {renderedCellValue}, + }, + { + accessorFn: (row) => row.birthday, + id: "birthday", + header: t("RefahiLoanFollowUp.birthday"), + enableColumnFilter: true, + datatype: "text", + filterFn: "contains", + columnFilterModeOptions: ["contains", "equals", "notEquals"], + Cell: ({ renderedCellValue }) => ( + + {moment(renderedCellValue).locale("fa").format("yyyy/MM/DD")} + + ), + }, + { + accessorFn: (row) => row.approved_amount, + id: "approved_amount", + header: t("RefahiLoanFollowUp.approved_amount"), + enableColumnFilter: true, + datatype: "text", + filterFn: "equals", + columnFilterModeOptions: ["equals", "notEquals", "contains"], + Cell: ({ renderedCellValue }) => ( + {Number(renderedCellValue).toLocaleString()} + ), + }, + { + accessorFn: (row) => row.branch_name, + id: "branch_name", + header: t("RefahiLoanFollowUp.branch_name"), + enableColumnFilter: true, + datatype: "text", + filterFn: "contains", + columnFilterModeOptions: ["contains", "equals", "notEquals"], + Cell: ({ renderedCellValue }) => {renderedCellValue}, + }, + { + accessorFn: (row) => row.province_name, + id: "province_name", + header: t("RefahiLoanFollowUp.province_name"), + enableColumnFilter: true, + datatype: "text", + filterFn: "contains", + columnFilterModeOptions: ["contains", "equals", "notEquals"], + Cell: ({ renderedCellValue }) => {renderedCellValue}, + }, + { + accessorFn: (row) => row.city_name, + id: "city_name", + header: t("RefahiLoanFollowUp.city_name"), + enableColumnFilter: true, + datatype: "text", + filterFn: "contains", + columnFilterModeOptions: ["contains", "equals", "notEquals"], + Cell: ({ renderedCellValue }) => {renderedCellValue}, + }, + { + accessorFn: (row) => moment(row.created_at).locale("fa").format("HH:mm | yyyy/MM/DD"), + id: "created_at", + header: t("RefahiLoanFollowUp.created_at"), + enableColumnFilter: true, + datatype: "date", + filterFn: "lessThan", + columnFilterModeOptions: ["lessThan", "greaterThan"], + Cell: ({ renderedCellValue }) => { + return {renderedCellValue}; + }, + Header: ({ column }) => <>{column.columnDef.header}, + Filter: ({ column }) => { + return ; + }, + }, + { + accessorFn: (row) => row.phone_number, + id: "phone_number", + header: t("RefahiLoanFollowUp.phone_number"), + enableColumnFilter: true, + datatype: "numeric", + filterFn: "equals", + columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"], + Cell: ({ renderedCellValue }) => {renderedCellValue}, + }, + { + accessorFn: (row) => row.state_name, + id: "state_id", + header: t("RefahiLoanFollowUp.state_name"), + enableColumnFilter: false, + datatype: "numeric", + Cell: ({ renderedCellValue }) => {renderedCellValue}, + }, + ], + [] + ); + return ( + + + + ); +} +export default DashboardLoanFollowUpComponent; diff --git a/src/components/dashboard/refahi/passenger-boss/Form/ConfirmForm/ConfirmContent.jsx b/src/components/dashboard/refahi/passenger-boss/Form/ConfirmForm/ConfirmContent.jsx index 12d410d..7405798 100644 --- a/src/components/dashboard/refahi/passenger-boss/Form/ConfirmForm/ConfirmContent.jsx +++ b/src/components/dashboard/refahi/passenger-boss/Form/ConfirmForm/ConfirmContent.jsx @@ -32,17 +32,17 @@ const ConfirmContent = ({ rowId, mutate, setOpenConfirmDialog, row }) => { ? value > parseInt(process.env.NEXT_PUBLIC_BUILD_LOAN_AMOUNT) ? parseInt(loan_refahi_amount[row.original?.refahi_type]) : parseInt(loan_refahi_amount[row.original?.refahi_type]) - : parseInt(loan_refahi_amount[row.original?.refahi_type]) + : parseInt(loan_refahi_amount[row.original?.refahi_type]); const message = row.original?.refahi_type == 1 ? value > parseInt(process.env.NEXT_PUBLIC_BUILD_LOAN_AMOUNT) && `${t("PassengerBoss.max_amount", { - value: (maxAmount/1000).toLocaleString("en"), + value: (maxAmount / 1000).toLocaleString("en"), amount: "میلیارد", })}` : value > parseInt(process.env.NEXT_PUBLIC_RESTORE_LOAN_AMOUNT) && `${t("PassengerBoss.max_amount", { - value: (maxAmount/1000).toLocaleString("en"), + value: (maxAmount / 1000).toLocaleString("en"), amount: "میلیارد", })}`; return value <= maxAmount || this.createError({ message }); diff --git a/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/BuildTableUserInfo.jsx b/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/BuildTableUserInfo.jsx index 4c754bb..b4e55bb 100644 --- a/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/BuildTableUserInfo.jsx +++ b/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/BuildTableUserInfo.jsx @@ -2,9 +2,9 @@ import { Button, Chip, Divider, Grid, Link, Stack, Typography } from "@mui/mater import DownloadIcon from "@mui/icons-material/Download"; import { useTranslations } from "next-intl"; -const BuildTableUserInfo = ({row}) => { +const BuildTableUserInfo = ({ row }) => { const t = useTranslations(); - return( + return ( <> @@ -76,6 +76,6 @@ const BuildTableUserInfo = ({row}) => { - ) -} -export default BuildTableUserInfo \ No newline at end of file + ); +}; +export default BuildTableUserInfo; diff --git a/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/LegalTableContent.jsx b/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/LegalTableContent.jsx index 02f7e97..2646c62 100644 --- a/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/LegalTableContent.jsx +++ b/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/LegalTableContent.jsx @@ -1,12 +1,4 @@ -import { - Chip, - DialogContent, - DialogTitle, - Divider, - Grid, - Stack, - Typography -} from "@mui/material"; +import { Chip, DialogContent, DialogTitle, Divider, Grid, Stack, Typography } from "@mui/material"; import { useTranslations } from "next-intl"; import moment from "jalali-moment"; import BuildTableUserInfo from "./BuildTableUserInfo"; @@ -273,8 +265,8 @@ const LegalTableContent = ({ rowId, row }) => { {row.original.investment_amount / 1000000 >= 1000 ? t("UserInfoDialog.milyard", { - value: row.original.investment_amount / 1000000000, - }) + value: row.original.investment_amount / 1000000000, + }) : t("UserInfoDialog.toman", { value: row.original.investment_amount / 1000000 })} @@ -297,11 +289,11 @@ const LegalTableContent = ({ rowId, row }) => { {row.original.requested_facility_amount / 1000000 >= 1000 ? t("UserInfoDialog.milyard", { - value: row.original.requested_facility_amount / 1000000000, - }) + value: row.original.requested_facility_amount / 1000000000, + }) : t("UserInfoDialog.toman", { - value: row.original.requested_facility_amount / 1000000, - })} + value: row.original.requested_facility_amount / 1000000, + })} @@ -357,7 +349,7 @@ const LegalTableContent = ({ rowId, row }) => { - {row.original.refahi_type === 1 ? () : () } + {row.original.refahi_type === 1 ? : } @@ -395,4 +387,4 @@ const LegalTableContent = ({ rowId, row }) => { ); }; -export default LegalTableContent; \ No newline at end of file +export default LegalTableContent; diff --git a/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/RealTableContent.jsx b/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/RealTableContent.jsx index 20b3038..2a2bc4b 100644 --- a/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/RealTableContent.jsx +++ b/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/RealTableContent.jsx @@ -242,8 +242,8 @@ const RealTableContent = ({ rowId, row }) => { {row.original.investment_amount / 1000000 >= 1000 ? t("UserInfoDialog.milyard", { - value: row.original.investment_amount / 1000000000, - }) + value: row.original.investment_amount / 1000000000, + }) : t("UserInfoDialog.toman", { value: row.original.investment_amount / 1000000 })} @@ -266,11 +266,11 @@ const RealTableContent = ({ rowId, row }) => { {row.original.requested_facility_amount / 1000000 >= 1000 ? t("UserInfoDialog.milyard", { - value: row.original.requested_facility_amount / 1000000000, - }) + value: row.original.requested_facility_amount / 1000000000, + }) : t("UserInfoDialog.toman", { - value: row.original.requested_facility_amount / 1000000, - })} + value: row.original.requested_facility_amount / 1000000, + })} @@ -306,7 +306,7 @@ const RealTableContent = ({ rowId, row }) => { - {row.original.refahi_type === 1 ? () : () } + {row.original.refahi_type === 1 ? : } @@ -344,4 +344,4 @@ const RealTableContent = ({ rowId, row }) => { ); }; -export default RealTableContent; \ No newline at end of file +export default RealTableContent; diff --git a/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/RestoreTableUserInfo.jsx b/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/RestoreTableUserInfo.jsx index 7263105..54692cd 100644 --- a/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/RestoreTableUserInfo.jsx +++ b/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/RestoreTableUserInfo.jsx @@ -2,9 +2,9 @@ import { Button, Chip, Divider, Grid, Link, Stack, Typography } from "@mui/mater import DownloadIcon from "@mui/icons-material/Download"; import { useTranslations } from "next-intl"; -const RestoreTableUserInfo = ({row}) => { +const RestoreTableUserInfo = ({ row }) => { const t = useTranslations(); - return( + return ( <> @@ -65,6 +65,6 @@ const RestoreTableUserInfo = ({row}) => { - ) -} -export default RestoreTableUserInfo \ No newline at end of file + ); +}; +export default RestoreTableUserInfo; diff --git a/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/index.jsx b/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/index.jsx index 90de161..d0e47ea 100644 --- a/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/index.jsx +++ b/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/index.jsx @@ -39,7 +39,14 @@ const UserInfoForm = ({ rowId, row }) => { - diff --git a/src/components/dashboard/refahi/passenger-boss/print-report/index.jsx b/src/components/dashboard/refahi/passenger-boss/print-report/index.jsx index 66a546b..a76858f 100644 --- a/src/components/dashboard/refahi/passenger-boss/print-report/index.jsx +++ b/src/components/dashboard/refahi/passenger-boss/print-report/index.jsx @@ -6,9 +6,5 @@ export default function DashboardPassengerBossReportComponent() { const id = searchParams.get("id"); console.log(id); - return ( -
- hello -
- ); -} \ No newline at end of file + return
hello
; +} diff --git a/src/components/dashboard/refahi/refahi-loan-management/Buttons/PrintExcel.jsx b/src/components/dashboard/refahi/refahi-loan-management/Buttons/PrintExcel.jsx new file mode 100644 index 0000000..aa8aaa2 --- /dev/null +++ b/src/components/dashboard/refahi/refahi-loan-management/Buttons/PrintExcel.jsx @@ -0,0 +1,69 @@ +import { Button, CircularProgress } from "@mui/material"; +import { useTranslations } from "next-intl"; +import { useMemo, useState } from "react"; +import useRequest from "@/lib/app/hooks/useRequest"; +import { EXPORT_LOAN_MANAGEMENT_HISTORY } from "@/core/data/apiRoutes"; +import moment from "jalali-moment"; +import FileSaver from "file-saver"; +import DescriptionIcon from "@mui/icons-material/Description"; + +const PrintExcel = ({ table }) => { + const t = useTranslations(); + const [loading, setLoading] = useState(false); + const requestServer = useRequest({ auth: true, pending: false, success: { notification: { show: false } } }); + const { columnFilters, columnFilterFns, sorting } = table.getState(); + const columns = table.getAllColumns(); + + const filterParams = useMemo(() => { + const params = new URLSearchParams(); + const filters = columnFilters.map((filter) => { + let datatype; + for (const i in columns) { + if (columns[i].id == filter.id) { + datatype = columns[i].columnDef.datatype; + } + } + return { + ...filter, + fn: columnFilterFns[filter.id], + datatype: datatype, + }; + }); + params.set("start", "0"); + params.set("filters", JSON.stringify(filters ?? [])); + params.set("sorting", JSON.stringify(sorting ?? [])); + return params; + }, [columnFilters, columnFilterFns, sorting, columns]); + + const clickHandler = () => { + setLoading(true); + requestServer(`${EXPORT_LOAN_MANAGEMENT_HISTORY}?${filterParams}`, "get", { + auth: true, + requestOptions: { responseType: "blob" }, + }) + .then((response) => { + const filename = `خروجی کارتابل مدیریت وام ها تاریخ_${moment().format("jYYYY_jMM_jDD")}.xlsx`; + FileSaver.saveAs(response.data, filename); + }) + .catch(() => {}) + .finally(() => { + setLoading(false); + }); + }; + + return ( + + ); +}; + +export default PrintExcel; diff --git a/src/components/dashboard/refahi/refahi-loan-management/TableToolbar.jsx b/src/components/dashboard/refahi/refahi-loan-management/TableToolbar.jsx new file mode 100644 index 0000000..3e0cb48 --- /dev/null +++ b/src/components/dashboard/refahi/refahi-loan-management/TableToolbar.jsx @@ -0,0 +1,12 @@ +import { Stack } from "@mui/material"; +import PrintExcel from "./Buttons/PrintExcel"; + +const TableToolbar = ({ table }) => { + return ( + + + + ); +}; + +export default TableToolbar; diff --git a/src/components/dashboard/refahi/refahi-loan-management/index.jsx b/src/components/dashboard/refahi/refahi-loan-management/index.jsx index 6a50654..c8d29db 100644 --- a/src/components/dashboard/refahi/refahi-loan-management/index.jsx +++ b/src/components/dashboard/refahi/refahi-loan-management/index.jsx @@ -23,9 +23,43 @@ function DashboardRefahiLoanManagementComponent() { Cell: ({ renderedCellValue }) => {renderedCellValue}, }, { - accessorFn: (row) => row.name, - id: "name", - header: t("RefahiLoanManagement.name"), + accessorFn: (row) => row.project_title, + id: "project_title", + header: t("RefahiLoanManagement.project_title"), + enableColumnFilter: false, + datatype: "text", + filterFn: "equals", + columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"], + Cell: ({ renderedCellValue }) => {renderedCellValue}, + }, + { + accessorFn: (row) => row.is_legal_person, + id: "is_legal_person", + header: t("RefahiLoanManagement.is_legal_person"), + enableColumnFilter: false, + datatype: "numeric", + filterFn: "equals", + columnFilterModeOptions: ["equals"], + Cell: ({ renderedCellValue }) => ( + + {renderedCellValue === 1 ? `${t("PassengerBoss.hoghoghi")}` : `${t("PassengerBoss.haghighi")}`} + + ), + }, + { + accessorFn: (row) => row.first_name, + id: "first_name", + header: t("RefahiLoanManagement.first_name"), + enableColumnFilter: true, + datatype: "text", + filterFn: "contains", + columnFilterModeOptions: ["contains", "equals", "notEquals"], + Cell: ({ renderedCellValue }) => {renderedCellValue}, + }, + { + accessorFn: (row) => row.last_name, + id: "last_name", + header: t("RefahiLoanManagement.last_name"), enableColumnFilter: true, datatype: "text", filterFn: "contains", @@ -43,9 +77,9 @@ function DashboardRefahiLoanManagementComponent() { Cell: ({ renderedCellValue }) => {renderedCellValue}, }, { - accessorFn: (row) => row.phone_number, - id: "phone_number", - header: t("RefahiLoanManagement.phone_number"), + accessorFn: (row) => row.shenase_meli, + id: "shenase_meli", + header: t("RefahiLoanManagement.shenase_meli"), enableColumnFilter: true, datatype: "numeric", filterFn: "equals", @@ -56,7 +90,20 @@ function DashboardRefahiLoanManagementComponent() { accessorFn: (row) => row.province_name, id: "province_name", header: t("RefahiLoanManagement.province_name"), - enableColumnFilter: false, + enableColumnFilter: true, + datatype: "text", + filterFn: "contains", + columnFilterModeOptions: ["contains", "equals", "notEquals"], + Cell: ({ renderedCellValue }) => {renderedCellValue}, + }, + { + accessorFn: (row) => row.city_name, + id: "city_name", + header: t("RefahiLoanManagement.city_name"), + enableColumnFilter: true, + datatype: "text", + filterFn: "contains", + columnFilterModeOptions: ["contains", "equals", "notEquals"], Cell: ({ renderedCellValue }) => {renderedCellValue}, }, { @@ -83,6 +130,16 @@ function DashboardRefahiLoanManagementComponent() { datatype: "numeric", Cell: ({ renderedCellValue }) => {renderedCellValue}, }, + { + accessorFn: (row) => row.phone_number, + id: "phone_number", + header: t("RefahiLoanManagement.phone_number"), + enableColumnFilter: true, + datatype: "numeric", + filterFn: "equals", + columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"], + Cell: ({ renderedCellValue }) => {renderedCellValue}, + }, { accessorFn: (row) => row.state_name, id: "state_id", diff --git a/src/components/dashboard/refahi/refahi-province-manager/Form/ConfirmForm/ConfirmContent.jsx b/src/components/dashboard/refahi/refahi-province-manager/Form/ConfirmForm/ConfirmContent.jsx index 8dd0208..d8be8d1 100644 --- a/src/components/dashboard/refahi/refahi-province-manager/Form/ConfirmForm/ConfirmContent.jsx +++ b/src/components/dashboard/refahi/refahi-province-manager/Form/ConfirmForm/ConfirmContent.jsx @@ -14,9 +14,7 @@ import { } from "@mui/material"; import { useFormik } from "formik"; import { useTranslations } from "next-intl"; -import { - CONFIRM_REFAHI_PROVINCE_MANAGER, CONFIRM_REFAHI_PROVINCE_MANAGER_DETAILS -} from "@/core/data/apiRoutes"; +import { CONFIRM_REFAHI_PROVINCE_MANAGER, CONFIRM_REFAHI_PROVINCE_MANAGER_DETAILS } from "@/core/data/apiRoutes"; import { useEffect, useState } from "react"; import * as Yup from "yup"; import CustomAccordion from "@/core/components/CustomAccordion"; diff --git a/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/BuildTableUserInfo.jsx b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/BuildTableUserInfo.jsx index 4c754bb..b4e55bb 100644 --- a/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/BuildTableUserInfo.jsx +++ b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/BuildTableUserInfo.jsx @@ -2,9 +2,9 @@ import { Button, Chip, Divider, Grid, Link, Stack, Typography } from "@mui/mater import DownloadIcon from "@mui/icons-material/Download"; import { useTranslations } from "next-intl"; -const BuildTableUserInfo = ({row}) => { +const BuildTableUserInfo = ({ row }) => { const t = useTranslations(); - return( + return ( <> @@ -76,6 +76,6 @@ const BuildTableUserInfo = ({row}) => { - ) -} -export default BuildTableUserInfo \ No newline at end of file + ); +}; +export default BuildTableUserInfo; diff --git a/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/LegalTableContent.jsx b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/LegalTableContent.jsx index 02f7e97..2646c62 100644 --- a/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/LegalTableContent.jsx +++ b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/LegalTableContent.jsx @@ -1,12 +1,4 @@ -import { - Chip, - DialogContent, - DialogTitle, - Divider, - Grid, - Stack, - Typography -} from "@mui/material"; +import { Chip, DialogContent, DialogTitle, Divider, Grid, Stack, Typography } from "@mui/material"; import { useTranslations } from "next-intl"; import moment from "jalali-moment"; import BuildTableUserInfo from "./BuildTableUserInfo"; @@ -273,8 +265,8 @@ const LegalTableContent = ({ rowId, row }) => { {row.original.investment_amount / 1000000 >= 1000 ? t("UserInfoDialog.milyard", { - value: row.original.investment_amount / 1000000000, - }) + value: row.original.investment_amount / 1000000000, + }) : t("UserInfoDialog.toman", { value: row.original.investment_amount / 1000000 })}
@@ -297,11 +289,11 @@ const LegalTableContent = ({ rowId, row }) => { {row.original.requested_facility_amount / 1000000 >= 1000 ? t("UserInfoDialog.milyard", { - value: row.original.requested_facility_amount / 1000000000, - }) + value: row.original.requested_facility_amount / 1000000000, + }) : t("UserInfoDialog.toman", { - value: row.original.requested_facility_amount / 1000000, - })} + value: row.original.requested_facility_amount / 1000000, + })}
@@ -357,7 +349,7 @@ const LegalTableContent = ({ rowId, row }) => {
- {row.original.refahi_type === 1 ? () : () } + {row.original.refahi_type === 1 ? : } @@ -395,4 +387,4 @@ const LegalTableContent = ({ rowId, row }) => { ); }; -export default LegalTableContent; \ No newline at end of file +export default LegalTableContent; diff --git a/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/RealTableContent.jsx b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/RealTableContent.jsx index 20b3038..2a2bc4b 100644 --- a/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/RealTableContent.jsx +++ b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/RealTableContent.jsx @@ -242,8 +242,8 @@ const RealTableContent = ({ rowId, row }) => { {row.original.investment_amount / 1000000 >= 1000 ? t("UserInfoDialog.milyard", { - value: row.original.investment_amount / 1000000000, - }) + value: row.original.investment_amount / 1000000000, + }) : t("UserInfoDialog.toman", { value: row.original.investment_amount / 1000000 })} @@ -266,11 +266,11 @@ const RealTableContent = ({ rowId, row }) => { {row.original.requested_facility_amount / 1000000 >= 1000 ? t("UserInfoDialog.milyard", { - value: row.original.requested_facility_amount / 1000000000, - }) + value: row.original.requested_facility_amount / 1000000000, + }) : t("UserInfoDialog.toman", { - value: row.original.requested_facility_amount / 1000000, - })} + value: row.original.requested_facility_amount / 1000000, + })} @@ -306,7 +306,7 @@ const RealTableContent = ({ rowId, row }) => { - {row.original.refahi_type === 1 ? () : () } + {row.original.refahi_type === 1 ? : } @@ -344,4 +344,4 @@ const RealTableContent = ({ rowId, row }) => { ); }; -export default RealTableContent; \ No newline at end of file +export default RealTableContent; diff --git a/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/RestoreTableUserInfo.jsx b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/RestoreTableUserInfo.jsx index 7263105..54692cd 100644 --- a/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/RestoreTableUserInfo.jsx +++ b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/RestoreTableUserInfo.jsx @@ -2,9 +2,9 @@ import { Button, Chip, Divider, Grid, Link, Stack, Typography } from "@mui/mater import DownloadIcon from "@mui/icons-material/Download"; import { useTranslations } from "next-intl"; -const RestoreTableUserInfo = ({row}) => { +const RestoreTableUserInfo = ({ row }) => { const t = useTranslations(); - return( + return ( <> @@ -65,6 +65,6 @@ const RestoreTableUserInfo = ({row}) => { - ) -} -export default RestoreTableUserInfo \ No newline at end of file + ); +}; +export default RestoreTableUserInfo; diff --git a/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/index.jsx b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/index.jsx index 90de161..d0e47ea 100644 --- a/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/index.jsx +++ b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/index.jsx @@ -39,7 +39,14 @@ const UserInfoForm = ({ rowId, row }) => { - diff --git a/src/components/dashboard/refahi/refahi-province-manager/restore/index.jsx b/src/components/dashboard/refahi/refahi-province-manager/restore/index.jsx index e3fe6cf..c7b516a 100644 --- a/src/components/dashboard/refahi/refahi-province-manager/restore/index.jsx +++ b/src/components/dashboard/refahi/refahi-province-manager/restore/index.jsx @@ -1,8 +1,6 @@ -import { Box ,Typography } from "@mui/material"; +import { Box, Typography } from "@mui/material"; import { useMemo } from "react"; -import { - GET_REFAHI_RESTORE_PROVINCE_MANAGER -} from "@/core/data/apiRoutes"; +import { GET_REFAHI_RESTORE_PROVINCE_MANAGER } from "@/core/data/apiRoutes"; import { useTranslations } from "next-intl"; import TableRowActions from "./TableRowActions"; import moment from "jalali-moment"; diff --git a/src/components/dashboard/refahi/transportation-assistance/Form/ConfirmForm/ConfirmContent.jsx b/src/components/dashboard/refahi/transportation-assistance/Form/ConfirmForm/ConfirmContent.jsx index 9c21720..3486009 100644 --- a/src/components/dashboard/refahi/transportation-assistance/Form/ConfirmForm/ConfirmContent.jsx +++ b/src/components/dashboard/refahi/transportation-assistance/Form/ConfirmForm/ConfirmContent.jsx @@ -19,7 +19,7 @@ import { useFormik } from "formik"; import { useTranslations } from "next-intl"; import { CONFIRM_REFAHI_TRANSPORTATION_ASSISTANCE, - GET_REFAHI_TRANSPORTATION_ASSISTANCE_DETAILS + GET_REFAHI_TRANSPORTATION_ASSISTANCE_DETAILS, } from "@/core/data/apiRoutes"; import { useEffect, useState } from "react"; import * as Yup from "yup"; diff --git a/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/BuildTableUserInfo.jsx b/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/BuildTableUserInfo.jsx index 4c754bb..b4e55bb 100644 --- a/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/BuildTableUserInfo.jsx +++ b/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/BuildTableUserInfo.jsx @@ -2,9 +2,9 @@ import { Button, Chip, Divider, Grid, Link, Stack, Typography } from "@mui/mater import DownloadIcon from "@mui/icons-material/Download"; import { useTranslations } from "next-intl"; -const BuildTableUserInfo = ({row}) => { +const BuildTableUserInfo = ({ row }) => { const t = useTranslations(); - return( + return ( <> @@ -76,6 +76,6 @@ const BuildTableUserInfo = ({row}) => { - ) -} -export default BuildTableUserInfo \ No newline at end of file + ); +}; +export default BuildTableUserInfo; diff --git a/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/LegalTableContent.jsx b/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/LegalTableContent.jsx index 02f7e97..2646c62 100644 --- a/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/LegalTableContent.jsx +++ b/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/LegalTableContent.jsx @@ -1,12 +1,4 @@ -import { - Chip, - DialogContent, - DialogTitle, - Divider, - Grid, - Stack, - Typography -} from "@mui/material"; +import { Chip, DialogContent, DialogTitle, Divider, Grid, Stack, Typography } from "@mui/material"; import { useTranslations } from "next-intl"; import moment from "jalali-moment"; import BuildTableUserInfo from "./BuildTableUserInfo"; @@ -273,8 +265,8 @@ const LegalTableContent = ({ rowId, row }) => { {row.original.investment_amount / 1000000 >= 1000 ? t("UserInfoDialog.milyard", { - value: row.original.investment_amount / 1000000000, - }) + value: row.original.investment_amount / 1000000000, + }) : t("UserInfoDialog.toman", { value: row.original.investment_amount / 1000000 })} @@ -297,11 +289,11 @@ const LegalTableContent = ({ rowId, row }) => { {row.original.requested_facility_amount / 1000000 >= 1000 ? t("UserInfoDialog.milyard", { - value: row.original.requested_facility_amount / 1000000000, - }) + value: row.original.requested_facility_amount / 1000000000, + }) : t("UserInfoDialog.toman", { - value: row.original.requested_facility_amount / 1000000, - })} + value: row.original.requested_facility_amount / 1000000, + })} @@ -357,7 +349,7 @@ const LegalTableContent = ({ rowId, row }) => { - {row.original.refahi_type === 1 ? () : () } + {row.original.refahi_type === 1 ? : } @@ -395,4 +387,4 @@ const LegalTableContent = ({ rowId, row }) => { ); }; -export default LegalTableContent; \ No newline at end of file +export default LegalTableContent; diff --git a/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/RealTableContent.jsx b/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/RealTableContent.jsx index 20b3038..2a2bc4b 100644 --- a/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/RealTableContent.jsx +++ b/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/RealTableContent.jsx @@ -242,8 +242,8 @@ const RealTableContent = ({ rowId, row }) => { {row.original.investment_amount / 1000000 >= 1000 ? t("UserInfoDialog.milyard", { - value: row.original.investment_amount / 1000000000, - }) + value: row.original.investment_amount / 1000000000, + }) : t("UserInfoDialog.toman", { value: row.original.investment_amount / 1000000 })} @@ -266,11 +266,11 @@ const RealTableContent = ({ rowId, row }) => { {row.original.requested_facility_amount / 1000000 >= 1000 ? t("UserInfoDialog.milyard", { - value: row.original.requested_facility_amount / 1000000000, - }) + value: row.original.requested_facility_amount / 1000000000, + }) : t("UserInfoDialog.toman", { - value: row.original.requested_facility_amount / 1000000, - })} + value: row.original.requested_facility_amount / 1000000, + })} @@ -306,7 +306,7 @@ const RealTableContent = ({ rowId, row }) => { - {row.original.refahi_type === 1 ? () : () } + {row.original.refahi_type === 1 ? : } @@ -344,4 +344,4 @@ const RealTableContent = ({ rowId, row }) => { ); }; -export default RealTableContent; \ No newline at end of file +export default RealTableContent; diff --git a/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/RestoreTableUserInfo.jsx b/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/RestoreTableUserInfo.jsx index 7263105..54692cd 100644 --- a/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/RestoreTableUserInfo.jsx +++ b/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/RestoreTableUserInfo.jsx @@ -2,9 +2,9 @@ import { Button, Chip, Divider, Grid, Link, Stack, Typography } from "@mui/mater import DownloadIcon from "@mui/icons-material/Download"; import { useTranslations } from "next-intl"; -const RestoreTableUserInfo = ({row}) => { +const RestoreTableUserInfo = ({ row }) => { const t = useTranslations(); - return( + return ( <> @@ -65,6 +65,6 @@ const RestoreTableUserInfo = ({row}) => { - ) -} -export default RestoreTableUserInfo \ No newline at end of file + ); +}; +export default RestoreTableUserInfo; diff --git a/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/index.jsx b/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/index.jsx index 90de161..d0e47ea 100644 --- a/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/index.jsx +++ b/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/index.jsx @@ -39,7 +39,14 @@ const UserInfoForm = ({ rowId, row }) => { - diff --git a/src/components/dashboard/refahi/transportation-assistance/restore/index.jsx b/src/components/dashboard/refahi/transportation-assistance/restore/index.jsx index 236dd05..c624cae 100644 --- a/src/components/dashboard/refahi/transportation-assistance/restore/index.jsx +++ b/src/components/dashboard/refahi/transportation-assistance/restore/index.jsx @@ -1,4 +1,4 @@ -import { Box ,Typography } from "@mui/material"; +import { Box, Typography } from "@mui/material"; import { useMemo } from "react"; import { GET_RESTORE_REFAHI_TRANSPORTATION_ASSISTANCE } from "@/core/data/apiRoutes"; import { useTranslations } from "next-intl"; diff --git a/src/core/data/apiRoutes.js b/src/core/data/apiRoutes.js index 12091cc..17c57c4 100644 --- a/src/core/data/apiRoutes.js +++ b/src/core/data/apiRoutes.js @@ -196,9 +196,11 @@ export const EXPORT_REFAHI_PASSENGER_BOSS = BASE_URL + "/dashboard/province_work //refahi passenger boss //refahi transportation assistance -export const GET_RESTORE_REFAHI_TRANSPORTATION_ASSISTANCE = BASE_URL + "/dashboard/refahi_transportation_assistant/show"; +export const GET_RESTORE_REFAHI_TRANSPORTATION_ASSISTANCE = + BASE_URL + "/dashboard/refahi_transportation_assistant/show"; export const GET_BUILD_REFAHI_TRANSPORTATION_ASSISTANCE = BASE_URL + "/dashboard/refahi_transportation_assistant/show"; -export const GET_REFAHI_TRANSPORTATION_ASSISTANCE_DETAILS = BASE_URL + "/dashboard/refahi_transportation_assistant/details"; +export const GET_REFAHI_TRANSPORTATION_ASSISTANCE_DETAILS = + BASE_URL + "/dashboard/refahi_transportation_assistant/details"; export const CONFIRM_REFAHI_TRANSPORTATION_ASSISTANCE = BASE_URL + "/dashboard/refahi_transportation_assistant/confirm"; export const REJECT_REFAHI_TRANSPORTATION_ASSISTANCE = BASE_URL + "/dashboard/refahi_transportation_assistant/reject"; export const REFER_REFAHI_TRANSPORTATION_ASSISTANCE = BASE_URL + "/dashboard/refahi_transportation_assistant/refer"; @@ -213,4 +215,13 @@ export const REJECT_REFAHI_PROVINCE_MANAGER = BASE_URL + "/dashboard/refahi_prov export const REFER_REFAHI_PROVINCE_MANAGER = BASE_URL + "/dashboard/refahi_province_manager/refer"; export const EXPORT_REFAHI_PROVINCE_MANAGER = BASE_URL + "/dashboard/province_manager/export"; export const CONFIRM_REFAHI_PROVINCE_MANAGER_DETAILS = BASE_URL + "/dashboard/refahi_province_manager/details"; -//refahi province manager \ No newline at end of file +//refahi province manager + +//refahi loan follow up +export const GET_REFAHI_LOAN_FOLLOWUP = BASE_URL + "/dashboard/vezarat_refahi_loan_tracking"; +export const REFER_REFAHI_LOAN_FOLLOWUP_PASSENGERBOSS = BASE_URL + "/dashboard/vezarat_refahi_loan_tracking/refer"; +export const GET_REFAHI_HISTORY_COUNCIL = BASE_URL + "/dashboard/vezarat_refahi_loan_tracking/planning_council_loan"; +export const GET_REFAHI_COMEBACK_LOAN_DETAIL = BASE_URL + "/dashboard/vezarat_refahi_loan_tracking/comeback_loan"; +export const GET_REFAHI_BANK_PAYMENT = BASE_URL + "/dashboard/vezarat_refahi_loan_tracking/bank_payment_loan"; +export const GET_REFAHI_APPROVED_BANK_LOAN = BASE_URL + "/dashboard/vezarat_refahi_loan_tracking/approved_loan"; +//refahi loan follow up diff --git a/src/core/data/sidebarMenu.jsx b/src/core/data/sidebarMenu.jsx index 91de110..fdb9ab2 100644 --- a/src/core/data/sidebarMenu.jsx +++ b/src/core/data/sidebarMenu.jsx @@ -180,6 +180,26 @@ const sidebarMenu = [ // selected: false, // permissions: ["manage_province_affairs_navgan"], // }, + { + key: "sidebar.refahi-loan-followup", + secondary: "secondary.refahi-loan-followup", + name: "refahi-loan-followup", + type: "page", + route: "/dashboard/refahi/loan-followup", + icon: , + selected: false, + permissions: ["manage_vezarat_eghtesad_loans"], + }, + { + key: "sidebar.refahi-loan-management", + secondary: "secondary.refahi-loan-management", + name: "refahi_loan_management", + type: "page", + route: "/dashboard/refahi/refahi-loan-management", + icon: , + selected: false, + permissions: ["manage_refahi_loan"], + }, ], [ { diff --git a/src/pages/dashboard/refahi/loan-followup/index.jsx b/src/pages/dashboard/refahi/loan-followup/index.jsx new file mode 100644 index 0000000..73aa3f8 --- /dev/null +++ b/src/pages/dashboard/refahi/loan-followup/index.jsx @@ -0,0 +1,19 @@ +import { parse } from "next-useragent"; +import DashboardLoanFollowUpComponent from "@/components/dashboard/refahi/loan-followup"; + +export default function LoanFollowUp() { + return ; +} + +export async function getServerSideProps({ req, locale }) { + const { isBot } = parse(req.headers["user-agent"]); + return { + props: { + messages: (await import(`&/locales/${locale}/app.json`)).default, + title: "Dashboard.loan_followup", + isBot, + locale, + layout: { name: "DashboardLayout", props: { permissions: ["manage_vezarat_eghtesad_loans"] } }, + }, + }; +} diff --git a/src/pages/dashboard/refahi/refahi-province-manager/build/index.jsx b/src/pages/dashboard/refahi/refahi-province-manager/build/index.jsx index c06bcd3..8dd3819 100644 --- a/src/pages/dashboard/refahi/refahi-province-manager/build/index.jsx +++ b/src/pages/dashboard/refahi/refahi-province-manager/build/index.jsx @@ -13,7 +13,7 @@ export async function getServerSideProps({ req, locale }) { title: "Dashboard.province_manager_page", isBot, locale, - layout: { name: "DashboardLayout", props: { permissions: ["manage_province_affairs_navgan"] } },//پرمیشن باید عوض بشه + layout: { name: "DashboardLayout", props: { permissions: ["manage_province_affairs_navgan"] } }, //پرمیشن باید عوض بشه }, }; } diff --git a/src/pages/dashboard/refahi/refahi-province-manager/index.jsx b/src/pages/dashboard/refahi/refahi-province-manager/index.jsx index e42c0db..0942b3d 100644 --- a/src/pages/dashboard/refahi/refahi-province-manager/index.jsx +++ b/src/pages/dashboard/refahi/refahi-province-manager/index.jsx @@ -13,7 +13,7 @@ export async function getServerSideProps({ req, locale }) { title: "Dashboard.province_manager_page", isBot, locale, - layout: { name: "DashboardLayout", props: { permissions: ["manage_province_affairs_navgan"] } },//پرمیشن باید عوض بشه + layout: { name: "DashboardLayout", props: { permissions: ["manage_province_affairs_navgan"] } }, //پرمیشن باید عوض بشه }, }; } diff --git a/src/pages/dashboard/refahi/refahi-province-manager/restore/index.jsx b/src/pages/dashboard/refahi/refahi-province-manager/restore/index.jsx index e42c0db..0942b3d 100644 --- a/src/pages/dashboard/refahi/refahi-province-manager/restore/index.jsx +++ b/src/pages/dashboard/refahi/refahi-province-manager/restore/index.jsx @@ -13,7 +13,7 @@ export async function getServerSideProps({ req, locale }) { title: "Dashboard.province_manager_page", isBot, locale, - layout: { name: "DashboardLayout", props: { permissions: ["manage_province_affairs_navgan"] } },//پرمیشن باید عوض بشه + layout: { name: "DashboardLayout", props: { permissions: ["manage_province_affairs_navgan"] } }, //پرمیشن باید عوض بشه }, }; }