Merge branch 'feature/followup_refahi' into 'develop'
Feature/followup refahi See merge request witel-front-end/loan-facilities/expert-v2!22
This commit is contained in:
@@ -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": "کد ناوگان",
|
||||
|
||||
@@ -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 (
|
||||
<Box>
|
||||
{error ? (
|
||||
<Typography
|
||||
sx={{
|
||||
padding: 2,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
}}
|
||||
>
|
||||
{t("LoanHistory.Table_history_error")}
|
||||
</Typography>
|
||||
) : isLoading ? (
|
||||
<LinearProgress sx={{ width: "100%" }} />
|
||||
) : (
|
||||
<Paper
|
||||
elevation={0}
|
||||
sx={{
|
||||
width: "100%",
|
||||
overflow: "hidden",
|
||||
"*::-webkit-scrollbar": {
|
||||
width: "0.5em",
|
||||
},
|
||||
"*::-webkit-scrollbar-thumb": {
|
||||
backgroundColor: "primary.main",
|
||||
},
|
||||
}}
|
||||
>
|
||||
<TableContainer sx={{ maxHeight: 600 }}>
|
||||
<Table stickyHeader sx={{ minWidth: 800 }}>
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell>{t("ApprovedBankLoanDialog.Table_head_approved_date")}</TableCell>
|
||||
<TableCell>
|
||||
{t("ApprovedBankLoanDialog.Table_head_approved_facility_bank")}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
{t("ApprovedBankLoanDialog.Table_head_approved_facility_gov")}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
{t("ApprovedBankLoanDialog.Table_head_approved_facility_person")}
|
||||
</TableCell>
|
||||
<TableCell>{t("ApprovedBankLoanDialog.Table_head_contract_date")}</TableCell>
|
||||
<TableCell>
|
||||
{t("ApprovedBankLoanDialog.Table_head_contract_facility_bank")}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
{t("ApprovedBankLoanDialog.Table_head_contract_facility_gov")}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
{t("ApprovedBankLoanDialog.Table_head_contract_facility_person")}
|
||||
</TableCell>
|
||||
<TableCell>{t("ApprovedBankLoanDialog.Table_head_due_date")}</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
<TableRow sx={{ "&:last-child td, &:last-child th": { border: 0 } }}>
|
||||
<TableCell>
|
||||
{ApprovedBankDetail.approved_date
|
||||
? moment(ApprovedBankDetail.approved_date)
|
||||
.locale("fa")
|
||||
.format("HH:mm | yyyy/MM/DD")
|
||||
: null}
|
||||
</TableCell>
|
||||
<TableCell>{ApprovedBankDetail?.approved_facility_bank}</TableCell>
|
||||
<TableCell> {ApprovedBankDetail?.approved_facility_gov}</TableCell>
|
||||
<TableCell> {ApprovedBankDetail?.approved_facility_person}</TableCell>
|
||||
<TableCell>
|
||||
{ApprovedBankDetail.contract_date
|
||||
? moment(ApprovedBankDetail.contract_date)
|
||||
.locale("fa")
|
||||
.format("HH:mm | yyyy/MM/DD")
|
||||
: null}
|
||||
</TableCell>
|
||||
<TableCell> {ApprovedBankDetail?.contract_facility_bank}</TableCell>
|
||||
<TableCell> {ApprovedBankDetail?.contract_facility_gov}</TableCell>
|
||||
<TableCell> {ApprovedBankDetail?.contract_facility_person}</TableCell>
|
||||
<TableCell>
|
||||
{ApprovedBankDetail.due_date
|
||||
? moment(ApprovedBankDetail.due_date)
|
||||
.locale("fa")
|
||||
.format("HH:mm | yyyy/MM/DD")
|
||||
: null}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
</Paper>
|
||||
)}
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
export default ApprovedBankLoanContent;
|
||||
@@ -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 (
|
||||
<>
|
||||
<Tooltip title={t("ApprovedBankLoanDialog.approved-bank-loan")}>
|
||||
<IconButton color="primary" onClick={() => setOpenApprovedBankLoanDialog(true)}>
|
||||
<GavelIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Dialog
|
||||
maxWidth={"xl"}
|
||||
fullWidth
|
||||
open={openApprovedBankLoanDialog}
|
||||
PaperProps={{
|
||||
sx: {
|
||||
boxShadow: "rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px",
|
||||
},
|
||||
}}
|
||||
>
|
||||
<DialogTitle>{t("ApprovedBankLoanDialog.approved-bank-loan")}</DialogTitle>
|
||||
<ApprovedBankLoanContent rowId={rowId} />
|
||||
<DialogActions>
|
||||
<Button
|
||||
onClick={() => setOpenApprovedBankLoanDialog(false)}
|
||||
variant="outlined"
|
||||
color="secondary"
|
||||
autoFocus
|
||||
>
|
||||
{t("CouncilHistory.button-cancel")}
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default ApprovedBankLoan;
|
||||
@@ -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 (
|
||||
<Box>
|
||||
{error ? (
|
||||
<Typography
|
||||
sx={{
|
||||
padding: 2,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
}}
|
||||
>
|
||||
{t("LoanHistory.Table_history_error")}
|
||||
</Typography>
|
||||
) : isLoading ? (
|
||||
<LinearProgress sx={{ width: "100%" }} />
|
||||
) : (
|
||||
<Paper
|
||||
elevation={0}
|
||||
sx={{
|
||||
width: "100%",
|
||||
overflow: "hidden",
|
||||
"*::-webkit-scrollbar": {
|
||||
width: "0.5em",
|
||||
},
|
||||
"*::-webkit-scrollbar-thumb": {
|
||||
backgroundColor: "primary.main",
|
||||
},
|
||||
}}
|
||||
>
|
||||
<TableContainer sx={{ maxHeight: 600 }}>
|
||||
<Table stickyHeader sx={{ minWidth: 800 }}>
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell>{t("BankPaymentDialog.Table_head_installment_number")}</TableCell>
|
||||
<TableCell>{t("BankPaymentDialog.Table_head_remaining_facility")}</TableCell>
|
||||
<TableCell>{t("BankPaymentDialog.Table_head_paid_facility")}</TableCell>
|
||||
<TableCell>{t("BankPaymentDialog.Table_head_paid_date")}</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
<TableRow sx={{ "&:last-child td, &:last-child th": { border: 0 } }}>
|
||||
<TableCell>{BankPaymentDetail?.installment_number}</TableCell>
|
||||
<TableCell> {BankPaymentDetail?.paid_facility}</TableCell>
|
||||
<TableCell> {BankPaymentDetail?.remaining_facility}</TableCell>
|
||||
<TableCell>
|
||||
{BankPaymentDetail.paid_date
|
||||
? moment(BankPaymentDetail.paid_date)
|
||||
.locale("fa")
|
||||
.format("HH:mm | yyyy/MM/DD")
|
||||
: null}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
</Paper>
|
||||
)}
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
export default BankPaymentContent;
|
||||
@@ -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 (
|
||||
<>
|
||||
<Tooltip title={t("BankPaymentDialog.bank-payment")}>
|
||||
<IconButton color="primary" onClick={() => setOpenBankPaymentDialog(true)}>
|
||||
<PaidIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Dialog
|
||||
maxWidth={"xl"}
|
||||
fullWidth
|
||||
open={openBankPaymentDialog}
|
||||
PaperProps={{
|
||||
sx: {
|
||||
boxShadow: "rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px",
|
||||
},
|
||||
}}
|
||||
>
|
||||
<DialogTitle>{t("BankPaymentDialog.bank-payment")}</DialogTitle>
|
||||
<BankPaymentContent rowId={rowId} />
|
||||
<DialogActions>
|
||||
<Button
|
||||
onClick={() => setOpenBankPaymentDialog(false)}
|
||||
variant="outlined"
|
||||
color="secondary"
|
||||
autoFocus
|
||||
>
|
||||
{t("CouncilHistory.button-cancel")}
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default BankPayment;
|
||||
@@ -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 (
|
||||
<Box>
|
||||
{error ? (
|
||||
<Typography
|
||||
sx={{
|
||||
padding: 2,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
}}
|
||||
>
|
||||
{t("LoanHistory.Table_history_error")}
|
||||
</Typography>
|
||||
) : isLoading ? (
|
||||
<LinearProgress sx={{ width: "100%" }} />
|
||||
) : (
|
||||
<Paper
|
||||
elevation={0}
|
||||
sx={{
|
||||
width: "100%",
|
||||
overflow: "hidden",
|
||||
"*::-webkit-scrollbar": {
|
||||
width: "0.5em",
|
||||
},
|
||||
"*::-webkit-scrollbar-thumb": {
|
||||
backgroundColor: "primary.main",
|
||||
},
|
||||
}}
|
||||
>
|
||||
<TableContainer sx={{ maxHeight: 600 }}>
|
||||
<Table stickyHeader sx={{ minWidth: 800 }}>
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell>{t("ComebackLoanDetailDialog.Table_head_comeback_name")}</TableCell>
|
||||
<TableCell>{t("ComebackLoanDetailDialog.Table_head_comeback_comment")}</TableCell>
|
||||
<TableCell>{t("ComebackLoanDetailDialog.Table_head_comeback_date")}</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
<TableRow sx={{ "&:last-child td, &:last-child th": { border: 0 } }}>
|
||||
<TableCell>{ComebackLoanDetail.comeback_name}</TableCell>
|
||||
<TableCell> {ComebackLoanDetail.comeback_comment}</TableCell>
|
||||
<TableCell>
|
||||
{ComebackLoanDetail.comeback_date
|
||||
? moment(ComebackLoanDetail.comeback_date)
|
||||
.locale("fa")
|
||||
.format("HH:mm | yyyy/MM/DD")
|
||||
: null}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
</Paper>
|
||||
)}
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
export default ComebackLoanDetailContent;
|
||||
@@ -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 (
|
||||
<>
|
||||
<Tooltip title={t("ComebackLoanDetailDialog.comeback-loan-detail")}>
|
||||
<IconButton color="primary" onClick={() => setOpenComebackLoanDetailDialog(true)}>
|
||||
<SyncAltIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Dialog
|
||||
maxWidth={"xl"}
|
||||
fullWidth
|
||||
open={openComebackLoanDetailDialog}
|
||||
PaperProps={{
|
||||
sx: {
|
||||
boxShadow: "rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px",
|
||||
},
|
||||
}}
|
||||
>
|
||||
<DialogTitle>{t("ComebackLoanDetailDialog.comeback-loan-detail")}</DialogTitle>
|
||||
<ComebackLoanDetailContent rowId={rowId} />
|
||||
<DialogActions>
|
||||
<Button
|
||||
onClick={() => setOpenComebackLoanDetailDialog(false)}
|
||||
variant="outlined"
|
||||
color="secondary"
|
||||
autoFocus
|
||||
>
|
||||
{t("CouncilHistory.button-cancel")}
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default ComebackLoanDetail;
|
||||
@@ -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 (
|
||||
<Box>
|
||||
{error ? (
|
||||
<Typography
|
||||
sx={{
|
||||
padding: 2,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
}}
|
||||
>
|
||||
{t("LoanHistory.Table_history_error")}
|
||||
</Typography>
|
||||
) : isLoading ? (
|
||||
<LinearProgress sx={{ width: "100%" }} />
|
||||
) : (
|
||||
<Paper
|
||||
elevation={0}
|
||||
sx={{
|
||||
width: "100%",
|
||||
overflow: "hidden",
|
||||
"*::-webkit-scrollbar": {
|
||||
width: "0.5em",
|
||||
},
|
||||
"*::-webkit-scrollbar-thumb": {
|
||||
backgroundColor: "primary.main",
|
||||
},
|
||||
}}
|
||||
>
|
||||
<TableContainer sx={{ maxHeight: 600 }}>
|
||||
<Table stickyHeader sx={{ minWidth: 800 }}>
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell>{t("CouncilHistory.Table_head_id")}</TableCell>
|
||||
<TableCell>{t("CouncilHistory.Table_head_council_confirm")}</TableCell>
|
||||
<TableCell>{t("CouncilHistory.Table_head_council_comment")}</TableCell>
|
||||
<TableCell>{t("CouncilHistory.Table_head_planning_council_loan")}</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
<TableRow sx={{ "&:last-child td, &:last-child th": { border: 0 } }}>
|
||||
<TableCell> {CouncilDetails.id}</TableCell>
|
||||
<TableCell>{CouncilConfirm[CouncilDetails.council_confirm]}</TableCell>
|
||||
<TableCell>
|
||||
<Box display="flex" alignItems="center">
|
||||
<Typography fontWeight={CouncilDetails.council_comment && "bold"}>
|
||||
{CouncilDetails.council_reason_name}
|
||||
</Typography>
|
||||
{CouncilDetails.council_comment && (
|
||||
<IconButton onClick={handleToggleComment} size="small">
|
||||
{isCommentExpanded ? (
|
||||
<Button variant="text" endIcon={<KeyboardArrowUpIcon />}>
|
||||
{t("CouncilHistory.close")}
|
||||
</Button>
|
||||
) : (
|
||||
<Button variant="text" endIcon={<KeyboardArrowDownIcon />}>
|
||||
{t("CouncilHistory.more")}
|
||||
</Button>
|
||||
)}
|
||||
</IconButton>
|
||||
)}
|
||||
</Box>
|
||||
<Collapse in={isCommentExpanded} timeout="auto" unmountOnExit>
|
||||
<Stack
|
||||
spacing={2}
|
||||
sx={{
|
||||
border: "1px solid",
|
||||
borderColor: "primary.light",
|
||||
p: 2,
|
||||
mt: 1,
|
||||
borderRadius: "8px",
|
||||
}}
|
||||
>
|
||||
<Typography variant="body1">
|
||||
{t("CouncilHistory.council_opinion")}
|
||||
</Typography>
|
||||
<Typography variant="body2">
|
||||
{CouncilDetails.council_comment}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Collapse>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
{CouncilDetails.planning_council_loan
|
||||
? moment(CouncilDetails.planning_council_loan.date_confirm)
|
||||
.locale("fa")
|
||||
.format("HH:mm | yyyy/MM/DD")
|
||||
: null}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
</Paper>
|
||||
)}
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
export default PlanningCouncilTable;
|
||||
@@ -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 (
|
||||
<>
|
||||
<Tooltip title={t("CouncilHistory.council_history")}>
|
||||
<IconButton color="primary" onClick={() => setOpenPlanningCouncilDialog(true)}>
|
||||
<Diversity3Icon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Dialog
|
||||
maxWidth={"xl"}
|
||||
fullWidth
|
||||
open={openPlanningCouncilDialog}
|
||||
PaperProps={{
|
||||
sx: {
|
||||
boxShadow: "rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px",
|
||||
},
|
||||
}}
|
||||
>
|
||||
<DialogTitle>{t("CouncilHistory.council_history_detail")}</DialogTitle>
|
||||
<PlanningCouncilTable rowId={rowId} setOpenPlanningCouncilDialog={setOpenPlanningCouncilDialog} />
|
||||
<DialogActions>
|
||||
<Button
|
||||
onClick={() => setOpenPlanningCouncilDialog(false)}
|
||||
variant="outlined"
|
||||
color="secondary"
|
||||
autoFocus
|
||||
>
|
||||
{t("CouncilHistory.button-cancel")}
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default PlanningCouncilForm;
|
||||
@@ -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 (
|
||||
<>
|
||||
<DialogContent>
|
||||
<Stack spacing={2}>
|
||||
<Stack>
|
||||
<TextField
|
||||
name="description"
|
||||
multiline
|
||||
rows={8}
|
||||
label={t("ReferDialog.description")}
|
||||
value={formik.values.description}
|
||||
onChange={handleDescriptionChange}
|
||||
onBlur={formik.handleBlur("description")}
|
||||
error={formik.touched.description && Boolean(formik.errors.description)}
|
||||
helperText={formik.touched.description && formik.errors.description}
|
||||
fullWidth
|
||||
variant="outlined"
|
||||
sx={{ mt: 1 }}
|
||||
/>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button
|
||||
onClick={() => setOpenReferDialog(false)}
|
||||
variant="outlined"
|
||||
color="secondary"
|
||||
disabled={formik.isSubmitting}
|
||||
autoFocus
|
||||
>
|
||||
{t("ReferDialog.button-cancel")}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={formik.handleSubmit}
|
||||
variant="contained"
|
||||
color="primary"
|
||||
disabled={formik.isSubmitting || !formik.dirty || !formik.isValid}
|
||||
>
|
||||
{t("ReferDialog.button-refer")}
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default ReferPassengerBossContent;
|
||||
@@ -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 (
|
||||
<>
|
||||
<Tooltip title={t("ReferDialog.refer-passenger-boss")}>
|
||||
<IconButton color="primary" onClick={() => setOpenReferDialog(true)}>
|
||||
<UTurnRightIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Dialog
|
||||
fullWidth
|
||||
open={openReferDialog}
|
||||
PaperProps={{
|
||||
sx: {
|
||||
boxShadow: "rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px",
|
||||
},
|
||||
}}
|
||||
>
|
||||
<DialogTitle>{t("ReferDialog.refer-passenger-boss")}</DialogTitle>
|
||||
<ReferPassengerBossContent mutate={mutate} rowId={rowId} setOpenReferDialog={setOpenReferDialog} />
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default ReferPassengerBoss;
|
||||
@@ -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 (
|
||||
<>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.project_physical_progress")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.project_physical_progress || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.basic_approval_number")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.basic_approval_number || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.basic_approval_image")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Button size={"small"} variant="contained" startIcon={<DownloadIcon />}>
|
||||
<Link
|
||||
variant="subtitle2"
|
||||
sx={{ padding: 0 }}
|
||||
color={"white"}
|
||||
download
|
||||
underline="none"
|
||||
href={`${row.original.basic_approval_image}`}
|
||||
>
|
||||
{t("UserInfoDialog.download_image")}
|
||||
</Link>
|
||||
</Button>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.basic_approval_renewal_image")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Button size={"small"} variant="contained" startIcon={<DownloadIcon />}>
|
||||
<Link
|
||||
variant="subtitle2"
|
||||
sx={{ padding: 0 }}
|
||||
color={"white"}
|
||||
download
|
||||
underline="none"
|
||||
href={`${row.original.basic_approval_renewal_image}`}
|
||||
>
|
||||
{t("UserInfoDialog.download_image")}
|
||||
</Link>
|
||||
</Button>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={12}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.basic_approval_renewal_date")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.basic_approval_renewal_date || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default BuildTableUserInfo;
|
||||
@@ -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 (
|
||||
<>
|
||||
<DialogTitle>{t("UserInfoDialog.user_info")}</DialogTitle>
|
||||
<DialogContent>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.is_legal_person")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">{t("UserInfoDialog.legal_person")}</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.id")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">{row.original.id || t("UserInfoDialog.no_info")}</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.activity_type")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.activity_category_name || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.navgan_plan_id")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.project_title || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.first_name")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.first_name || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.last_name")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.last_name || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.father_name")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.father_name || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.gender")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.gender ? t("UserInfoDialog.female") : t("UserInfoDialog.male")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.national_id")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.national_id || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip
|
||||
label={
|
||||
row.original.national_serial_number
|
||||
? t("UserInfoDialog.national_serial_number")
|
||||
: t("UserInfoDialog.national_tracking_code")
|
||||
}
|
||||
sx={{ mr: 1 }}
|
||||
/>
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.national_serial_number ||
|
||||
row.original.national_tracking_code ||
|
||||
t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.education_id")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.education_title || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.occupation_id")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.occupation_title || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.phone_number")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.phone_number || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.birthday")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.birthday
|
||||
? moment(row.original.birthday).locale("fa").format("YYYY/MM/DD")
|
||||
: t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.province_id")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.province_name || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.city_id")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.city_name || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.shenase_meli")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.shenase_meli || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.postal_code")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.postal_code || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.company_register_date")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.company_register_date
|
||||
? moment(row.original.company_register_date).locale("fa").format("YYYY/MM/DD")
|
||||
: t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.register_number")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.register_number || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.company_name")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.company_name || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.tel_number")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.telephone_number || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.project_province_name")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.project_province_name || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.project_city_name")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">{row.original.project_city_name}</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.investment_amount")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.investment_amount / 1000000 >= 1000
|
||||
? t("UserInfoDialog.milyard", {
|
||||
value: row.original.investment_amount / 1000000000,
|
||||
})
|
||||
: t("UserInfoDialog.toman", { value: row.original.investment_amount / 1000000 })}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.welfare_complex_degree")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.welfare_complex_degree || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.requested_facilities")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{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,
|
||||
})}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.applicant_payment")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.person_share / 1000000 >= 1000
|
||||
? t("UserInfoDialog.milyard", { value: row.original.person_share / 1000000000 })
|
||||
: t("UserInfoDialog.toman", { value: row.original.person_share / 1000000 })}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.user_committed_employment")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.user_committed_employment || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.user_existing_employment")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.user_existing_employment || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.project_axis")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.project_axis || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.project_direction")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.project_direction || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
{row.original.refahi_type === 1 ? <BuildTableUserInfo row={row} /> : <RestoreTableUserInfo row={row} />}
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={12}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.project_kilometer_marker")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.project_kilometer_marker || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={12}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.project_address")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.project_address || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={12}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.address")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.address || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</DialogContent>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default LegalTableContent;
|
||||
@@ -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 (
|
||||
<>
|
||||
<DialogTitle>{t("UserInfoDialog.user_info")}</DialogTitle>
|
||||
<DialogContent>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.is_legal_person")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">{t("UserInfoDialog.real_person")}</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.id")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">{row.original.id || t("UserInfoDialog.no_info")}</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.activity_type")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.activity_category_name || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.navgan_plan_id")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.project_title || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.first_name")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.first_name || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.last_name")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.last_name || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.national_id")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.national_id || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip
|
||||
label={
|
||||
row.original.national_serial_number
|
||||
? t("UserInfoDialog.national_serial_number")
|
||||
: t("UserInfoDialog.national_tracking_code")
|
||||
}
|
||||
sx={{ mr: 1 }}
|
||||
/>
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.national_serial_number ||
|
||||
row.original.national_tracking_code ||
|
||||
t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.education_id")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.education_title || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.occupation_id")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.occupation_title || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.phone_number")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.phone_number || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.tel_number")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.telephone_number || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.birthday")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.birthday
|
||||
? moment(row.original.birthday).locale("fa").format("YYYY/MM/DD")
|
||||
: t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.postal_code")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.postal_code || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.father_name")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.father_name || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.gender")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.gender ? t("UserInfoDialog.female") : t("UserInfoDialog.male")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.province_id")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.province_name || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.city_id")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">{row.original.city_name}</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.user_committed_employment")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.user_committed_employment || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.user_existing_employment")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.user_existing_employment || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.project_province_name")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.project_province_name || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.project_city_name")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">{row.original.project_city_name}</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.investment_amount")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.investment_amount / 1000000 >= 1000
|
||||
? t("UserInfoDialog.milyard", {
|
||||
value: row.original.investment_amount / 1000000000,
|
||||
})
|
||||
: t("UserInfoDialog.toman", { value: row.original.investment_amount / 1000000 })}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.welfare_complex_degree")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.welfare_complex_degree || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.requested_facilities")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{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,
|
||||
})}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.applicant_payment")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.person_share / 1000000 >= 1000
|
||||
? t("UserInfoDialog.milyard", { value: row.original.person_share / 1000000000 })
|
||||
: t("UserInfoDialog.toman", { value: row.original.person_share / 1000000 })}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.project_axis")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.project_axis || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.project_direction")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.project_direction || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
{row.original.refahi_type === 1 ? <BuildTableUserInfo row={row} /> : <RestoreTableUserInfo row={row} />}
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={12}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.project_kilometer_marker")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.project_kilometer_marker || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={12}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.project_address")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.project_address || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={12}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.address")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.address || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</DialogContent>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default RealTableContent;
|
||||
@@ -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 (
|
||||
<>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.exploitation_date")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.exploitation_date || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.exploitation_license_renewal_date")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Typography variant="body1">
|
||||
{row.original.exploitation_license_renewal_date || t("UserInfoDialog.no_info")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.exploitation_license_image")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Button size={"small"} variant="contained" startIcon={<DownloadIcon />}>
|
||||
<Link
|
||||
variant="subtitle2"
|
||||
sx={{ padding: 0 }}
|
||||
color={"white"}
|
||||
download
|
||||
underline="none"
|
||||
href={`${row.original.exploitation_license_image}`}
|
||||
>
|
||||
{t("UserInfoDialog.download_image")}
|
||||
</Link>
|
||||
</Button>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Chip label={t("UserInfoDialog.exploitation_license_renewal_image")} sx={{ mr: 1 }} />
|
||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||
<Button size={"small"} variant="contained" startIcon={<DownloadIcon />}>
|
||||
<Link
|
||||
variant="subtitle2"
|
||||
sx={{ padding: 0 }}
|
||||
color={"white"}
|
||||
download
|
||||
underline="none"
|
||||
href={`${row.original.exploitation_license_renewal_image}`}
|
||||
>
|
||||
{t("UserInfoDialog.download_image")}
|
||||
</Link>
|
||||
</Button>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default RestoreTableUserInfo;
|
||||
@@ -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 (
|
||||
<>
|
||||
<Tooltip title={t("UserInfoDialog.user_info_tooltip")}>
|
||||
<IconButton
|
||||
color="primary"
|
||||
onClick={() => {
|
||||
setOpenUserInfoDialog(true);
|
||||
}}
|
||||
>
|
||||
<ContactPageIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Dialog
|
||||
open={openUserInfoDialog}
|
||||
PaperProps={{
|
||||
sx: {
|
||||
transition: "all .3s",
|
||||
boxShadow: "rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px",
|
||||
},
|
||||
}}
|
||||
fullWidth
|
||||
maxWidth="lg"
|
||||
>
|
||||
{row.original.is_legal_person === 1 ? (
|
||||
<LegalTableContent rowId={rowId} row={row} />
|
||||
) : (
|
||||
<RealTableContent rowId={rowId} row={row} />
|
||||
)}
|
||||
<DialogActions>
|
||||
<Button onClick={() => setOpenUserInfoDialog(false)} variant="outlined" color="secondary" autoFocus>
|
||||
{t("UserInfoDialog.button-cancel")}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() =>
|
||||
window.open(`/dashboard/refahi/passenger-boss/print-report?id=${row.original.id}`, "_blank")
|
||||
}
|
||||
variant="contained"
|
||||
color="primary"
|
||||
autoFocus
|
||||
>
|
||||
{t("UserInfoDialog.button-report")}
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default UserInfoForm;
|
||||
@@ -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 (
|
||||
<Box sx={{ display: "flex", flexWrap: "nowrap", gap: "8px" }}>
|
||||
<UserInfoForm rowId={row.getValue("id")} row={row} />
|
||||
{[11, 12, 13, 14, 15, 16].includes(row.original.state_id) && (
|
||||
<PlanningCouncilForm rowId={row.getValue("id")} />
|
||||
)}
|
||||
|
||||
{row.original.state_id === 16 && <ComebackLoanDetail rowId={row.getValue("id")} />}
|
||||
|
||||
{row.original.state_id === 15 && <BankPayment rowId={row.getValue("id")} />}
|
||||
|
||||
{row.original.state_id === 14 || row.original.state_id === 15 ? (
|
||||
<ApprovedBankLoan rowId={row.getValue("id")} />
|
||||
) : null}
|
||||
|
||||
{row.original.state_id === 11 || row.original.state_id === 16 ? (
|
||||
<ReferPassengerBoss rowId={row.getValue("id")} mutate={mutate} />
|
||||
) : null}
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
export default TableRow;
|
||||
@@ -0,0 +1,7 @@
|
||||
import { Stack } from "@mui/material";
|
||||
|
||||
const TableToolbar = ({ table }) => {
|
||||
return <Stack direction={"row"} spacing={2}></Stack>;
|
||||
};
|
||||
|
||||
export default TableToolbar;
|
||||
225
src/components/dashboard/refahi/loan-followup/index.jsx
Normal file
225
src/components/dashboard/refahi/loan-followup/index.jsx
Normal file
@@ -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 }) => <Typography variant="body2">{renderedCellValue}</Typography>,
|
||||
},
|
||||
{
|
||||
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 }) => <Typography variant="body2">{renderedCellValue}</Typography>,
|
||||
},
|
||||
{
|
||||
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 }) => (
|
||||
<Typography variant="body2">
|
||||
{renderedCellValue === 1 ? `${t("PassengerBoss.hoghoghi")}` : `${t("PassengerBoss.haghighi")}`}
|
||||
</Typography>
|
||||
),
|
||||
},
|
||||
{
|
||||
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 }) => <Typography variant="body2">{renderedCellValue}</Typography>,
|
||||
},
|
||||
{
|
||||
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 }) => <Typography variant="body2">{renderedCellValue}</Typography>,
|
||||
},
|
||||
{
|
||||
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 }) => <Typography variant="body2">{renderedCellValue}</Typography>,
|
||||
},
|
||||
{
|
||||
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 }) => <Typography variant="body2">{renderedCellValue}</Typography>,
|
||||
},
|
||||
{
|
||||
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 }) => <Typography variant="body2">{renderedCellValue}</Typography>,
|
||||
},
|
||||
{
|
||||
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 }) => <Typography variant="body2">{renderedCellValue}</Typography>,
|
||||
},
|
||||
{
|
||||
accessorFn: (row) => row.birthday,
|
||||
id: "birthday",
|
||||
header: t("RefahiLoanFollowUp.birthday"),
|
||||
enableColumnFilter: true,
|
||||
datatype: "text",
|
||||
filterFn: "contains",
|
||||
columnFilterModeOptions: ["contains", "equals", "notEquals"],
|
||||
Cell: ({ renderedCellValue }) => (
|
||||
<Typography variant="body2">
|
||||
{moment(renderedCellValue).locale("fa").format("yyyy/MM/DD")}
|
||||
</Typography>
|
||||
),
|
||||
},
|
||||
{
|
||||
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 }) => (
|
||||
<Typography variant="body2">{Number(renderedCellValue).toLocaleString()}</Typography>
|
||||
),
|
||||
},
|
||||
{
|
||||
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 }) => <Typography variant="body2">{renderedCellValue}</Typography>,
|
||||
},
|
||||
{
|
||||
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 }) => <Typography variant="body2">{renderedCellValue}</Typography>,
|
||||
},
|
||||
{
|
||||
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 }) => <Typography variant="body2">{renderedCellValue}</Typography>,
|
||||
},
|
||||
{
|
||||
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 <Typography variant="body2">{renderedCellValue}</Typography>;
|
||||
},
|
||||
Header: ({ column }) => <>{column.columnDef.header}</>,
|
||||
Filter: ({ column }) => {
|
||||
return <MuiDatePicker column={column} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
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 }) => <Typography variant="body2">{renderedCellValue}</Typography>,
|
||||
},
|
||||
{
|
||||
accessorFn: (row) => row.state_name,
|
||||
id: "state_id",
|
||||
header: t("RefahiLoanFollowUp.state_name"),
|
||||
enableColumnFilter: false,
|
||||
datatype: "numeric",
|
||||
Cell: ({ renderedCellValue }) => <Typography variant="body2">{renderedCellValue}</Typography>,
|
||||
},
|
||||
],
|
||||
[]
|
||||
);
|
||||
return (
|
||||
<Box sx={{ px: 3 }}>
|
||||
<DataTable
|
||||
tableUrl={GET_REFAHI_LOAN_FOLLOWUP}
|
||||
columns={columns}
|
||||
selectableRow={false}
|
||||
enableCustomToolbar={true}
|
||||
CustomToolbar={TableToolbar}
|
||||
enableLastUpdate={true}
|
||||
enablePinning={true}
|
||||
enableDensityToggle={false}
|
||||
initialState={{ density: "compact" }} //compact (small) //comfortable (medium) //spacious (large)
|
||||
enableColumnFilters={true}
|
||||
enableHiding={true}
|
||||
enableFullScreenToggle={false}
|
||||
enableGlobalFilter={false}
|
||||
enableColumnResizing={false} // if you want true this you shold change renderRowActions props ** see https://www.material-react-table.com/docs/guides/row-actions
|
||||
enableRowActions={true}
|
||||
TableRowAction={TableRowActions}
|
||||
/>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
export default DashboardLoanFollowUpComponent;
|
||||
@@ -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 });
|
||||
|
||||
@@ -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 (
|
||||
<>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
@@ -76,6 +76,6 @@ const BuildTableUserInfo = ({row}) => {
|
||||
</Grid>
|
||||
</Grid>
|
||||
</>
|
||||
)
|
||||
}
|
||||
export default BuildTableUserInfo
|
||||
);
|
||||
};
|
||||
export default BuildTableUserInfo;
|
||||
|
||||
@@ -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 }) => {
|
||||
<Typography variant="body1">
|
||||
{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 })}
|
||||
</Typography>
|
||||
</Stack>
|
||||
@@ -297,11 +289,11 @@ const LegalTableContent = ({ rowId, row }) => {
|
||||
<Typography variant="body1">
|
||||
{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,
|
||||
})}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
@@ -357,7 +349,7 @@ const LegalTableContent = ({ rowId, row }) => {
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
{row.original.refahi_type === 1 ? (<BuildTableUserInfo row={row} />) : (<RestoreTableUserInfo row={row} />) }
|
||||
{row.original.refahi_type === 1 ? <BuildTableUserInfo row={row} /> : <RestoreTableUserInfo row={row} />}
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={12}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
@@ -395,4 +387,4 @@ const LegalTableContent = ({ rowId, row }) => {
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default LegalTableContent;
|
||||
export default LegalTableContent;
|
||||
|
||||
@@ -242,8 +242,8 @@ const RealTableContent = ({ rowId, row }) => {
|
||||
<Typography variant="body1">
|
||||
{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 })}
|
||||
</Typography>
|
||||
</Stack>
|
||||
@@ -266,11 +266,11 @@ const RealTableContent = ({ rowId, row }) => {
|
||||
<Typography variant="body1">
|
||||
{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,
|
||||
})}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
@@ -306,7 +306,7 @@ const RealTableContent = ({ rowId, row }) => {
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
{row.original.refahi_type === 1 ? (<BuildTableUserInfo row={row} />) : (<RestoreTableUserInfo row={row} />) }
|
||||
{row.original.refahi_type === 1 ? <BuildTableUserInfo row={row} /> : <RestoreTableUserInfo row={row} />}
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={12}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
@@ -344,4 +344,4 @@ const RealTableContent = ({ rowId, row }) => {
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default RealTableContent;
|
||||
export default RealTableContent;
|
||||
|
||||
@@ -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 (
|
||||
<>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
@@ -65,6 +65,6 @@ const RestoreTableUserInfo = ({row}) => {
|
||||
</Grid>
|
||||
</Grid>
|
||||
</>
|
||||
)
|
||||
}
|
||||
export default RestoreTableUserInfo
|
||||
);
|
||||
};
|
||||
export default RestoreTableUserInfo;
|
||||
|
||||
@@ -39,7 +39,14 @@ const UserInfoForm = ({ rowId, row }) => {
|
||||
<Button onClick={() => setOpenUserInfoDialog(false)} variant="outlined" color="secondary" autoFocus>
|
||||
{t("UserInfoDialog.button-cancel")}
|
||||
</Button>
|
||||
<Button onClick={() => window.open(`/dashboard/refahi/passenger-boss/print-report?id=${row.original.id}`, "_blank")} variant="contained" color="primary" autoFocus>
|
||||
<Button
|
||||
onClick={() =>
|
||||
window.open(`/dashboard/refahi/passenger-boss/print-report?id=${row.original.id}`, "_blank")
|
||||
}
|
||||
variant="contained"
|
||||
color="primary"
|
||||
autoFocus
|
||||
>
|
||||
{t("UserInfoDialog.button-report")}
|
||||
</Button>
|
||||
</DialogActions>
|
||||
|
||||
@@ -6,9 +6,5 @@ export default function DashboardPassengerBossReportComponent() {
|
||||
const id = searchParams.get("id");
|
||||
console.log(id);
|
||||
|
||||
return (
|
||||
<div>
|
||||
hello
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return <div>hello</div>;
|
||||
}
|
||||
|
||||
@@ -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 (
|
||||
<Button
|
||||
color="primary"
|
||||
variant="contained"
|
||||
size="small"
|
||||
disabled={loading}
|
||||
sx={{ textTransform: "unset", alignSelf: "center" }}
|
||||
startIcon={loading ? <CircularProgress size={18} color="inherit" /> : <DescriptionIcon />}
|
||||
onClick={clickHandler}
|
||||
>
|
||||
{t("NavganLoanManagement.excel_report")}
|
||||
</Button>
|
||||
);
|
||||
};
|
||||
|
||||
export default PrintExcel;
|
||||
@@ -0,0 +1,12 @@
|
||||
import { Stack } from "@mui/material";
|
||||
import PrintExcel from "./Buttons/PrintExcel";
|
||||
|
||||
const TableToolbar = ({ table }) => {
|
||||
return (
|
||||
<Stack direction={"row"} spacing={2}>
|
||||
<PrintExcel table={table} />
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
|
||||
export default TableToolbar;
|
||||
@@ -23,9 +23,43 @@ function DashboardRefahiLoanManagementComponent() {
|
||||
Cell: ({ renderedCellValue }) => <Typography variant="body2">{renderedCellValue}</Typography>,
|
||||
},
|
||||
{
|
||||
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 }) => <Typography variant="body2">{renderedCellValue}</Typography>,
|
||||
},
|
||||
{
|
||||
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 }) => (
|
||||
<Typography variant="body2">
|
||||
{renderedCellValue === 1 ? `${t("PassengerBoss.hoghoghi")}` : `${t("PassengerBoss.haghighi")}`}
|
||||
</Typography>
|
||||
),
|
||||
},
|
||||
{
|
||||
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 }) => <Typography variant="body2">{renderedCellValue}</Typography>,
|
||||
},
|
||||
{
|
||||
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 }) => <Typography variant="body2">{renderedCellValue}</Typography>,
|
||||
},
|
||||
{
|
||||
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 }) => <Typography variant="body2">{renderedCellValue}</Typography>,
|
||||
},
|
||||
{
|
||||
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 }) => <Typography variant="body2">{renderedCellValue}</Typography>,
|
||||
},
|
||||
{
|
||||
@@ -83,6 +130,16 @@ function DashboardRefahiLoanManagementComponent() {
|
||||
datatype: "numeric",
|
||||
Cell: ({ renderedCellValue }) => <Typography variant="body2">{renderedCellValue}</Typography>,
|
||||
},
|
||||
{
|
||||
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 }) => <Typography variant="body2">{renderedCellValue}</Typography>,
|
||||
},
|
||||
{
|
||||
accessorFn: (row) => row.state_name,
|
||||
id: "state_id",
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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 (
|
||||
<>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
@@ -76,6 +76,6 @@ const BuildTableUserInfo = ({row}) => {
|
||||
</Grid>
|
||||
</Grid>
|
||||
</>
|
||||
)
|
||||
}
|
||||
export default BuildTableUserInfo
|
||||
);
|
||||
};
|
||||
export default BuildTableUserInfo;
|
||||
|
||||
@@ -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 }) => {
|
||||
<Typography variant="body1">
|
||||
{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 })}
|
||||
</Typography>
|
||||
</Stack>
|
||||
@@ -297,11 +289,11 @@ const LegalTableContent = ({ rowId, row }) => {
|
||||
<Typography variant="body1">
|
||||
{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,
|
||||
})}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
@@ -357,7 +349,7 @@ const LegalTableContent = ({ rowId, row }) => {
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
{row.original.refahi_type === 1 ? (<BuildTableUserInfo row={row} />) : (<RestoreTableUserInfo row={row} />) }
|
||||
{row.original.refahi_type === 1 ? <BuildTableUserInfo row={row} /> : <RestoreTableUserInfo row={row} />}
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={12}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
@@ -395,4 +387,4 @@ const LegalTableContent = ({ rowId, row }) => {
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default LegalTableContent;
|
||||
export default LegalTableContent;
|
||||
|
||||
@@ -242,8 +242,8 @@ const RealTableContent = ({ rowId, row }) => {
|
||||
<Typography variant="body1">
|
||||
{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 })}
|
||||
</Typography>
|
||||
</Stack>
|
||||
@@ -266,11 +266,11 @@ const RealTableContent = ({ rowId, row }) => {
|
||||
<Typography variant="body1">
|
||||
{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,
|
||||
})}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
@@ -306,7 +306,7 @@ const RealTableContent = ({ rowId, row }) => {
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
{row.original.refahi_type === 1 ? (<BuildTableUserInfo row={row} />) : (<RestoreTableUserInfo row={row} />) }
|
||||
{row.original.refahi_type === 1 ? <BuildTableUserInfo row={row} /> : <RestoreTableUserInfo row={row} />}
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={12}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
@@ -344,4 +344,4 @@ const RealTableContent = ({ rowId, row }) => {
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default RealTableContent;
|
||||
export default RealTableContent;
|
||||
|
||||
@@ -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 (
|
||||
<>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
@@ -65,6 +65,6 @@ const RestoreTableUserInfo = ({row}) => {
|
||||
</Grid>
|
||||
</Grid>
|
||||
</>
|
||||
)
|
||||
}
|
||||
export default RestoreTableUserInfo
|
||||
);
|
||||
};
|
||||
export default RestoreTableUserInfo;
|
||||
|
||||
@@ -39,7 +39,14 @@ const UserInfoForm = ({ rowId, row }) => {
|
||||
<Button onClick={() => setOpenUserInfoDialog(false)} variant="outlined" color="secondary" autoFocus>
|
||||
{t("UserInfoDialog.button-cancel")}
|
||||
</Button>
|
||||
<Button onClick={() => window.open(`/dashboard/refahi/passenger-boss/print-report?id=${row.original.id}`, "_blank")} variant="contained" color="primary" autoFocus>
|
||||
<Button
|
||||
onClick={() =>
|
||||
window.open(`/dashboard/refahi/passenger-boss/print-report?id=${row.original.id}`, "_blank")
|
||||
}
|
||||
variant="contained"
|
||||
color="primary"
|
||||
autoFocus
|
||||
>
|
||||
{t("UserInfoDialog.button-report")}
|
||||
</Button>
|
||||
</DialogActions>
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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 (
|
||||
<>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
@@ -76,6 +76,6 @@ const BuildTableUserInfo = ({row}) => {
|
||||
</Grid>
|
||||
</Grid>
|
||||
</>
|
||||
)
|
||||
}
|
||||
export default BuildTableUserInfo
|
||||
);
|
||||
};
|
||||
export default BuildTableUserInfo;
|
||||
|
||||
@@ -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 }) => {
|
||||
<Typography variant="body1">
|
||||
{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 })}
|
||||
</Typography>
|
||||
</Stack>
|
||||
@@ -297,11 +289,11 @@ const LegalTableContent = ({ rowId, row }) => {
|
||||
<Typography variant="body1">
|
||||
{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,
|
||||
})}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
@@ -357,7 +349,7 @@ const LegalTableContent = ({ rowId, row }) => {
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
{row.original.refahi_type === 1 ? (<BuildTableUserInfo row={row} />) : (<RestoreTableUserInfo row={row} />) }
|
||||
{row.original.refahi_type === 1 ? <BuildTableUserInfo row={row} /> : <RestoreTableUserInfo row={row} />}
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={12}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
@@ -395,4 +387,4 @@ const LegalTableContent = ({ rowId, row }) => {
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default LegalTableContent;
|
||||
export default LegalTableContent;
|
||||
|
||||
@@ -242,8 +242,8 @@ const RealTableContent = ({ rowId, row }) => {
|
||||
<Typography variant="body1">
|
||||
{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 })}
|
||||
</Typography>
|
||||
</Stack>
|
||||
@@ -266,11 +266,11 @@ const RealTableContent = ({ rowId, row }) => {
|
||||
<Typography variant="body1">
|
||||
{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,
|
||||
})}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
@@ -306,7 +306,7 @@ const RealTableContent = ({ rowId, row }) => {
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
{row.original.refahi_type === 1 ? (<BuildTableUserInfo row={row} />) : (<RestoreTableUserInfo row={row} />) }
|
||||
{row.original.refahi_type === 1 ? <BuildTableUserInfo row={row} /> : <RestoreTableUserInfo row={row} />}
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={12}>
|
||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||
@@ -344,4 +344,4 @@ const RealTableContent = ({ rowId, row }) => {
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default RealTableContent;
|
||||
export default RealTableContent;
|
||||
|
||||
@@ -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 (
|
||||
<>
|
||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
@@ -65,6 +65,6 @@ const RestoreTableUserInfo = ({row}) => {
|
||||
</Grid>
|
||||
</Grid>
|
||||
</>
|
||||
)
|
||||
}
|
||||
export default RestoreTableUserInfo
|
||||
);
|
||||
};
|
||||
export default RestoreTableUserInfo;
|
||||
|
||||
@@ -39,7 +39,14 @@ const UserInfoForm = ({ rowId, row }) => {
|
||||
<Button onClick={() => setOpenUserInfoDialog(false)} variant="outlined" color="secondary" autoFocus>
|
||||
{t("UserInfoDialog.button-cancel")}
|
||||
</Button>
|
||||
<Button onClick={() => window.open(`/dashboard/refahi/passenger-boss/print-report?id=${row.original.id}`, "_blank")} variant="contained" color="primary" autoFocus>
|
||||
<Button
|
||||
onClick={() =>
|
||||
window.open(`/dashboard/refahi/passenger-boss/print-report?id=${row.original.id}`, "_blank")
|
||||
}
|
||||
variant="contained"
|
||||
color="primary"
|
||||
autoFocus
|
||||
>
|
||||
{t("UserInfoDialog.button-report")}
|
||||
</Button>
|
||||
</DialogActions>
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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
|
||||
//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
|
||||
|
||||
@@ -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: <GavelIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
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: <BusinessCenterIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
selected: false,
|
||||
permissions: ["manage_refahi_loan"],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
|
||||
19
src/pages/dashboard/refahi/loan-followup/index.jsx
Normal file
19
src/pages/dashboard/refahi/loan-followup/index.jsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import { parse } from "next-useragent";
|
||||
import DashboardLoanFollowUpComponent from "@/components/dashboard/refahi/loan-followup";
|
||||
|
||||
export default function LoanFollowUp() {
|
||||
return <DashboardLoanFollowUpComponent />;
|
||||
}
|
||||
|
||||
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"] } },
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -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"] } }, //پرمیشن باید عوض بشه
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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"] } }, //پرمیشن باید عوض بشه
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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"] } }, //پرمیشن باید عوض بشه
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user