Feature/permission check
This commit is contained in:
@@ -238,6 +238,7 @@
|
|||||||
"vehicle_type": "نوع ماشین",
|
"vehicle_type": "نوع ماشین",
|
||||||
"state_name": "وضعیت درخواست",
|
"state_name": "وضعیت درخواست",
|
||||||
"revert": "بازگشت به معاون حمل و نقل",
|
"revert": "بازگشت به معاون حمل و نقل",
|
||||||
|
"revert_refahi": "بازگشت به معاون توسعه",
|
||||||
"confirm": "تایید نهایی و ارجاع به بانک",
|
"confirm": "تایید نهایی و ارجاع به بانک",
|
||||||
"upload_file_unit": "فایل بارگذاری شده باید حداکثر 5Mb باشد",
|
"upload_file_unit": "فایل بارگذاری شده باید حداکثر 5Mb باشد",
|
||||||
"upload_file_format": "فرمت قابل قبول : png,jpg,pdf",
|
"upload_file_format": "فرمت قابل قبول : png,jpg,pdf",
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const BuildTableUserInfo = ({row}) => {
|
|||||||
return(
|
return(
|
||||||
<>
|
<>
|
||||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||||
<Grid item xs={12} sm={4}>
|
<Grid item xs={12} sm={6}>
|
||||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||||
<Chip label={t("UserInfoDialog.project_physical_progress")} sx={{ mr: 1 }} />
|
<Chip label={t("UserInfoDialog.project_physical_progress")} sx={{ mr: 1 }} />
|
||||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||||
@@ -16,7 +16,7 @@ const BuildTableUserInfo = ({row}) => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} sm={4}>
|
<Grid item xs={12} sm={6}>
|
||||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||||
<Chip label={t("UserInfoDialog.basic_approval_number")} sx={{ mr: 1 }} />
|
<Chip label={t("UserInfoDialog.basic_approval_number")} sx={{ mr: 1 }} />
|
||||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||||
@@ -25,15 +25,6 @@ const BuildTableUserInfo = ({row}) => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} sm={4}>
|
|
||||||
<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>
|
</Grid>
|
||||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||||
<Grid item xs={12} sm={6}>
|
<Grid item xs={12} sm={6}>
|
||||||
@@ -73,6 +64,17 @@ const BuildTableUserInfo = ({row}) => {
|
|||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
</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>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const Revert = ({ rowId, mutate }) => {
|
|||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<DialogTitle>{t("NavganProvinceManager.revert")}</DialogTitle>
|
<DialogTitle>{t("NavganProvinceManager.revert_refahi")}</DialogTitle>
|
||||||
<RevertContent mutate={mutate} rowId={rowId} setOpenRevertDialog={setOpenRevertDialog} />
|
<RevertContent mutate={mutate} rowId={rowId} setOpenRevertDialog={setOpenRevertDialog} />
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const BuildTableUserInfo = ({row}) => {
|
|||||||
return(
|
return(
|
||||||
<>
|
<>
|
||||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||||
<Grid item xs={12} sm={4}>
|
<Grid item xs={12} sm={6}>
|
||||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||||
<Chip label={t("UserInfoDialog.project_physical_progress")} sx={{ mr: 1 }} />
|
<Chip label={t("UserInfoDialog.project_physical_progress")} sx={{ mr: 1 }} />
|
||||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||||
@@ -16,7 +16,7 @@ const BuildTableUserInfo = ({row}) => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} sm={4}>
|
<Grid item xs={12} sm={6}>
|
||||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||||
<Chip label={t("UserInfoDialog.basic_approval_number")} sx={{ mr: 1 }} />
|
<Chip label={t("UserInfoDialog.basic_approval_number")} sx={{ mr: 1 }} />
|
||||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||||
@@ -25,15 +25,6 @@ const BuildTableUserInfo = ({row}) => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} sm={4}>
|
|
||||||
<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>
|
</Grid>
|
||||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||||
<Grid item xs={12} sm={6}>
|
<Grid item xs={12} sm={6}>
|
||||||
@@ -73,6 +64,17 @@ const BuildTableUserInfo = ({row}) => {
|
|||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
</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>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,16 @@
|
|||||||
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 { useTranslations } from "next-intl";
|
||||||
import moment from "jalali-moment";
|
import moment from "jalali-moment";
|
||||||
|
import BuildTableUserInfo from "./BuildTableUserInfo";
|
||||||
|
import RestoreTableUserInfo from "./RestoreTableUserInfo";
|
||||||
|
|
||||||
const LegalTableContent = ({ rowId, row }) => {
|
const LegalTableContent = ({ rowId, row }) => {
|
||||||
const t = useTranslations();
|
const t = useTranslations();
|
||||||
@@ -27,19 +37,19 @@ const LegalTableContent = ({ rowId, row }) => {
|
|||||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||||
<Grid item xs={12} sm={6}>
|
<Grid item xs={12} sm={6}>
|
||||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||||
<Chip label={t("UserInfoDialog.navgan_plan_id")} sx={{ mr: 1 }} />
|
<Chip label={t("UserInfoDialog.activity_type")} sx={{ mr: 1 }} />
|
||||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||||
<Typography variant="body1">
|
<Typography variant="body1">
|
||||||
{row.original.project_title || t("UserInfoDialog.no_info")}
|
{row.original.activity_category_name || t("UserInfoDialog.no_info")}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} sm={6}>
|
<Grid item xs={12} sm={6}>
|
||||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||||
<Chip label={t("UserInfoDialog.activity_type")} sx={{ mr: 1 }} />
|
<Chip label={t("UserInfoDialog.navgan_plan_id")} sx={{ mr: 1 }} />
|
||||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||||
<Typography variant="body1">
|
<Typography variant="body1">
|
||||||
{row.original.activity_category_name || t("UserInfoDialog.no_info")}
|
{row.original.project_title || t("UserInfoDialog.no_info")}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -217,26 +227,6 @@ const LegalTableContent = ({ rowId, row }) => {
|
|||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
</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.navgan_id")} sx={{ mr: 1 }} />
|
|
||||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
|
||||||
<Typography variant="body1">
|
|
||||||
{row.original.navgan_id || 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_type")} sx={{ mr: 1 }} />
|
|
||||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
|
||||||
<Typography variant="body1">
|
|
||||||
{row.original.navgan_type || t("UserInfoDialog.no_info")}
|
|
||||||
</Typography>
|
|
||||||
</Stack>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||||
<Grid item xs={12} sm={6}>
|
<Grid item xs={12} sm={6}>
|
||||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||||
@@ -260,26 +250,44 @@ const LegalTableContent = ({ rowId, row }) => {
|
|||||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||||
<Grid item xs={12} sm={6}>
|
<Grid item xs={12} sm={6}>
|
||||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||||
<Chip label={t("UserInfoDialog.vehicle_type")} sx={{ mr: 1 }} />
|
<Chip label={t("UserInfoDialog.project_province_name")} sx={{ mr: 1 }} />
|
||||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||||
<Typography variant="body1">
|
<Typography variant="body1">
|
||||||
{row.original.vehicle_type || t("UserInfoDialog.no_info")}
|
{row.original.project_province_name || t("UserInfoDialog.no_info")}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} sm={6}>
|
<Grid item xs={12} sm={6}>
|
||||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||||
<Chip label={t("UserInfoDialog.investment")} sx={{ mr: 1 }} />
|
<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 }} />
|
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||||
<Typography variant="body1">
|
<Typography variant="body1">
|
||||||
{row.original.investment_amount / 1000000 >= 1000
|
{row.original.investment_amount / 1000000 >= 1000
|
||||||
? t("UserInfoDialog.milyard", {
|
? t("UserInfoDialog.milyard", {
|
||||||
value: row.original.investment_amount / 1000000000,
|
value: row.original.investment_amount / 1000000000,
|
||||||
})
|
})
|
||||||
: t("UserInfoDialog.toman", { value: row.original.investment_amount / 1000000 })}
|
: t("UserInfoDialog.toman", { value: row.original.investment_amount / 1000000 })}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</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>
|
||||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||||
<Grid item xs={12} sm={6}>
|
<Grid item xs={12} sm={6}>
|
||||||
@@ -289,11 +297,11 @@ const LegalTableContent = ({ rowId, row }) => {
|
|||||||
<Typography variant="body1">
|
<Typography variant="body1">
|
||||||
{row.original.requested_facility_amount / 1000000 >= 1000
|
{row.original.requested_facility_amount / 1000000 >= 1000
|
||||||
? t("UserInfoDialog.milyard", {
|
? t("UserInfoDialog.milyard", {
|
||||||
value: row.original.requested_facility_amount / 1000000000,
|
value: row.original.requested_facility_amount / 1000000000,
|
||||||
})
|
})
|
||||||
: t("UserInfoDialog.toman", {
|
: t("UserInfoDialog.toman", {
|
||||||
value: row.original.requested_facility_amount / 1000000,
|
value: row.original.requested_facility_amount / 1000000,
|
||||||
})}
|
})}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -329,53 +337,46 @@ const LegalTableContent = ({ rowId, row }) => {
|
|||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
</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 container spacing={2} sx={{ my: 2 }}>
|
||||||
<Grid item xs={12} sm={12}>
|
<Grid item xs={12} sm={12}>
|
||||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||||
<Chip label={t("UserInfoDialog.plate")} sx={{ mr: 1 }} />
|
<Chip label={t("UserInfoDialog.project_kilometer_marker")} sx={{ mr: 1 }} />
|
||||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||||
<Stack sx={{ border: 1, borderColor: "divider", borderRadius: 1 }} direction={"row"}>
|
<Typography variant="body1">
|
||||||
<Stack
|
{row.original.project_kilometer_marker || t("UserInfoDialog.no_info")}
|
||||||
sx={{
|
</Typography>
|
||||||
borderRight: 1,
|
</Stack>
|
||||||
borderColor: "divider",
|
</Grid>
|
||||||
textAlign: "center",
|
</Grid>
|
||||||
width: "100%",
|
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||||
px: 1,
|
<Grid item xs={12} sm={12}>
|
||||||
}}
|
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||||
>
|
<Chip label={t("UserInfoDialog.project_address")} sx={{ mr: 1 }} />
|
||||||
{row.original.plate_number.split("-")[3] || t("UserInfoDialog.no_info")}
|
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||||
</Stack>
|
<Typography variant="body1">
|
||||||
<Stack spacing={1} direction={"row"} sx={{ width: "100%" }}>
|
{row.original.project_address || t("UserInfoDialog.no_info")}
|
||||||
<Stack
|
</Typography>
|
||||||
sx={{
|
|
||||||
textAlign: "center",
|
|
||||||
width: "100%",
|
|
||||||
pl: 1,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{row.original.plate_number.split("-")[2] || t("UserInfoDialog.no_info")}
|
|
||||||
</Stack>
|
|
||||||
<Stack
|
|
||||||
sx={{
|
|
||||||
textAlign: "center",
|
|
||||||
width: "100%",
|
|
||||||
pl: 1,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{row.original.plate_number.split("-")[1] || t("UserInfoDialog.no_info")}
|
|
||||||
</Stack>
|
|
||||||
<Stack
|
|
||||||
sx={{
|
|
||||||
textAlign: "center",
|
|
||||||
width: "100%",
|
|
||||||
px: 1,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{row.original.plate_number.split("-")[0] || t("UserInfoDialog.no_info")}
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -394,4 +395,4 @@ const LegalTableContent = ({ rowId, row }) => {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
export default LegalTableContent;
|
export default LegalTableContent;
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
import { Chip, DialogContent, DialogTitle, Divider, Grid, Stack, Typography } from "@mui/material";
|
import { Button, Chip, DialogContent, DialogTitle, Divider, Grid, Link, Stack, Typography } from "@mui/material";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
import moment from "jalali-moment";
|
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 RealTableContent = ({ rowId, row }) => {
|
||||||
const t = useTranslations();
|
const t = useTranslations();
|
||||||
@@ -27,19 +30,19 @@ const RealTableContent = ({ rowId, row }) => {
|
|||||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||||
<Grid item xs={12} sm={6}>
|
<Grid item xs={12} sm={6}>
|
||||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||||
<Chip label={t("UserInfoDialog.navgan_plan_id")} sx={{ mr: 1 }} />
|
<Chip label={t("UserInfoDialog.activity_type")} sx={{ mr: 1 }} />
|
||||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||||
<Typography variant="body1">
|
<Typography variant="body1">
|
||||||
{row.original.project_title || t("UserInfoDialog.no_info")}
|
{row.original.activity_category_name || t("UserInfoDialog.no_info")}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} sm={6}>
|
<Grid item xs={12} sm={6}>
|
||||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||||
<Chip label={t("UserInfoDialog.activity_type")} sx={{ mr: 1 }} />
|
<Chip label={t("UserInfoDialog.navgan_plan_id")} sx={{ mr: 1 }} />
|
||||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||||
<Typography variant="body1">
|
<Typography variant="body1">
|
||||||
{row.original.activity_category_name || t("UserInfoDialog.no_info")}
|
{row.original.project_title || t("UserInfoDialog.no_info")}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -193,26 +196,6 @@ const RealTableContent = ({ rowId, row }) => {
|
|||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
</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.navgan_id")} sx={{ mr: 1 }} />
|
|
||||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
|
||||||
<Typography variant="body1">
|
|
||||||
{row.original.navgan_id || 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_type")} sx={{ mr: 1 }} />
|
|
||||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
|
||||||
<Typography variant="body1">
|
|
||||||
{row.original.navgan_type || t("UserInfoDialog.no_info")}
|
|
||||||
</Typography>
|
|
||||||
</Stack>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||||
<Grid item xs={12} sm={6}>
|
<Grid item xs={12} sm={6}>
|
||||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||||
@@ -236,26 +219,44 @@ const RealTableContent = ({ rowId, row }) => {
|
|||||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||||
<Grid item xs={12} sm={6}>
|
<Grid item xs={12} sm={6}>
|
||||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||||
<Chip label={t("UserInfoDialog.vehicle_type")} sx={{ mr: 1 }} />
|
<Chip label={t("UserInfoDialog.project_province_name")} sx={{ mr: 1 }} />
|
||||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||||
<Typography variant="body1">
|
<Typography variant="body1">
|
||||||
{row.original.vehicle_type || t("UserInfoDialog.no_info")}
|
{row.original.project_province_name || t("UserInfoDialog.no_info")}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} sm={6}>
|
<Grid item xs={12} sm={6}>
|
||||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||||
<Chip label={t("UserInfoDialog.investment")} sx={{ mr: 1 }} />
|
<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 }} />
|
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||||
<Typography variant="body1">
|
<Typography variant="body1">
|
||||||
{row.original.investment_amount / 1000000 >= 1000
|
{row.original.investment_amount / 1000000 >= 1000
|
||||||
? t("UserInfoDialog.milyard", {
|
? t("UserInfoDialog.milyard", {
|
||||||
value: row.original.investment_amount / 1000000000,
|
value: row.original.investment_amount / 1000000000,
|
||||||
})
|
})
|
||||||
: t("UserInfoDialog.toman", { value: row.original.investment_amount / 1000000 })}
|
: t("UserInfoDialog.toman", { value: row.original.investment_amount / 1000000 })}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</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>
|
||||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||||
<Grid item xs={12} sm={6}>
|
<Grid item xs={12} sm={6}>
|
||||||
@@ -265,11 +266,11 @@ const RealTableContent = ({ rowId, row }) => {
|
|||||||
<Typography variant="body1">
|
<Typography variant="body1">
|
||||||
{row.original.requested_facility_amount / 1000000 >= 1000
|
{row.original.requested_facility_amount / 1000000 >= 1000
|
||||||
? t("UserInfoDialog.milyard", {
|
? t("UserInfoDialog.milyard", {
|
||||||
value: row.original.requested_facility_amount / 1000000000,
|
value: row.original.requested_facility_amount / 1000000000,
|
||||||
})
|
})
|
||||||
: t("UserInfoDialog.toman", {
|
: t("UserInfoDialog.toman", {
|
||||||
value: row.original.requested_facility_amount / 1000000,
|
value: row.original.requested_facility_amount / 1000000,
|
||||||
})}
|
})}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -285,53 +286,46 @@ const RealTableContent = ({ rowId, row }) => {
|
|||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
</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 container spacing={2} sx={{ my: 2 }}>
|
||||||
<Grid item xs={12} sm={12}>
|
<Grid item xs={12} sm={12}>
|
||||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||||
<Chip label={t("UserInfoDialog.plate")} sx={{ mr: 1 }} />
|
<Chip label={t("UserInfoDialog.project_kilometer_marker")} sx={{ mr: 1 }} />
|
||||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||||
<Stack sx={{ border: 1, borderColor: "divider", borderRadius: 1 }} direction={"row"}>
|
<Typography variant="body1">
|
||||||
<Stack
|
{row.original.project_kilometer_marker || t("UserInfoDialog.no_info")}
|
||||||
sx={{
|
</Typography>
|
||||||
borderRight: 1,
|
</Stack>
|
||||||
borderColor: "divider",
|
</Grid>
|
||||||
textAlign: "center",
|
</Grid>
|
||||||
width: "100%",
|
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||||
px: 1,
|
<Grid item xs={12} sm={12}>
|
||||||
}}
|
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||||
>
|
<Chip label={t("UserInfoDialog.project_address")} sx={{ mr: 1 }} />
|
||||||
{row.original.plate_number.split("-")[3] || t("UserInfoDialog.no_info")}
|
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||||
</Stack>
|
<Typography variant="body1">
|
||||||
<Stack spacing={1} direction={"row"} sx={{ width: "100%" }}>
|
{row.original.project_address || t("UserInfoDialog.no_info")}
|
||||||
<Stack
|
</Typography>
|
||||||
sx={{
|
|
||||||
textAlign: "center",
|
|
||||||
width: "100%",
|
|
||||||
pl: 1,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{row.original.plate_number.split("-")[2] || t("UserInfoDialog.no_info")}
|
|
||||||
</Stack>
|
|
||||||
<Stack
|
|
||||||
sx={{
|
|
||||||
textAlign: "center",
|
|
||||||
width: "100%",
|
|
||||||
pl: 1,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{row.original.plate_number.split("-")[1] || t("UserInfoDialog.no_info")}
|
|
||||||
</Stack>
|
|
||||||
<Stack
|
|
||||||
sx={{
|
|
||||||
textAlign: "center",
|
|
||||||
width: "100%",
|
|
||||||
px: 1,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{row.original.plate_number.split("-")[0] || t("UserInfoDialog.no_info")}
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -350,4 +344,4 @@ const RealTableContent = ({ rowId, row }) => {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
export default RealTableContent;
|
export default RealTableContent;
|
||||||
@@ -39,6 +39,9 @@ const UserInfoForm = ({ rowId, row }) => {
|
|||||||
<Button onClick={() => setOpenUserInfoDialog(false)} variant="outlined" color="secondary" autoFocus>
|
<Button onClick={() => setOpenUserInfoDialog(false)} variant="outlined" color="secondary" autoFocus>
|
||||||
{t("UserInfoDialog.button-cancel")}
|
{t("UserInfoDialog.button-cancel")}
|
||||||
</Button>
|
</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>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const BuildTableUserInfo = ({row}) => {
|
|||||||
return(
|
return(
|
||||||
<>
|
<>
|
||||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||||
<Grid item xs={12} sm={4}>
|
<Grid item xs={12} sm={6}>
|
||||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||||
<Chip label={t("UserInfoDialog.project_physical_progress")} sx={{ mr: 1 }} />
|
<Chip label={t("UserInfoDialog.project_physical_progress")} sx={{ mr: 1 }} />
|
||||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||||
@@ -16,7 +16,7 @@ const BuildTableUserInfo = ({row}) => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} sm={4}>
|
<Grid item xs={12} sm={6}>
|
||||||
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
<Stack direction="row" alignItems="center" sx={{ width: "100%" }}>
|
||||||
<Chip label={t("UserInfoDialog.basic_approval_number")} sx={{ mr: 1 }} />
|
<Chip label={t("UserInfoDialog.basic_approval_number")} sx={{ mr: 1 }} />
|
||||||
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
<Divider sx={{ flexGrow: 1, mx: 1 }} />
|
||||||
@@ -25,15 +25,6 @@ const BuildTableUserInfo = ({row}) => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} sm={4}>
|
|
||||||
<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>
|
</Grid>
|
||||||
<Grid container spacing={2} sx={{ my: 2 }}>
|
<Grid container spacing={2} sx={{ my: 2 }}>
|
||||||
<Grid item xs={12} sm={6}>
|
<Grid item xs={12} sm={6}>
|
||||||
@@ -73,6 +64,17 @@ const BuildTableUserInfo = ({row}) => {
|
|||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
</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>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export async function getServerSideProps({ req, locale }) {
|
|||||||
title: "Dashboard.transportation_assistance",
|
title: "Dashboard.transportation_assistance",
|
||||||
isBot,
|
isBot,
|
||||||
locale,
|
locale,
|
||||||
layout: { name: "DashboardLayout", props: { permissions: ["manage_transportation_navgan"] } }, //پرمیشن باید عوض بشه
|
layout: { name: "DashboardLayout", props: { permissions: ["manage_transportation_refahi"] } }, //پرمیشن باید عوض بشه
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user