diff --git a/.env.local.example b/.env.local.example
index a6882a3..8fbb380 100644
--- a/.env.local.example
+++ b/.env.local.example
@@ -1,5 +1,5 @@
NEXT_PUBLIC_API_NAME = "Loan Facilities Dashboard"
-NEXT_PUBLIC_API_VERSION = "2.8.0"
+NEXT_PUBLIC_API_VERSION = "2.9.0"
NEXT_PUBLIC_DEFAULT_LANGUAGE = "fa"
NEXT_PUBLIC_DEFAULT_DIRECTION = "rtl"
@@ -10,6 +10,8 @@ NEXT_PUBLIC_FACILITY_BANK = 66
NEXT_PUBLIC_FACILITY_PERSON = 20
NEXT_PUBLIC_BUS_AMOUNT=10000
NEXT_PUBLIC_MINIBUS_AMOUNT=4000
+NEXT_PUBLIC_RESTORE_LOAN_AMOUNT=10000
+NEXT_PUBLIC_BUILD_LOAN_AMOUNT=50000
NEXT_PUBLIC_BASE_URL = "https://loan-v2.witel.ir"
NEXT_PUBLIC_POWERED_BY_URL = "https://witel.ir"
diff --git a/package.json b/package.json
index b2fc261..9cf7de6 100644
--- a/package.json
+++ b/package.json
@@ -23,7 +23,6 @@
"@mui/material": "^5.12.0",
"@mui/x-data-grid": "^6.18.1",
"@mui/x-date-pickers": "^6.9.2",
- "apexcharts": "^3.44.0",
"axios": "^1.4.0",
"colord": "^2.9.3",
"date-fns-jalali": "^2.13.0-0",
@@ -70,4 +69,4 @@
"prettier": "^3.3.3",
"run-script-os": "^1.1.6"
}
-}
+}
\ No newline at end of file
diff --git a/public/locales/fa/app.json b/public/locales/fa/app.json
index 5a23145..696e89d 100644
--- a/public/locales/fa/app.json
+++ b/public/locales/fa/app.json
@@ -42,14 +42,24 @@
},
"sidebar": {
"dashboard": "داشبورد",
+ "restore": "مرمت و بازسازی مجتمع رفاهی",
+ "build": "ساخت مجتمع رفاهی",
+ "refahi": "رفاهی",
+ "navgan": "ناوگان",
"reports": "گزارشات",
+ "refahi-province-manager": "بررسی وام های تبصره 18",
"admin-setting": "تنظیمات ",
"machinery-expert": "کارتابل کارشناسی",
"passenger-boss": "کارتابل کارگروه",
+ "restore-passenger-boss": "کارتابل کارگروه",
+ "build-passenger-boss": "کارتابل کارگروه",
"transportation-assistant": "بررسی وام های تبصره 18",
+ "restore-transportation-assistant": "بررسی وام های تبصره 18",
+ "build-transportation-assistant": "بررسی وام های تبصره 18",
"bank-management": "کارتابل نظارت بانک",
"navgan-province-manager": "بررسی وام های تبصره 18",
- "refahi-province-manager": "مدیر کل استانی",
+ "restore-province-manager": "بررسی وام های تبصره 18",
+ "build-province-manager": "بررسی وام های تبصره 18",
"refahi-loan-management": "مدیریت وام",
"navgan-loan-management": "مدیریت وام",
"commercial-chief": "رئیس اداره بازرگانی",
@@ -68,9 +78,11 @@
},
"secondary": {
"passenger-boss": "کارگروه",
- "refahi-province-manager": "رفاهی",
"loan-followup": "ناوگان",
"refahi-loan-management": "رفاهی",
+ "refahi-province-manager": "رفاهی",
+ "refahi-transportation": "رفاهی",
+ "refahi-province-working-group": "رفاهی",
"navgan-loan-management": "ناوگان",
"navgan-province-manager": "ناوگان",
"admin-management": "ادمین"
@@ -194,6 +206,9 @@
},
"NavganProvinceManager": {
"name": "نام",
+ "project_title": "نام پروژه",
+ "first_name": "نام",
+ "last_name": "نام خانوادگی",
"id": "کد یکتا",
"interest_rate": "نرخ بهره وام(درصد)",
"physical_progress": "درصد پیشرفت فیزیکی",
@@ -230,6 +245,9 @@
},
"PassengerBoss": {
"name": "نام",
+ "project_title": "نام پروژه",
+ "first_name": "نام",
+ "last_name": "نام خانوادگی",
"button-reserve-confirm": "رزرو",
"reserve-loan-title": "رزرو وام",
"description-reserve-loan-first": "آیا از رزرو وام به کد یکتا",
@@ -260,6 +278,7 @@
"vehicle_type": "نوع ماشین",
"state_name": "وضعیت درخواست",
"confirm": "ارجاع به معاون حمل و نقل",
+ "confirm_refahi": "ارجاع به معاون توسعه",
"upload_file": "فایل خود را بارگذاری کنید(اختیاری)",
"upload_expert_img": "فایل گزارش کارشناسی را بارگذاری کنید",
"upload_file_required": "وارد کردن گزارش کارشناسی الزامیست",
@@ -407,7 +426,10 @@
},
"TransportationAssistance": {
"name": "نام",
+ "project_title": "نام پروژه",
"city_name": "شهرستان",
+ "first_name": "نام",
+ "last_name": "نام خانوادگی",
"refer_reason": "علت ارجاع",
"plate_number": "پلاک",
"id": "کد یکتا",
@@ -553,6 +575,8 @@
"context": "آیا از تایید این آیتم اطمینان دارید؟",
"button-cancel": "بستن",
"loan_interest": "نرخ بهره وام",
+ "physical_progress_number": "درصد پیشرفت پروژه باید عدد باشد",
+ "physical_progress_positive": "درصد پیشرفت پروژه باید بین 0 تا 100 باشد",
"button-confirm": "ارجاع",
"facility_bank": "تسهیلات سهم بانک",
"facility_person": "تسهیلات سهم متقاضی",
@@ -841,6 +865,23 @@
"real_person" : "شخص حقیقی",
"activity_type": "نوع فعالیت",
"navgan_plan_id": "عنوان پروژه",
+ "welfare_complex_degree": "درجه مجتمع",
+ "project_city_name": "شهر محل پروژه",
+ "project_province_name": "استان محل پروژه",
+ "project_address": "ادرس محل اجرا پروژه",
+ "project_direction": "سمت پروژه",
+ "project_axis": "محور پروژه",
+ "project_kilometer_marker": "کیلومتر پروژه",
+ "exploitation_date": "تاریخ بهره برداری",
+ "exploitation_license_image": "تصویر پروانه بهره برداری",
+ "exploitation_license_renewal_date": "تاریخ اخرین تمدیدی پروانه بهره برداری",
+ "exploitation_license_renewal_image": "تصویر اخرین تمدیدی بهره برداری",
+ "download_image": "دریافت تصویر",
+ "project_physical_progress": "درصد پیشرفت پروژه",
+ "basic_approval_number": "شماره موافقت اصولی",
+ "basic_approval_renewal_date": "تاریخ اخرین تمدیدی موافقت اصولی",
+ "basic_approval_image": "تصویر موافقت اصولی",
+ "basic_approval_renewal_image": "تصویر اخرین تمدیدی موافقت اصولی",
"shenasname_serial": "سریال پشت کارت ملی",
"national_tracking_code": "کد رهگیری کارت ملی",
"national_id": "کد ملی",
@@ -852,6 +893,7 @@
"committed_employment": "اشتغال ایجاد شده",
"existing_employment": "اشتغال موجود",
"plate" : "پلاک",
+ "investment_amount" : "سرمایه گذاری انجام شده",
"male" : "مرد",
"female" : "زن",
"IRAN" : "ایران",
@@ -874,7 +916,8 @@
"last_name": "نام خانوادگی",
"vehicle_type": "نوع وسیله",
"tel_number": "شماره ثابت (با پیش شماره استان)",
- "button-cancel": "بستن"
+ "button-cancel": "بستن",
+ "button-report": "گزارش"
},
"ReferDialog": {
"refer-passenger-boss": "بازگشت به کارگروه",
diff --git a/src/components/dashboard/commercial-chief/Form/ConfirmForm/ConfirmContent.jsx b/src/components/dashboard/commercial-chief/Form/ConfirmForm/ConfirmContent.jsx
deleted file mode 100644
index 066d4d5..0000000
--- a/src/components/dashboard/commercial-chief/Form/ConfirmForm/ConfirmContent.jsx
+++ /dev/null
@@ -1,134 +0,0 @@
-import UploadSystem from "@/core/components/UploadSystem";
-import useNotification from "@/lib/app/hooks/useNotification";
-import useRequest from "@/lib/app/hooks/useRequest";
-import { Button, DialogActions, DialogContent, Stack, TextField, Typography } from "@mui/material";
-import { useFormik } from "formik";
-import { useTranslations } from "next-intl";
-import { CONFIRM_COMMERCIAL_CHIEF } from "@/core/data/apiRoutes";
-import UploadFileNotification from "@/core/components/notifications/UploadFileNotification";
-import { useState } from "react";
-
-const ConfirmContent = ({ rowId, mutate, setOpenConfirmDialog }) => {
- const t = useTranslations();
- const [selectedImage, setSelectedImage] = useState("");
- const [fileType, setfileType] = useState(null);
- const [fileName, setfileName] = useState(null);
- const [showAddIcon, setShowAddIcon] = useState(true);
- const requestServer = useRequest({ auth: true });
- const { update_notification } = useNotification();
-
- const formik = useFormik({
- initialValues: {
- description: "",
- confirm_img: null,
- },
- onSubmit: (values, { setSubmitting }) => {
- const formData = new FormData();
- if (values.description != "") formData.append("description", values.description);
- if (values.confirm_img != null) formData.append("attachment", values.confirm_img);
-
- requestServer(`${CONFIRM_COMMERCIAL_CHIEF}/${rowId}`, "post", {
- data: formData,
- })
- .then((response) => {
- setOpenConfirmDialog(false);
- update_notification();
- mutate();
- })
- .catch(() => {})
- .finally(() => {
- setSubmitting(false);
- });
- },
- });
-
- const handleDescriptionChange = (event) => {
- formik.setFieldValue("description", event.target.value);
- };
-
- const handleUploadChange = (event) => {
- const uploadedFile = event.target?.files?.[0];
- if (uploadedFile) {
- const maxFileSize = 2 * 1024 * 1024;
- if (uploadedFile.size > maxFileSize) {
- UploadFileNotification(t);
- event.target.value = "";
- return;
- }
-
- const fileType = event.target?.files?.[0].type;
- const fileName = event.target?.files?.[0].name;
- setSelectedImage(URL.createObjectURL(uploadedFile));
- setfileType(fileType);
- setfileName(fileName);
- formik.setFieldValue("confirm_img", uploadedFile);
- setShowAddIcon(false);
- }
- };
-
- return (
- <>
-
-
-
-
- {t("ConfirmDialog.description")}
- {t("ConfirmDialog.optional")}
- >
- }
- value={formik.values.description}
- onChange={handleDescriptionChange}
- fullWidth
- variant="outlined"
- sx={{ mt: 1 }}
- />
-
-
-
- {t("UploadSystem.upload_file")}
- {t("UploadSystem.optional")}
-
-
-
-
-
-
-
-
-
- >
- );
-};
-export default ConfirmContent;
diff --git a/src/components/dashboard/commercial-chief/Form/RejectForm/RejectContent.jsx b/src/components/dashboard/commercial-chief/Form/RejectForm/RejectContent.jsx
deleted file mode 100644
index ba4e6b6..0000000
--- a/src/components/dashboard/commercial-chief/Form/RejectForm/RejectContent.jsx
+++ /dev/null
@@ -1,135 +0,0 @@
-import UploadSystem from "@/core/components/UploadSystem";
-import useNotification from "@/lib/app/hooks/useNotification";
-import useRequest from "@/lib/app/hooks/useRequest";
-import { Button, DialogActions, DialogContent, Stack, TextField, Typography } from "@mui/material";
-import { useFormik } from "formik";
-import { useTranslations } from "next-intl";
-import { useState } from "react";
-import * as Yup from "yup";
-import { REJECT_COMMERCIAL_CHIEF } from "@/core/data/apiRoutes";
-
-const RejectContent = ({ rowId, mutate, setOpenRejectDialog }) => {
- const [selectedImage, setSelectedImage] = useState("");
- const [fileType, setfileType] = useState(null);
- const [fileName, setfileName] = useState(null);
- const [showAddIcon, setShowAddIcon] = useState(true);
- const t = useTranslations();
- const requestServer = useRequest({ auth: true });
- const { update_notification } = useNotification();
-
- const validationSchema = Yup.object().shape({
- description: Yup.string().required(t("RejectDialog.description_error")),
- });
-
- const formik = useFormik({
- initialValues: {
- description: "",
- reject_img: null,
- },
- validationSchema,
- onSubmit: (values, { setSubmitting }) => {
- const formData = new FormData();
- formData.append("description", values.description);
- if (values.reject_img != null) formData.append("attachment", values.reject_img);
-
- requestServer(`${REJECT_COMMERCIAL_CHIEF}/${rowId}`, "post", {
- data: formData,
- })
- .then((response) => {
- setOpenRejectDialog(false);
- mutate();
- update_notification();
- })
- .catch(() => {})
- .finally(() => {
- setSubmitting(false);
- });
- },
- });
-
- const handleDescriptionChange = (event) => {
- formik.setFieldValue("description", event.target.value);
- formik.handleChange(event);
- };
- const handleUploadChange = (event) => {
- const uploadedFile = event.target?.files?.[0];
- if (uploadedFile) {
- const maxFileSize = 2 * 1024 * 1024;
- if (uploadedFile.size > maxFileSize) {
- UploadFileNotification(t);
- event.target.value = "";
- return;
- }
- const fileType = event.target?.files?.[0].type;
- const fileName = event.target?.files?.[0].name;
- setSelectedImage(URL.createObjectURL(uploadedFile));
- setfileType(fileType);
- setfileName(fileName);
- formik.setFieldValue("reject_img", uploadedFile);
- setShowAddIcon(false);
- }
- };
- return (
- <>
-
-
-
-
-
-
-
- {t("UploadSystem.upload_file")}
- {t("UploadSystem.optional")}
-
-
-
-
-
-
-
-
-
- >
- );
-};
-export default RejectContent;
diff --git a/src/components/dashboard/commercial-chief/TableRowActions.jsx b/src/components/dashboard/commercial-chief/TableRowActions.jsx
deleted file mode 100644
index fa9e1ef..0000000
--- a/src/components/dashboard/commercial-chief/TableRowActions.jsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { Box } from "@mui/material";
-import Confirm from "./Form/ConfirmForm";
-import Reject from "./Form/RejectForm";
-
-const TableRow = ({ row, mutate }) => {
- return (
-
-
-
-
- );
-};
-
-export default TableRow;
diff --git a/src/components/dashboard/development-assistant/Form/ConfirmForm/ConfirmContent.jsx b/src/components/dashboard/development-assistant/Form/ConfirmForm/ConfirmContent.jsx
deleted file mode 100644
index 8c412b8..0000000
--- a/src/components/dashboard/development-assistant/Form/ConfirmForm/ConfirmContent.jsx
+++ /dev/null
@@ -1,134 +0,0 @@
-import UploadSystem from "@/core/components/UploadSystem";
-import useNotification from "@/lib/app/hooks/useNotification";
-import useRequest from "@/lib/app/hooks/useRequest";
-import { Button, DialogActions, DialogContent, Stack, TextField, Typography } from "@mui/material";
-import { useFormik } from "formik";
-import { useTranslations } from "next-intl";
-import { CONFIRM_DEVELOPMENT_ASSISTANT } from "@/core/data/apiRoutes";
-import UploadFileNotification from "@/core/components/notifications/UploadFileNotification";
-import { useState } from "react";
-
-const ConfirmContent = ({ rowId, mutate, setOpenConfirmDialog }) => {
- const t = useTranslations();
- const [selectedImage, setSelectedImage] = useState("");
- const [fileType, setfileType] = useState(null);
- const [fileName, setfileName] = useState(null);
- const [showAddIcon, setShowAddIcon] = useState(true);
- const requestServer = useRequest({ auth: true });
- const { update_notification } = useNotification();
-
- const formik = useFormik({
- initialValues: {
- description: "",
- confirm_img: null,
- },
- onSubmit: (values, { setSubmitting }) => {
- const formData = new FormData();
- if (values.description != "") formData.append("description", values.description);
- if (values.confirm_img != null) formData.append("attachment", values.confirm_img);
-
- requestServer(`${CONFIRM_DEVELOPMENT_ASSISTANT}/${rowId}`, "post", {
- data: formData,
- })
- .then((response) => {
- setOpenConfirmDialog(false);
- mutate();
- update_notification();
- })
- .catch(() => {})
- .finally(() => {
- setSubmitting(false);
- });
- },
- });
-
- const handleDescriptionChange = (event) => {
- formik.setFieldValue("description", event.target.value);
- };
-
- const handleUploadChange = (event) => {
- const uploadedFile = event.target?.files?.[0];
- if (uploadedFile) {
- const maxFileSize = 2 * 1024 * 1024;
- if (uploadedFile.size > maxFileSize) {
- UploadFileNotification(t);
- event.target.value = "";
- return;
- }
-
- const fileType = event.target?.files?.[0].type;
- const fileName = event.target?.files?.[0].name;
- setSelectedImage(URL.createObjectURL(uploadedFile));
- setfileType(fileType);
- setfileName(fileName);
- formik.setFieldValue("confirm_img", uploadedFile);
- setShowAddIcon(false);
- }
- };
-
- return (
- <>
-
-
-
-
- {t("ConfirmDialog.description")}
- {t("ConfirmDialog.optional")}
- >
- }
- value={formik.values.description}
- onChange={handleDescriptionChange}
- fullWidth
- variant="outlined"
- sx={{ mt: 1 }}
- />
-
-
-
- {t("UploadSystem.upload_file")}
- {t("UploadSystem.optional")}
-
-
-
-
-
-
-
-
-
- >
- );
-};
-export default ConfirmContent;
diff --git a/src/components/dashboard/development-assistant/Form/ConfirmForm/index.jsx b/src/components/dashboard/development-assistant/Form/ConfirmForm/index.jsx
deleted file mode 100644
index e849196..0000000
--- a/src/components/dashboard/development-assistant/Form/ConfirmForm/index.jsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import { Dialog, DialogTitle, IconButton, Tooltip } from "@mui/material";
-import { useTranslations } from "next-intl";
-import ThumbUpAltIcon from "@mui/icons-material/ThumbUpAlt";
-import { useState } from "react";
-import ConfirmContent from "./ConfirmContent";
-
-const Confirm = ({ rowId, mutate }) => {
- const t = useTranslations();
- const [openConfirmDialog, setOpenConfirmDialog] = useState(false);
- return (
- <>
-
- {
- setOpenConfirmDialog(true);
- }}
- >
-
-
-
-
- >
- );
-};
-export default Confirm;
diff --git a/src/components/dashboard/development-assistant/TableRowActions.jsx b/src/components/dashboard/development-assistant/TableRowActions.jsx
deleted file mode 100644
index fa9e1ef..0000000
--- a/src/components/dashboard/development-assistant/TableRowActions.jsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { Box } from "@mui/material";
-import Confirm from "./Form/ConfirmForm";
-import Reject from "./Form/RejectForm";
-
-const TableRow = ({ row, mutate }) => {
- return (
-
-
-
-
- );
-};
-
-export default TableRow;
diff --git a/src/components/dashboard/inspector-expert/Form/ConfirmForm/ConfirmContent.jsx b/src/components/dashboard/inspector-expert/Form/ConfirmForm/ConfirmContent.jsx
deleted file mode 100644
index 3e61151..0000000
--- a/src/components/dashboard/inspector-expert/Form/ConfirmForm/ConfirmContent.jsx
+++ /dev/null
@@ -1,134 +0,0 @@
-import UploadSystem from "@/core/components/UploadSystem";
-import useNotification from "@/lib/app/hooks/useNotification";
-import useRequest from "@/lib/app/hooks/useRequest";
-import { Button, DialogActions, DialogContent, Stack, TextField, Typography } from "@mui/material";
-import { useFormik } from "formik";
-import { useTranslations } from "next-intl";
-import { CONFIRM_INSPECTOR_EXPERT } from "@/core/data/apiRoutes";
-import UploadFileNotification from "@/core/components/notifications/UploadFileNotification";
-import { useState } from "react";
-
-const ConfirmContent = ({ rowId, mutate, setOpenConfirmDialog }) => {
- const t = useTranslations();
- const [selectedImage, setSelectedImage] = useState("");
- const [fileType, setfileType] = useState(null);
- const [fileName, setfileName] = useState(null);
- const [showAddIcon, setShowAddIcon] = useState(true);
- const requestServer = useRequest({ auth: true });
- const { update_notification } = useNotification();
-
- const formik = useFormik({
- initialValues: {
- description: "",
- confirm_img: null,
- },
- onSubmit: (values, { setSubmitting }) => {
- const formData = new FormData();
- if (values.description != "") formData.append("description", values.description);
- if (values.confirm_img != null) formData.append("attachment", values.confirm_img);
-
- requestServer(`${CONFIRM_INSPECTOR_EXPERT}/${rowId}`, "post", {
- data: formData,
- })
- .then((response) => {
- setOpenConfirmDialog(false);
- mutate();
- update_notification();
- })
- .catch(() => {})
- .finally(() => {
- setSubmitting(false);
- });
- },
- });
-
- const handleDescriptionChange = (event) => {
- formik.setFieldValue("description", event.target.value);
- };
-
- const handleUploadChange = (event) => {
- const uploadedFile = event.target?.files?.[0];
- if (uploadedFile) {
- const maxFileSize = 2 * 1024 * 1024;
- if (uploadedFile.size > maxFileSize) {
- UploadFileNotification(t);
- event.target.value = "";
- return;
- }
-
- const fileType = event.target?.files?.[0].type;
- const fileName = event.target?.files?.[0].name;
- setSelectedImage(URL.createObjectURL(uploadedFile));
- setfileType(fileType);
- setfileName(fileName);
- formik.setFieldValue("confirm_img", uploadedFile);
- setShowAddIcon(false);
- }
- };
-
- return (
- <>
-
-
-
-
- {t("ConfirmDialog.description")}
- {t("ConfirmDialog.optional")}
- >
- }
- value={formik.values.description}
- onChange={handleDescriptionChange}
- fullWidth
- variant="outlined"
- sx={{ mt: 1 }}
- />
-
-
-
- {t("UploadSystem.upload_file")}
- {t("UploadSystem.optional")}
-
-
-
-
-
-
-
-
-
- >
- );
-};
-export default ConfirmContent;
diff --git a/src/components/dashboard/inspector-expert/Form/ReviseForm/index.jsx b/src/components/dashboard/inspector-expert/Form/ReviseForm/index.jsx
deleted file mode 100644
index 4fad1cd..0000000
--- a/src/components/dashboard/inspector-expert/Form/ReviseForm/index.jsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import { Dialog, DialogTitle, IconButton, Tooltip } from "@mui/material";
-import { useTranslations } from "next-intl";
-import ReplyIcon from "@mui/icons-material/Reply";
-import { useState } from "react";
-import ReviseContent from "./ReviseContent";
-
-const Revise = ({ rowId, mutate }) => {
- const t = useTranslations();
- const [openReviseDialog, setOpenReviseDialog] = useState(false);
- return (
- <>
-
- {
- setOpenReviseDialog(true);
- }}
- >
-
-
-
-
- >
- );
-};
-export default Revise;
diff --git a/src/components/dashboard/inspector-expert/TableRowActions.jsx b/src/components/dashboard/inspector-expert/TableRowActions.jsx
deleted file mode 100644
index 6a427f6..0000000
--- a/src/components/dashboard/inspector-expert/TableRowActions.jsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { Box } from "@mui/material";
-import Confirm from "./Form/ConfirmForm";
-import Reject from "./Form/RejectForm";
-import Revise from "./Form/ReviseForm";
-
-const TableRow = ({ row, mutate }) => {
- return (
-
-
-
-
-
- );
-};
-
-export default TableRow;
diff --git a/src/components/dashboard/bank-management/Buttons/printExcel.jsx b/src/components/dashboard/navgan/bank-management/Buttons/printExcel.jsx
similarity index 100%
rename from src/components/dashboard/bank-management/Buttons/printExcel.jsx
rename to src/components/dashboard/navgan/bank-management/Buttons/printExcel.jsx
diff --git a/src/components/dashboard/bank-management/Form/Edit/EditContent.jsx b/src/components/dashboard/navgan/bank-management/Form/Edit/EditContent.jsx
similarity index 100%
rename from src/components/dashboard/bank-management/Form/Edit/EditContent.jsx
rename to src/components/dashboard/navgan/bank-management/Form/Edit/EditContent.jsx
diff --git a/src/components/dashboard/bank-management/Form/Edit/index.jsx b/src/components/dashboard/navgan/bank-management/Form/Edit/index.jsx
similarity index 94%
rename from src/components/dashboard/bank-management/Form/Edit/index.jsx
rename to src/components/dashboard/navgan/bank-management/Form/Edit/index.jsx
index f59c71c..707b44c 100644
--- a/src/components/dashboard/bank-management/Form/Edit/index.jsx
+++ b/src/components/dashboard/navgan/bank-management/Form/Edit/index.jsx
@@ -2,7 +2,7 @@ import { Dialog, DialogTitle, IconButton, Tooltip } from "@mui/material";
import { useTranslations } from "next-intl";
import { useState } from "react";
import EditIcon from "@mui/icons-material/Edit";
-import EditContent from "@/components/dashboard/bank-management/Form/Edit/EditContent";
+import EditContent from "./Edit/EditContent";
const EditForm = ({ rowId, row, mutate, vehicle_type }) => {
const t = useTranslations();
diff --git a/src/components/dashboard/bank-management/Form/Reject/RejectContent.jsx b/src/components/dashboard/navgan/bank-management/Form/Reject/RejectContent.jsx
similarity index 100%
rename from src/components/dashboard/bank-management/Form/Reject/RejectContent.jsx
rename to src/components/dashboard/navgan/bank-management/Form/Reject/RejectContent.jsx
diff --git a/src/components/dashboard/bank-management/Form/Reject/index.jsx b/src/components/dashboard/navgan/bank-management/Form/Reject/index.jsx
similarity index 100%
rename from src/components/dashboard/bank-management/Form/Reject/index.jsx
rename to src/components/dashboard/navgan/bank-management/Form/Reject/index.jsx
diff --git a/src/components/dashboard/bank-management/Form/Update.jsx b/src/components/dashboard/navgan/bank-management/Form/Update.jsx
similarity index 100%
rename from src/components/dashboard/bank-management/Form/Update.jsx
rename to src/components/dashboard/navgan/bank-management/Form/Update.jsx
diff --git a/src/components/dashboard/bank-management/TableRowActions.jsx b/src/components/dashboard/navgan/bank-management/TableRowActions.jsx
similarity index 77%
rename from src/components/dashboard/bank-management/TableRowActions.jsx
rename to src/components/dashboard/navgan/bank-management/TableRowActions.jsx
index 14c32ed..21a872d 100644
--- a/src/components/dashboard/bank-management/TableRowActions.jsx
+++ b/src/components/dashboard/navgan/bank-management/TableRowActions.jsx
@@ -1,7 +1,7 @@
import { Box } from "@mui/material";
-import UpdateForm from "@/components/dashboard/bank-management/Form/Update";
-import EditForm from "@/components/dashboard/bank-management/Form/Edit";
-import RejectForm from "@/components/dashboard/bank-management/Form/Reject";
+import UpdateForm from "./Form/Update";
+import EditForm from "./Form/Edit";
+import RejectForm from "./Form/Reject";
const TableRow = ({ row, mutate }) => {
return (
diff --git a/src/components/dashboard/bank-management/TableToobar.jsx b/src/components/dashboard/navgan/bank-management/TableToobar.jsx
similarity index 73%
rename from src/components/dashboard/bank-management/TableToobar.jsx
rename to src/components/dashboard/navgan/bank-management/TableToobar.jsx
index 95a9ad4..22483e2 100644
--- a/src/components/dashboard/bank-management/TableToobar.jsx
+++ b/src/components/dashboard/navgan/bank-management/TableToobar.jsx
@@ -1,5 +1,5 @@
import { Stack } from "@mui/material";
-import PrintExcel from "@/components/dashboard/bank-management/Buttons/printExcel";
+import PrintExcel from "./Buttons/printExcel";
const TableToolbar = ({ table }) => {
return (
diff --git a/src/components/dashboard/bank-management/index.jsx b/src/components/dashboard/navgan/bank-management/index.jsx
similarity index 97%
rename from src/components/dashboard/bank-management/index.jsx
rename to src/components/dashboard/navgan/bank-management/index.jsx
index 7b75088..388fb55 100644
--- a/src/components/dashboard/bank-management/index.jsx
+++ b/src/components/dashboard/navgan/bank-management/index.jsx
@@ -3,9 +3,9 @@ import { useMemo } from "react";
import { useTranslations } from "next-intl";
import moment from "jalali-moment";
import DataTable from "@/core/components/DataTable";
-import TableRowActions from "@/components/dashboard/bank-management/TableRowActions";
+import TableRowActions from "./TableRowActions";
import { GET_BANK_STATEMENT } from "@/core/data/apiRoutes";
-import TableToolbar from "@/components/dashboard/bank-management/TableToobar";
+import TableToolbar from "./TableToobar";
function DashboardBankManagementComponent() {
const t = useTranslations();
diff --git a/src/components/dashboard/loan-followup/Form/ApprovedBankLoan/ApprovedBankLoanContent.jsx b/src/components/dashboard/navgan/loan-followup/Form/ApprovedBankLoan/ApprovedBankLoanContent.jsx
similarity index 100%
rename from src/components/dashboard/loan-followup/Form/ApprovedBankLoan/ApprovedBankLoanContent.jsx
rename to src/components/dashboard/navgan/loan-followup/Form/ApprovedBankLoan/ApprovedBankLoanContent.jsx
diff --git a/src/components/dashboard/loan-followup/Form/ApprovedBankLoan/index.jsx b/src/components/dashboard/navgan/loan-followup/Form/ApprovedBankLoan/index.jsx
similarity index 100%
rename from src/components/dashboard/loan-followup/Form/ApprovedBankLoan/index.jsx
rename to src/components/dashboard/navgan/loan-followup/Form/ApprovedBankLoan/index.jsx
diff --git a/src/components/dashboard/loan-followup/Form/BankPayment/BankPaymentContent.jsx b/src/components/dashboard/navgan/loan-followup/Form/BankPayment/BankPaymentContent.jsx
similarity index 100%
rename from src/components/dashboard/loan-followup/Form/BankPayment/BankPaymentContent.jsx
rename to src/components/dashboard/navgan/loan-followup/Form/BankPayment/BankPaymentContent.jsx
diff --git a/src/components/dashboard/loan-followup/Form/BankPayment/index.jsx b/src/components/dashboard/navgan/loan-followup/Form/BankPayment/index.jsx
similarity index 100%
rename from src/components/dashboard/loan-followup/Form/BankPayment/index.jsx
rename to src/components/dashboard/navgan/loan-followup/Form/BankPayment/index.jsx
diff --git a/src/components/dashboard/loan-followup/Form/ComebackLoanDetail/ComebackLoanDetailContent.jsx b/src/components/dashboard/navgan/loan-followup/Form/ComebackLoanDetail/ComebackLoanDetailContent.jsx
similarity index 100%
rename from src/components/dashboard/loan-followup/Form/ComebackLoanDetail/ComebackLoanDetailContent.jsx
rename to src/components/dashboard/navgan/loan-followup/Form/ComebackLoanDetail/ComebackLoanDetailContent.jsx
diff --git a/src/components/dashboard/loan-followup/Form/ComebackLoanDetail/index.jsx b/src/components/dashboard/navgan/loan-followup/Form/ComebackLoanDetail/index.jsx
similarity index 100%
rename from src/components/dashboard/loan-followup/Form/ComebackLoanDetail/index.jsx
rename to src/components/dashboard/navgan/loan-followup/Form/ComebackLoanDetail/index.jsx
diff --git a/src/components/dashboard/loan-followup/Form/PlanningCouncilForm/PlanningCouncilTable.jsx b/src/components/dashboard/navgan/loan-followup/Form/PlanningCouncilForm/PlanningCouncilTable.jsx
similarity index 100%
rename from src/components/dashboard/loan-followup/Form/PlanningCouncilForm/PlanningCouncilTable.jsx
rename to src/components/dashboard/navgan/loan-followup/Form/PlanningCouncilForm/PlanningCouncilTable.jsx
diff --git a/src/components/dashboard/loan-followup/Form/PlanningCouncilForm/index.jsx b/src/components/dashboard/navgan/loan-followup/Form/PlanningCouncilForm/index.jsx
similarity index 100%
rename from src/components/dashboard/loan-followup/Form/PlanningCouncilForm/index.jsx
rename to src/components/dashboard/navgan/loan-followup/Form/PlanningCouncilForm/index.jsx
diff --git a/src/components/dashboard/loan-followup/Form/ReferPassengerBoss/ReferPassengerBossContent.jsx b/src/components/dashboard/navgan/loan-followup/Form/ReferPassengerBoss/ReferPassengerBossContent.jsx
similarity index 100%
rename from src/components/dashboard/loan-followup/Form/ReferPassengerBoss/ReferPassengerBossContent.jsx
rename to src/components/dashboard/navgan/loan-followup/Form/ReferPassengerBoss/ReferPassengerBossContent.jsx
diff --git a/src/components/dashboard/loan-followup/Form/ReferPassengerBoss/index.jsx b/src/components/dashboard/navgan/loan-followup/Form/ReferPassengerBoss/index.jsx
similarity index 100%
rename from src/components/dashboard/loan-followup/Form/ReferPassengerBoss/index.jsx
rename to src/components/dashboard/navgan/loan-followup/Form/ReferPassengerBoss/index.jsx
diff --git a/src/components/dashboard/loan-followup/Form/UserInfoForm/LegalTableContent.jsx b/src/components/dashboard/navgan/loan-followup/Form/UserInfoForm/LegalTableContent.jsx
similarity index 100%
rename from src/components/dashboard/loan-followup/Form/UserInfoForm/LegalTableContent.jsx
rename to src/components/dashboard/navgan/loan-followup/Form/UserInfoForm/LegalTableContent.jsx
diff --git a/src/components/dashboard/loan-followup/Form/UserInfoForm/RealTableContent.jsx b/src/components/dashboard/navgan/loan-followup/Form/UserInfoForm/RealTableContent.jsx
similarity index 100%
rename from src/components/dashboard/loan-followup/Form/UserInfoForm/RealTableContent.jsx
rename to src/components/dashboard/navgan/loan-followup/Form/UserInfoForm/RealTableContent.jsx
diff --git a/src/components/dashboard/loan-followup/Form/UserInfoForm/index.jsx b/src/components/dashboard/navgan/loan-followup/Form/UserInfoForm/index.jsx
similarity index 100%
rename from src/components/dashboard/loan-followup/Form/UserInfoForm/index.jsx
rename to src/components/dashboard/navgan/loan-followup/Form/UserInfoForm/index.jsx
diff --git a/src/components/dashboard/loan-followup/TableRowActions.jsx b/src/components/dashboard/navgan/loan-followup/TableRowActions.jsx
similarity index 68%
rename from src/components/dashboard/loan-followup/TableRowActions.jsx
rename to src/components/dashboard/navgan/loan-followup/TableRowActions.jsx
index 352246d..7a2cfb3 100644
--- a/src/components/dashboard/loan-followup/TableRowActions.jsx
+++ b/src/components/dashboard/navgan/loan-followup/TableRowActions.jsx
@@ -1,10 +1,10 @@
import { Box } from "@mui/material";
-import ReferPassengerBoss from "@/components/dashboard/loan-followup/Form/ReferPassengerBoss";
+import ReferPassengerBoss from "./Form/ReferPassengerBoss";
import UserInfoForm from "./Form/UserInfoForm";
-import PlanningCouncilForm from "@/components/dashboard/loan-followup/Form/PlanningCouncilForm";
-import ComebackLoanDetail from "@/components/dashboard/loan-followup/Form/ComebackLoanDetail";
-import BankPayment from "@/components/dashboard/loan-followup/Form/BankPayment";
-import ApprovedBankLoan from "@/components/dashboard/loan-followup/Form/ApprovedBankLoan";
+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 (
diff --git a/src/components/dashboard/loan-followup/TableToolbar.jsx b/src/components/dashboard/navgan/loan-followup/TableToolbar.jsx
similarity index 100%
rename from src/components/dashboard/loan-followup/TableToolbar.jsx
rename to src/components/dashboard/navgan/loan-followup/TableToolbar.jsx
diff --git a/src/components/dashboard/loan-followup/index.jsx b/src/components/dashboard/navgan/loan-followup/index.jsx
similarity index 100%
rename from src/components/dashboard/loan-followup/index.jsx
rename to src/components/dashboard/navgan/loan-followup/index.jsx
diff --git a/src/components/dashboard/navgan-loan-management/Buttons/printExcel.jsx b/src/components/dashboard/navgan/navgan-loan-management/Buttons/printExcel.jsx
similarity index 100%
rename from src/components/dashboard/navgan-loan-management/Buttons/printExcel.jsx
rename to src/components/dashboard/navgan/navgan-loan-management/Buttons/printExcel.jsx
diff --git a/src/components/dashboard/navgan-loan-management/Form/UpdateForm/UpdateContent.jsx b/src/components/dashboard/navgan/navgan-loan-management/Form/UpdateForm/UpdateContent.jsx
similarity index 100%
rename from src/components/dashboard/navgan-loan-management/Form/UpdateForm/UpdateContent.jsx
rename to src/components/dashboard/navgan/navgan-loan-management/Form/UpdateForm/UpdateContent.jsx
diff --git a/src/components/dashboard/navgan-loan-management/Form/UpdateForm/index.jsx b/src/components/dashboard/navgan/navgan-loan-management/Form/UpdateForm/index.jsx
similarity index 100%
rename from src/components/dashboard/navgan-loan-management/Form/UpdateForm/index.jsx
rename to src/components/dashboard/navgan/navgan-loan-management/Form/UpdateForm/index.jsx
diff --git a/src/components/dashboard/navgan-loan-management/TableRowActions.jsx b/src/components/dashboard/navgan/navgan-loan-management/TableRowActions.jsx
similarity index 100%
rename from src/components/dashboard/navgan-loan-management/TableRowActions.jsx
rename to src/components/dashboard/navgan/navgan-loan-management/TableRowActions.jsx
diff --git a/src/components/dashboard/passenger-boss/TableToolbar.jsx b/src/components/dashboard/navgan/navgan-loan-management/TableToolbar.jsx
similarity index 73%
rename from src/components/dashboard/passenger-boss/TableToolbar.jsx
rename to src/components/dashboard/navgan/navgan-loan-management/TableToolbar.jsx
index 3433640..22483e2 100644
--- a/src/components/dashboard/passenger-boss/TableToolbar.jsx
+++ b/src/components/dashboard/navgan/navgan-loan-management/TableToolbar.jsx
@@ -1,5 +1,5 @@
import { Stack } from "@mui/material";
-import PrintExcel from "@/components/dashboard/passenger-boss/Buttons/printExcel";
+import PrintExcel from "./Buttons/printExcel";
const TableToolbar = ({ table }) => {
return (
diff --git a/src/components/dashboard/navgan-loan-management/index.jsx b/src/components/dashboard/navgan/navgan-loan-management/index.jsx
similarity index 99%
rename from src/components/dashboard/navgan-loan-management/index.jsx
rename to src/components/dashboard/navgan/navgan-loan-management/index.jsx
index ef3c4d3..d171673 100644
--- a/src/components/dashboard/navgan-loan-management/index.jsx
+++ b/src/components/dashboard/navgan/navgan-loan-management/index.jsx
@@ -6,7 +6,7 @@ import TableRowActions from "./TableRowActions";
import DataTable from "@/core/components/DataTable";
import moment from "jalali-moment";
import MuiDatePicker from "@/core/components/MuiDatePicker";
-import TableToolbar from "@/components/dashboard/navgan-loan-management/TableToolbar";
+import TableToolbar from "./TableToolbar";
function DashboardNavganLoanManagementComponent() {
const t = useTranslations();
diff --git a/src/components/dashboard/navgan-province-manager/Buttons/printExcel.jsx b/src/components/dashboard/navgan/navgan-province-manager/Buttons/printExcel.jsx
similarity index 100%
rename from src/components/dashboard/navgan-province-manager/Buttons/printExcel.jsx
rename to src/components/dashboard/navgan/navgan-province-manager/Buttons/printExcel.jsx
diff --git a/src/components/dashboard/navgan-province-manager/Form/ConfirmForm/ConfirmContent.jsx b/src/components/dashboard/navgan/navgan-province-manager/Form/ConfirmForm/ConfirmContent.jsx
similarity index 100%
rename from src/components/dashboard/navgan-province-manager/Form/ConfirmForm/ConfirmContent.jsx
rename to src/components/dashboard/navgan/navgan-province-manager/Form/ConfirmForm/ConfirmContent.jsx
diff --git a/src/components/dashboard/navgan-province-manager/Form/ConfirmForm/index.jsx b/src/components/dashboard/navgan/navgan-province-manager/Form/ConfirmForm/index.jsx
similarity index 100%
rename from src/components/dashboard/navgan-province-manager/Form/ConfirmForm/index.jsx
rename to src/components/dashboard/navgan/navgan-province-manager/Form/ConfirmForm/index.jsx
diff --git a/src/components/dashboard/navgan-province-manager/Form/RejectForm/RejectContent.jsx b/src/components/dashboard/navgan/navgan-province-manager/Form/RejectForm/RejectContent.jsx
similarity index 100%
rename from src/components/dashboard/navgan-province-manager/Form/RejectForm/RejectContent.jsx
rename to src/components/dashboard/navgan/navgan-province-manager/Form/RejectForm/RejectContent.jsx
diff --git a/src/components/dashboard/commercial-chief/Form/RejectForm/index.jsx b/src/components/dashboard/navgan/navgan-province-manager/Form/RejectForm/index.jsx
similarity index 100%
rename from src/components/dashboard/commercial-chief/Form/RejectForm/index.jsx
rename to src/components/dashboard/navgan/navgan-province-manager/Form/RejectForm/index.jsx
diff --git a/src/components/dashboard/navgan-province-manager/Form/RevertForm/RevertContent.jsx b/src/components/dashboard/navgan/navgan-province-manager/Form/RevertForm/RevertContent.jsx
similarity index 100%
rename from src/components/dashboard/navgan-province-manager/Form/RevertForm/RevertContent.jsx
rename to src/components/dashboard/navgan/navgan-province-manager/Form/RevertForm/RevertContent.jsx
diff --git a/src/components/dashboard/navgan-province-manager/Form/RevertForm/index.jsx b/src/components/dashboard/navgan/navgan-province-manager/Form/RevertForm/index.jsx
similarity index 91%
rename from src/components/dashboard/navgan-province-manager/Form/RevertForm/index.jsx
rename to src/components/dashboard/navgan/navgan-province-manager/Form/RevertForm/index.jsx
index 182428d..0d78227 100644
--- a/src/components/dashboard/navgan-province-manager/Form/RevertForm/index.jsx
+++ b/src/components/dashboard/navgan/navgan-province-manager/Form/RevertForm/index.jsx
@@ -2,7 +2,7 @@ import { Dialog, DialogTitle, IconButton, Tooltip } from "@mui/material";
import { useTranslations } from "next-intl";
import { useState } from "react";
import CallReceivedIcon from "@mui/icons-material/CallReceived";
-import RevertContent from "@/components/dashboard/navgan-province-manager/Form/RevertForm/RevertContent";
+import RevertContent from "./RevertContent";
const Revert = ({ rowId, mutate }) => {
const t = useTranslations();
diff --git a/src/components/dashboard/navgan-province-manager/Form/UserInfoForm/LegalTableContent.jsx b/src/components/dashboard/navgan/navgan-province-manager/Form/UserInfoForm/LegalTableContent.jsx
similarity index 100%
rename from src/components/dashboard/navgan-province-manager/Form/UserInfoForm/LegalTableContent.jsx
rename to src/components/dashboard/navgan/navgan-province-manager/Form/UserInfoForm/LegalTableContent.jsx
diff --git a/src/components/dashboard/navgan-province-manager/Form/UserInfoForm/RealTableContent.jsx b/src/components/dashboard/navgan/navgan-province-manager/Form/UserInfoForm/RealTableContent.jsx
similarity index 100%
rename from src/components/dashboard/navgan-province-manager/Form/UserInfoForm/RealTableContent.jsx
rename to src/components/dashboard/navgan/navgan-province-manager/Form/UserInfoForm/RealTableContent.jsx
diff --git a/src/components/dashboard/navgan-province-manager/Form/UserInfoForm/index.jsx b/src/components/dashboard/navgan/navgan-province-manager/Form/UserInfoForm/index.jsx
similarity index 100%
rename from src/components/dashboard/navgan-province-manager/Form/UserInfoForm/index.jsx
rename to src/components/dashboard/navgan/navgan-province-manager/Form/UserInfoForm/index.jsx
diff --git a/src/components/dashboard/navgan-province-manager/TableRowActions.jsx b/src/components/dashboard/navgan/navgan-province-manager/TableRowActions.jsx
similarity index 87%
rename from src/components/dashboard/navgan-province-manager/TableRowActions.jsx
rename to src/components/dashboard/navgan/navgan-province-manager/TableRowActions.jsx
index 79afcbc..13430e6 100644
--- a/src/components/dashboard/navgan-province-manager/TableRowActions.jsx
+++ b/src/components/dashboard/navgan/navgan-province-manager/TableRowActions.jsx
@@ -1,7 +1,7 @@
import { Box } from "@mui/material";
import Confirm from "./Form/ConfirmForm";
import Reject from "./Form/RejectForm";
-import Revert from "@/components/dashboard/navgan-province-manager/Form/RevertForm";
+import Revert from "./Form/RevertForm";
import UserInfoForm from "./Form/UserInfoForm";
const TableRow = ({ row, mutate }) => {
diff --git a/src/components/dashboard/navgan-loan-management/TableToolbar.jsx b/src/components/dashboard/navgan/navgan-province-manager/TableToolbar.jsx
similarity index 72%
rename from src/components/dashboard/navgan-loan-management/TableToolbar.jsx
rename to src/components/dashboard/navgan/navgan-province-manager/TableToolbar.jsx
index 2ad283e..22483e2 100644
--- a/src/components/dashboard/navgan-loan-management/TableToolbar.jsx
+++ b/src/components/dashboard/navgan/navgan-province-manager/TableToolbar.jsx
@@ -1,5 +1,5 @@
import { Stack } from "@mui/material";
-import PrintExcel from "@/components/dashboard/navgan-loan-management/Buttons/printExcel";
+import PrintExcel from "./Buttons/printExcel";
const TableToolbar = ({ table }) => {
return (
diff --git a/src/components/dashboard/navgan-province-manager/index.jsx b/src/components/dashboard/navgan/navgan-province-manager/index.jsx
similarity index 99%
rename from src/components/dashboard/navgan-province-manager/index.jsx
rename to src/components/dashboard/navgan/navgan-province-manager/index.jsx
index b58e1f9..bc04113 100644
--- a/src/components/dashboard/navgan-province-manager/index.jsx
+++ b/src/components/dashboard/navgan/navgan-province-manager/index.jsx
@@ -6,7 +6,7 @@ import TableRowActions from "./TableRowActions";
import moment from "jalali-moment";
import DataTable from "@/core/components/DataTable";
import MuiDatePicker from "@/core/components/MuiDatePicker";
-import TableToolbar from "@/components/dashboard/navgan-province-manager/TableToolbar";
+import TableToolbar from "./TableToolbar";
function DashboardNavganProvinceManagerComponent() {
const t = useTranslations();
diff --git a/src/components/dashboard/passenger-boss/Buttons/printExcel.jsx b/src/components/dashboard/navgan/passenger-boss/Buttons/printExcel.jsx
similarity index 100%
rename from src/components/dashboard/passenger-boss/Buttons/printExcel.jsx
rename to src/components/dashboard/navgan/passenger-boss/Buttons/printExcel.jsx
diff --git a/src/components/dashboard/passenger-boss/Buttons/printFinalCreditAmount.jsx b/src/components/dashboard/navgan/passenger-boss/Buttons/printFinalCreditAmount.jsx
similarity index 100%
rename from src/components/dashboard/passenger-boss/Buttons/printFinalCreditAmount.jsx
rename to src/components/dashboard/navgan/passenger-boss/Buttons/printFinalCreditAmount.jsx
diff --git a/src/components/dashboard/passenger-boss/Form/ConfirmForm/ConfirmContent.jsx b/src/components/dashboard/navgan/passenger-boss/Form/ConfirmForm/ConfirmContent.jsx
similarity index 100%
rename from src/components/dashboard/passenger-boss/Form/ConfirmForm/ConfirmContent.jsx
rename to src/components/dashboard/navgan/passenger-boss/Form/ConfirmForm/ConfirmContent.jsx
diff --git a/src/components/dashboard/passenger-boss/Form/ConfirmForm/index.jsx b/src/components/dashboard/navgan/passenger-boss/Form/ConfirmForm/index.jsx
similarity index 100%
rename from src/components/dashboard/passenger-boss/Form/ConfirmForm/index.jsx
rename to src/components/dashboard/navgan/passenger-boss/Form/ConfirmForm/index.jsx
diff --git a/src/components/dashboard/passenger-boss/Form/ReferReason/HistoryContent.jsx b/src/components/dashboard/navgan/passenger-boss/Form/ReferReason/HistoryContent.jsx
similarity index 100%
rename from src/components/dashboard/passenger-boss/Form/ReferReason/HistoryContent.jsx
rename to src/components/dashboard/navgan/passenger-boss/Form/ReferReason/HistoryContent.jsx
diff --git a/src/components/dashboard/passenger-boss/Form/ReferReason/TableContent.jsx b/src/components/dashboard/navgan/passenger-boss/Form/ReferReason/TableContent.jsx
similarity index 100%
rename from src/components/dashboard/passenger-boss/Form/ReferReason/TableContent.jsx
rename to src/components/dashboard/navgan/passenger-boss/Form/ReferReason/TableContent.jsx
diff --git a/src/components/dashboard/passenger-boss/Form/ReferReason/index.jsx b/src/components/dashboard/navgan/passenger-boss/Form/ReferReason/index.jsx
similarity index 100%
rename from src/components/dashboard/passenger-boss/Form/ReferReason/index.jsx
rename to src/components/dashboard/navgan/passenger-boss/Form/ReferReason/index.jsx
diff --git a/src/components/dashboard/passenger-boss/Form/ReferUser/ReferUserContent.jsx b/src/components/dashboard/navgan/passenger-boss/Form/ReferUser/ReferUserContent.jsx
similarity index 100%
rename from src/components/dashboard/passenger-boss/Form/ReferUser/ReferUserContent.jsx
rename to src/components/dashboard/navgan/passenger-boss/Form/ReferUser/ReferUserContent.jsx
diff --git a/src/components/dashboard/passenger-boss/Form/ReferUser/index.jsx b/src/components/dashboard/navgan/passenger-boss/Form/ReferUser/index.jsx
similarity index 92%
rename from src/components/dashboard/passenger-boss/Form/ReferUser/index.jsx
rename to src/components/dashboard/navgan/passenger-boss/Form/ReferUser/index.jsx
index b61f2f4..f3b0ea4 100644
--- a/src/components/dashboard/passenger-boss/Form/ReferUser/index.jsx
+++ b/src/components/dashboard/navgan/passenger-boss/Form/ReferUser/index.jsx
@@ -2,7 +2,7 @@ import { Dialog, DialogTitle, IconButton, Tooltip } from "@mui/material";
import { useTranslations } from "next-intl";
import { useState } from "react";
import ContactMailIcon from "@mui/icons-material/ContactMail";
-import ReferUserContent from "@/components/dashboard/passenger-boss/Form/ReferUser/ReferUserContent";
+import ReferUserContent from "./ReferUserContent";
const ReferUser = ({ rowId, mutate }) => {
const t = useTranslations();
const [openReferDialog, setOpenReferDialog] = useState(false);
diff --git a/src/components/dashboard/passenger-boss/Form/RejectForm/RejectContent.jsx b/src/components/dashboard/navgan/passenger-boss/Form/RejectForm/RejectContent.jsx
similarity index 100%
rename from src/components/dashboard/passenger-boss/Form/RejectForm/RejectContent.jsx
rename to src/components/dashboard/navgan/passenger-boss/Form/RejectForm/RejectContent.jsx
diff --git a/src/components/dashboard/development-assistant/Form/RejectForm/index.jsx b/src/components/dashboard/navgan/passenger-boss/Form/RejectForm/index.jsx
similarity index 100%
rename from src/components/dashboard/development-assistant/Form/RejectForm/index.jsx
rename to src/components/dashboard/navgan/passenger-boss/Form/RejectForm/index.jsx
diff --git a/src/components/dashboard/passenger-boss/Form/ReserveForm/index.jsx b/src/components/dashboard/navgan/passenger-boss/Form/ReserveForm/index.jsx
similarity index 100%
rename from src/components/dashboard/passenger-boss/Form/ReserveForm/index.jsx
rename to src/components/dashboard/navgan/passenger-boss/Form/ReserveForm/index.jsx
diff --git a/src/components/dashboard/passenger-boss/Form/UserInfoForm/LegalTableContent.jsx b/src/components/dashboard/navgan/passenger-boss/Form/UserInfoForm/LegalTableContent.jsx
similarity index 100%
rename from src/components/dashboard/passenger-boss/Form/UserInfoForm/LegalTableContent.jsx
rename to src/components/dashboard/navgan/passenger-boss/Form/UserInfoForm/LegalTableContent.jsx
diff --git a/src/components/dashboard/passenger-boss/Form/UserInfoForm/RealTableContent.jsx b/src/components/dashboard/navgan/passenger-boss/Form/UserInfoForm/RealTableContent.jsx
similarity index 100%
rename from src/components/dashboard/passenger-boss/Form/UserInfoForm/RealTableContent.jsx
rename to src/components/dashboard/navgan/passenger-boss/Form/UserInfoForm/RealTableContent.jsx
diff --git a/src/components/dashboard/passenger-boss/Form/UserInfoForm/index.jsx b/src/components/dashboard/navgan/passenger-boss/Form/UserInfoForm/index.jsx
similarity index 100%
rename from src/components/dashboard/passenger-boss/Form/UserInfoForm/index.jsx
rename to src/components/dashboard/navgan/passenger-boss/Form/UserInfoForm/index.jsx
diff --git a/src/components/dashboard/passenger-boss/TableRowActions.jsx b/src/components/dashboard/navgan/passenger-boss/TableRowActions.jsx
similarity index 79%
rename from src/components/dashboard/passenger-boss/TableRowActions.jsx
rename to src/components/dashboard/navgan/passenger-boss/TableRowActions.jsx
index f57d6e4..3eea39d 100644
--- a/src/components/dashboard/passenger-boss/TableRowActions.jsx
+++ b/src/components/dashboard/navgan/passenger-boss/TableRowActions.jsx
@@ -1,9 +1,9 @@
import { Box } from "@mui/material";
import Reject from "./Form/RejectForm";
import Confirm from "./Form/ConfirmForm";
-import ReserveForm from "@/components/dashboard/passenger-boss/Form/ReserveForm";
-import ReferReason from "@/components/dashboard/passenger-boss/Form/ReferReason";
-import ReferUser from "@/components/dashboard/passenger-boss/Form/ReferUser";
+import ReserveForm from "./Form/ReserveForm";
+import ReferReason from "./Form/ReferReason";
+import ReferUser from "./Form/ReferUser";
import UserInfoForm from "./Form/UserInfoForm";
const TableRow = ({ row, mutate }) => {
diff --git a/src/components/dashboard/navgan-province-manager/TableToolbar.jsx b/src/components/dashboard/navgan/passenger-boss/TableToolbar.jsx
similarity index 71%
rename from src/components/dashboard/navgan-province-manager/TableToolbar.jsx
rename to src/components/dashboard/navgan/passenger-boss/TableToolbar.jsx
index 0a4ba8c..22483e2 100644
--- a/src/components/dashboard/navgan-province-manager/TableToolbar.jsx
+++ b/src/components/dashboard/navgan/passenger-boss/TableToolbar.jsx
@@ -1,5 +1,5 @@
import { Stack } from "@mui/material";
-import PrintExcel from "@/components/dashboard/navgan-province-manager/Buttons/printExcel";
+import PrintExcel from "./Buttons/printExcel";
const TableToolbar = ({ table }) => {
return (
diff --git a/src/components/dashboard/passenger-boss/index.jsx b/src/components/dashboard/navgan/passenger-boss/index.jsx
similarity index 99%
rename from src/components/dashboard/passenger-boss/index.jsx
rename to src/components/dashboard/navgan/passenger-boss/index.jsx
index 2835f6c..fb1becb 100644
--- a/src/components/dashboard/passenger-boss/index.jsx
+++ b/src/components/dashboard/navgan/passenger-boss/index.jsx
@@ -6,7 +6,7 @@ import TableRowActions from "./TableRowActions";
import moment from "jalali-moment";
import DataTable from "@/core/components/DataTable";
import MuiDatePicker from "@/core/components/MuiDatePicker";
-import TableToolbar from "@/components/dashboard/passenger-boss/TableToolbar";
+import TableToolbar from "./TableToolbar";
function DashboardPassengerOfficeComponent() {
const t = useTranslations();
diff --git a/src/components/dashboard/reserve-loan/Form/CanselReserve/index.jsx b/src/components/dashboard/navgan/reserve-loan/Form/CanselReserve/index.jsx
similarity index 100%
rename from src/components/dashboard/reserve-loan/Form/CanselReserve/index.jsx
rename to src/components/dashboard/navgan/reserve-loan/Form/CanselReserve/index.jsx
diff --git a/src/components/dashboard/reserve-loan/TableRowActions.jsx b/src/components/dashboard/navgan/reserve-loan/TableRowActions.jsx
similarity index 100%
rename from src/components/dashboard/reserve-loan/TableRowActions.jsx
rename to src/components/dashboard/navgan/reserve-loan/TableRowActions.jsx
diff --git a/src/components/dashboard/reserve-loan/TableToolbar.jsx b/src/components/dashboard/navgan/reserve-loan/TableToolbar.jsx
similarity index 100%
rename from src/components/dashboard/reserve-loan/TableToolbar.jsx
rename to src/components/dashboard/navgan/reserve-loan/TableToolbar.jsx
diff --git a/src/components/dashboard/reserve-loan/index.jsx b/src/components/dashboard/navgan/reserve-loan/index.jsx
similarity index 99%
rename from src/components/dashboard/reserve-loan/index.jsx
rename to src/components/dashboard/navgan/reserve-loan/index.jsx
index d36d185..d2380e0 100644
--- a/src/components/dashboard/reserve-loan/index.jsx
+++ b/src/components/dashboard/navgan/reserve-loan/index.jsx
@@ -6,7 +6,7 @@ import TableRowActions from "./TableRowActions";
import moment from "jalali-moment";
import DataTable from "@/core/components/DataTable";
import MuiDatePicker from "@/core/components/MuiDatePicker";
-import TableToolbar from "@/components/dashboard/reserve-loan/TableToolbar";
+import TableToolbar from "./TableToolbar";
function DashboardReserveLoan() {
const t = useTranslations();
diff --git a/src/components/dashboard/transportation-assistance/Buttons/printExcel.jsx b/src/components/dashboard/navgan/transportation-assistance/Buttons/printExcel.jsx
similarity index 100%
rename from src/components/dashboard/transportation-assistance/Buttons/printExcel.jsx
rename to src/components/dashboard/navgan/transportation-assistance/Buttons/printExcel.jsx
diff --git a/src/components/dashboard/transportation-assistance/Form/ConfirmForm/ConfirmContent.jsx b/src/components/dashboard/navgan/transportation-assistance/Form/ConfirmForm/ConfirmContent.jsx
similarity index 100%
rename from src/components/dashboard/transportation-assistance/Form/ConfirmForm/ConfirmContent.jsx
rename to src/components/dashboard/navgan/transportation-assistance/Form/ConfirmForm/ConfirmContent.jsx
diff --git a/src/components/dashboard/transportation-assistance/Form/ConfirmForm/index.jsx b/src/components/dashboard/navgan/transportation-assistance/Form/ConfirmForm/index.jsx
similarity index 100%
rename from src/components/dashboard/transportation-assistance/Form/ConfirmForm/index.jsx
rename to src/components/dashboard/navgan/transportation-assistance/Form/ConfirmForm/index.jsx
diff --git a/src/components/dashboard/transportation-assistance/Form/ReferReason/HistoryContent.jsx b/src/components/dashboard/navgan/transportation-assistance/Form/ReferReason/HistoryContent.jsx
similarity index 100%
rename from src/components/dashboard/transportation-assistance/Form/ReferReason/HistoryContent.jsx
rename to src/components/dashboard/navgan/transportation-assistance/Form/ReferReason/HistoryContent.jsx
diff --git a/src/components/dashboard/transportation-assistance/Form/ReferReason/TableContent.jsx b/src/components/dashboard/navgan/transportation-assistance/Form/ReferReason/TableContent.jsx
similarity index 100%
rename from src/components/dashboard/transportation-assistance/Form/ReferReason/TableContent.jsx
rename to src/components/dashboard/navgan/transportation-assistance/Form/ReferReason/TableContent.jsx
diff --git a/src/components/dashboard/transportation-assistance/Form/ReferReason/index.jsx b/src/components/dashboard/navgan/transportation-assistance/Form/ReferReason/index.jsx
similarity index 100%
rename from src/components/dashboard/transportation-assistance/Form/ReferReason/index.jsx
rename to src/components/dashboard/navgan/transportation-assistance/Form/ReferReason/index.jsx
diff --git a/src/components/dashboard/transportation-assistance/Form/RejectForm/RejectContent.jsx b/src/components/dashboard/navgan/transportation-assistance/Form/RejectForm/RejectContent.jsx
similarity index 100%
rename from src/components/dashboard/transportation-assistance/Form/RejectForm/RejectContent.jsx
rename to src/components/dashboard/navgan/transportation-assistance/Form/RejectForm/RejectContent.jsx
diff --git a/src/components/dashboard/inspector-expert/Form/RejectForm/index.jsx b/src/components/dashboard/navgan/transportation-assistance/Form/RejectForm/index.jsx
similarity index 100%
rename from src/components/dashboard/inspector-expert/Form/RejectForm/index.jsx
rename to src/components/dashboard/navgan/transportation-assistance/Form/RejectForm/index.jsx
diff --git a/src/components/dashboard/transportation-assistance/Form/RevertForm/RevertContent.jsx b/src/components/dashboard/navgan/transportation-assistance/Form/RevertForm/RevertContent.jsx
similarity index 100%
rename from src/components/dashboard/transportation-assistance/Form/RevertForm/RevertContent.jsx
rename to src/components/dashboard/navgan/transportation-assistance/Form/RevertForm/RevertContent.jsx
diff --git a/src/components/dashboard/transportation-assistance/Form/RevertForm/index.jsx b/src/components/dashboard/navgan/transportation-assistance/Form/RevertForm/index.jsx
similarity index 91%
rename from src/components/dashboard/transportation-assistance/Form/RevertForm/index.jsx
rename to src/components/dashboard/navgan/transportation-assistance/Form/RevertForm/index.jsx
index 2983cca..21b84f8 100644
--- a/src/components/dashboard/transportation-assistance/Form/RevertForm/index.jsx
+++ b/src/components/dashboard/navgan/transportation-assistance/Form/RevertForm/index.jsx
@@ -2,7 +2,7 @@ import { Dialog, DialogTitle, IconButton, Tooltip } from "@mui/material";
import { useTranslations } from "next-intl";
import { useState } from "react";
import CallReceivedIcon from "@mui/icons-material/CallReceived";
-import RevertContent from "@/components/dashboard/transportation-assistance/Form/RevertForm/RevertContent";
+import RevertContent from "./RevertContent";
const Revert = ({ rowId, mutate }) => {
const t = useTranslations();
diff --git a/src/components/dashboard/transportation-assistance/Form/UserInfoForm/LegalTableContent.jsx b/src/components/dashboard/navgan/transportation-assistance/Form/UserInfoForm/LegalTableContent.jsx
similarity index 100%
rename from src/components/dashboard/transportation-assistance/Form/UserInfoForm/LegalTableContent.jsx
rename to src/components/dashboard/navgan/transportation-assistance/Form/UserInfoForm/LegalTableContent.jsx
diff --git a/src/components/dashboard/transportation-assistance/Form/UserInfoForm/RealTableContent.jsx b/src/components/dashboard/navgan/transportation-assistance/Form/UserInfoForm/RealTableContent.jsx
similarity index 100%
rename from src/components/dashboard/transportation-assistance/Form/UserInfoForm/RealTableContent.jsx
rename to src/components/dashboard/navgan/transportation-assistance/Form/UserInfoForm/RealTableContent.jsx
diff --git a/src/components/dashboard/transportation-assistance/Form/UserInfoForm/index.jsx b/src/components/dashboard/navgan/transportation-assistance/Form/UserInfoForm/index.jsx
similarity index 100%
rename from src/components/dashboard/transportation-assistance/Form/UserInfoForm/index.jsx
rename to src/components/dashboard/navgan/transportation-assistance/Form/UserInfoForm/index.jsx
diff --git a/src/components/dashboard/transportation-assistance/TableRowActions.jsx b/src/components/dashboard/navgan/transportation-assistance/TableRowActions.jsx
similarity index 79%
rename from src/components/dashboard/transportation-assistance/TableRowActions.jsx
rename to src/components/dashboard/navgan/transportation-assistance/TableRowActions.jsx
index 4e8e68d..f80810d 100644
--- a/src/components/dashboard/transportation-assistance/TableRowActions.jsx
+++ b/src/components/dashboard/navgan/transportation-assistance/TableRowActions.jsx
@@ -1,8 +1,8 @@
import { Box } from "@mui/material";
import Confirm from "./Form/ConfirmForm";
import Reject from "./Form/RejectForm";
-import Revert from "@/components/dashboard/transportation-assistance/Form/RevertForm";
-import ReferReason from "@/components/dashboard/transportation-assistance/Form/ReferReason";
+import Revert from "./Form/RevertForm";
+import ReferReason from "./Form/ReferReason";
import UserInfoForm from "./Form/UserInfoForm";
const TableRow = ({ row, mutate }) => {
diff --git a/src/components/dashboard/navgan/transportation-assistance/TableToolbar.jsx b/src/components/dashboard/navgan/transportation-assistance/TableToolbar.jsx
new file mode 100644
index 0000000..22483e2
--- /dev/null
+++ b/src/components/dashboard/navgan/transportation-assistance/TableToolbar.jsx
@@ -0,0 +1,12 @@
+import { Stack } from "@mui/material";
+import PrintExcel from "./Buttons/printExcel";
+
+const TableToolbar = ({ table }) => {
+ return (
+
+
+
+ );
+};
+
+export default TableToolbar;
diff --git a/src/components/dashboard/transportation-assistance/index.jsx b/src/components/dashboard/navgan/transportation-assistance/index.jsx
similarity index 99%
rename from src/components/dashboard/transportation-assistance/index.jsx
rename to src/components/dashboard/navgan/transportation-assistance/index.jsx
index 5f468bd..bf6168e 100644
--- a/src/components/dashboard/transportation-assistance/index.jsx
+++ b/src/components/dashboard/navgan/transportation-assistance/index.jsx
@@ -6,7 +6,7 @@ import TableRowActions from "./TableRowActions";
import moment from "jalali-moment";
import DataTable from "@/core/components/DataTable";
import MuiDatePicker from "@/core/components/MuiDatePicker";
-import TableToolbar from "@/components/dashboard/transportation-assistance/TableToolbar";
+import TableToolbar from "./TableToolbar";
function DashboardTransportationAssistanceComponent() {
const t = useTranslations();
diff --git a/src/components/dashboard/province-head-expert/Form/ConfirmForm/ConfirmContent.jsx b/src/components/dashboard/province-head-expert/Form/ConfirmForm/ConfirmContent.jsx
deleted file mode 100644
index 12f9aa1..0000000
--- a/src/components/dashboard/province-head-expert/Form/ConfirmForm/ConfirmContent.jsx
+++ /dev/null
@@ -1,134 +0,0 @@
-import UploadSystem from "@/core/components/UploadSystem";
-import useNotification from "@/lib/app/hooks/useNotification";
-import useRequest from "@/lib/app/hooks/useRequest";
-import { Button, DialogActions, DialogContent, Stack, TextField, Typography } from "@mui/material";
-import { useFormik } from "formik";
-import { useTranslations } from "next-intl";
-import { CONFIRM_PROVINCE_HEAD_EXPERT } from "@/core/data/apiRoutes";
-import UploadFileNotification from "@/core/components/notifications/UploadFileNotification";
-import { useState } from "react";
-
-const ConfirmContent = ({ rowId, mutate, setOpenConfirmDialog }) => {
- const t = useTranslations();
- const [selectedImage, setSelectedImage] = useState("");
- const [fileType, setfileType] = useState(null);
- const [fileName, setfileName] = useState(null);
- const [showAddIcon, setShowAddIcon] = useState(true);
- const requestServer = useRequest({ auth: true });
- const { update_notification } = useNotification();
-
- const formik = useFormik({
- initialValues: {
- description: "",
- confirm_img: null,
- },
- onSubmit: (values, { setSubmitting }) => {
- const formData = new FormData();
- if (values.description != "") formData.append("description", values.description);
- if (values.confirm_img != null) formData.append("attachment", values.confirm_img);
-
- requestServer(`${CONFIRM_PROVINCE_HEAD_EXPERT}/${rowId}`, "post", {
- data: formData,
- })
- .then((response) => {
- setOpenConfirmDialog(false);
- mutate();
- update_notification();
- })
- .catch(() => {})
- .finally(() => {
- setSubmitting(false);
- });
- },
- });
-
- const handleDescriptionChange = (event) => {
- formik.setFieldValue("description", event.target.value);
- };
-
- const handleUploadChange = (event) => {
- const uploadedFile = event.target?.files?.[0];
- if (uploadedFile) {
- const maxFileSize = 2 * 1024 * 1024;
- if (uploadedFile.size > maxFileSize) {
- UploadFileNotification(t);
- event.target.value = "";
- return;
- }
-
- const fileType = event.target?.files?.[0].type;
- const fileName = event.target?.files?.[0].name;
- setSelectedImage(URL.createObjectURL(uploadedFile));
- setfileType(fileType);
- setfileName(fileName);
- formik.setFieldValue("confirm_img", uploadedFile);
- setShowAddIcon(false);
- }
- };
-
- return (
- <>
-
-
-
-
- {t("ConfirmDialog.description")}
- {t("ConfirmDialog.optional")}
- >
- }
- value={formik.values.description}
- onChange={handleDescriptionChange}
- fullWidth
- variant="outlined"
- sx={{ mt: 1 }}
- />
-
-
-
- {t("UploadSystem.upload_file")}
- {t("UploadSystem.optional")}
-
-
-
-
-
-
-
-
-
- >
- );
-};
-export default ConfirmContent;
diff --git a/src/components/dashboard/province-head-expert/Form/RejectForm/RejectContent.jsx b/src/components/dashboard/province-head-expert/Form/RejectForm/RejectContent.jsx
deleted file mode 100644
index a04de07..0000000
--- a/src/components/dashboard/province-head-expert/Form/RejectForm/RejectContent.jsx
+++ /dev/null
@@ -1,135 +0,0 @@
-import UploadSystem from "@/core/components/UploadSystem";
-import useNotification from "@/lib/app/hooks/useNotification";
-import useRequest from "@/lib/app/hooks/useRequest";
-import { Button, DialogActions, DialogContent, Stack, TextField, Typography } from "@mui/material";
-import { useFormik } from "formik";
-import { useTranslations } from "next-intl";
-import { useState } from "react";
-import * as Yup from "yup";
-import { REJECT_PROVINCE_HEAD_EXPERT } from "@/core/data/apiRoutes";
-
-const RejectContent = ({ rowId, mutate, setOpenRejectDialog }) => {
- const [selectedImage, setSelectedImage] = useState("");
- const [fileType, setfileType] = useState(null);
- const [fileName, setfileName] = useState(null);
- const [showAddIcon, setShowAddIcon] = useState(true);
- const t = useTranslations();
- const requestServer = useRequest({ auth: true });
- const { update_notification } = useNotification();
-
- const validationSchema = Yup.object().shape({
- description: Yup.string().required(t("RejectDialog.description_error")),
- });
-
- const formik = useFormik({
- initialValues: {
- description: "",
- reject_img: null,
- },
- validationSchema,
- onSubmit: (values, { setSubmitting }) => {
- const formData = new FormData();
- formData.append("description", values.description);
- if (values.reject_img != null) formData.append("attachment", values.reject_img);
-
- requestServer(`${REJECT_PROVINCE_HEAD_EXPERT}/${rowId}`, "post", {
- data: formData,
- })
- .then((response) => {
- setOpenRejectDialog(false);
- mutate();
- update_notification();
- })
- .catch(() => {})
- .finally(() => {
- setSubmitting(false);
- });
- },
- });
-
- const handleDescriptionChange = (event) => {
- formik.setFieldValue("description", event.target.value);
- formik.handleChange(event);
- };
- const handleUploadChange = (event) => {
- const uploadedFile = event.target?.files?.[0];
- if (uploadedFile) {
- const maxFileSize = 2 * 1024 * 1024;
- if (uploadedFile.size > maxFileSize) {
- UploadFileNotification(t);
- event.target.value = "";
- return;
- }
- const fileType = event.target?.files?.[0].type;
- const fileName = event.target?.files?.[0].name;
- setSelectedImage(URL.createObjectURL(uploadedFile));
- setfileType(fileType);
- setfileName(fileName);
- formik.setFieldValue("reject_img", uploadedFile);
- setShowAddIcon(false);
- }
- };
- return (
- <>
-
-
-
-
-
-
-
- {t("UploadSystem.upload_file")}
- {t("UploadSystem.optional")}
-
-
-
-
-
-
-
-
-
- >
- );
-};
-export default RejectContent;
diff --git a/src/components/dashboard/province-head-expert/Form/ReviseForm/index.jsx b/src/components/dashboard/province-head-expert/Form/ReviseForm/index.jsx
deleted file mode 100644
index 4fad1cd..0000000
--- a/src/components/dashboard/province-head-expert/Form/ReviseForm/index.jsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import { Dialog, DialogTitle, IconButton, Tooltip } from "@mui/material";
-import { useTranslations } from "next-intl";
-import ReplyIcon from "@mui/icons-material/Reply";
-import { useState } from "react";
-import ReviseContent from "./ReviseContent";
-
-const Revise = ({ rowId, mutate }) => {
- const t = useTranslations();
- const [openReviseDialog, setOpenReviseDialog] = useState(false);
- return (
- <>
-
- {
- setOpenReviseDialog(true);
- }}
- >
-
-
-
-
- >
- );
-};
-export default Revise;
diff --git a/src/components/dashboard/province-head-expert/TableRowActions.jsx b/src/components/dashboard/province-head-expert/TableRowActions.jsx
deleted file mode 100644
index 524963d..0000000
--- a/src/components/dashboard/province-head-expert/TableRowActions.jsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { Box } from "@mui/material";
-import Confirm from "./Form/ConfirmForm";
-import Reject from "./Form/RejectForm";
-import Revise from "./Form/ReviseForm";
-
-const TableRowActions = ({ row, mutate }) => {
- return (
-
-
-
-
-
- );
-};
-
-export default TableRowActions;
diff --git a/src/components/dashboard/province-head-expert/index.jsx b/src/components/dashboard/province-head-expert/index.jsx
deleted file mode 100644
index bba30b4..0000000
--- a/src/components/dashboard/province-head-expert/index.jsx
+++ /dev/null
@@ -1,119 +0,0 @@
-import { Box, Typography } from "@mui/material";
-import { useMemo } from "react";
-import { GET_PROVINCE_HEAD_EXPERT } from "@/core/data/apiRoutes";
-import { useTranslations } from "next-intl";
-import moment from "jalali-moment";
-import DataTable from "@/core/components/DataTable";
-import TableRowActions from "./TableRowActions";
-import MuiDatePicker from "@/core/components/MuiDatePicker";
-
-function DashboardProvinceHeadExpertComponent() {
- const t = useTranslations();
-
- const columns = useMemo(
- () => [
- {
- accessorFn: (row) => row.id,
- id: "id",
- header: t("ProvinceHeadExpert.id"),
- enableColumnFilter: true,
- datatype: "numeric",
- filterFn: "equals",
- columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"],
- Cell: ({ renderedCellValue }) => {renderedCellValue},
- },
- {
- accessorFn: (row) => row.name,
- id: "name",
- header: t("ProvinceHeadExpert.name"),
- enableColumnFilter: true,
- datatype: "text",
- filterFn: "contains",
- columnFilterModeOptions: ["contains", "equals", "notEquals"],
- Cell: ({ renderedCellValue }) => {renderedCellValue},
- },
- {
- accessorFn: (row) => row.national_id,
- id: "national_id",
- header: t("ProvinceHeadExpert.national_id"),
- enableColumnFilter: true,
- datatype: "numeric",
- filterFn: "equals",
- columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"],
- Cell: ({ renderedCellValue }) => {renderedCellValue},
- },
- {
- accessorFn: (row) => row.phone_number,
- id: "phone_number",
- header: t("ProvinceHeadExpert.phone_number"),
- enableColumnFilter: true,
- datatype: "numeric",
- filterFn: "equals",
- columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"],
- Cell: ({ renderedCellValue }) => {renderedCellValue},
- },
- {
- accessorFn: (row) => moment(row.created_at).locale("fa").format("HH:mm | yyyy/MM/DD"),
- id: "created_at",
- header: t("ProvinceHeadExpert.created_at"),
- enableColumnFilter: true,
- datatype: "date",
- filterFn: "lessThan",
- columnFilterModeOptions: ["lessThan", "greaterThan"],
- Cell: ({ renderedCellValue }) => {
- return {renderedCellValue};
- },
- Header: ({ column }) => <>{column.columnDef.header}>,
- Filter: ({ column }) => {
- return ;
- },
- },
- {
- accessorFn: (row) => moment(row.updated_at).locale("fa").format("HH:mm | yyyy/MM/DD"),
- id: "updated_at",
- header: t("ProvinceHeadExpert.updated_at"),
- enableColumnFilter: false,
- datatype: "numeric",
- Cell: ({ renderedCellValue }) => {renderedCellValue},
- },
- {
- accessorFn: (row) => row.state_name,
- id: "state_id",
- header: t("ProvinceHeadExpert.state_name"),
- enableColumnFilter: false,
- datatype: "numeric",
- Cell: ({ renderedCellValue }) => {renderedCellValue},
- },
- ],
- []
- );
- return (
-
-
-
- );
-}
-
-export default DashboardProvinceHeadExpertComponent;
diff --git a/src/components/dashboard/refahi-province-manager/Form/ConfirmForm/ConfirmContent.jsx b/src/components/dashboard/refahi-province-manager/Form/ConfirmForm/ConfirmContent.jsx
deleted file mode 100644
index 5b1178e..0000000
--- a/src/components/dashboard/refahi-province-manager/Form/ConfirmForm/ConfirmContent.jsx
+++ /dev/null
@@ -1,134 +0,0 @@
-import UploadSystem from "@/core/components/UploadSystem";
-import useNotification from "@/lib/app/hooks/useNotification";
-import useRequest from "@/lib/app/hooks/useRequest";
-import { Button, DialogActions, DialogContent, Stack, TextField, Typography } from "@mui/material";
-import { useFormik } from "formik";
-import { useTranslations } from "next-intl";
-import { CONFIRM_REFAHI_PROVINCE_MANAGER } from "@/core/data/apiRoutes";
-import UploadFileNotification from "@/core/components/notifications/UploadFileNotification";
-import { useState } from "react";
-
-const ConfirmContent = ({ rowId, mutate, setOpenConfirmDialog }) => {
- const t = useTranslations();
- const [selectedImage, setSelectedImage] = useState("");
- const [fileType, setfileType] = useState(null);
- const [fileName, setfileName] = useState(null);
- const [showAddIcon, setShowAddIcon] = useState(true);
- const requestServer = useRequest({ auth: true });
- const { update_notification } = useNotification();
-
- const formik = useFormik({
- initialValues: {
- description: "",
- confirm_img: null,
- },
- onSubmit: (values, { setSubmitting }) => {
- const formData = new FormData();
- if (values.description != "") formData.append("description", values.description);
- if (values.confirm_img != null) formData.append("attachment", values.confirm_img);
-
- requestServer(`${CONFIRM_REFAHI_PROVINCE_MANAGER}/${rowId}`, "post", {
- data: formData,
- })
- .then((response) => {
- setOpenConfirmDialog(false);
- mutate();
- update_notification();
- })
- .catch(() => {})
- .finally(() => {
- setSubmitting(false);
- });
- },
- });
-
- const handleDescriptionChange = (event) => {
- formik.setFieldValue("description", event.target.value);
- };
-
- const handleUploadChange = (event) => {
- const uploadedFile = event.target?.files?.[0];
- if (uploadedFile) {
- const maxFileSize = 2 * 1024 * 1024;
- if (uploadedFile.size > maxFileSize) {
- UploadFileNotification(t);
- event.target.value = "";
- return;
- }
-
- const fileType = event.target?.files?.[0].type;
- const fileName = event.target?.files?.[0].name;
- setSelectedImage(URL.createObjectURL(uploadedFile));
- setfileType(fileType);
- setfileName(fileName);
- formik.setFieldValue("confirm_img", uploadedFile);
- setShowAddIcon(false);
- }
- };
-
- return (
- <>
-
-
-
-
- {t("ConfirmDialog.description")}
- {t("ConfirmDialog.optional")}
- >
- }
- value={formik.values.description}
- onChange={handleDescriptionChange}
- fullWidth
- variant="outlined"
- sx={{ mt: 1 }}
- />
-
-
-
- {t("UploadSystem.upload_file")}
- {t("UploadSystem.optional")}
-
-
-
-
-
-
-
-
-
- >
- );
-};
-export default ConfirmContent;
diff --git a/src/components/dashboard/refahi-province-manager/Form/ConfirmForm/index.jsx b/src/components/dashboard/refahi-province-manager/Form/ConfirmForm/index.jsx
deleted file mode 100644
index e849196..0000000
--- a/src/components/dashboard/refahi-province-manager/Form/ConfirmForm/index.jsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import { Dialog, DialogTitle, IconButton, Tooltip } from "@mui/material";
-import { useTranslations } from "next-intl";
-import ThumbUpAltIcon from "@mui/icons-material/ThumbUpAlt";
-import { useState } from "react";
-import ConfirmContent from "./ConfirmContent";
-
-const Confirm = ({ rowId, mutate }) => {
- const t = useTranslations();
- const [openConfirmDialog, setOpenConfirmDialog] = useState(false);
- return (
- <>
-
- {
- setOpenConfirmDialog(true);
- }}
- >
-
-
-
-
- >
- );
-};
-export default Confirm;
diff --git a/src/components/dashboard/refahi-province-manager/TableRowActions.jsx b/src/components/dashboard/refahi-province-manager/TableRowActions.jsx
deleted file mode 100644
index fa9e1ef..0000000
--- a/src/components/dashboard/refahi-province-manager/TableRowActions.jsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { Box } from "@mui/material";
-import Confirm from "./Form/ConfirmForm";
-import Reject from "./Form/RejectForm";
-
-const TableRow = ({ row, mutate }) => {
- return (
-
-
-
-
- );
-};
-
-export default TableRow;
diff --git a/src/components/dashboard/refahi/passenger-boss/Buttons/printExcel.jsx b/src/components/dashboard/refahi/passenger-boss/Buttons/printExcel.jsx
new file mode 100644
index 0000000..52a81c4
--- /dev/null
+++ b/src/components/dashboard/refahi/passenger-boss/Buttons/printExcel.jsx
@@ -0,0 +1,69 @@
+import { Button, CircularProgress } from "@mui/material";
+import { useTranslations } from "next-intl";
+import { useMemo, useState } from "react";
+import useRequest from "@/lib/app/hooks/useRequest";
+import { EXPORT_REFAHI_PASSENGER_BOSS } 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_REFAHI_PASSENGER_BOSS}?${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 (
+ : }
+ onClick={clickHandler}
+ >
+ {t("PassengerBoss.excel_report")}
+
+ );
+};
+
+export default PrintExcel;
diff --git a/src/components/dashboard/refahi/passenger-boss/Buttons/printFinalCreditAmount.jsx b/src/components/dashboard/refahi/passenger-boss/Buttons/printFinalCreditAmount.jsx
new file mode 100644
index 0000000..78d31c0
--- /dev/null
+++ b/src/components/dashboard/refahi/passenger-boss/Buttons/printFinalCreditAmount.jsx
@@ -0,0 +1,50 @@
+import PrintIcon from "@mui/icons-material/Print";
+import { Button, CircularProgress } from "@mui/material";
+import { useTranslations } from "next-intl";
+import { useRouter } from "next/router";
+import { useState } from "react";
+import useRequest from "@/lib/app/hooks/useRequest";
+import { GET_REFAHI_PASSENGER_BOSS } from "@/core/data/apiRoutes";
+import usePrint from "@/lib/app/hooks/usePrint";
+
+const PrintFinalCreditAmount = () => {
+ const t = useTranslations();
+ const router = useRouter();
+ const [loading, setLoading] = useState(false);
+ const requestServer = useRequest({ auth: true, pending: false, success: { notification: { show: false } } });
+ const { setPrintPage, setPrintTitle } = usePrint();
+ const clickHandler = () => {
+ setLoading(true);
+ const params = new URLSearchParams();
+ params.set("start", "0");
+ params.set("filters", "[]");
+ params.set("sorting", "[]");
+ requestServer(`${GET_REFAHI_PASSENGER_BOSS}?${params}`, "get")
+ .then((response) => {
+ const _data = response.data.data;
+ setPrintPage(_data.length);
+ setPrintTitle(t("PassengerBoss.print_final_credit_amount"));
+ sessionStorage.setItem("final-credit-amount-print", JSON.stringify(_data));
+ router.push("/dashboard/passenger-boss/prints/final-credit-amount");
+ })
+ .catch(() => {
+ setLoading(false);
+ });
+ };
+
+ return (
+ : }
+ onClick={clickHandler}
+ >
+ {t("PassengerBoss.print_final_credit_amount")}
+
+ );
+};
+
+export default PrintFinalCreditAmount;
diff --git a/src/components/dashboard/refahi/passenger-boss/Form/ConfirmForm/ConfirmContent.jsx b/src/components/dashboard/refahi/passenger-boss/Form/ConfirmForm/ConfirmContent.jsx
new file mode 100644
index 0000000..12d410d
--- /dev/null
+++ b/src/components/dashboard/refahi/passenger-boss/Form/ConfirmForm/ConfirmContent.jsx
@@ -0,0 +1,558 @@
+import PriceField from "@/core/components/PriceField";
+import SelectBox from "@/core/components/SelectBox";
+import UploadSystem from "@/core/components/UploadSystem";
+import { CONFIRM_REFAHI_PASSENGER_BOSS } from "@/core/data/apiRoutes";
+import useNotification from "@/lib/app/hooks/useNotification";
+import useRequest from "@/lib/app/hooks/useRequest";
+import { Button, DialogActions, DialogContent, FormHelperText, Stack, TextField, Typography } from "@mui/material";
+import { useFormik } from "formik";
+import { useTranslations } from "next-intl";
+import { useState } from "react";
+import * as Yup from "yup";
+
+const loan_refahi_amount = {
+ 1: parseInt(process.env.NEXT_PUBLIC_BUILD_LOAN_AMOUNT),
+ 2: parseInt(process.env.NEXT_PUBLIC_RESTORE_LOAN_AMOUNT),
+};
+const ConfirmContent = ({ rowId, mutate, setOpenConfirmDialog, row }) => {
+ const t = useTranslations();
+ const [expertImg, setExpertImg] = useState("");
+ const [expertFileType, setExpertFileType] = useState(null);
+ const [expertFileName, setExpertFileName] = useState(null);
+ const [showExpertAddIcon, setShowExpertAddIcon] = useState(true);
+ const requestServer = useRequest({ auth: true, notification: false });
+ const { update_notification } = useNotification();
+
+ const validationSchema = Yup.object().shape({
+ approved_amount: Yup.mixed()
+ .test("is-number", `${t("ConfirmDialog.approved_amount_number")}`, (value) => !isNaN(value))
+ .test("max-amount", function (value) {
+ const maxAmount =
+ row.original?.refahi_type == 1
+ ? 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])
+ 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"),
+ amount: "میلیارد",
+ })}`
+ : value > parseInt(process.env.NEXT_PUBLIC_RESTORE_LOAN_AMOUNT) &&
+ `${t("PassengerBoss.max_amount", {
+ value: (maxAmount/1000).toLocaleString("en"),
+ amount: "میلیارد",
+ })}`;
+ return value <= maxAmount || this.createError({ message });
+ })
+ .test("positive", `${t("ConfirmDialog.approved_amount_positive")}`, (value) => value >= 0)
+ .required(t("ConfirmDialog.approved_amount_error")),
+ repayment_period: Yup.mixed()
+ .test("is-number", `${t("ConfirmDialog.repayment_period_number")}`, (value) => !isNaN(value))
+ .test("positive", `${t("ConfirmDialog.repayment_period_positive")}`, (value) => value >= 0)
+ .required(t("ConfirmDialog.repayment_period_error")),
+ confirmation_reason: Yup.string().required(t("ConfirmDialog.confirm_reason_error")),
+ committed_employment: Yup.mixed()
+ .test("is-number", `${t("ConfirmDialog.committed_employment_number")}`, (value) => !isNaN(value))
+ .test("positive", `${t("ConfirmDialog.committed_employment_positive")}`, (value) => value >= 0)
+ .required(t("ConfirmDialog.committed_employment_error")),
+ existing_employment: Yup.mixed()
+ .test("is-number", `${t("ConfirmDialog.existing_employment_number")}`, (value) => !isNaN(value))
+ .test("positive", `${t("ConfirmDialog.existing_employment_positive")}`, (value) => value >= 0)
+ .required(t("ConfirmDialog.existing_employment_error")),
+ physical_progress: Yup.mixed()
+ .test("is-number", `${t("ConfirmDialog.physical_progress_number")}`, (value) => !isNaN(value))
+ .test("positive", `${t("ConfirmDialog.physical_progress_positive")}`, (value) => value >= 0 && value <= 100)
+ .required(t("ConfirmDialog.existing_employment_error")),
+ loan_interest: Yup.mixed()
+ .test("is-number", `${t("ConfirmDialog.loan_interest_number")}`, (value) => !isNaN(value))
+ .test("positive", `${t("ConfirmDialog.loan_interest_positive")}`, (value) => value >= 0)
+ .required(t("ConfirmDialog.loan_interest_error")),
+ sakht_period: Yup.mixed()
+ .test("is-number", `${t("ConfirmDialog.sakht_period_number")}`, (value) => !isNaN(value))
+ .test("positive", `${t("ConfirmDialog.sakht_period_positive")}`, (value) => value > 0)
+ .required(t("ConfirmDialog.sakht_period_error")),
+ tanafos_period: Yup.mixed()
+ .test("is-number", `${t("ConfirmDialog.tanafos_period_number")}`, (value) => !isNaN(value))
+ .test("positive", `${t("ConfirmDialog.tanafos_period_positive")}`, (value) => value > 0)
+ .required(t("ConfirmDialog.tanafos_period_error")),
+ expert_img: Yup.mixed()
+ .required(t("PassengerBoss.upload_expert_file_required"))
+ .test("fileSize", `${t("PassengerBoss.upload_expert_file_unit")}`, (value) => {
+ return value.size <= 5 * 1024 * 1024;
+ })
+ .test("fileType", `${t("PassengerBoss.upload_expert_file_format")}`, (value) => {
+ const allowedTypes = ["image/jpg", "image/jpeg", "image/png", "application/pdf"];
+ return allowedTypes.includes(value.type);
+ }),
+ });
+
+ const formik = useFormik({
+ initialValues: {
+ confirmation_reason: row.original.confirmation_reason || "",
+ approved_amount: row.original.approved_amount / 1000000 || "",
+ facility_bank: row.original.facility_bank / 1000000 || "",
+ facility_gov: row.original.facility_gov / 1000000 || "",
+ facility_person: row.original.facility_person / 1000000 || "",
+ physical_progress: row.original.physical_progress || "",
+ repayment_period: row.original.repayment_period || "",
+ committed_employment: row.original.committed_employment || "",
+ sakht_period: row.original.sakht_period || "",
+ tanafos_period: row.original.tanafos_period || "",
+ existing_employment: row.original.existing_employment || "",
+ loan_interest: row.original.interest_rate || "",
+ expert_img: null,
+ },
+ validationSchema,
+ onSubmit: (values, { setSubmitting }) => {
+ const formData = new FormData();
+ formData.append("approved_amount", Number(values.approved_amount) * 1000000);
+ formData.append("facility_bank", Number(values.facility_bank) * 1000000);
+ formData.append("facility_gov", Number(values.facility_gov) * 1000000);
+ formData.append("facility_person", Number(values.facility_person) * 1000000);
+ formData.append("repayment_period", values.repayment_period);
+ formData.append("committed_employment", values.committed_employment);
+ formData.append("existing_employment", values.existing_employment);
+ formData.append("interest_rate", values.loan_interest);
+ formData.append("sakht_period", values.sakht_period);
+ formData.append("tanafos_period", values.tanafos_period);
+ formData.append("confirmation_reason", values.confirmation_reason);
+ if (values.physical_progress != "") formData.append("physical_progress", values.physical_progress);
+ if (values.expert_img != null) {
+ const attachments = [
+ {
+ title: "فایل ضمیمه گزارش کارشناس",
+ file: values.expert_img,
+ },
+ ];
+ attachments.forEach((attachment, index) => {
+ formData.append(`attachment[${index}][title]`, attachment.title);
+ formData.append(`attachment[${index}][file]`, attachment.file);
+ });
+ }
+
+ requestServer(`${CONFIRM_REFAHI_PASSENGER_BOSS}/${rowId}`, "post", {
+ notification: true,
+ data: formData,
+ })
+ .then((response) => {
+ setOpenConfirmDialog(false);
+ mutate();
+ update_notification();
+ })
+ .catch(() => {})
+ .finally(() => {
+ setSubmitting(false);
+ });
+ },
+ });
+
+ const handleExpertFileChange = (event) => {
+ const uploadedFile = event.target?.files?.[0];
+ if (uploadedFile) {
+ const fileType = event.target?.files?.[0].type;
+ const fileName = event.target?.files?.[0].name;
+ setExpertImg(URL.createObjectURL(uploadedFile));
+ setExpertFileType(fileType);
+ setExpertFileName(fileName);
+ formik.setFieldValue("expert_img", uploadedFile).then(() => {
+ formik.setFieldTouched("expert_img", true);
+ });
+ setShowExpertAddIcon(false);
+ }
+ };
+ const handleAmountChange = (event) => {
+ if (!isNaN(event.target.value)) {
+ formik.setFieldValue("approved_amount", event.target.value).then(() => {
+ formik.setFieldValue(
+ "facility_bank",
+ parseInt((parseInt(process.env.NEXT_PUBLIC_FACILITY_BANK) / 100) * event.target.value, 10)
+ );
+ formik.setFieldValue(
+ "facility_gov",
+ parseInt(((100 - parseInt(process.env.NEXT_PUBLIC_FACILITY_BANK)) / 100) * event.target.value, 10)
+ );
+ formik.setFieldValue(
+ "facility_person",
+ parseInt((parseInt(process.env.NEXT_PUBLIC_FACILITY_PERSON) / 100) * event.target.value, 10)
+ );
+ });
+ } else {
+ formik.setFieldValue("approved_amount", formik.values.approved_amount);
+ }
+ };
+
+ return (
+ <>
+
+
+
+
+ {t("ConfirmDialog.approved_amount")}
+ {t("ConfirmDialog.unit")}
+ >
+ }
+ type="text"
+ inputProps={{
+ inputMode: "number",
+ min: 0,
+ pattern: "[0-9]*",
+ }}
+ variant="outlined"
+ value={formik.values.approved_amount}
+ onChange={handleAmountChange}
+ onBlur={formik.handleBlur("approved_amount")}
+ error={formik.touched.approved_amount && Boolean(formik.errors.approved_amount)}
+ helperText={formik.touched.approved_amount && formik.errors.approved_amount}
+ sx={{ mt: 1 }}
+ fullWidth
+ />
+
+
+
+ {t("ConfirmDialog.facility_bank")}
+ {t("ConfirmDialog.unit")}
+ >
+ }
+ type="text"
+ inputProps={{
+ inputMode: "number",
+ min: 0,
+ pattern: "[0-9]*",
+ }}
+ variant="outlined"
+ value={formik.values.facility_bank}
+ fullWidth
+ disabled
+ />
+
+
+
+ {t("ConfirmDialog.facility_gov")}
+ {t("ConfirmDialog.unit")}
+ >
+ }
+ type="text"
+ inputProps={{
+ inputMode: "number",
+ min: 0,
+ pattern: "[0-9]*",
+ }}
+ variant="outlined"
+ value={formik.values.facility_gov}
+ disabled
+ fullWidth
+ />
+
+
+
+ {t("ConfirmDialog.facility_person")}
+ {t("ConfirmDialog.unit")}
+ >
+ }
+ variant="outlined"
+ value={formik.values.facility_person}
+ disabled
+ fullWidth
+ />
+
+
+ {
+ if (!isNaN(event.target.value)) {
+ formik.setFieldValue("physical_progress", event.target.value);
+ } else {
+ formik.setFieldValue("physical_progress", formik.values.physical_progress);
+ }
+ }}
+ error={formik.touched.physical_progress && Boolean(formik.errors.physical_progress)}
+ helperText={formik.touched.physical_progress && formik.errors.physical_progress}
+ onBlur={formik.handleBlur("physical_progress")}
+ fullWidth
+ />
+
+
+
+ {t("ConfirmDialog.repayment_period")}{" "}
+ {t("ConfirmDialog.month")}
+ >
+ }
+ selectType="repayment_period"
+ selectors={[
+ { id: 0, value: "12", name: "12 ماه" },
+ { id: 1, value: "24", name: "24 ماه" },
+ { id: 2, value: "36", name: "36 ماه" },
+ { id: 3, value: "48", name: "48 ماه" },
+ { id: 4, value: "60", name: "60 ماه" },
+ ]}
+ schema={{ value: "value", name: "name" }}
+ select={formik.values.repayment_period}
+ value={formik.values.repayment_period}
+ handleChange={(event) => {
+ formik.setFieldValue("repayment_period", event.target.value);
+ }}
+ setFieldTouched={formik.setFieldTouched}
+ error={formik.touched.repayment_period && Boolean(formik.errors.repayment_period)}
+ helperText={formik.touched.repayment_period && formik.errors.repayment_period}
+ onBlur={formik.handleBlur("repayment_period")}
+ />
+
+
+ {
+ formik.setFieldValue("sakht_period", event.target.value);
+ }}
+ setFieldTouched={formik.setFieldTouched}
+ error={formik.touched.sakht_period && Boolean(formik.errors.sakht_period)}
+ helperText={formik.touched.sakht_period && formik.errors.sakht_period}
+ onBlur={formik.handleBlur("sakht_period")}
+ />
+
+
+ {
+ formik.setFieldValue("tanafos_period", event.target.value);
+ }}
+ setFieldTouched={formik.setFieldTouched}
+ error={formik.touched.tanafos_period && Boolean(formik.errors.tanafos_period)}
+ helperText={formik.touched.tanafos_period && formik.errors.tanafos_period}
+ onBlur={formik.handleBlur("tanafos_period")}
+ />
+
+
+ {
+ formik.setFieldValue("loan_interest", event.target.value);
+ }}
+ setFieldTouched={formik.setFieldTouched}
+ error={formik.touched.loan_interest && Boolean(formik.errors.loan_interest)}
+ helperText={formik.touched.loan_interest && formik.errors.loan_interest}
+ onBlur={formik.handleBlur("loan_interest")}
+ />
+
+
+ {
+ if (!isNaN(event.target.value)) {
+ formik.setFieldValue("committed_employment", event.target.value);
+ } else {
+ formik.setFieldValue("committed_employment", formik.values.committed_employment);
+ }
+ }}
+ onBlur={formik.handleBlur("committed_employment")}
+ error={formik.touched.committed_employment && Boolean(formik.errors.committed_employment)}
+ helperText={formik.touched.committed_employment && formik.errors.committed_employment}
+ fullWidth
+ />
+
+
+ {
+ if (!isNaN(event.target.value)) {
+ formik.setFieldValue("existing_employment", event.target.value);
+ } else {
+ formik.setFieldValue("existing_employment", formik.values.existing_employment);
+ }
+ }}
+ onBlur={formik.handleBlur("existing_employment")}
+ error={formik.touched.existing_employment && Boolean(formik.errors.existing_employment)}
+ helperText={formik.touched.existing_employment && formik.errors.existing_employment}
+ fullWidth
+ />
+
+
+
+
+
+ {t("PassengerBoss.upload_expert_img")}
+
+
+ {formik.touched.expert_img && formik.errors.expert_img}
+
+
+
+
+
+
+
+
+ >
+ );
+};
+export default ConfirmContent;
diff --git a/src/components/dashboard/inspector-expert/Form/ConfirmForm/index.jsx b/src/components/dashboard/refahi/passenger-boss/Form/ConfirmForm/index.jsx
similarity index 52%
rename from src/components/dashboard/inspector-expert/Form/ConfirmForm/index.jsx
rename to src/components/dashboard/refahi/passenger-boss/Form/ConfirmForm/index.jsx
index e849196..24f1079 100644
--- a/src/components/dashboard/inspector-expert/Form/ConfirmForm/index.jsx
+++ b/src/components/dashboard/refahi/passenger-boss/Form/ConfirmForm/index.jsx
@@ -1,12 +1,24 @@
import { Dialog, DialogTitle, IconButton, Tooltip } from "@mui/material";
import { useTranslations } from "next-intl";
-import ThumbUpAltIcon from "@mui/icons-material/ThumbUpAlt";
-import { useState } from "react";
+import { useEffect, useState } from "react";
import ConfirmContent from "./ConfirmContent";
+import CallMadeIcon from "@mui/icons-material/CallMade";
-const Confirm = ({ rowId, mutate }) => {
+const Confirm = ({ rowId, mutate, row }) => {
const t = useTranslations();
const [openConfirmDialog, setOpenConfirmDialog] = useState(false);
+ const [dialogSize, setDialogSize] = useState("sm");
+
+ useEffect(() => {
+ if (!openConfirmDialog) {
+ setDialogSize("sm");
+ }
+ }, [openConfirmDialog]);
+
+ const handleSizeChangeClick = (size) => {
+ setDialogSize(size);
+ };
+
return (
<>
@@ -16,7 +28,7 @@ const Confirm = ({ rowId, mutate }) => {
setOpenConfirmDialog(true);
}}
>
-
+
>
);
diff --git a/src/components/dashboard/refahi/passenger-boss/Form/ReferReason/HistoryContent.jsx b/src/components/dashboard/refahi/passenger-boss/Form/ReferReason/HistoryContent.jsx
new file mode 100644
index 0000000..bd8c5ef
--- /dev/null
+++ b/src/components/dashboard/refahi/passenger-boss/Form/ReferReason/HistoryContent.jsx
@@ -0,0 +1,19 @@
+import { Button, DialogActions, DialogContent } from "@mui/material";
+import { useTranslations } from "next-intl";
+import TableContent from "./TableContent";
+const HistoryContent = ({ setOpenReferReasonDialog, row }) => {
+ const t = useTranslations();
+ return (
+ <>
+
+
+
+
+
+
+ >
+ );
+};
+export default HistoryContent;
diff --git a/src/components/dashboard/refahi/passenger-boss/Form/ReferReason/TableContent.jsx b/src/components/dashboard/refahi/passenger-boss/Form/ReferReason/TableContent.jsx
new file mode 100644
index 0000000..b4c6bf6
--- /dev/null
+++ b/src/components/dashboard/refahi/passenger-boss/Form/ReferReason/TableContent.jsx
@@ -0,0 +1,34 @@
+import { Box, Table, TableBody, TableCell, TableContainer, TableHead, TableRow } from "@mui/material";
+import { useTranslations } from "next-intl";
+import moment from "jalali-moment";
+
+const TableContent = ({ row }) => {
+ const t = useTranslations();
+ return (
+
+
+
+
+
+ {t("LoanHistory.Table_head_date")}
+ {t("LoanHistory.Table_head_state")}
+ {t("LoanHistory.Table_head_refer_reason")}
+
+
+
+
+
+ {moment(row.original.latest_history?.created_at)
+ .locale("fa")
+ .format("HH:mm | yyyy/MM/DD")}
+
+ {row.original.latest_history?.previous_state_name}
+ {row.original.latest_history?.expert_description}
+
+
+
+
+
+ );
+};
+export default TableContent;
diff --git a/src/components/dashboard/refahi/passenger-boss/Form/ReferReason/index.jsx b/src/components/dashboard/refahi/passenger-boss/Form/ReferReason/index.jsx
new file mode 100644
index 0000000..5b46003
--- /dev/null
+++ b/src/components/dashboard/refahi/passenger-boss/Form/ReferReason/index.jsx
@@ -0,0 +1,33 @@
+import { Dialog, DialogTitle, IconButton, Tooltip } from "@mui/material";
+import { useTranslations } from "next-intl";
+import { useState } from "react";
+import RestorePageIcon from "@mui/icons-material/RestorePage";
+import HistoryContent from "./HistoryContent";
+
+const ReferReason = ({ row }) => {
+ const t = useTranslations();
+ const [openReferReasonDialog, setOpenReferReasonDialog] = useState(false);
+ return (
+ <>
+
+ setOpenReferReasonDialog(true)}>
+
+
+
+
+ >
+ );
+};
+export default ReferReason;
diff --git a/src/components/dashboard/refahi/passenger-boss/Form/ReferUser/ReferUserContent.jsx b/src/components/dashboard/refahi/passenger-boss/Form/ReferUser/ReferUserContent.jsx
new file mode 100644
index 0000000..d611689
--- /dev/null
+++ b/src/components/dashboard/refahi/passenger-boss/Form/ReferUser/ReferUserContent.jsx
@@ -0,0 +1,89 @@
+import useNotification from "@/lib/app/hooks/useNotification";
+import useRequest from "@/lib/app/hooks/useRequest";
+import { Button, DialogActions, DialogContent, Stack, TextField } from "@mui/material";
+import { useFormik } from "formik";
+import { useTranslations } from "next-intl";
+import * as Yup from "yup";
+import { REFER_REFAHI_LOAN_FOLLOWUP_USER } from "@/core/data/apiRoutes";
+
+const ReferUserContent = ({ 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_USER}/${rowId}`, "post", {
+ data: formData,
+ })
+ .then((response) => {
+ setOpenReferDialog(false);
+ mutate();
+ update_notification();
+ })
+ .catch(() => {})
+ .finally(() => {
+ setSubmitting(false);
+ });
+ },
+ });
+
+ // const handleDescriptionChange = (event) => {
+ // formik.setFieldValue("description", event.target.value);
+ // formik.handleChange(event);
+ // };
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+};
+export default ReferUserContent;
diff --git a/src/components/dashboard/refahi/passenger-boss/Form/ReferUser/index.jsx b/src/components/dashboard/refahi/passenger-boss/Form/ReferUser/index.jsx
new file mode 100644
index 0000000..f3b0ea4
--- /dev/null
+++ b/src/components/dashboard/refahi/passenger-boss/Form/ReferUser/index.jsx
@@ -0,0 +1,31 @@
+import { Dialog, DialogTitle, IconButton, Tooltip } from "@mui/material";
+import { useTranslations } from "next-intl";
+import { useState } from "react";
+import ContactMailIcon from "@mui/icons-material/ContactMail";
+import ReferUserContent from "./ReferUserContent";
+const ReferUser = ({ rowId, mutate }) => {
+ const t = useTranslations();
+ const [openReferDialog, setOpenReferDialog] = useState(false);
+ return (
+ <>
+
+ setOpenReferDialog(true)}>
+
+
+
+
+ >
+ );
+};
+export default ReferUser;
diff --git a/src/components/dashboard/development-assistant/Form/RejectForm/RejectContent.jsx b/src/components/dashboard/refahi/passenger-boss/Form/RejectForm/RejectContent.jsx
similarity index 64%
rename from src/components/dashboard/development-assistant/Form/RejectForm/RejectContent.jsx
rename to src/components/dashboard/refahi/passenger-boss/Form/RejectForm/RejectContent.jsx
index 8878e72..905f555 100644
--- a/src/components/dashboard/development-assistant/Form/RejectForm/RejectContent.jsx
+++ b/src/components/dashboard/refahi/passenger-boss/Form/RejectForm/RejectContent.jsx
@@ -1,17 +1,26 @@
import UploadSystem from "@/core/components/UploadSystem";
import useNotification from "@/lib/app/hooks/useNotification";
import useRequest from "@/lib/app/hooks/useRequest";
-import { Button, DialogActions, DialogContent, Stack, TextField, Typography } from "@mui/material";
+import {
+ Button,
+ DialogActions,
+ DialogContent,
+ FormHelperText,
+ Grid,
+ Stack,
+ TextField,
+ Typography,
+} from "@mui/material";
import { useFormik } from "formik";
import { useTranslations } from "next-intl";
import { useState } from "react";
import * as Yup from "yup";
-import { REJECT_DEVELOPMENT_ASSISTANT } from "@/core/data/apiRoutes";
+import { REJECT_REFAHI_PASSENGER_BOSS } from "@/core/data/apiRoutes";
const RejectContent = ({ rowId, mutate, setOpenRejectDialog }) => {
const [selectedImage, setSelectedImage] = useState("");
- const [fileType, setfileType] = useState(null);
- const [fileName, setfileName] = useState(null);
+ const [fileType, setFileType] = useState(null);
+ const [fileName, setFileName] = useState(null);
const [showAddIcon, setShowAddIcon] = useState(true);
const t = useTranslations();
const requestServer = useRequest({ auth: true });
@@ -19,20 +28,42 @@ const RejectContent = ({ rowId, mutate, setOpenRejectDialog }) => {
const validationSchema = Yup.object().shape({
description: Yup.string().required(t("RejectDialog.description_error")),
+ confirm_img: Yup.mixed()
+ .notRequired(t("ConfirmDialog.approved_amount_error"))
+ .test("fileSize", `${t("PassengerBoss.upload_file_unit")}`, (value) => {
+ if (!value) return true;
+ return value.size <= 5 * 1024 * 1024;
+ })
+ .test("fileType", `${t("PassengerBoss.upload_file_format")}`, (value) => {
+ if (!value) return true;
+ const allowedTypes = ["image/jpg", "image/jpeg", "image/png", "application/pdf"];
+ return allowedTypes.includes(value.type);
+ }),
});
const formik = useFormik({
initialValues: {
description: "",
- reject_img: null,
+ confirm_img: null,
},
validationSchema,
onSubmit: (values, { setSubmitting }) => {
const formData = new FormData();
- formData.append("description", values.description);
- if (values.reject_img != null) formData.append("attachment", values.reject_img);
+ formData.append("expert_description", values.description);
+ if (values.confirm_img != null) {
+ const attachments = [
+ {
+ title: "فایل ضمیمه کارتابل کارگروه",
+ file: values.confirm_img,
+ },
+ ];
+ attachments.forEach((attachment, index) => {
+ formData.append(`attachment[${index}][title]`, attachment.title);
+ formData.append(`attachment[${index}][file]`, attachment.file);
+ });
+ }
- requestServer(`${REJECT_DEVELOPMENT_ASSISTANT}/${rowId}`, "post", {
+ requestServer(`${REJECT_REFAHI_PASSENGER_BOSS}/${rowId}`, "post", {
data: formData,
})
.then((response) => {
@@ -54,18 +85,14 @@ const RejectContent = ({ rowId, mutate, setOpenRejectDialog }) => {
const handleUploadChange = (event) => {
const uploadedFile = event.target?.files?.[0];
if (uploadedFile) {
- const maxFileSize = 2 * 1024 * 1024;
- if (uploadedFile.size > maxFileSize) {
- UploadFileNotification(t);
- event.target.value = "";
- return;
- }
const fileType = event.target?.files?.[0].type;
const fileName = event.target?.files?.[0].name;
setSelectedImage(URL.createObjectURL(uploadedFile));
- setfileType(fileType);
- setfileName(fileName);
- formik.setFieldValue("reject_img", uploadedFile);
+ setFileType(fileType);
+ setFileName(fileName);
+ formik.setFieldValue("confirm_img", uploadedFile).then(() => {
+ formik.setFieldTouched("confirm_img", true);
+ });
setShowAddIcon(false);
}
};
@@ -90,23 +117,25 @@ const RejectContent = ({ rowId, mutate, setOpenRejectDialog }) => {
/>
-
- {t("UploadSystem.upload_file")}
- {t("UploadSystem.optional")}
-
+ {t("PassengerBoss.upload_file")}
+
+ {formik.touched.confirm_img && formik.errors.confirm_img}
+
diff --git a/src/components/dashboard/navgan-province-manager/Form/RejectForm/index.jsx b/src/components/dashboard/refahi/passenger-boss/Form/RejectForm/index.jsx
similarity index 100%
rename from src/components/dashboard/navgan-province-manager/Form/RejectForm/index.jsx
rename to src/components/dashboard/refahi/passenger-boss/Form/RejectForm/index.jsx
diff --git a/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/BuildTableUserInfo.jsx b/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/BuildTableUserInfo.jsx
new file mode 100644
index 0000000..80ef334
--- /dev/null
+++ b/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/BuildTableUserInfo.jsx
@@ -0,0 +1,79 @@
+import { Button, Chip, Divider, Grid, Link, Stack, Typography } from "@mui/material";
+import DownloadIcon from "@mui/icons-material/Download";
+import { useTranslations } from "next-intl";
+
+const BuildTableUserInfo = ({row}) => {
+ const t = useTranslations();
+ return(
+ <>
+
+
+
+
+
+
+ {row.original.project_physical_progress || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.basic_approval_number || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.basic_approval_renewal_date || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+ }>
+
+ {t("UserInfoDialog.download_image")}
+
+
+
+
+
+
+
+
+ }>
+
+ {t("UserInfoDialog.download_image")}
+
+
+
+
+
+ >
+ )
+}
+export default BuildTableUserInfo
\ No newline at end of file
diff --git a/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/LegalTableContent.jsx b/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/LegalTableContent.jsx
new file mode 100644
index 0000000..02f7e97
--- /dev/null
+++ b/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/LegalTableContent.jsx
@@ -0,0 +1,398 @@
+import {
+ Chip,
+ DialogContent,
+ DialogTitle,
+ Divider,
+ Grid,
+ Stack,
+ Typography
+} from "@mui/material";
+import { useTranslations } from "next-intl";
+import moment from "jalali-moment";
+import BuildTableUserInfo from "./BuildTableUserInfo";
+import RestoreTableUserInfo from "./RestoreTableUserInfo";
+
+const LegalTableContent = ({ rowId, row }) => {
+ const t = useTranslations();
+ return (
+ <>
+ {t("UserInfoDialog.user_info")}
+
+
+
+
+
+
+ {t("UserInfoDialog.legal_person")}
+
+
+
+
+
+
+ {row.original.id || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+ {row.original.activity_category_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.project_title || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.first_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.last_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.father_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.gender ? t("UserInfoDialog.female") : t("UserInfoDialog.male")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.national_id || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.national_serial_number ||
+ row.original.national_tracking_code ||
+ t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.education_title || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.occupation_title || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.phone_number || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.birthday
+ ? moment(row.original.birthday).locale("fa").format("YYYY/MM/DD")
+ : t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.province_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.city_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.shenase_meli || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.postal_code || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.company_register_date
+ ? moment(row.original.company_register_date).locale("fa").format("YYYY/MM/DD")
+ : t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.register_number || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.company_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.telephone_number || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.project_province_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+ {row.original.project_city_name}
+
+
+
+
+
+
+
+
+
+ {row.original.investment_amount / 1000000 >= 1000
+ ? t("UserInfoDialog.milyard", {
+ value: row.original.investment_amount / 1000000000,
+ })
+ : t("UserInfoDialog.toman", { value: row.original.investment_amount / 1000000 })}
+
+
+
+
+
+
+
+
+ {row.original.welfare_complex_degree || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.requested_facility_amount / 1000000 >= 1000
+ ? t("UserInfoDialog.milyard", {
+ value: row.original.requested_facility_amount / 1000000000,
+ })
+ : t("UserInfoDialog.toman", {
+ value: row.original.requested_facility_amount / 1000000,
+ })}
+
+
+
+
+
+
+
+
+ {row.original.person_share / 1000000 >= 1000
+ ? t("UserInfoDialog.milyard", { value: row.original.person_share / 1000000000 })
+ : t("UserInfoDialog.toman", { value: row.original.person_share / 1000000 })}
+
+
+
+
+
+
+
+
+
+
+ {row.original.user_committed_employment || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.user_existing_employment || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.project_axis || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.project_direction || t("UserInfoDialog.no_info")}
+
+
+
+
+ {row.original.refahi_type === 1 ? () : () }
+
+
+
+
+
+
+ {row.original.project_kilometer_marker || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.project_address || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.address || t("UserInfoDialog.no_info")}
+
+
+
+
+
+ >
+ );
+};
+export default LegalTableContent;
\ No newline at end of file
diff --git a/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/RealTableContent.jsx b/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/RealTableContent.jsx
new file mode 100644
index 0000000..20b3038
--- /dev/null
+++ b/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/RealTableContent.jsx
@@ -0,0 +1,347 @@
+import { Button, Chip, DialogContent, DialogTitle, Divider, Grid, Link, Stack, Typography } from "@mui/material";
+import { useTranslations } from "next-intl";
+import moment from "jalali-moment";
+import DownloadIcon from "@mui/icons-material/Download";
+import BuildTableUserInfo from "./BuildTableUserInfo";
+import RestoreTableUserInfo from "./RestoreTableUserInfo";
+
+const RealTableContent = ({ rowId, row }) => {
+ const t = useTranslations();
+ return (
+ <>
+ {t("UserInfoDialog.user_info")}
+
+
+
+
+
+
+ {t("UserInfoDialog.real_person")}
+
+
+
+
+
+
+ {row.original.id || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+ {row.original.activity_category_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.project_title || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.first_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.last_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.national_id || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.national_serial_number ||
+ row.original.national_tracking_code ||
+ t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.education_title || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.occupation_title || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.phone_number || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.telephone_number || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.birthday
+ ? moment(row.original.birthday).locale("fa").format("YYYY/MM/DD")
+ : t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.postal_code || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.father_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.gender ? t("UserInfoDialog.female") : t("UserInfoDialog.male")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.province_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+ {row.original.city_name}
+
+
+
+
+
+
+
+
+
+ {row.original.user_committed_employment || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.user_existing_employment || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.project_province_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+ {row.original.project_city_name}
+
+
+
+
+
+
+
+
+
+ {row.original.investment_amount / 1000000 >= 1000
+ ? t("UserInfoDialog.milyard", {
+ value: row.original.investment_amount / 1000000000,
+ })
+ : t("UserInfoDialog.toman", { value: row.original.investment_amount / 1000000 })}
+
+
+
+
+
+
+
+
+ {row.original.welfare_complex_degree || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.requested_facility_amount / 1000000 >= 1000
+ ? t("UserInfoDialog.milyard", {
+ value: row.original.requested_facility_amount / 1000000000,
+ })
+ : t("UserInfoDialog.toman", {
+ value: row.original.requested_facility_amount / 1000000,
+ })}
+
+
+
+
+
+
+
+
+ {row.original.person_share / 1000000 >= 1000
+ ? t("UserInfoDialog.milyard", { value: row.original.person_share / 1000000000 })
+ : t("UserInfoDialog.toman", { value: row.original.person_share / 1000000 })}
+
+
+
+
+
+
+
+
+
+
+ {row.original.project_axis || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.project_direction || t("UserInfoDialog.no_info")}
+
+
+
+
+ {row.original.refahi_type === 1 ? () : () }
+
+
+
+
+
+
+ {row.original.project_kilometer_marker || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.project_address || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.address || t("UserInfoDialog.no_info")}
+
+
+
+
+
+ >
+ );
+};
+export default RealTableContent;
\ No newline at end of file
diff --git a/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/RestoreTableUserInfo.jsx b/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/RestoreTableUserInfo.jsx
new file mode 100644
index 0000000..7263105
--- /dev/null
+++ b/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/RestoreTableUserInfo.jsx
@@ -0,0 +1,70 @@
+import { Button, Chip, Divider, Grid, Link, Stack, Typography } from "@mui/material";
+import DownloadIcon from "@mui/icons-material/Download";
+import { useTranslations } from "next-intl";
+
+const RestoreTableUserInfo = ({row}) => {
+ const t = useTranslations();
+ return(
+ <>
+
+
+
+
+
+
+ {row.original.exploitation_date || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.exploitation_license_renewal_date || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+ }>
+
+ {t("UserInfoDialog.download_image")}
+
+
+
+
+
+
+
+
+ }>
+
+ {t("UserInfoDialog.download_image")}
+
+
+
+
+
+ >
+ )
+}
+export default RestoreTableUserInfo
\ No newline at end of file
diff --git a/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/index.jsx b/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/index.jsx
new file mode 100644
index 0000000..90de161
--- /dev/null
+++ b/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/index.jsx
@@ -0,0 +1,50 @@
+import { Button, Dialog, DialogActions, IconButton, Tooltip } from "@mui/material";
+import { useTranslations } from "next-intl";
+import { useState } from "react";
+import ContactPageIcon from "@mui/icons-material/ContactPage";
+import LegalTableContent from "./LegalTableContent";
+import RealTableContent from "./RealTableContent";
+const UserInfoForm = ({ rowId, row }) => {
+ const t = useTranslations();
+ const [openUserInfoDialog, setOpenUserInfoDialog] = useState(false);
+ return (
+ <>
+
+ {
+ setOpenUserInfoDialog(true);
+ }}
+ >
+
+
+
+
+ >
+ );
+};
+export default UserInfoForm;
diff --git a/src/components/dashboard/refahi/passenger-boss/build/TableRowActions.jsx b/src/components/dashboard/refahi/passenger-boss/build/TableRowActions.jsx
new file mode 100644
index 0000000..7fe85b5
--- /dev/null
+++ b/src/components/dashboard/refahi/passenger-boss/build/TableRowActions.jsx
@@ -0,0 +1,22 @@
+import { Box } from "@mui/material";
+import Reject from "../Form/RejectForm";
+import Confirm from "../Form/ConfirmForm";
+import ReferReason from "../Form/ReferReason";
+import ReferUser from "../Form/ReferUser";
+import UserInfoForm from "../Form/UserInfoForm";
+
+const TableRow = ({ row, mutate }) => {
+ return (
+
+ {row.original.latest_history?.action === "refer" || row.original.latest_history?.action === "user-edit" ? (
+
+ ) : null}
+
+
+
+
+
+ );
+};
+
+export default TableRow;
diff --git a/src/components/dashboard/refahi/passenger-boss/build/TableToolbar.jsx b/src/components/dashboard/refahi/passenger-boss/build/TableToolbar.jsx
new file mode 100644
index 0000000..56ce00e
--- /dev/null
+++ b/src/components/dashboard/refahi/passenger-boss/build/TableToolbar.jsx
@@ -0,0 +1,12 @@
+import { Stack } from "@mui/material";
+import PrintExcel from "../Buttons/printExcel";
+
+const TableToolbar = ({ table }) => {
+ return (
+
+ {/**/}
+
+ );
+};
+
+export default TableToolbar;
diff --git a/src/components/dashboard/development-assistant/index.jsx b/src/components/dashboard/refahi/passenger-boss/build/index.jsx
similarity index 54%
rename from src/components/dashboard/development-assistant/index.jsx
rename to src/components/dashboard/refahi/passenger-boss/build/index.jsx
index 3b7877c..eb765c8 100644
--- a/src/components/dashboard/development-assistant/index.jsx
+++ b/src/components/dashboard/refahi/passenger-boss/build/index.jsx
@@ -1,13 +1,14 @@
-import { Box, Typography } from "@mui/material";
+import { Box, Stack, Typography } from "@mui/material";
import { useMemo } from "react";
-import { GET_DEVELOPMENT_ASSISTANT } from "@/core/data/apiRoutes";
+import { GET_REFAHI_PASSENGER_BOSS_BUILD } from "@/core/data/apiRoutes";
import { useTranslations } from "next-intl";
import TableRowActions from "./TableRowActions";
import moment from "jalali-moment";
import DataTable from "@/core/components/DataTable";
import MuiDatePicker from "@/core/components/MuiDatePicker";
+import TableToolbar from "./TableToolbar";
-function DashboardDevelopmentAssistantComponent() {
+function DashboardPassengerOfficeComponent() {
const t = useTranslations();
const columns = useMemo(
@@ -15,7 +16,7 @@ function DashboardDevelopmentAssistantComponent() {
{
accessorFn: (row) => row.id,
id: "id",
- header: t("DevelopmentAssistant.id"),
+ header: t("PassengerBoss.id"),
enableColumnFilter: true,
datatype: "numeric",
filterFn: "equals",
@@ -23,9 +24,33 @@ function DashboardDevelopmentAssistantComponent() {
Cell: ({ renderedCellValue }) => {renderedCellValue},
},
{
- accessorFn: (row) => row.name,
- id: "name",
- header: t("DevelopmentAssistant.name"),
+ accessorFn: (row) => row.is_legal_person,
+ id: "is_legal_person",
+ header: t("PassengerBoss.is_legal_person"),
+ enableColumnFilter: false,
+ datatype: "numeric",
+ filterFn: "equals",
+ columnFilterModeOptions: ["equals"],
+ Cell: ({ renderedCellValue }) => (
+
+ {renderedCellValue === 1 ? `${t("PassengerBoss.hoghoghi")}` : `${t("PassengerBoss.haghighi")}`}
+
+ ),
+ },
+ {
+ accessorFn: (row) => row.first_name,
+ id: "first_name",
+ header: t("PassengerBoss.first_name"),
+ enableColumnFilter: true,
+ datatype: "text",
+ filterFn: "contains",
+ columnFilterModeOptions: ["contains", "equals", "notEquals"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => row.last_name,
+ id: "last_name",
+ header: t("PassengerBoss.last_name"),
enableColumnFilter: true,
datatype: "text",
filterFn: "contains",
@@ -35,7 +60,7 @@ function DashboardDevelopmentAssistantComponent() {
{
accessorFn: (row) => row.national_id,
id: "national_id",
- header: t("DevelopmentAssistant.national_id"),
+ header: t("PassengerBoss.national_id"),
enableColumnFilter: true,
datatype: "numeric",
filterFn: "equals",
@@ -43,19 +68,39 @@ function DashboardDevelopmentAssistantComponent() {
Cell: ({ renderedCellValue }) => {renderedCellValue},
},
{
- accessorFn: (row) => row.phone_number,
- id: "phone_number",
- header: t("DevelopmentAssistant.phone_number"),
+ accessorFn: (row) => row.shenase_meli,
+ id: "shenase_meli",
+ header: t("PassengerBoss.shenase_meli"),
enableColumnFilter: true,
datatype: "numeric",
filterFn: "equals",
columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"],
Cell: ({ renderedCellValue }) => {renderedCellValue},
},
+ {
+ accessorFn: (row) => row.province_name,
+ id: "province_name",
+ header: t("PassengerBoss.province_name"),
+ enableColumnFilter: true,
+ datatype: "text",
+ filterFn: "contains",
+ columnFilterModeOptions: ["contains", "equals", "notEquals"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => row.city_name,
+ id: "city_name",
+ header: t("PassengerBoss.city_name"),
+ enableColumnFilter: true,
+ datatype: "text",
+ filterFn: "contains",
+ columnFilterModeOptions: ["contains", "equals", "notEquals"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
{
accessorFn: (row) => moment(row.created_at).locale("fa").format("HH:mm | yyyy/MM/DD"),
id: "created_at",
- header: t("DevelopmentAssistant.created_at"),
+ header: t("PassengerBoss.created_at"),
enableColumnFilter: true,
datatype: "date",
filterFn: "lessThan",
@@ -69,17 +114,19 @@ function DashboardDevelopmentAssistantComponent() {
},
},
{
- accessorFn: (row) => moment(row.updated_at).locale("fa").format("HH:mm | yyyy/MM/DD"),
- id: "updated_at",
- header: t("DevelopmentAssistant.updated_at"),
- enableColumnFilter: false,
+ accessorFn: (row) => row.phone_number,
+ id: "phone_number",
+ header: t("PassengerBoss.phone_number"),
+ enableColumnFilter: true,
datatype: "numeric",
+ filterFn: "equals",
+ columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"],
Cell: ({ renderedCellValue }) => {renderedCellValue},
},
{
accessorFn: (row) => row.state_name,
id: "state_id",
- header: t("DevelopmentAssistant.state_name"),
+ header: t("PassengerBoss.state_name"),
enableColumnFilter: false,
datatype: "numeric",
Cell: ({ renderedCellValue }) => {renderedCellValue},
@@ -87,29 +134,23 @@ function DashboardDevelopmentAssistantComponent() {
],
[]
);
-
return (
@@ -117,4 +158,4 @@ function DashboardDevelopmentAssistantComponent() {
);
}
-export default DashboardDevelopmentAssistantComponent;
+export default DashboardPassengerOfficeComponent;
diff --git a/src/components/dashboard/refahi/passenger-boss/print-report/index.jsx b/src/components/dashboard/refahi/passenger-boss/print-report/index.jsx
new file mode 100644
index 0000000..66a546b
--- /dev/null
+++ b/src/components/dashboard/refahi/passenger-boss/print-report/index.jsx
@@ -0,0 +1,14 @@
+"use client";
+import { useSearchParams } from "next/navigation";
+
+export default function DashboardPassengerBossReportComponent() {
+ const searchParams = useSearchParams();
+ const id = searchParams.get("id");
+ console.log(id);
+
+ return (
+
+ hello
+
+ );
+}
\ No newline at end of file
diff --git a/src/components/dashboard/refahi/passenger-boss/restore/TableRowActions.jsx b/src/components/dashboard/refahi/passenger-boss/restore/TableRowActions.jsx
new file mode 100644
index 0000000..7fe85b5
--- /dev/null
+++ b/src/components/dashboard/refahi/passenger-boss/restore/TableRowActions.jsx
@@ -0,0 +1,22 @@
+import { Box } from "@mui/material";
+import Reject from "../Form/RejectForm";
+import Confirm from "../Form/ConfirmForm";
+import ReferReason from "../Form/ReferReason";
+import ReferUser from "../Form/ReferUser";
+import UserInfoForm from "../Form/UserInfoForm";
+
+const TableRow = ({ row, mutate }) => {
+ return (
+
+ {row.original.latest_history?.action === "refer" || row.original.latest_history?.action === "user-edit" ? (
+
+ ) : null}
+
+
+
+
+
+ );
+};
+
+export default TableRow;
diff --git a/src/components/dashboard/refahi/passenger-boss/restore/TableToolbar.jsx b/src/components/dashboard/refahi/passenger-boss/restore/TableToolbar.jsx
new file mode 100644
index 0000000..56ce00e
--- /dev/null
+++ b/src/components/dashboard/refahi/passenger-boss/restore/TableToolbar.jsx
@@ -0,0 +1,12 @@
+import { Stack } from "@mui/material";
+import PrintExcel from "../Buttons/printExcel";
+
+const TableToolbar = ({ table }) => {
+ return (
+
+ {/**/}
+
+ );
+};
+
+export default TableToolbar;
diff --git a/src/components/dashboard/inspector-expert/index.jsx b/src/components/dashboard/refahi/passenger-boss/restore/index.jsx
similarity index 50%
rename from src/components/dashboard/inspector-expert/index.jsx
rename to src/components/dashboard/refahi/passenger-boss/restore/index.jsx
index 5d3cd8d..54ce9ac 100644
--- a/src/components/dashboard/inspector-expert/index.jsx
+++ b/src/components/dashboard/refahi/passenger-boss/restore/index.jsx
@@ -1,20 +1,22 @@
-import { Box, Typography } from "@mui/material";
+import { Box, Stack, Typography } from "@mui/material";
import { useMemo } from "react";
-import { GET_INSPECTOR_EXPERT } from "@/core/data/apiRoutes";
+import { GET_REFAHI_PASSENGER_BOSS_RESTORE } from "@/core/data/apiRoutes";
import { useTranslations } from "next-intl";
import TableRowActions from "./TableRowActions";
import moment from "jalali-moment";
import DataTable from "@/core/components/DataTable";
import MuiDatePicker from "@/core/components/MuiDatePicker";
+import TableToolbar from "./TableToolbar";
-function DashboardInspectorExpertComponent() {
+function DashboardPassengerOfficeComponent() {
const t = useTranslations();
+
const columns = useMemo(
() => [
{
accessorFn: (row) => row.id,
id: "id",
- header: t("InspectorExpert.id"),
+ header: t("PassengerBoss.id"),
enableColumnFilter: true,
datatype: "numeric",
filterFn: "equals",
@@ -22,9 +24,43 @@ function DashboardInspectorExpertComponent() {
Cell: ({ renderedCellValue }) => {renderedCellValue},
},
{
- accessorFn: (row) => row.name,
- id: "name",
- header: t("InspectorExpert.name"),
+ accessorFn: (row) => row.project_title,
+ id: "project_title",
+ header: t("PassengerBoss.project_title"),
+ enableColumnFilter: false,
+ datatype: "text",
+ filterFn: "equals",
+ columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => row.is_legal_person,
+ id: "is_legal_person",
+ header: t("PassengerBoss.is_legal_person"),
+ enableColumnFilter: false,
+ datatype: "numeric",
+ filterFn: "equals",
+ columnFilterModeOptions: ["equals"],
+ Cell: ({ renderedCellValue }) => (
+
+ {renderedCellValue === 1 ? `${t("PassengerBoss.hoghoghi")}` : `${t("PassengerBoss.haghighi")}`}
+
+ ),
+ },
+ {
+ accessorFn: (row) => row.first_name,
+ id: "first_name",
+ header: t("PassengerBoss.first_name"),
+ enableColumnFilter: true,
+ datatype: "text",
+ filterFn: "contains",
+ columnFilterModeOptions: ["contains", "equals", "notEquals"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => row.last_name,
+ id: "last_name",
+ header: t("PassengerBoss.last_name"),
enableColumnFilter: true,
datatype: "text",
filterFn: "contains",
@@ -34,7 +70,7 @@ function DashboardInspectorExpertComponent() {
{
accessorFn: (row) => row.national_id,
id: "national_id",
- header: t("InspectorExpert.national_id"),
+ header: t("PassengerBoss.national_id"),
enableColumnFilter: true,
datatype: "numeric",
filterFn: "equals",
@@ -42,19 +78,39 @@ function DashboardInspectorExpertComponent() {
Cell: ({ renderedCellValue }) => {renderedCellValue},
},
{
- accessorFn: (row) => row.phone_number,
- id: "phone_number",
- header: t("InspectorExpert.phone_number"),
+ accessorFn: (row) => row.shenase_meli,
+ id: "shenase_meli",
+ header: t("PassengerBoss.shenase_meli"),
enableColumnFilter: true,
datatype: "numeric",
filterFn: "equals",
columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"],
Cell: ({ renderedCellValue }) => {renderedCellValue},
},
+ {
+ accessorFn: (row) => row.province_name,
+ id: "province_name",
+ header: t("PassengerBoss.province_name"),
+ enableColumnFilter: true,
+ datatype: "text",
+ filterFn: "contains",
+ columnFilterModeOptions: ["contains", "equals", "notEquals"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => row.city_name,
+ id: "city_name",
+ header: t("PassengerBoss.city_name"),
+ enableColumnFilter: true,
+ datatype: "text",
+ filterFn: "contains",
+ columnFilterModeOptions: ["contains", "equals", "notEquals"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
{
accessorFn: (row) => moment(row.created_at).locale("fa").format("HH:mm | yyyy/MM/DD"),
id: "created_at",
- header: t("InspectorExpert.created_at"),
+ header: t("PassengerBoss.created_at"),
enableColumnFilter: true,
datatype: "date",
filterFn: "lessThan",
@@ -68,17 +124,19 @@ function DashboardInspectorExpertComponent() {
},
},
{
- accessorFn: (row) => moment(row.updated_at).locale("fa").format("HH:mm | yyyy/MM/DD"),
- id: "updated_at",
- header: t("InspectorExpert.updated_at"),
- enableColumnFilter: false,
+ accessorFn: (row) => row.phone_number,
+ id: "phone_number",
+ header: t("PassengerBoss.phone_number"),
+ enableColumnFilter: true,
datatype: "numeric",
+ filterFn: "equals",
+ columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"],
Cell: ({ renderedCellValue }) => {renderedCellValue},
},
{
accessorFn: (row) => row.state_name,
id: "state_id",
- header: t("InspectorExpert.state_name"),
+ header: t("PassengerBoss.state_name"),
enableColumnFilter: false,
datatype: "numeric",
Cell: ({ renderedCellValue }) => {renderedCellValue},
@@ -86,29 +144,23 @@ function DashboardInspectorExpertComponent() {
],
[]
);
-
return (
@@ -116,4 +168,4 @@ function DashboardInspectorExpertComponent() {
);
}
-export default DashboardInspectorExpertComponent;
+export default DashboardPassengerOfficeComponent;
diff --git a/src/components/dashboard/refahi-loan-management/Form/UpdateForm/UpdateContent.jsx b/src/components/dashboard/refahi/refahi-loan-management/Form/UpdateForm/UpdateContent.jsx
similarity index 100%
rename from src/components/dashboard/refahi-loan-management/Form/UpdateForm/UpdateContent.jsx
rename to src/components/dashboard/refahi/refahi-loan-management/Form/UpdateForm/UpdateContent.jsx
diff --git a/src/components/dashboard/refahi-loan-management/Form/UpdateForm/index.jsx b/src/components/dashboard/refahi/refahi-loan-management/Form/UpdateForm/index.jsx
similarity index 100%
rename from src/components/dashboard/refahi-loan-management/Form/UpdateForm/index.jsx
rename to src/components/dashboard/refahi/refahi-loan-management/Form/UpdateForm/index.jsx
diff --git a/src/components/dashboard/refahi-loan-management/TableRowActions.jsx b/src/components/dashboard/refahi/refahi-loan-management/TableRowActions.jsx
similarity index 100%
rename from src/components/dashboard/refahi-loan-management/TableRowActions.jsx
rename to src/components/dashboard/refahi/refahi-loan-management/TableRowActions.jsx
diff --git a/src/components/dashboard/refahi-loan-management/index.jsx b/src/components/dashboard/refahi/refahi-loan-management/index.jsx
similarity index 100%
rename from src/components/dashboard/refahi-loan-management/index.jsx
rename to src/components/dashboard/refahi/refahi-loan-management/index.jsx
diff --git a/src/components/dashboard/refahi/refahi-province-manager/Buttons/printExcel.jsx b/src/components/dashboard/refahi/refahi-province-manager/Buttons/printExcel.jsx
new file mode 100644
index 0000000..52a81c4
--- /dev/null
+++ b/src/components/dashboard/refahi/refahi-province-manager/Buttons/printExcel.jsx
@@ -0,0 +1,69 @@
+import { Button, CircularProgress } from "@mui/material";
+import { useTranslations } from "next-intl";
+import { useMemo, useState } from "react";
+import useRequest from "@/lib/app/hooks/useRequest";
+import { EXPORT_REFAHI_PASSENGER_BOSS } 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_REFAHI_PASSENGER_BOSS}?${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 (
+ : }
+ onClick={clickHandler}
+ >
+ {t("PassengerBoss.excel_report")}
+
+ );
+};
+
+export default PrintExcel;
diff --git a/src/components/dashboard/refahi/refahi-province-manager/Form/ConfirmForm/ConfirmContent.jsx b/src/components/dashboard/refahi/refahi-province-manager/Form/ConfirmForm/ConfirmContent.jsx
new file mode 100644
index 0000000..8dd0208
--- /dev/null
+++ b/src/components/dashboard/refahi/refahi-province-manager/Form/ConfirmForm/ConfirmContent.jsx
@@ -0,0 +1,336 @@
+import UploadSystem from "@/core/components/UploadSystem";
+import useNotification from "@/lib/app/hooks/useNotification";
+import useRequest from "@/lib/app/hooks/useRequest";
+import {
+ Button,
+ DialogActions,
+ DialogContent,
+ FormHelperText,
+ Grid,
+ LinearProgress,
+ Stack,
+ TextField,
+ Typography,
+} 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 { useEffect, useState } from "react";
+import * as Yup from "yup";
+import CustomAccordion from "@/core/components/CustomAccordion";
+import ImageContent from "@/core/components/ImageContent";
+import NumberShowBox from "@/core/components/NumberShowBox";
+
+const ConfirmContent = ({ rowId, mutate, setOpenConfirmDialog, handleSizeChangeClick }) => {
+ const t = useTranslations();
+ const [selectedImage, setSelectedImage] = useState("");
+ const [fileType, setfileType] = useState(null);
+ const [fileName, setfileName] = useState(null);
+ const [showAddIcon, setShowAddIcon] = useState(true);
+ const requestServer = useRequest({ auth: true, notification: false });
+ const { update_notification } = useNotification();
+ const [attachmentsData, setAttachmentsData] = useState([]);
+ const [accordionStates, setAccordionStates] = useState([]);
+ const [hasImageShown, setHasImageShown] = useState(false);
+ const [imageLink, setImageLink] = useState(null);
+ const [detailsList, setDetailsData] = useState(null);
+ const [loading, setLoading] = useState(true);
+ const [isSkeleton, setIsSkeleton] = useState(false);
+
+ const validationSchema = Yup.object().shape({
+ confirm_img: Yup.mixed()
+ .notRequired(t("ConfirmDialog.approved_amount_error"))
+ .test("fileSize", `${t("NavganProvinceManager.upload_file_unit")}`, (value) => {
+ if (!value) return true;
+ return value.size <= 5 * 1024 * 1024;
+ })
+ .test("fileType", `${t("NavganProvinceManager.upload_file_format")}`, (value) => {
+ if (!value) return true;
+ const allowedTypes = ["image/jpg", "image/jpeg", "image/png", "application/pdf"]; // Define your allowed file types
+ return allowedTypes.includes(value.type);
+ }),
+ });
+
+ useEffect(() => {
+ requestServer(`${CONFIRM_REFAHI_PROVINCE_MANAGER_DETAILS}/${rowId}`, "get")
+ .then((response) => {
+ if (response.data.data.latest_histories.length !== 0) {
+ let latest_attachments = [];
+ let attachments = [];
+ response.data.data.latest_histories.map((allAttachment) => {
+ if (allAttachment.previous_state_id === 4 || allAttachment.previous_state_id === 5) {
+ if (!latest_attachments.includes(allAttachment.previous_state_id)) {
+ attachments = [...attachments, ...allAttachment.attachments];
+ latest_attachments.push(allAttachment.previous_state_id);
+ }
+ }
+ setDetailsData(response.data);
+ setAttachmentsData(attachments);
+ });
+ }
+ })
+ .catch(() => {})
+ .finally(() => {
+ setLoading(false);
+ });
+ }, []);
+
+ useEffect(() => {
+ if (attachmentsData.length !== 0) {
+ const booleanData = Array.from({ length: attachmentsData.length }, () => false);
+ setAccordionStates(booleanData);
+ }
+ }, [attachmentsData]);
+
+ const handleAccordionChange = (index) => {
+ const newAccordionStates = accordionStates.map((state, i) => (i === index ? !state : false));
+ setAccordionStates(newAccordionStates);
+
+ if (!newAccordionStates[index]) {
+ handleSizeChangeClick("sm");
+ setHasImageShown(false);
+ setIsSkeleton(false);
+ } else {
+ handleSizeChangeClick("xl");
+ setHasImageShown(true);
+ setImageLink(attachmentsData[index]);
+ setIsSkeleton(true);
+ }
+ };
+
+ const formik = useFormik({
+ initialValues: {
+ description: "",
+ confirm_img: null,
+ },
+ validationSchema,
+ onSubmit: (values, { setSubmitting }) => {
+ const formData = new FormData();
+ if (values.description !== "") formData.append("expert_description", values.description);
+ if (values.confirm_img != null) {
+ const attachments = [
+ {
+ title: "فایل ضمیمه کارتابل بررسی وام های تبصره 18",
+ file: values.confirm_img,
+ },
+ ];
+ attachments.forEach((attachment, index) => {
+ formData.append(`attachment[${index}][title]`, attachment.title);
+ formData.append(`attachment[${index}][file]`, attachment.file);
+ });
+ }
+ requestServer(`${CONFIRM_REFAHI_PROVINCE_MANAGER}/${rowId}`, "post", {
+ data: formData,
+ notification: true,
+ })
+ .then((response) => {
+ setOpenConfirmDialog(false);
+ mutate();
+ update_notification();
+ })
+ .catch(() => {})
+ .finally(() => {
+ setSubmitting(false);
+ });
+ },
+ });
+
+ const handleDescriptionChange = (event) => {
+ formik.setFieldValue("description", event.target.value);
+ };
+
+ const handleUploadChange = (event) => {
+ const uploadedFile = event.target?.files?.[0];
+ if (uploadedFile) {
+ const fileType = event.target?.files?.[0].type;
+ const fileName = event.target?.files?.[0].name;
+ setSelectedImage(URL.createObjectURL(uploadedFile));
+ setfileType(fileType);
+ setfileName(fileName);
+ formik.setFieldValue("confirm_img", uploadedFile).then(() => {
+ formik.setFieldTouched("confirm_img", true);
+ });
+ setShowAddIcon(false);
+ }
+ };
+
+ const renderCustomAccordions = () => {
+ if (attachmentsData) {
+ return attachmentsData.map((file, index) => (
+ handleAccordionChange(index)}
+ accordionIndex={index}
+ downloadFile={file.file}
+ />
+ ));
+ }
+ return null;
+ };
+
+ return (
+ <>
+
+
+
+ {loading ? (
+
+ ) : (
+ <>
+ = 1000
+ ? detailsList?.data?.approved_amount / 1000000000
+ : detailsList?.data?.approved_amount / 1000000
+ }
+ headerTitle={t("ConfirmDialog.approved_amount_title")}
+ unitTitle={
+ detailsList?.data?.approved_amount / 1000000 >= 1000
+ ? t("ConfirmDialog.milyard")
+ : t("ConfirmDialog.unit")
+ }
+ />
+ = 1000
+ ? detailsList?.data?.facility_bank / 1000000000
+ : detailsList?.data?.facility_bank / 1000000
+ }
+ headerTitle={t("ConfirmDialog.facility_bank_title")}
+ unitTitle={
+ detailsList?.data?.facility_bank / 1000000 >= 1000
+ ? t("ConfirmDialog.milyard")
+ : t("ConfirmDialog.unit")
+ }
+ />
+ = 1000
+ ? detailsList?.data?.facility_gov / 1000000000
+ : detailsList?.data?.facility_gov / 1000000
+ }
+ headerTitle={t("ConfirmDialog.facility_gov_title")}
+ unitTitle={
+ detailsList?.data?.facility_gov / 1000000 >= 1000
+ ? t("ConfirmDialog.milyard")
+ : t("ConfirmDialog.unit")
+ }
+ />
+ = 1000
+ ? detailsList?.data?.facility_person / 1000000000
+ : detailsList?.data?.facility_person / 1000000
+ }
+ headerTitle={t("ConfirmDialog.facility_person_title")}
+ unitTitle={
+ detailsList?.data?.facility_person / 1000000 >= 1000
+ ? t("ConfirmDialog.milyard")
+ : t("ConfirmDialog.unit")
+ }
+ />
+
+
+
+ {renderCustomAccordions()}
+ >
+ )}
+
+
+
+ {t("ConfirmDialog.description")}
+ {t("ConfirmDialog.optional")}
+ >
+ }
+ value={formik.values.description}
+ onChange={handleDescriptionChange}
+ fullWidth
+ variant="outlined"
+ sx={{ mt: 1 }}
+ />
+
+
+
+ {t("UploadSystem.upload_file")}
+ {t("UploadSystem.optional")}
+
+ formik.handleBlur("confirm_img")}
+ error={formik.touched.confirm_img && Boolean(formik.errors.confirm_img)}
+ />
+
+ {formik.touched.confirm_img && formik.errors.confirm_img}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+};
+export default ConfirmContent;
diff --git a/src/components/dashboard/province-head-expert/Form/ConfirmForm/index.jsx b/src/components/dashboard/refahi/refahi-province-manager/Form/ConfirmForm/index.jsx
similarity index 55%
rename from src/components/dashboard/province-head-expert/Form/ConfirmForm/index.jsx
rename to src/components/dashboard/refahi/refahi-province-manager/Form/ConfirmForm/index.jsx
index e849196..a2928fc 100644
--- a/src/components/dashboard/province-head-expert/Form/ConfirmForm/index.jsx
+++ b/src/components/dashboard/refahi/refahi-province-manager/Form/ConfirmForm/index.jsx
@@ -1,12 +1,22 @@
import { Dialog, DialogTitle, IconButton, Tooltip } from "@mui/material";
import { useTranslations } from "next-intl";
-import ThumbUpAltIcon from "@mui/icons-material/ThumbUpAlt";
-import { useState } from "react";
+import { useEffect, useState } from "react";
import ConfirmContent from "./ConfirmContent";
-
+import CallMadeIcon from "@mui/icons-material/CallMade";
const Confirm = ({ rowId, mutate }) => {
const t = useTranslations();
const [openConfirmDialog, setOpenConfirmDialog] = useState(false);
+ const [dialogSize, setDialogSize] = useState("sm");
+
+ useEffect(() => {
+ if (!openConfirmDialog) {
+ setDialogSize("sm");
+ }
+ }, [openConfirmDialog]);
+
+ const handleSizeChangeClick = (size) => {
+ setDialogSize(size);
+ };
return (
<>
@@ -16,7 +26,7 @@ const Confirm = ({ rowId, mutate }) => {
setOpenConfirmDialog(true);
}}
>
-
+
>
);
diff --git a/src/components/dashboard/refahi-province-manager/Form/RejectForm/RejectContent.jsx b/src/components/dashboard/refahi/refahi-province-manager/Form/RejectForm/RejectContent.jsx
similarity index 73%
rename from src/components/dashboard/refahi-province-manager/Form/RejectForm/RejectContent.jsx
rename to src/components/dashboard/refahi/refahi-province-manager/Form/RejectForm/RejectContent.jsx
index 16ac531..d80ed86 100644
--- a/src/components/dashboard/refahi-province-manager/Form/RejectForm/RejectContent.jsx
+++ b/src/components/dashboard/refahi/refahi-province-manager/Form/RejectForm/RejectContent.jsx
@@ -1,7 +1,7 @@
import UploadSystem from "@/core/components/UploadSystem";
import useNotification from "@/lib/app/hooks/useNotification";
import useRequest from "@/lib/app/hooks/useRequest";
-import { Button, DialogActions, DialogContent, Stack, TextField, Typography } from "@mui/material";
+import { Button, DialogActions, DialogContent, FormHelperText, Stack, TextField, Typography } from "@mui/material";
import { useFormik } from "formik";
import { useTranslations } from "next-intl";
import { useState } from "react";
@@ -19,6 +19,15 @@ const RejectContent = ({ rowId, mutate, setOpenRejectDialog }) => {
const validationSchema = Yup.object().shape({
description: Yup.string().required(t("RejectDialog.description_error")),
+ reject_img: Yup.mixed()
+ .notRequired(t("RejectDialog.choose_file"))
+ .test("fileSize", `${t("NavganProvinceManager.upload_file_unit")}`, (value) => {
+ return !value || (value.size && value.size <= 5 * 1024 * 1024);
+ })
+ .test("fileType", `${t("NavganProvinceManager.upload_file_format")}`, (value) => {
+ const allowedTypes = ["image/jpg", "image/jpeg", "image/png", "application/pdf"]; // Define your allowed file types
+ return !value || (value.type && allowedTypes.includes(value.type));
+ }),
});
const formik = useFormik({
@@ -29,9 +38,19 @@ const RejectContent = ({ rowId, mutate, setOpenRejectDialog }) => {
validationSchema,
onSubmit: (values, { setSubmitting }) => {
const formData = new FormData();
- formData.append("description", values.description);
- if (values.reject_img != null) formData.append("attachment", values.reject_img);
-
+ formData.append("expert_description", values.description);
+ if (values.reject_img != null) {
+ const attachments = [
+ {
+ title: "فایل ضمیمه کارتابل بررسی وام های تبصره 18",
+ file: values.reject_img,
+ },
+ ];
+ attachments.forEach((attachment, index) => {
+ formData.append(`attachment[${index}][title]`, attachment.title);
+ formData.append(`attachment[${index}][file]`, attachment.file);
+ });
+ }
requestServer(`${REJECT_REFAHI_PROVINCE_MANAGER}/${rowId}`, "post", {
data: formData,
})
@@ -54,21 +73,18 @@ const RejectContent = ({ rowId, mutate, setOpenRejectDialog }) => {
const handleUploadChange = (event) => {
const uploadedFile = event.target?.files?.[0];
if (uploadedFile) {
- const maxFileSize = 2 * 1024 * 1024;
- if (uploadedFile.size > maxFileSize) {
- UploadFileNotification(t);
- event.target.value = "";
- return;
- }
const fileType = event.target?.files?.[0].type;
const fileName = event.target?.files?.[0].name;
setSelectedImage(URL.createObjectURL(uploadedFile));
setfileType(fileType);
setfileName(fileName);
- formik.setFieldValue("reject_img", uploadedFile);
+ formik.setFieldValue("reject_img", uploadedFile).then(() => {
+ formik.setFieldTouched("reject_img", true);
+ });
setShowAddIcon(false);
}
};
+
return (
<>
@@ -106,7 +122,12 @@ const RejectContent = ({ rowId, mutate, setOpenRejectDialog }) => {
imageSize={[250 /*width*/, 150 /*height*/]}
setShowAddIcon={setShowAddIcon}
showAddIcon={showAddIcon}
+ onBlur={() => formik.handleBlur("reject_img")}
+ error={formik.touched.reject_img && Boolean(formik.errors.reject_img)}
/>
+
+ {formik.touched.reject_img && formik.errors.reject_img}
+
diff --git a/src/components/dashboard/passenger-boss/Form/RejectForm/index.jsx b/src/components/dashboard/refahi/refahi-province-manager/Form/RejectForm/index.jsx
similarity index 100%
rename from src/components/dashboard/passenger-boss/Form/RejectForm/index.jsx
rename to src/components/dashboard/refahi/refahi-province-manager/Form/RejectForm/index.jsx
diff --git a/src/components/dashboard/inspector-expert/Form/ReviseForm/ReviseContent.jsx b/src/components/dashboard/refahi/refahi-province-manager/Form/RevertForm/RevertContent.jsx
similarity index 77%
rename from src/components/dashboard/inspector-expert/Form/ReviseForm/ReviseContent.jsx
rename to src/components/dashboard/refahi/refahi-province-manager/Form/RevertForm/RevertContent.jsx
index f8964c7..0979a9d 100644
--- a/src/components/dashboard/inspector-expert/Form/ReviseForm/ReviseContent.jsx
+++ b/src/components/dashboard/refahi/refahi-province-manager/Form/RevertForm/RevertContent.jsx
@@ -4,15 +4,15 @@ import { Button, DialogActions, DialogContent, Stack, TextField } from "@mui/mat
import { useFormik } from "formik";
import { useTranslations } from "next-intl";
import * as Yup from "yup";
-import { REVISE_INSPECTOR_EXPERT } from "@/core/data/apiRoutes";
+import { REFER_REFAHI_PROVINCE_MANAGER } from "@/core/data/apiRoutes";
-const ReviseContent = ({ rowId, mutate, setOpenReviseDialog }) => {
+const RevertContent = ({ rowId, mutate, setOpenRevertDialog }) => {
const t = useTranslations();
const requestServer = useRequest({ auth: true });
const { update_notification } = useNotification();
const validationSchema = Yup.object().shape({
- description: Yup.string().required(t("ReviseDialog.description_error")),
+ description: Yup.string().required(t("RevertDialog.description_error")),
});
const formik = useFormik({
@@ -21,14 +21,13 @@ const ReviseContent = ({ rowId, mutate, setOpenReviseDialog }) => {
},
validationSchema,
onSubmit: (values, { setSubmitting }) => {
- const formData = new FormData();
- formData.append("description", values.description);
-
- requestServer(`${REVISE_INSPECTOR_EXPERT}/${rowId}`, "post", {
- data: formData,
+ requestServer(`${REFER_REFAHI_PROVINCE_MANAGER}/${rowId}`, "post", {
+ data: {
+ expert_description: values.description,
+ },
})
- .then((response) => {
- setOpenReviseDialog(false);
+ .then(() => {
+ setOpenRevertDialog(false);
mutate();
update_notification();
})
@@ -52,7 +51,7 @@ const ReviseContent = ({ rowId, mutate, setOpenReviseDialog }) => {
name="description"
multiline
rows={8}
- label={t("ReviseDialog.description")}
+ label={t("RevertDialog.description")}
value={formik.values.description}
onChange={handleDescriptionChange}
onBlur={formik.handleBlur("description")}
@@ -67,13 +66,13 @@ const ReviseContent = ({ rowId, mutate, setOpenReviseDialog }) => {
>
);
};
-export default ReviseContent;
+export default RevertContent;
diff --git a/src/components/dashboard/refahi-province-manager/Form/RejectForm/index.jsx b/src/components/dashboard/refahi/refahi-province-manager/Form/RevertForm/index.jsx
similarity index 52%
rename from src/components/dashboard/refahi-province-manager/Form/RejectForm/index.jsx
rename to src/components/dashboard/refahi/refahi-province-manager/Form/RevertForm/index.jsx
index a04d0e1..0d78227 100644
--- a/src/components/dashboard/refahi-province-manager/Form/RejectForm/index.jsx
+++ b/src/components/dashboard/refahi/refahi-province-manager/Form/RevertForm/index.jsx
@@ -1,32 +1,32 @@
import { Dialog, DialogTitle, IconButton, Tooltip } from "@mui/material";
import { useTranslations } from "next-intl";
import { useState } from "react";
-import RejectContent from "./RejectContent";
-import ThumbDownIcon from "@mui/icons-material/ThumbDown";
+import CallReceivedIcon from "@mui/icons-material/CallReceived";
+import RevertContent from "./RevertContent";
-const Reject = ({ rowId, mutate }) => {
+const Revert = ({ rowId, mutate }) => {
const t = useTranslations();
- const [openRejectDialog, setOpenRejectDialog] = useState(false);
+ const [openRevertDialog, setOpenRevertDialog] = useState(false);
return (
<>
-
- setOpenRejectDialog(true)}>
-
+
+ setOpenRevertDialog(true)}>
+
>
);
};
-export default Reject;
+export default Revert;
diff --git a/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/BuildTableUserInfo.jsx b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/BuildTableUserInfo.jsx
new file mode 100644
index 0000000..80ef334
--- /dev/null
+++ b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/BuildTableUserInfo.jsx
@@ -0,0 +1,79 @@
+import { Button, Chip, Divider, Grid, Link, Stack, Typography } from "@mui/material";
+import DownloadIcon from "@mui/icons-material/Download";
+import { useTranslations } from "next-intl";
+
+const BuildTableUserInfo = ({row}) => {
+ const t = useTranslations();
+ return(
+ <>
+
+
+
+
+
+
+ {row.original.project_physical_progress || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.basic_approval_number || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.basic_approval_renewal_date || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+ }>
+
+ {t("UserInfoDialog.download_image")}
+
+
+
+
+
+
+
+
+ }>
+
+ {t("UserInfoDialog.download_image")}
+
+
+
+
+
+ >
+ )
+}
+export default BuildTableUserInfo
\ No newline at end of file
diff --git a/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/LegalTableContent.jsx b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/LegalTableContent.jsx
new file mode 100644
index 0000000..8c01afb
--- /dev/null
+++ b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/LegalTableContent.jsx
@@ -0,0 +1,397 @@
+import { Chip, DialogContent, DialogTitle, Divider, Grid, Stack, Typography } from "@mui/material";
+import { useTranslations } from "next-intl";
+import moment from "jalali-moment";
+
+const LegalTableContent = ({ rowId, row }) => {
+ const t = useTranslations();
+ return (
+ <>
+ {t("UserInfoDialog.user_info")}
+
+
+
+
+
+
+ {t("UserInfoDialog.legal_person")}
+
+
+
+
+
+
+ {row.original.id || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+ {row.original.project_title || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.activity_category_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.first_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.last_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.father_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.gender ? t("UserInfoDialog.female") : t("UserInfoDialog.male")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.national_id || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.national_serial_number ||
+ row.original.national_tracking_code ||
+ t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.education_title || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.occupation_title || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.phone_number || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.birthday
+ ? moment(row.original.birthday).locale("fa").format("YYYY/MM/DD")
+ : t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.province_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.city_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.shenase_meli || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.postal_code || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.company_register_date
+ ? moment(row.original.company_register_date).locale("fa").format("YYYY/MM/DD")
+ : t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.register_number || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.navgan_id || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.navgan_type || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.company_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.telephone_number || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.vehicle_type || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.investment_amount / 1000000 >= 1000
+ ? t("UserInfoDialog.milyard", {
+ value: row.original.investment_amount / 1000000000,
+ })
+ : t("UserInfoDialog.toman", { value: row.original.investment_amount / 1000000 })}
+
+
+
+
+
+
+
+
+
+
+ {row.original.requested_facility_amount / 1000000 >= 1000
+ ? t("UserInfoDialog.milyard", {
+ value: row.original.requested_facility_amount / 1000000000,
+ })
+ : t("UserInfoDialog.toman", {
+ value: row.original.requested_facility_amount / 1000000,
+ })}
+
+
+
+
+
+
+
+
+ {row.original.person_share / 1000000 >= 1000
+ ? t("UserInfoDialog.milyard", { value: row.original.person_share / 1000000000 })
+ : t("UserInfoDialog.toman", { value: row.original.person_share / 1000000 })}
+
+
+
+
+
+
+
+
+
+
+ {row.original.user_committed_employment || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.user_existing_employment || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+
+ {row.original.plate_number.split("-")[3] || t("UserInfoDialog.no_info")}
+
+
+
+ {row.original.plate_number.split("-")[2] || t("UserInfoDialog.no_info")}
+
+
+ {row.original.plate_number.split("-")[1] || t("UserInfoDialog.no_info")}
+
+
+ {row.original.plate_number.split("-")[0] || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+
+
+ {row.original.address || t("UserInfoDialog.no_info")}
+
+
+
+
+
+ >
+ );
+};
+export default LegalTableContent;
diff --git a/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/RealTableContent.jsx b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/RealTableContent.jsx
new file mode 100644
index 0000000..34e4223
--- /dev/null
+++ b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/RealTableContent.jsx
@@ -0,0 +1,353 @@
+import { Chip, DialogContent, DialogTitle, Divider, Grid, Stack, Typography } from "@mui/material";
+import { useTranslations } from "next-intl";
+import moment from "jalali-moment";
+
+const RealTableContent = ({ rowId, row }) => {
+ const t = useTranslations();
+ return (
+ <>
+ {t("UserInfoDialog.user_info")}
+
+
+
+
+
+
+ {t("UserInfoDialog.real_person")}
+
+
+
+
+
+
+ {row.original.id || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+ {row.original.project_title || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.activity_category_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.first_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.last_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.national_id || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.national_serial_number ||
+ row.original.national_tracking_code ||
+ t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.education_title || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.occupation_title || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.phone_number || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.telephone_number || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.birthday
+ ? moment(row.original.birthday).locale("fa").format("YYYY/MM/DD")
+ : t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.postal_code || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.father_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.gender ? t("UserInfoDialog.female") : t("UserInfoDialog.male")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.province_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+ {row.original.city_name}
+
+
+
+
+
+
+
+
+
+ {row.original.navgan_id || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.navgan_type || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.user_committed_employment || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.user_existing_employment || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.vehicle_type || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.investment_amount / 1000000 >= 1000
+ ? t("UserInfoDialog.milyard", {
+ value: row.original.investment_amount / 1000000000,
+ })
+ : t("UserInfoDialog.toman", { value: row.original.investment_amount / 1000000 })}
+
+
+
+
+
+
+
+
+
+
+ {row.original.requested_facility_amount / 1000000 >= 1000
+ ? t("UserInfoDialog.milyard", {
+ value: row.original.requested_facility_amount / 1000000000,
+ })
+ : t("UserInfoDialog.toman", {
+ value: row.original.requested_facility_amount / 1000000,
+ })}
+
+
+
+
+
+
+
+
+ {row.original.person_share / 1000000 >= 1000
+ ? t("UserInfoDialog.milyard", { value: row.original.person_share / 1000000000 })
+ : t("UserInfoDialog.toman", { value: row.original.person_share / 1000000 })}
+
+
+
+
+
+
+
+
+
+
+
+ {row.original.plate_number.split("-")[3] || t("UserInfoDialog.no_info")}
+
+
+
+ {row.original.plate_number.split("-")[2] || t("UserInfoDialog.no_info")}
+
+
+ {row.original.plate_number.split("-")[1] || t("UserInfoDialog.no_info")}
+
+
+ {row.original.plate_number.split("-")[0] || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+
+
+ {row.original.address || t("UserInfoDialog.no_info")}
+
+
+
+
+
+ >
+ );
+};
+export default RealTableContent;
diff --git a/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/RestoreTableUserInfo.jsx b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/RestoreTableUserInfo.jsx
new file mode 100644
index 0000000..7263105
--- /dev/null
+++ b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/RestoreTableUserInfo.jsx
@@ -0,0 +1,70 @@
+import { Button, Chip, Divider, Grid, Link, Stack, Typography } from "@mui/material";
+import DownloadIcon from "@mui/icons-material/Download";
+import { useTranslations } from "next-intl";
+
+const RestoreTableUserInfo = ({row}) => {
+ const t = useTranslations();
+ return(
+ <>
+
+
+
+
+
+
+ {row.original.exploitation_date || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.exploitation_license_renewal_date || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+ }>
+
+ {t("UserInfoDialog.download_image")}
+
+
+
+
+
+
+
+
+ }>
+
+ {t("UserInfoDialog.download_image")}
+
+
+
+
+
+ >
+ )
+}
+export default RestoreTableUserInfo
\ No newline at end of file
diff --git a/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/index.jsx b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/index.jsx
new file mode 100644
index 0000000..aa67e15
--- /dev/null
+++ b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/index.jsx
@@ -0,0 +1,47 @@
+import { Button, Dialog, DialogActions, IconButton, Tooltip } from "@mui/material";
+import { useTranslations } from "next-intl";
+import { useState } from "react";
+import ContactPageIcon from "@mui/icons-material/ContactPage";
+import LegalTableContent from "./LegalTableContent";
+import RealTableContent from "./RealTableContent";
+const UserInfoForm = ({ rowId, row }) => {
+ const t = useTranslations();
+ const [openUserInfoDialog, setOpenUserInfoDialog] = useState(false);
+ return (
+ <>
+
+ {
+ setOpenUserInfoDialog(true);
+ }}
+ >
+
+
+
+
+ >
+ );
+};
+export default UserInfoForm;
diff --git a/src/components/dashboard/refahi/refahi-province-manager/build/TableRowActions.jsx b/src/components/dashboard/refahi/refahi-province-manager/build/TableRowActions.jsx
new file mode 100644
index 0000000..9d6aee0
--- /dev/null
+++ b/src/components/dashboard/refahi/refahi-province-manager/build/TableRowActions.jsx
@@ -0,0 +1,18 @@
+import { Box } from "@mui/material";
+import UserInfoForm from "../Form/UserInfoForm";
+import Confirm from "../Form/ConfirmForm";
+import Revert from "../Form/RevertForm";
+import Reject from "../Form/RejectForm";
+
+const TableRow = ({ row, mutate }) => {
+ return (
+
+
+
+
+
+
+ );
+};
+
+export default TableRow;
diff --git a/src/components/dashboard/refahi/refahi-province-manager/build/TableToolbar.jsx b/src/components/dashboard/refahi/refahi-province-manager/build/TableToolbar.jsx
new file mode 100644
index 0000000..56ce00e
--- /dev/null
+++ b/src/components/dashboard/refahi/refahi-province-manager/build/TableToolbar.jsx
@@ -0,0 +1,12 @@
+import { Stack } from "@mui/material";
+import PrintExcel from "../Buttons/printExcel";
+
+const TableToolbar = ({ table }) => {
+ return (
+
+ {/**/}
+
+ );
+};
+
+export default TableToolbar;
diff --git a/src/components/dashboard/refahi-province-manager/index.jsx b/src/components/dashboard/refahi/refahi-province-manager/build/index.jsx
similarity index 55%
rename from src/components/dashboard/refahi-province-manager/index.jsx
rename to src/components/dashboard/refahi/refahi-province-manager/build/index.jsx
index f49b26a..6fc9bad 100644
--- a/src/components/dashboard/refahi-province-manager/index.jsx
+++ b/src/components/dashboard/refahi/refahi-province-manager/build/index.jsx
@@ -1,21 +1,21 @@
import { Box, Typography } from "@mui/material";
import { useMemo } from "react";
-import { GET_REFAHI_PROVINCE_MANAGER } from "@/core/data/apiRoutes";
+import { GET_REFAHI_BUILD_PROVINCE_MANAGER } from "@/core/data/apiRoutes";
import { useTranslations } from "next-intl";
import TableRowActions from "./TableRowActions";
import moment from "jalali-moment";
import DataTable from "@/core/components/DataTable";
import MuiDatePicker from "@/core/components/MuiDatePicker";
+import TableToolbar from "./TableToolbar";
function DashboardRefahiProvinceManagerComponent() {
const t = useTranslations();
-
const columns = useMemo(
() => [
{
accessorFn: (row) => row.id,
id: "id",
- header: t("RefahiProvinceManager.id"),
+ header: t("NavganProvinceManager.id"),
enableColumnFilter: true,
datatype: "numeric",
filterFn: "equals",
@@ -23,9 +23,33 @@ function DashboardRefahiProvinceManagerComponent() {
Cell: ({ renderedCellValue }) => {renderedCellValue},
},
{
- accessorFn: (row) => row.name,
- id: "name",
- header: t("RefahiProvinceManager.name"),
+ accessorFn: (row) => row.is_legal_person,
+ id: "is_legal_person",
+ header: t("NavganProvinceManager.is_legal_person"),
+ enableColumnFilter: false,
+ datatype: "numeric",
+ filterFn: "equals",
+ columnFilterModeOptions: ["equals"],
+ Cell: ({ renderedCellValue }) => (
+
+ {renderedCellValue === 1 ? `${t("PassengerBoss.hoghoghi")}` : `${t("PassengerBoss.haghighi")}`}
+
+ ),
+ },
+ {
+ accessorFn: (row) => row.first_name,
+ id: "first_name",
+ header: t("NavganProvinceManager.first_name"),
+ enableColumnFilter: true,
+ datatype: "text",
+ filterFn: "contains",
+ columnFilterModeOptions: ["contains", "equals", "notEquals"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => row.last_name,
+ id: "last_name",
+ header: t("NavganProvinceManager.last_name"),
enableColumnFilter: true,
datatype: "text",
filterFn: "contains",
@@ -35,7 +59,7 @@ function DashboardRefahiProvinceManagerComponent() {
{
accessorFn: (row) => row.national_id,
id: "national_id",
- header: t("RefahiProvinceManager.national_id"),
+ header: t("NavganProvinceManager.national_id"),
enableColumnFilter: true,
datatype: "numeric",
filterFn: "equals",
@@ -43,19 +67,39 @@ function DashboardRefahiProvinceManagerComponent() {
Cell: ({ renderedCellValue }) => {renderedCellValue},
},
{
- accessorFn: (row) => row.phone_number,
- id: "phone_number",
- header: t("RefahiProvinceManager.phone_number"),
+ accessorFn: (row) => row.shenase_meli,
+ id: "shenase_meli",
+ header: t("NavganProvinceManager.shenase_meli"),
enableColumnFilter: true,
datatype: "numeric",
filterFn: "equals",
columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"],
Cell: ({ renderedCellValue }) => {renderedCellValue},
},
+ {
+ accessorFn: (row) => row.province_name,
+ id: "province_name",
+ header: t("NavganProvinceManager.province_name"),
+ enableColumnFilter: true,
+ datatype: "text",
+ filterFn: "contains",
+ columnFilterModeOptions: ["contains", "equals", "notEquals"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => row.city_name,
+ id: "city_name",
+ header: t("NavganProvinceManager.city_name"),
+ enableColumnFilter: true,
+ datatype: "text",
+ filterFn: "contains",
+ columnFilterModeOptions: ["contains", "equals", "notEquals"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
{
accessorFn: (row) => moment(row.created_at).locale("fa").format("HH:mm | yyyy/MM/DD"),
id: "created_at",
- header: t("RefahiProvinceManager.created_at"),
+ header: t("NavganProvinceManager.created_at"),
enableColumnFilter: true,
datatype: "date",
filterFn: "lessThan",
@@ -69,17 +113,19 @@ function DashboardRefahiProvinceManagerComponent() {
},
},
{
- accessorFn: (row) => moment(row.updated_at).locale("fa").format("HH:mm | YYYY/MM/DD"),
- id: "updated_at",
- header: t("RefahiProvinceManager.updated_at"),
- enableColumnFilter: false,
+ accessorFn: (row) => row.phone_number,
+ id: "phone_number",
+ header: t("NavganProvinceManager.phone_number"),
+ enableColumnFilter: true,
datatype: "numeric",
+ filterFn: "equals",
+ columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"],
Cell: ({ renderedCellValue }) => {renderedCellValue},
},
{
accessorFn: (row) => row.state_name,
id: "state_id",
- header: t("RefahiProvinceManager.state_name"),
+ header: t("NavganProvinceManager.state_name"),
enableColumnFilter: false,
datatype: "numeric",
Cell: ({ renderedCellValue }) => {renderedCellValue},
@@ -87,29 +133,23 @@ function DashboardRefahiProvinceManagerComponent() {
],
[]
);
-
return (
diff --git a/src/components/dashboard/refahi/refahi-province-manager/restore/TableRowActions.jsx b/src/components/dashboard/refahi/refahi-province-manager/restore/TableRowActions.jsx
new file mode 100644
index 0000000..9d6aee0
--- /dev/null
+++ b/src/components/dashboard/refahi/refahi-province-manager/restore/TableRowActions.jsx
@@ -0,0 +1,18 @@
+import { Box } from "@mui/material";
+import UserInfoForm from "../Form/UserInfoForm";
+import Confirm from "../Form/ConfirmForm";
+import Revert from "../Form/RevertForm";
+import Reject from "../Form/RejectForm";
+
+const TableRow = ({ row, mutate }) => {
+ return (
+
+
+
+
+
+
+ );
+};
+
+export default TableRow;
diff --git a/src/components/dashboard/refahi/refahi-province-manager/restore/TableToolbar.jsx b/src/components/dashboard/refahi/refahi-province-manager/restore/TableToolbar.jsx
new file mode 100644
index 0000000..56ce00e
--- /dev/null
+++ b/src/components/dashboard/refahi/refahi-province-manager/restore/TableToolbar.jsx
@@ -0,0 +1,12 @@
+import { Stack } from "@mui/material";
+import PrintExcel from "../Buttons/printExcel";
+
+const TableToolbar = ({ table }) => {
+ return (
+
+ {/**/}
+
+ );
+};
+
+export default TableToolbar;
diff --git a/src/components/dashboard/refahi/refahi-province-manager/restore/index.jsx b/src/components/dashboard/refahi/refahi-province-manager/restore/index.jsx
new file mode 100644
index 0000000..e3fe6cf
--- /dev/null
+++ b/src/components/dashboard/refahi/refahi-province-manager/restore/index.jsx
@@ -0,0 +1,172 @@
+import { Box ,Typography } from "@mui/material";
+import { useMemo } from "react";
+import {
+ GET_REFAHI_RESTORE_PROVINCE_MANAGER
+} from "@/core/data/apiRoutes";
+import { useTranslations } from "next-intl";
+import TableRowActions from "./TableRowActions";
+import moment from "jalali-moment";
+import DataTable from "@/core/components/DataTable";
+import MuiDatePicker from "@/core/components/MuiDatePicker";
+import TableToolbar from "./TableToolbar";
+
+function DashboardRefahiProvinceManagerComponent() {
+ const t = useTranslations();
+ const columns = useMemo(
+ () => [
+ {
+ accessorFn: (row) => row.id,
+ id: "id",
+ header: t("NavganProvinceManager.id"),
+ enableColumnFilter: true,
+ datatype: "numeric",
+ filterFn: "equals",
+ columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => row.project_title,
+ id: "project_title",
+ header: t("NavganProvinceManager.project_title"),
+ enableColumnFilter: false,
+ datatype: "text",
+ filterFn: "equals",
+ columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => row.is_legal_person,
+ id: "is_legal_person",
+ header: t("NavganProvinceManager.is_legal_person"),
+ enableColumnFilter: false,
+ datatype: "numeric",
+ filterFn: "equals",
+ columnFilterModeOptions: ["equals"],
+ Cell: ({ renderedCellValue }) => (
+
+ {renderedCellValue === 1 ? `${t("PassengerBoss.hoghoghi")}` : `${t("PassengerBoss.haghighi")}`}
+
+ ),
+ },
+ {
+ accessorFn: (row) => row.first_name,
+ id: "first_name",
+ header: t("NavganProvinceManager.first_name"),
+ enableColumnFilter: true,
+ datatype: "text",
+ filterFn: "contains",
+ columnFilterModeOptions: ["contains", "equals", "notEquals"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => row.last_name,
+ id: "last_name",
+ header: t("NavganProvinceManager.last_name"),
+ enableColumnFilter: true,
+ datatype: "text",
+ filterFn: "contains",
+ columnFilterModeOptions: ["contains", "equals", "notEquals"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => row.national_id,
+ id: "national_id",
+ header: t("NavganProvinceManager.national_id"),
+ enableColumnFilter: true,
+ datatype: "numeric",
+ filterFn: "equals",
+ columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => row.shenase_meli,
+ id: "shenase_meli",
+ header: t("NavganProvinceManager.shenase_meli"),
+ enableColumnFilter: true,
+ datatype: "numeric",
+ filterFn: "equals",
+ columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => row.province_name,
+ id: "province_name",
+ header: t("NavganProvinceManager.province_name"),
+ enableColumnFilter: true,
+ datatype: "text",
+ filterFn: "contains",
+ columnFilterModeOptions: ["contains", "equals", "notEquals"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => row.city_name,
+ id: "city_name",
+ header: t("NavganProvinceManager.city_name"),
+ enableColumnFilter: true,
+ datatype: "text",
+ filterFn: "contains",
+ columnFilterModeOptions: ["contains", "equals", "notEquals"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => moment(row.created_at).locale("fa").format("HH:mm | yyyy/MM/DD"),
+ id: "created_at",
+ header: t("NavganProvinceManager.created_at"),
+ enableColumnFilter: true,
+ datatype: "date",
+ filterFn: "lessThan",
+ columnFilterModeOptions: ["lessThan", "greaterThan"],
+ Cell: ({ renderedCellValue }) => {
+ return {renderedCellValue};
+ },
+ Header: ({ column }) => <>{column.columnDef.header}>,
+ Filter: ({ column }) => {
+ return ;
+ },
+ },
+ {
+ accessorFn: (row) => row.phone_number,
+ id: "phone_number",
+ header: t("NavganProvinceManager.phone_number"),
+ enableColumnFilter: true,
+ datatype: "numeric",
+ filterFn: "equals",
+ columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => row.state_name,
+ id: "state_id",
+ header: t("NavganProvinceManager.state_name"),
+ enableColumnFilter: false,
+ datatype: "numeric",
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ ],
+ []
+ );
+ return (
+
+
+
+ );
+}
+
+export default DashboardRefahiProvinceManagerComponent;
diff --git a/src/components/dashboard/refahi/transportation-assistance/Buttons/printExcel.jsx b/src/components/dashboard/refahi/transportation-assistance/Buttons/printExcel.jsx
new file mode 100644
index 0000000..52a81c4
--- /dev/null
+++ b/src/components/dashboard/refahi/transportation-assistance/Buttons/printExcel.jsx
@@ -0,0 +1,69 @@
+import { Button, CircularProgress } from "@mui/material";
+import { useTranslations } from "next-intl";
+import { useMemo, useState } from "react";
+import useRequest from "@/lib/app/hooks/useRequest";
+import { EXPORT_REFAHI_PASSENGER_BOSS } 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_REFAHI_PASSENGER_BOSS}?${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 (
+ : }
+ onClick={clickHandler}
+ >
+ {t("PassengerBoss.excel_report")}
+
+ );
+};
+
+export default PrintExcel;
diff --git a/src/components/dashboard/refahi/transportation-assistance/Form/ConfirmForm/ConfirmContent.jsx b/src/components/dashboard/refahi/transportation-assistance/Form/ConfirmForm/ConfirmContent.jsx
new file mode 100644
index 0000000..9c21720
--- /dev/null
+++ b/src/components/dashboard/refahi/transportation-assistance/Form/ConfirmForm/ConfirmContent.jsx
@@ -0,0 +1,370 @@
+import UploadSystem from "@/core/components/UploadSystem";
+import useNotification from "@/lib/app/hooks/useNotification";
+import useRequest from "@/lib/app/hooks/useRequest";
+import {
+ Box,
+ Button,
+ Checkbox,
+ DialogActions,
+ DialogContent,
+ FormControlLabel,
+ FormHelperText,
+ Grid,
+ LinearProgress,
+ Stack,
+ TextField,
+ Typography,
+} from "@mui/material";
+import { useFormik } from "formik";
+import { useTranslations } from "next-intl";
+import {
+ CONFIRM_REFAHI_TRANSPORTATION_ASSISTANCE,
+ GET_REFAHI_TRANSPORTATION_ASSISTANCE_DETAILS
+} from "@/core/data/apiRoutes";
+import { useEffect, useState } from "react";
+import * as Yup from "yup";
+import CustomAccordion from "@/core/components/CustomAccordion";
+import ImageContent from "@/core/components/ImageContent";
+import NumberShowBox from "@/core/components/NumberShowBox";
+
+const ConfirmContent = ({ rowId, row, mutate, setOpenConfirmDialog, handleSizeChangeClick }) => {
+ const t = useTranslations();
+ const [selectedImage, setSelectedImage] = useState("");
+ const [fileType, setfileType] = useState(null);
+ const [fileName, setfileName] = useState(null);
+ const [showAddIcon, setShowAddIcon] = useState(true);
+ const requestServer = useRequest({ auth: true, notification: false });
+ const [attachmentsData, setAttachmentsData] = useState([]);
+ const [accordionStates, setAccordionStates] = useState([]);
+ const [hasAccordionOpened, setHasAccordionOpened] = useState([]);
+ const { update_notification } = useNotification();
+ const [hasImageShown, setHasImageShown] = useState(false);
+ const [imageLink, setImageLink] = useState(null);
+ const [detailsList, setDetailsData] = useState(null);
+ const [loading, setLoading] = useState(true);
+ const [isSkeleton, setIsSkeleton] = useState(false);
+ const [checked, setChecked] = useState(false);
+
+ useEffect(() => {
+ requestServer(`${GET_REFAHI_TRANSPORTATION_ASSISTANCE_DETAILS}/${rowId}`, "get")
+ .then((response) => {
+ if (response.data.data.latest_histories.length !== 0) {
+ let latest_attachments = [];
+ let attachments = [];
+ response.data.data.latest_histories.map((allAttachment) => {
+ if (allAttachment.previous_state_id !== 4) return;
+ if (!latest_attachments.includes(allAttachment.previous_state_id)) {
+ attachments = [...attachments, ...allAttachment.attachments];
+ latest_attachments.push(allAttachment.previous_state_id);
+ }
+ });
+ setDetailsData(response.data);
+ setAttachmentsData(attachments);
+ }
+ })
+ .catch(() => {})
+ .finally(() => {
+ setLoading(false);
+ });
+ }, []);
+
+ useEffect(() => {
+ if (attachmentsData.length !== 0) {
+ const booleanData = Array.from({ length: attachmentsData.length }, () => false);
+ setAccordionStates(booleanData);
+ setHasAccordionOpened(booleanData);
+ }
+ }, [attachmentsData]);
+
+ const handleAccordionChange = (index) => {
+ const newAccordionStates = accordionStates.map((state, i) => (i === index ? !state : false));
+ setAccordionStates(newAccordionStates);
+
+ if (!newAccordionStates[index]) {
+ handleSizeChangeClick("sm");
+ setHasImageShown(false);
+ setIsSkeleton(false);
+ } else {
+ handleSizeChangeClick("xl");
+ setHasImageShown(true);
+ setImageLink(attachmentsData[index]);
+ setIsSkeleton(true);
+ const newHasAccordionOpened = [...hasAccordionOpened];
+ newHasAccordionOpened[index] = true;
+ setHasAccordionOpened(newHasAccordionOpened);
+ }
+ };
+
+ const validationSchema = Yup.object().shape({
+ confirm_img: Yup.mixed()
+ .notRequired(t("ConfirmDialog.approved_amount_error"))
+ .test("fileSize", `${t("TransportationAssistance.upload_file_unit")}`, (value) => {
+ if (!value) return true;
+ return value.size <= 5 * 1024 * 1024;
+ })
+ .test("fileType", `${t("TransportationAssistance.upload_file_format")}`, (value) => {
+ if (!value) return true;
+ const allowedTypes = ["image/jpg", "image/jpeg", "image/png", "application/pdf"];
+ return allowedTypes.includes(value.type);
+ }),
+ });
+
+ const formik = useFormik({
+ initialValues: {
+ description: "",
+ confirm_img: null,
+ },
+ validationSchema,
+ onSubmit: (values, { setSubmitting }) => {
+ const formData = new FormData();
+ if (values.description !== "") formData.append("expert_description", values.description);
+ if (values.confirm_img != null) {
+ const attachments = [
+ {
+ title: "فایل ضمیمه کارتابل بررسی وام های تبصره 18",
+ file: values.confirm_img,
+ },
+ ];
+ attachments.forEach((attachment, index) => {
+ formData.append(`attachment[${index}][title]`, attachment.title);
+ formData.append(`attachment[${index}][file]`, attachment.file);
+ });
+ }
+ requestServer(`${CONFIRM_REFAHI_TRANSPORTATION_ASSISTANCE}/${rowId}`, "post", {
+ data: formData,
+ notification: true,
+ })
+ .then((response) => {
+ setOpenConfirmDialog(false);
+ mutate();
+ update_notification();
+ })
+ .catch(() => {})
+ .finally(() => {
+ setSubmitting(false);
+ });
+ },
+ });
+
+ const handleDescriptionChange = (event) => {
+ formik.setFieldValue("description", event.target.value);
+ };
+
+ const handleUploadChange = (event) => {
+ const uploadedFile = event.target?.files?.[0];
+ if (uploadedFile) {
+ const fileType = event.target?.files?.[0].type;
+ const fileName = event.target?.files?.[0].name;
+ setSelectedImage(URL.createObjectURL(uploadedFile));
+ setfileType(fileType);
+ setfileName(fileName);
+ formik.setFieldValue("confirm_img", uploadedFile).then(() => {
+ formik.setFieldTouched("confirm_img", true);
+ });
+ setShowAddIcon(false);
+ }
+ };
+ const handleCheckboxChange = (event) => {
+ setChecked(event.target.checked);
+ };
+
+ const renderCustomAccordions = () => {
+ if (attachmentsData) {
+ return attachmentsData.map((file, index) => (
+ handleAccordionChange(index)}
+ accordionIndex={index}
+ downloadFile={file.file}
+ />
+ ));
+ }
+ return null;
+ };
+ return (
+ <>
+
+
+
+ {loading ? (
+
+ ) : (
+ <>
+ = 1000
+ ? detailsList?.data?.approved_amount / 1000000000
+ : detailsList?.data?.approved_amount / 1000000
+ }
+ headerTitle={t("ConfirmDialog.approved_amount_title")}
+ unitTitle={
+ detailsList?.data?.approved_amount / 1000000 >= 1000
+ ? t("ConfirmDialog.milyard")
+ : t("ConfirmDialog.unit")
+ }
+ />
+ = 1000
+ ? detailsList?.data?.facility_bank / 1000000000
+ : detailsList?.data?.facility_bank / 1000000
+ }
+ headerTitle={t("ConfirmDialog.facility_bank_title")}
+ unitTitle={
+ detailsList?.data?.facility_bank / 1000000 >= 1000
+ ? t("ConfirmDialog.milyard")
+ : t("ConfirmDialog.unit")
+ }
+ />
+ = 1000
+ ? detailsList?.data?.facility_gov / 1000000000
+ : detailsList?.data?.facility_gov / 1000000
+ }
+ headerTitle={t("ConfirmDialog.facility_gov_title")}
+ unitTitle={
+ detailsList?.data?.facility_gov / 1000000 >= 1000
+ ? t("ConfirmDialog.milyard")
+ : t("ConfirmDialog.unit")
+ }
+ />
+ = 1000
+ ? detailsList?.data?.facility_person / 1000000000
+ : detailsList?.data?.facility_person / 1000000
+ }
+ headerTitle={t("ConfirmDialog.facility_person_title")}
+ unitTitle={
+ detailsList?.data?.facility_person / 1000000 >= 1000
+ ? t("ConfirmDialog.milyard")
+ : t("ConfirmDialog.unit")
+ }
+ />
+
+
+
+
+
+ {t("ConfirmDialog.confirmation_reason")}
+
+
+ {row.original.confirmation_reason
+ ? row.original.confirmation_reason
+ : t("ConfirmDialog.no_info")}
+
+
+ {renderCustomAccordions()}
+ >
+ )}
+
+
+
+ {t("ConfirmDialog.description")}
+ {t("ConfirmDialog.optional")}
+ >
+ }
+ value={formik.values.description}
+ onChange={handleDescriptionChange}
+ fullWidth
+ variant="outlined"
+ sx={{ mt: 1 }}
+ />
+
+
+
+ {t("UploadSystem.upload_file")}
+ {t("UploadSystem.optional")}
+
+ formik.handleBlur("confirm_img")}
+ error={formik.touched.confirm_img && Boolean(formik.errors.confirm_img)}
+ />
+
+ {formik.touched.confirm_img && formik.errors.confirm_img}
+
+
+
+
+ }
+ label={t("TransportationAssistance.confirm_text")}
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+};
+export default ConfirmContent;
diff --git a/src/components/dashboard/commercial-chief/Form/ConfirmForm/index.jsx b/src/components/dashboard/refahi/transportation-assistance/Form/ConfirmForm/index.jsx
similarity index 52%
rename from src/components/dashboard/commercial-chief/Form/ConfirmForm/index.jsx
rename to src/components/dashboard/refahi/transportation-assistance/Form/ConfirmForm/index.jsx
index e849196..e0ec294 100644
--- a/src/components/dashboard/commercial-chief/Form/ConfirmForm/index.jsx
+++ b/src/components/dashboard/refahi/transportation-assistance/Form/ConfirmForm/index.jsx
@@ -1,12 +1,23 @@
import { Dialog, DialogTitle, IconButton, Tooltip } from "@mui/material";
import { useTranslations } from "next-intl";
-import ThumbUpAltIcon from "@mui/icons-material/ThumbUpAlt";
-import { useState } from "react";
+import { useState, useEffect } from "react";
import ConfirmContent from "./ConfirmContent";
-
-const Confirm = ({ rowId, mutate }) => {
+import CallMadeIcon from "@mui/icons-material/CallMade";
+const Confirm = ({ rowId, mutate, row }) => {
const t = useTranslations();
const [openConfirmDialog, setOpenConfirmDialog] = useState(false);
+ const [dialogSize, setDialogSize] = useState("sm");
+
+ useEffect(() => {
+ if (!openConfirmDialog) {
+ setDialogSize("sm");
+ }
+ }, [openConfirmDialog]);
+
+ const handleSizeChangeClick = (size) => {
+ setDialogSize(size);
+ };
+
return (
<>
@@ -16,7 +27,7 @@ const Confirm = ({ rowId, mutate }) => {
setOpenConfirmDialog(true);
}}
>
-
+
>
);
diff --git a/src/components/dashboard/refahi/transportation-assistance/Form/ReferReason/HistoryContent.jsx b/src/components/dashboard/refahi/transportation-assistance/Form/ReferReason/HistoryContent.jsx
new file mode 100644
index 0000000..bd8c5ef
--- /dev/null
+++ b/src/components/dashboard/refahi/transportation-assistance/Form/ReferReason/HistoryContent.jsx
@@ -0,0 +1,19 @@
+import { Button, DialogActions, DialogContent } from "@mui/material";
+import { useTranslations } from "next-intl";
+import TableContent from "./TableContent";
+const HistoryContent = ({ setOpenReferReasonDialog, row }) => {
+ const t = useTranslations();
+ return (
+ <>
+
+
+
+
+
+
+ >
+ );
+};
+export default HistoryContent;
diff --git a/src/components/dashboard/refahi/transportation-assistance/Form/ReferReason/TableContent.jsx b/src/components/dashboard/refahi/transportation-assistance/Form/ReferReason/TableContent.jsx
new file mode 100644
index 0000000..b4c6bf6
--- /dev/null
+++ b/src/components/dashboard/refahi/transportation-assistance/Form/ReferReason/TableContent.jsx
@@ -0,0 +1,34 @@
+import { Box, Table, TableBody, TableCell, TableContainer, TableHead, TableRow } from "@mui/material";
+import { useTranslations } from "next-intl";
+import moment from "jalali-moment";
+
+const TableContent = ({ row }) => {
+ const t = useTranslations();
+ return (
+
+
+
+
+
+ {t("LoanHistory.Table_head_date")}
+ {t("LoanHistory.Table_head_state")}
+ {t("LoanHistory.Table_head_refer_reason")}
+
+
+
+
+
+ {moment(row.original.latest_history?.created_at)
+ .locale("fa")
+ .format("HH:mm | yyyy/MM/DD")}
+
+ {row.original.latest_history?.previous_state_name}
+ {row.original.latest_history?.expert_description}
+
+
+
+
+
+ );
+};
+export default TableContent;
diff --git a/src/components/dashboard/refahi/transportation-assistance/Form/ReferReason/index.jsx b/src/components/dashboard/refahi/transportation-assistance/Form/ReferReason/index.jsx
new file mode 100644
index 0000000..5b46003
--- /dev/null
+++ b/src/components/dashboard/refahi/transportation-assistance/Form/ReferReason/index.jsx
@@ -0,0 +1,33 @@
+import { Dialog, DialogTitle, IconButton, Tooltip } from "@mui/material";
+import { useTranslations } from "next-intl";
+import { useState } from "react";
+import RestorePageIcon from "@mui/icons-material/RestorePage";
+import HistoryContent from "./HistoryContent";
+
+const ReferReason = ({ row }) => {
+ const t = useTranslations();
+ const [openReferReasonDialog, setOpenReferReasonDialog] = useState(false);
+ return (
+ <>
+
+ setOpenReferReasonDialog(true)}>
+
+
+
+
+ >
+ );
+};
+export default ReferReason;
diff --git a/src/components/dashboard/inspector-expert/Form/RejectForm/RejectContent.jsx b/src/components/dashboard/refahi/transportation-assistance/Form/RejectForm/RejectContent.jsx
similarity index 63%
rename from src/components/dashboard/inspector-expert/Form/RejectForm/RejectContent.jsx
rename to src/components/dashboard/refahi/transportation-assistance/Form/RejectForm/RejectContent.jsx
index 2bcc40a..c7d3a8b 100644
--- a/src/components/dashboard/inspector-expert/Form/RejectForm/RejectContent.jsx
+++ b/src/components/dashboard/refahi/transportation-assistance/Form/RejectForm/RejectContent.jsx
@@ -1,17 +1,26 @@
import UploadSystem from "@/core/components/UploadSystem";
import useNotification from "@/lib/app/hooks/useNotification";
import useRequest from "@/lib/app/hooks/useRequest";
-import { Button, DialogActions, DialogContent, Stack, TextField, Typography } from "@mui/material";
+import {
+ Button,
+ DialogActions,
+ DialogContent,
+ FormHelperText,
+ Grid,
+ Stack,
+ TextField,
+ Typography,
+} from "@mui/material";
import { useFormik } from "formik";
import { useTranslations } from "next-intl";
import { useState } from "react";
import * as Yup from "yup";
-import { REJECT_INSPECTOR_EXPERT } from "@/core/data/apiRoutes";
+import { REJECT_REFAHI_TRANSPORTATION_ASSISTANCE } from "@/core/data/apiRoutes";
const RejectContent = ({ rowId, mutate, setOpenRejectDialog }) => {
const [selectedImage, setSelectedImage] = useState("");
- const [fileType, setfileType] = useState(null);
- const [fileName, setfileName] = useState(null);
+ const [fileType, setFileType] = useState(null);
+ const [fileName, setFileName] = useState(null);
const [showAddIcon, setShowAddIcon] = useState(true);
const t = useTranslations();
const requestServer = useRequest({ auth: true });
@@ -19,20 +28,42 @@ const RejectContent = ({ rowId, mutate, setOpenRejectDialog }) => {
const validationSchema = Yup.object().shape({
description: Yup.string().required(t("RejectDialog.description_error")),
+ confirm_img: Yup.mixed()
+ .notRequired(t("ConfirmDialog.approved_amount_error"))
+ .test("fileSize", `${t("PassengerBoss.upload_file_unit")}`, (value) => {
+ if (!value) return true;
+ return value.size <= 5 * 1024 * 1024;
+ })
+ .test("fileType", `${t("PassengerBoss.upload_file_format")}`, (value) => {
+ if (!value) return true;
+ const allowedTypes = ["image/jpg", "image/jpeg", "image/png", "application/pdf"];
+ return allowedTypes.includes(value.type);
+ }),
});
const formik = useFormik({
initialValues: {
description: "",
- reject_img: null,
+ confirm_img: null,
},
validationSchema,
onSubmit: (values, { setSubmitting }) => {
const formData = new FormData();
- formData.append("description", values.description);
- if (values.reject_img != null) formData.append("attachment", values.reject_img);
+ formData.append("expert_description", values.description);
+ if (values.confirm_img != null) {
+ const attachments = [
+ {
+ title: "فایل ضمیمه کارتابل کارگروه",
+ file: values.confirm_img,
+ },
+ ];
+ attachments.forEach((attachment, index) => {
+ formData.append(`attachment[${index}][title]`, attachment.title);
+ formData.append(`attachment[${index}][file]`, attachment.file);
+ });
+ }
- requestServer(`${REJECT_INSPECTOR_EXPERT}/${rowId}`, "post", {
+ requestServer(`${REJECT_REFAHI_TRANSPORTATION_ASSISTANCE}/${rowId}`, "post", {
data: formData,
})
.then((response) => {
@@ -54,18 +85,14 @@ const RejectContent = ({ rowId, mutate, setOpenRejectDialog }) => {
const handleUploadChange = (event) => {
const uploadedFile = event.target?.files?.[0];
if (uploadedFile) {
- const maxFileSize = 2 * 1024 * 1024;
- if (uploadedFile.size > maxFileSize) {
- UploadFileNotification(t);
- event.target.value = "";
- return;
- }
const fileType = event.target?.files?.[0].type;
const fileName = event.target?.files?.[0].name;
setSelectedImage(URL.createObjectURL(uploadedFile));
- setfileType(fileType);
- setfileName(fileName);
- formik.setFieldValue("reject_img", uploadedFile);
+ setFileType(fileType);
+ setFileName(fileName);
+ formik.setFieldValue("confirm_img", uploadedFile).then(() => {
+ formik.setFieldTouched("confirm_img", true);
+ });
setShowAddIcon(false);
}
};
@@ -90,23 +117,25 @@ const RejectContent = ({ rowId, mutate, setOpenRejectDialog }) => {
/>
-
- {t("UploadSystem.upload_file")}
- {t("UploadSystem.optional")}
-
+ {t("PassengerBoss.upload_file")}
+
+ {formik.touched.confirm_img && formik.errors.confirm_img}
+
diff --git a/src/components/dashboard/province-head-expert/Form/RejectForm/index.jsx b/src/components/dashboard/refahi/transportation-assistance/Form/RejectForm/index.jsx
similarity index 100%
rename from src/components/dashboard/province-head-expert/Form/RejectForm/index.jsx
rename to src/components/dashboard/refahi/transportation-assistance/Form/RejectForm/index.jsx
diff --git a/src/components/dashboard/province-head-expert/Form/ReviseForm/ReviseContent.jsx b/src/components/dashboard/refahi/transportation-assistance/Form/RevertForm/RevertContent.jsx
similarity index 77%
rename from src/components/dashboard/province-head-expert/Form/ReviseForm/ReviseContent.jsx
rename to src/components/dashboard/refahi/transportation-assistance/Form/RevertForm/RevertContent.jsx
index b64ebf4..f3e3a27 100644
--- a/src/components/dashboard/province-head-expert/Form/ReviseForm/ReviseContent.jsx
+++ b/src/components/dashboard/refahi/transportation-assistance/Form/RevertForm/RevertContent.jsx
@@ -4,15 +4,15 @@ import { Button, DialogActions, DialogContent, Stack, TextField } from "@mui/mat
import { useFormik } from "formik";
import { useTranslations } from "next-intl";
import * as Yup from "yup";
-import { REVISE_PROVINCE_HEAD_EXPERT } from "@/core/data/apiRoutes";
+import { REFER_REFAHI_TRANSPORTATION_ASSISTANCE } from "@/core/data/apiRoutes";
-const ReviseContent = ({ rowId, mutate, setOpenReviseDialog }) => {
+const RevertContent = ({ rowId, mutate, setOpenRevertDialog }) => {
const t = useTranslations();
const requestServer = useRequest({ auth: true });
const { update_notification } = useNotification();
const validationSchema = Yup.object().shape({
- description: Yup.string().required(t("ReviseDialog.description_error")),
+ description: Yup.string().required(t("RevertDialog.description_error")),
});
const formik = useFormik({
@@ -21,14 +21,13 @@ const ReviseContent = ({ rowId, mutate, setOpenReviseDialog }) => {
},
validationSchema,
onSubmit: (values, { setSubmitting }) => {
- const formData = new FormData();
- formData.append("description", values.description);
-
- requestServer(`${REVISE_PROVINCE_HEAD_EXPERT}/${rowId}`, "post", {
- data: formData,
+ requestServer(`${REFER_REFAHI_TRANSPORTATION_ASSISTANCE}/${rowId}`, "post", {
+ data: {
+ expert_description: values.description,
+ },
})
- .then((response) => {
- setOpenReviseDialog(false);
+ .then(() => {
+ setOpenRevertDialog(false);
mutate();
update_notification();
})
@@ -52,7 +51,7 @@ const ReviseContent = ({ rowId, mutate, setOpenReviseDialog }) => {
name="description"
multiline
rows={8}
- label={t("ReviseDialog.description")}
+ label={t("RevertDialog.description")}
value={formik.values.description}
onChange={handleDescriptionChange}
onBlur={formik.handleBlur("description")}
@@ -67,13 +66,13 @@ const ReviseContent = ({ rowId, mutate, setOpenReviseDialog }) => {
>
);
};
-export default ReviseContent;
+export default RevertContent;
diff --git a/src/components/dashboard/transportation-assistance/Form/RejectForm/index.jsx b/src/components/dashboard/refahi/transportation-assistance/Form/RevertForm/index.jsx
similarity index 52%
rename from src/components/dashboard/transportation-assistance/Form/RejectForm/index.jsx
rename to src/components/dashboard/refahi/transportation-assistance/Form/RevertForm/index.jsx
index a04d0e1..21b84f8 100644
--- a/src/components/dashboard/transportation-assistance/Form/RejectForm/index.jsx
+++ b/src/components/dashboard/refahi/transportation-assistance/Form/RevertForm/index.jsx
@@ -1,32 +1,32 @@
import { Dialog, DialogTitle, IconButton, Tooltip } from "@mui/material";
import { useTranslations } from "next-intl";
import { useState } from "react";
-import RejectContent from "./RejectContent";
-import ThumbDownIcon from "@mui/icons-material/ThumbDown";
+import CallReceivedIcon from "@mui/icons-material/CallReceived";
+import RevertContent from "./RevertContent";
-const Reject = ({ rowId, mutate }) => {
+const Revert = ({ rowId, mutate }) => {
const t = useTranslations();
- const [openRejectDialog, setOpenRejectDialog] = useState(false);
+ const [openRevertDialog, setOpenRevertDialog] = useState(false);
return (
<>
-
- setOpenRejectDialog(true)}>
-
+
+ setOpenRevertDialog(true)}>
+
>
);
};
-export default Reject;
+export default Revert;
diff --git a/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/BuildTableUserInfo.jsx b/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/BuildTableUserInfo.jsx
new file mode 100644
index 0000000..80ef334
--- /dev/null
+++ b/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/BuildTableUserInfo.jsx
@@ -0,0 +1,79 @@
+import { Button, Chip, Divider, Grid, Link, Stack, Typography } from "@mui/material";
+import DownloadIcon from "@mui/icons-material/Download";
+import { useTranslations } from "next-intl";
+
+const BuildTableUserInfo = ({row}) => {
+ const t = useTranslations();
+ return(
+ <>
+
+
+
+
+
+
+ {row.original.project_physical_progress || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.basic_approval_number || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.basic_approval_renewal_date || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+ }>
+
+ {t("UserInfoDialog.download_image")}
+
+
+
+
+
+
+
+
+ }>
+
+ {t("UserInfoDialog.download_image")}
+
+
+
+
+
+ >
+ )
+}
+export default BuildTableUserInfo
\ No newline at end of file
diff --git a/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/LegalTableContent.jsx b/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/LegalTableContent.jsx
new file mode 100644
index 0000000..02f7e97
--- /dev/null
+++ b/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/LegalTableContent.jsx
@@ -0,0 +1,398 @@
+import {
+ Chip,
+ DialogContent,
+ DialogTitle,
+ Divider,
+ Grid,
+ Stack,
+ Typography
+} from "@mui/material";
+import { useTranslations } from "next-intl";
+import moment from "jalali-moment";
+import BuildTableUserInfo from "./BuildTableUserInfo";
+import RestoreTableUserInfo from "./RestoreTableUserInfo";
+
+const LegalTableContent = ({ rowId, row }) => {
+ const t = useTranslations();
+ return (
+ <>
+ {t("UserInfoDialog.user_info")}
+
+
+
+
+
+
+ {t("UserInfoDialog.legal_person")}
+
+
+
+
+
+
+ {row.original.id || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+ {row.original.activity_category_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.project_title || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.first_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.last_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.father_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.gender ? t("UserInfoDialog.female") : t("UserInfoDialog.male")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.national_id || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.national_serial_number ||
+ row.original.national_tracking_code ||
+ t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.education_title || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.occupation_title || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.phone_number || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.birthday
+ ? moment(row.original.birthday).locale("fa").format("YYYY/MM/DD")
+ : t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.province_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.city_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.shenase_meli || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.postal_code || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.company_register_date
+ ? moment(row.original.company_register_date).locale("fa").format("YYYY/MM/DD")
+ : t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.register_number || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.company_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.telephone_number || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.project_province_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+ {row.original.project_city_name}
+
+
+
+
+
+
+
+
+
+ {row.original.investment_amount / 1000000 >= 1000
+ ? t("UserInfoDialog.milyard", {
+ value: row.original.investment_amount / 1000000000,
+ })
+ : t("UserInfoDialog.toman", { value: row.original.investment_amount / 1000000 })}
+
+
+
+
+
+
+
+
+ {row.original.welfare_complex_degree || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.requested_facility_amount / 1000000 >= 1000
+ ? t("UserInfoDialog.milyard", {
+ value: row.original.requested_facility_amount / 1000000000,
+ })
+ : t("UserInfoDialog.toman", {
+ value: row.original.requested_facility_amount / 1000000,
+ })}
+
+
+
+
+
+
+
+
+ {row.original.person_share / 1000000 >= 1000
+ ? t("UserInfoDialog.milyard", { value: row.original.person_share / 1000000000 })
+ : t("UserInfoDialog.toman", { value: row.original.person_share / 1000000 })}
+
+
+
+
+
+
+
+
+
+
+ {row.original.user_committed_employment || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.user_existing_employment || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.project_axis || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.project_direction || t("UserInfoDialog.no_info")}
+
+
+
+
+ {row.original.refahi_type === 1 ? () : () }
+
+
+
+
+
+
+ {row.original.project_kilometer_marker || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.project_address || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.address || t("UserInfoDialog.no_info")}
+
+
+
+
+
+ >
+ );
+};
+export default LegalTableContent;
\ No newline at end of file
diff --git a/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/RealTableContent.jsx b/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/RealTableContent.jsx
new file mode 100644
index 0000000..20b3038
--- /dev/null
+++ b/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/RealTableContent.jsx
@@ -0,0 +1,347 @@
+import { Button, Chip, DialogContent, DialogTitle, Divider, Grid, Link, Stack, Typography } from "@mui/material";
+import { useTranslations } from "next-intl";
+import moment from "jalali-moment";
+import DownloadIcon from "@mui/icons-material/Download";
+import BuildTableUserInfo from "./BuildTableUserInfo";
+import RestoreTableUserInfo from "./RestoreTableUserInfo";
+
+const RealTableContent = ({ rowId, row }) => {
+ const t = useTranslations();
+ return (
+ <>
+ {t("UserInfoDialog.user_info")}
+
+
+
+
+
+
+ {t("UserInfoDialog.real_person")}
+
+
+
+
+
+
+ {row.original.id || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+ {row.original.activity_category_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.project_title || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.first_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.last_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.national_id || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.national_serial_number ||
+ row.original.national_tracking_code ||
+ t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.education_title || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.occupation_title || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.phone_number || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.telephone_number || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.birthday
+ ? moment(row.original.birthday).locale("fa").format("YYYY/MM/DD")
+ : t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.postal_code || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.father_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.gender ? t("UserInfoDialog.female") : t("UserInfoDialog.male")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.province_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+ {row.original.city_name}
+
+
+
+
+
+
+
+
+
+ {row.original.user_committed_employment || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.user_existing_employment || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.project_province_name || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+ {row.original.project_city_name}
+
+
+
+
+
+
+
+
+
+ {row.original.investment_amount / 1000000 >= 1000
+ ? t("UserInfoDialog.milyard", {
+ value: row.original.investment_amount / 1000000000,
+ })
+ : t("UserInfoDialog.toman", { value: row.original.investment_amount / 1000000 })}
+
+
+
+
+
+
+
+
+ {row.original.welfare_complex_degree || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.requested_facility_amount / 1000000 >= 1000
+ ? t("UserInfoDialog.milyard", {
+ value: row.original.requested_facility_amount / 1000000000,
+ })
+ : t("UserInfoDialog.toman", {
+ value: row.original.requested_facility_amount / 1000000,
+ })}
+
+
+
+
+
+
+
+
+ {row.original.person_share / 1000000 >= 1000
+ ? t("UserInfoDialog.milyard", { value: row.original.person_share / 1000000000 })
+ : t("UserInfoDialog.toman", { value: row.original.person_share / 1000000 })}
+
+
+
+
+
+
+
+
+
+
+ {row.original.project_axis || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.project_direction || t("UserInfoDialog.no_info")}
+
+
+
+
+ {row.original.refahi_type === 1 ? () : () }
+
+
+
+
+
+
+ {row.original.project_kilometer_marker || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.project_address || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+
+ {row.original.address || t("UserInfoDialog.no_info")}
+
+
+
+
+
+ >
+ );
+};
+export default RealTableContent;
\ No newline at end of file
diff --git a/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/RestoreTableUserInfo.jsx b/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/RestoreTableUserInfo.jsx
new file mode 100644
index 0000000..7263105
--- /dev/null
+++ b/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/RestoreTableUserInfo.jsx
@@ -0,0 +1,70 @@
+import { Button, Chip, Divider, Grid, Link, Stack, Typography } from "@mui/material";
+import DownloadIcon from "@mui/icons-material/Download";
+import { useTranslations } from "next-intl";
+
+const RestoreTableUserInfo = ({row}) => {
+ const t = useTranslations();
+ return(
+ <>
+
+
+
+
+
+
+ {row.original.exploitation_date || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+ {row.original.exploitation_license_renewal_date || t("UserInfoDialog.no_info")}
+
+
+
+
+
+
+
+
+
+ }>
+
+ {t("UserInfoDialog.download_image")}
+
+
+
+
+
+
+
+
+ }>
+
+ {t("UserInfoDialog.download_image")}
+
+
+
+
+
+ >
+ )
+}
+export default RestoreTableUserInfo
\ No newline at end of file
diff --git a/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/index.jsx b/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/index.jsx
new file mode 100644
index 0000000..90de161
--- /dev/null
+++ b/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/index.jsx
@@ -0,0 +1,50 @@
+import { Button, Dialog, DialogActions, IconButton, Tooltip } from "@mui/material";
+import { useTranslations } from "next-intl";
+import { useState } from "react";
+import ContactPageIcon from "@mui/icons-material/ContactPage";
+import LegalTableContent from "./LegalTableContent";
+import RealTableContent from "./RealTableContent";
+const UserInfoForm = ({ rowId, row }) => {
+ const t = useTranslations();
+ const [openUserInfoDialog, setOpenUserInfoDialog] = useState(false);
+ return (
+ <>
+
+ {
+ setOpenUserInfoDialog(true);
+ }}
+ >
+
+
+
+
+ >
+ );
+};
+export default UserInfoForm;
diff --git a/src/components/dashboard/refahi/transportation-assistance/build/TableRowActions.jsx b/src/components/dashboard/refahi/transportation-assistance/build/TableRowActions.jsx
new file mode 100644
index 0000000..b32bc5e
--- /dev/null
+++ b/src/components/dashboard/refahi/transportation-assistance/build/TableRowActions.jsx
@@ -0,0 +1,20 @@
+import { Box } from "@mui/material";
+import UserInfoForm from "../Form/UserInfoForm";
+import ReferReason from "../Form/ReferReason";
+import Confirm from "../Form/ConfirmForm";
+import Revert from "../Form/RevertForm";
+import Reject from "../Form/RejectForm";
+
+const TableRow = ({ row, mutate }) => {
+ return (
+
+ {row.original.latest_history?.action === "refer" ? : null}
+
+
+
+
+
+ );
+};
+
+export default TableRow;
diff --git a/src/components/dashboard/refahi/transportation-assistance/build/TableToolbar.jsx b/src/components/dashboard/refahi/transportation-assistance/build/TableToolbar.jsx
new file mode 100644
index 0000000..56ce00e
--- /dev/null
+++ b/src/components/dashboard/refahi/transportation-assistance/build/TableToolbar.jsx
@@ -0,0 +1,12 @@
+import { Stack } from "@mui/material";
+import PrintExcel from "../Buttons/printExcel";
+
+const TableToolbar = ({ table }) => {
+ return (
+
+ {/**/}
+
+ );
+};
+
+export default TableToolbar;
diff --git a/src/components/dashboard/commercial-chief/index.jsx b/src/components/dashboard/refahi/transportation-assistance/build/index.jsx
similarity index 52%
rename from src/components/dashboard/commercial-chief/index.jsx
rename to src/components/dashboard/refahi/transportation-assistance/build/index.jsx
index 3528fea..6ec5963 100644
--- a/src/components/dashboard/commercial-chief/index.jsx
+++ b/src/components/dashboard/refahi/transportation-assistance/build/index.jsx
@@ -1,20 +1,21 @@
-import { Box, Typography } from "@mui/material";
+import { Box, Stack, Typography } from "@mui/material";
import { useMemo } from "react";
-import { GET_COMMERCIAL_CHIEF } from "@/core/data/apiRoutes";
+import { GET_BUILD_REFAHI_TRANSPORTATION_ASSISTANCE } from "@/core/data/apiRoutes";
import { useTranslations } from "next-intl";
import TableRowActions from "./TableRowActions";
import moment from "jalali-moment";
import DataTable from "@/core/components/DataTable";
import MuiDatePicker from "@/core/components/MuiDatePicker";
+import TableToolbar from "./TableToolbar";
-function DashboardCommercialChiefComponent() {
+function DashboardTransportationAssistanceComponent() {
const t = useTranslations();
const columns = useMemo(
() => [
{
accessorFn: (row) => row.id,
id: "id",
- header: t("CommercialChief.id"),
+ header: t("TransportationAssistance.id"),
enableColumnFilter: true,
datatype: "numeric",
filterFn: "equals",
@@ -22,9 +23,33 @@ function DashboardCommercialChiefComponent() {
Cell: ({ renderedCellValue }) => {renderedCellValue},
},
{
- accessorFn: (row) => row.name,
- id: "name",
- header: t("CommercialChief.name"),
+ accessorFn: (row) => row.is_legal_person,
+ id: "is_legal_person",
+ header: t("TransportationAssistance.is_legal_person"),
+ enableColumnFilter: false,
+ datatype: "numeric",
+ filterFn: "equals",
+ columnFilterModeOptions: ["equals"],
+ Cell: ({ renderedCellValue }) => (
+
+ {renderedCellValue === 1 ? `${t("PassengerBoss.hoghoghi")}` : `${t("PassengerBoss.haghighi")}`}
+
+ ),
+ },
+ {
+ accessorFn: (row) => row.first_name,
+ id: "first_name",
+ header: t("TransportationAssistance.first_name"),
+ enableColumnFilter: true,
+ datatype: "text",
+ filterFn: "contains",
+ columnFilterModeOptions: ["contains", "equals", "notEquals"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => row.last_name,
+ id: "last_name",
+ header: t("TransportationAssistance.last_name"),
enableColumnFilter: true,
datatype: "text",
filterFn: "contains",
@@ -34,7 +59,7 @@ function DashboardCommercialChiefComponent() {
{
accessorFn: (row) => row.national_id,
id: "national_id",
- header: t("CommercialChief.national_id"),
+ header: t("TransportationAssistance.national_id"),
enableColumnFilter: true,
datatype: "numeric",
filterFn: "equals",
@@ -42,19 +67,39 @@ function DashboardCommercialChiefComponent() {
Cell: ({ renderedCellValue }) => {renderedCellValue},
},
{
- accessorFn: (row) => row.phone_number,
- id: "phone_number",
- header: t("CommercialChief.phone_number"),
+ accessorFn: (row) => row.shenase_meli,
+ id: "shenase_meli",
+ header: t("TransportationAssistance.shenase_meli"),
enableColumnFilter: true,
datatype: "numeric",
filterFn: "equals",
columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"],
Cell: ({ renderedCellValue }) => {renderedCellValue},
},
+ {
+ accessorFn: (row) => row.province_name,
+ id: "province_name",
+ header: t("TransportationAssistance.province_name"),
+ enableColumnFilter: true,
+ datatype: "text",
+ filterFn: "contains",
+ columnFilterModeOptions: ["contains", "equals", "notEquals"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => row.city_name,
+ id: "city_name",
+ header: t("TransportationAssistance.city_name"),
+ enableColumnFilter: true,
+ datatype: "text",
+ filterFn: "contains",
+ columnFilterModeOptions: ["contains", "equals", "notEquals"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
{
accessorFn: (row) => moment(row.created_at).locale("fa").format("HH:mm | yyyy/MM/DD"),
id: "created_at",
- header: t("CommercialChief.created_at"),
+ header: t("TransportationAssistance.created_at"),
enableColumnFilter: true,
datatype: "date",
filterFn: "lessThan",
@@ -68,17 +113,19 @@ function DashboardCommercialChiefComponent() {
},
},
{
- accessorFn: (row) => moment(row.updated_at).locale("fa").format("HH:mm | yyyy/MM/DD"),
- id: "updated_at",
- header: t("CommercialChief.updated_at"),
- enableColumnFilter: false,
+ accessorFn: (row) => row.phone_number,
+ id: "phone_number",
+ header: t("TransportationAssistance.phone_number"),
+ enableColumnFilter: true,
datatype: "numeric",
+ filterFn: "equals",
+ columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"],
Cell: ({ renderedCellValue }) => {renderedCellValue},
},
{
accessorFn: (row) => row.state_name,
id: "state_id",
- header: t("CommercialChief.state_name"),
+ header: t("TransportationAssistance.state_name"),
enableColumnFilter: false,
datatype: "numeric",
Cell: ({ renderedCellValue }) => {renderedCellValue},
@@ -86,29 +133,23 @@ function DashboardCommercialChiefComponent() {
],
[]
);
-
return (
@@ -116,4 +157,4 @@ function DashboardCommercialChiefComponent() {
);
}
-export default DashboardCommercialChiefComponent;
+export default DashboardTransportationAssistanceComponent;
diff --git a/src/components/dashboard/refahi/transportation-assistance/restore/TableRowActions.jsx b/src/components/dashboard/refahi/transportation-assistance/restore/TableRowActions.jsx
new file mode 100644
index 0000000..b32bc5e
--- /dev/null
+++ b/src/components/dashboard/refahi/transportation-assistance/restore/TableRowActions.jsx
@@ -0,0 +1,20 @@
+import { Box } from "@mui/material";
+import UserInfoForm from "../Form/UserInfoForm";
+import ReferReason from "../Form/ReferReason";
+import Confirm from "../Form/ConfirmForm";
+import Revert from "../Form/RevertForm";
+import Reject from "../Form/RejectForm";
+
+const TableRow = ({ row, mutate }) => {
+ return (
+
+ {row.original.latest_history?.action === "refer" ? : null}
+
+
+
+
+
+ );
+};
+
+export default TableRow;
diff --git a/src/components/dashboard/refahi/transportation-assistance/restore/TableToolbar.jsx b/src/components/dashboard/refahi/transportation-assistance/restore/TableToolbar.jsx
new file mode 100644
index 0000000..56ce00e
--- /dev/null
+++ b/src/components/dashboard/refahi/transportation-assistance/restore/TableToolbar.jsx
@@ -0,0 +1,12 @@
+import { Stack } from "@mui/material";
+import PrintExcel from "../Buttons/printExcel";
+
+const TableToolbar = ({ table }) => {
+ return (
+
+ {/**/}
+
+ );
+};
+
+export default TableToolbar;
diff --git a/src/components/dashboard/refahi/transportation-assistance/restore/index.jsx b/src/components/dashboard/refahi/transportation-assistance/restore/index.jsx
new file mode 100644
index 0000000..236dd05
--- /dev/null
+++ b/src/components/dashboard/refahi/transportation-assistance/restore/index.jsx
@@ -0,0 +1,170 @@
+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";
+import TableRowActions from "./TableRowActions";
+import moment from "jalali-moment";
+import DataTable from "@/core/components/DataTable";
+import MuiDatePicker from "@/core/components/MuiDatePicker";
+import TableToolbar from "./TableToolbar";
+
+function DashboardTransportationAssistanceComponent() {
+ const t = useTranslations();
+ const columns = useMemo(
+ () => [
+ {
+ accessorFn: (row) => row.id,
+ id: "id",
+ header: t("TransportationAssistance.id"),
+ enableColumnFilter: true,
+ datatype: "numeric",
+ filterFn: "equals",
+ columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => row.project_title,
+ id: "project_title",
+ header: t("TransportationAssistance.project_title"),
+ enableColumnFilter: false,
+ datatype: "text",
+ filterFn: "equals",
+ columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => row.is_legal_person,
+ id: "is_legal_person",
+ header: t("TransportationAssistance.is_legal_person"),
+ enableColumnFilter: false,
+ datatype: "numeric",
+ filterFn: "equals",
+ columnFilterModeOptions: ["equals"],
+ Cell: ({ renderedCellValue }) => (
+
+ {renderedCellValue === 1 ? `${t("PassengerBoss.hoghoghi")}` : `${t("PassengerBoss.haghighi")}`}
+
+ ),
+ },
+ {
+ accessorFn: (row) => row.first_name,
+ id: "first_name",
+ header: t("TransportationAssistance.first_name"),
+ enableColumnFilter: true,
+ datatype: "text",
+ filterFn: "contains",
+ columnFilterModeOptions: ["contains", "equals", "notEquals"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => row.last_name,
+ id: "last_name",
+ header: t("TransportationAssistance.last_name"),
+ enableColumnFilter: true,
+ datatype: "text",
+ filterFn: "contains",
+ columnFilterModeOptions: ["contains", "equals", "notEquals"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => row.national_id,
+ id: "national_id",
+ header: t("TransportationAssistance.national_id"),
+ enableColumnFilter: true,
+ datatype: "numeric",
+ filterFn: "equals",
+ columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => row.shenase_meli,
+ id: "shenase_meli",
+ header: t("TransportationAssistance.shenase_meli"),
+ enableColumnFilter: true,
+ datatype: "numeric",
+ filterFn: "equals",
+ columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => row.province_name,
+ id: "province_name",
+ header: t("TransportationAssistance.province_name"),
+ enableColumnFilter: true,
+ datatype: "text",
+ filterFn: "contains",
+ columnFilterModeOptions: ["contains", "equals", "notEquals"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => row.city_name,
+ id: "city_name",
+ header: t("TransportationAssistance.city_name"),
+ enableColumnFilter: true,
+ datatype: "text",
+ filterFn: "contains",
+ columnFilterModeOptions: ["contains", "equals", "notEquals"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => moment(row.created_at).locale("fa").format("HH:mm | yyyy/MM/DD"),
+ id: "created_at",
+ header: t("TransportationAssistance.created_at"),
+ enableColumnFilter: true,
+ datatype: "date",
+ filterFn: "lessThan",
+ columnFilterModeOptions: ["lessThan", "greaterThan"],
+ Cell: ({ renderedCellValue }) => {
+ return {renderedCellValue};
+ },
+ Header: ({ column }) => <>{column.columnDef.header}>,
+ Filter: ({ column }) => {
+ return ;
+ },
+ },
+ {
+ accessorFn: (row) => row.phone_number,
+ id: "phone_number",
+ header: t("TransportationAssistance.phone_number"),
+ enableColumnFilter: true,
+ datatype: "numeric",
+ filterFn: "equals",
+ columnFilterModeOptions: ["equals", "notEquals", "contains", "lessThan", "greaterThan", "between"],
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ {
+ accessorFn: (row) => row.state_name,
+ id: "state_id",
+ header: t("TransportationAssistance.state_name"),
+ enableColumnFilter: false,
+ datatype: "numeric",
+ Cell: ({ renderedCellValue }) => {renderedCellValue},
+ },
+ ],
+ []
+ );
+ return (
+
+
+
+ );
+}
+
+export default DashboardTransportationAssistanceComponent;
diff --git a/src/components/dashboard/transportation-assistance/TableToolbar.jsx b/src/components/dashboard/transportation-assistance/TableToolbar.jsx
deleted file mode 100644
index 11fb04d..0000000
--- a/src/components/dashboard/transportation-assistance/TableToolbar.jsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { Stack } from "@mui/material";
-import PrintExcel from "@/components/dashboard/transportation-assistance/Buttons/printExcel";
-
-const TableToolbar = ({ table }) => {
- return (
-
-
-
- );
-};
-
-export default TableToolbar;
diff --git a/src/core/data/apiRoutes.js b/src/core/data/apiRoutes.js
index 4be881d..12091cc 100644
--- a/src/core/data/apiRoutes.js
+++ b/src/core/data/apiRoutes.js
@@ -79,49 +79,30 @@ export const REJECT_COMMERCIAL_CHIEF = BASE_URL + "/dashboard/commercial_chief/r
//navgan province manager
export const GET_NAVGAN_PROVINCE_MANAGER = BASE_URL + "/dashboard/province_manager/show";
-
export const CONFIRM_NAVGAN_PROVINCE_MANAGER = BASE_URL + "/dashboard/province_manager/confirm";
-
export const REJECT_NAVGAN_PROVINCE_MANAGER = BASE_URL + "/dashboard/province_manager/reject";
export const REFER_NAVGAN_PROVINCE_MANAGER = BASE_URL + "/dashboard/province_manager/refer";
export const EXPORT_NAVGAN_PROVINCE_MANAGER = BASE_URL + "/dashboard/province_manager/export";
-
export const CONFIRM_PROVINCE_MANAGER_DETAILS = BASE_URL + "/dashboard/province_manager";
//navgan province manager
-// refahi province manager
-export const GET_REFAHI_PROVINCE_MANAGER = BASE_URL + "/dashboard/refahi_province_manager/show";
-
-export const CONFIRM_REFAHI_PROVINCE_MANAGER = BASE_URL + "/dashboard/refahi_province_manager/confirm";
-
-export const REJECT_REFAHI_PROVINCE_MANAGER = BASE_URL + "/dashboard/refahi_province_manager/reject";
-//refahi province manager
-
// development assistant
export const GET_DEVELOPMENT_ASSISTANT = BASE_URL + "/dashboard/development_assistant/show";
-
export const CONFIRM_DEVELOPMENT_ASSISTANT = BASE_URL + "/dashboard/development_assistant/confirm";
-
export const REJECT_DEVELOPMENT_ASSISTANT = BASE_URL + "/dashboard/development_assistant/reject";
//development assistant
// inspector expert
export const GET_INSPECTOR_EXPERT = BASE_URL + "/dashboard/inspector_expert/show";
-
export const CONFIRM_INSPECTOR_EXPERT = BASE_URL + "/dashboard/inspector_expert/confirm";
-
export const REJECT_INSPECTOR_EXPERT = BASE_URL + "/dashboard/inspector_expert/reject";
-
export const REVISE_INSPECTOR_EXPERT = BASE_URL + "/dashboard/inspector_expert/revise";
//inspector expert
// province head expert
export const GET_PROVINCE_HEAD_EXPERT = BASE_URL + "/dashboard/province_head_expert/show";
-
export const CONFIRM_PROVINCE_HEAD_EXPERT = BASE_URL + "/dashboard/province_head_expert/confirm";
-
export const REJECT_PROVINCE_HEAD_EXPERT = BASE_URL + "/dashboard/province_head_expert/reject";
-
export const REVISE_PROVINCE_HEAD_EXPERT = BASE_URL + "/dashboard/province_head_expert/revise";
//province head expert
@@ -171,7 +152,6 @@ export const GET_ROLE_MANAGEMENT = BASE_URL + "/dashboard/roles";
export const ADD_ROLE_MANAGEMENT = BASE_URL + "/dashboard/roles/store";
export const UPDATE_ROLE_MANAGEMENT = BASE_URL + "/dashboard/roles/update";
export const DELETE_ROLE_MANAGEMENT = BASE_URL + "/dashboard/roles/delete";
-
export const GET_PERMISSIONS_LIST = BASE_URL + "/dashboard/permissions/list";
//role management
@@ -205,3 +185,32 @@ export const EDIT_APPROVED_AMOUNT = BASE_URL + "/dashboard/bank_referred_loans/u
// loan statistics
export const GET_LOAN_STATISTICS = BASE_URL + "/dashboard/reports/navgan/statistics";
+
+//refahi passenger boss
+export const GET_REFAHI_PASSENGER_BOSS_RESTORE = BASE_URL + "/dashboard/refahi_province_working_group/show";
+export const GET_REFAHI_PASSENGER_BOSS_BUILD = BASE_URL + "/dashboard/refahi_province_working_group/show";
+export const REFER_REFAHI_LOAN_FOLLOWUP_USER = BASE_URL + "/dashboard/refahi_province_working_group/refer";
+export const CONFIRM_REFAHI_PASSENGER_BOSS = BASE_URL + "/dashboard/refahi_province_working_group/confirm";
+export const REJECT_REFAHI_PASSENGER_BOSS = BASE_URL + "/dashboard/refahi_province_working_group/reject";
+export const EXPORT_REFAHI_PASSENGER_BOSS = BASE_URL + "/dashboard/province_working_group/export";
+//refahi passenger boss
+
+//refahi transportation assistance
+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 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";
+export const EXPORT_REFAHI_TRANSPORTATION_ASSISTANCE = BASE_URL + "/dashboard/transportation_assistant/export";
+//refahi transportation assistance
+
+//refahi province manager
+export const GET_REFAHI_RESTORE_PROVINCE_MANAGER = BASE_URL + "/dashboard/refahi_province_manager/show";
+export const GET_REFAHI_BUILD_PROVINCE_MANAGER = BASE_URL + "/dashboard/refahi_province_manager/show";
+export const CONFIRM_REFAHI_PROVINCE_MANAGER = BASE_URL + "/dashboard/refahi_province_manager/confirm";
+export const REJECT_REFAHI_PROVINCE_MANAGER = BASE_URL + "/dashboard/refahi_province_manager/reject";
+export const REFER_REFAHI_PROVINCE_MANAGER = BASE_URL + "/dashboard/refahi_province_manager/refer";
+export const EXPORT_REFAHI_PROVINCE_MANAGER = BASE_URL + "/dashboard/province_manager/export";
+export const CONFIRM_REFAHI_PROVINCE_MANAGER_DETAILS = BASE_URL + "/dashboard/refahi_province_manager/details";
+//refahi province manager
\ No newline at end of file
diff --git a/src/core/data/sidebarMenu.jsx b/src/core/data/sidebarMenu.jsx
index e170091..91de110 100644
--- a/src/core/data/sidebarMenu.jsx
+++ b/src/core/data/sidebarMenu.jsx
@@ -53,7 +53,7 @@ const sidebarMenu = [
secondary: "secondary.navgan-province-manager",
name: "reserve_loan",
type: "page",
- route: "/dashboard/reserve-loan",
+ route: "/dashboard/navgan/reserve-loan",
icon: ,
selected: false,
permissions: ["manage_reserved_loans"],
@@ -63,18 +63,17 @@ const sidebarMenu = [
secondary: "secondary.navgan-province-manager",
name: "province_working_group",
type: "page",
- route: "/dashboard/passenger-boss",
+ route: "/dashboard/navgan/passenger-boss",
icon: ,
selected: false,
permissions: ["manage_province_working_group_navgan"],
},
-
{
key: "sidebar.transportation-assistant",
secondary: "secondary.navgan-province-manager",
name: "transportation_assistant",
type: "page",
- route: "/dashboard/transportation-assistant",
+ route: "/dashboard/navgan/transportation-assistant",
icon: ,
selected: false,
permissions: ["manage_transportation_navgan"],
@@ -84,7 +83,7 @@ const sidebarMenu = [
secondary: "secondary.navgan-province-manager",
name: "province_manager_navgan",
type: "page",
- route: "/dashboard/navgan-province-manager",
+ route: "/dashboard/navgan/navgan-province-manager",
icon: ,
selected: false,
permissions: ["manage_province_affairs_navgan"],
@@ -94,7 +93,7 @@ const sidebarMenu = [
secondary: "secondary.navgan-province-manager",
name: "management",
type: "page",
- route: "/dashboard/bank-management",
+ route: "/dashboard/navgan/bank-management",
icon: ,
selected: false,
permissions: ["tracking_bank_loans"],
@@ -104,7 +103,7 @@ const sidebarMenu = [
secondary: "secondary.loan-followup",
name: "loan-followup",
type: "page",
- route: "/dashboard/loan-followup",
+ route: "/dashboard/navgan/loan-followup",
icon: ,
selected: false,
permissions: ["manage_vezarat_eghtesad_loans"], //permission should change
@@ -114,7 +113,7 @@ const sidebarMenu = [
secondary: "secondary.navgan-loan-management",
name: "navgan_loan_management",
type: "page",
- route: "/dashboard/navgan-loan-management",
+ route: "/dashboard/navgan/navgan-loan-management",
icon: ,
selected: false,
permissions: ["manage_navgan_loan"],
@@ -122,65 +121,65 @@ const sidebarMenu = [
],
[
{
- key: "sidebar.province-head-expert",
- secondary: "secondary.refahi-province-manager",
- name: "province_head_expert",
+ key: "sidebar.restore-passenger-boss",
+ secondary: "secondary.refahi-province-working-group",
+ name: "refahi_province_working_group",
type: "page",
- route: "/dashboard/province-head-expert",
- icon: ,
+ route: "/dashboard/refahi/passenger-boss",
+ icon: ,
selected: false,
- permissions: ["manage_province_headquarter_refahi"],
+ permissions: ["manage_province_working_group_refahi"],
},
+ // {
+ // key: "sidebar.build-passenger-boss",
+ // secondary: "secondary.build-passenger-boss",
+ // name: "province_working_group_refahi",
+ // type: "page",
+ // route: "/dashboard/refahi/passenger-boss/build",
+ // icon: ,
+ // selected: false,
+ // permissions: ["manage_province_working_group_refahi"],
+ // },
{
- key: "sidebar.inspector-expert",
- secondary: "secondary.refahi-province-manager",
- name: "inspector_expert",
+ key: "sidebar.restore-transportation-assistant",
+ secondary: "secondary.refahi-transportation",
+ name: "refahi_transportation_assistant",
type: "page",
- route: "/dashboard/inspector-expert",
- icon: ,
+ route: "/dashboard/refahi/transportation-assistant",
+ icon: ,
selected: false,
- permissions: ["manage_inspector_refahi"],
+ permissions: ["manage_transportation_refahi"],
},
+ // {
+ // key: "sidebar.build-transportation-assistant",
+ // secondary: "secondary.build-transportation-assistant",
+ // name: "transportation_assistant",
+ // type: "page",
+ // route: "/dashboard/refahi/transportation-assistant/build",
+ // icon: ,
+ // selected: false,
+ // permissions: ["manage_transportation_refahi"],
+ // },
{
- key: "sidebar.commercial-chief",
+ key: "sidebar.restore-province-manager",
secondary: "secondary.refahi-province-manager",
- name: "commercial_chief",
+ name: "refahi_province_manager_navgan",
type: "page",
- route: "/dashboard/commercial-chief",
- icon: ,
+ route: "/dashboard/refahi/refahi-province-manager",
+ icon: ,
selected: false,
- permissions: ["manage_commercial_refahi"],
- },
- {
- key: "sidebar.development-assistant",
- secondary: "secondary.refahi-province-manager",
- name: "development_assistant",
- type: "page",
- route: "/dashboard/development-assistant",
- icon: ,
- selected: false,
- permissions: ["manage_development_refahi"],
- },
- {
- key: "sidebar.refahi-province-manager",
- secondary: "secondary.refahi-province-manager",
- name: "province_manager_refahi",
- type: "page",
- route: "/dashboard/refahi-province-manager",
- icon: ,
- selected: false,
- permissions: ["manage_province_affairs_refahi"],
- },
- {
- key: "sidebar.refahi-loan-management",
- secondary: "secondary.refahi-loan-management",
- name: "refahi_loan_management",
- type: "page",
- route: "/dashboard/refahi-loan-management",
- icon: ,
- selected: false,
- permissions: ["manage_refahi_loan"],
+ permissions: ["manage_province_affairs_navgan"],
},
+ // {
+ // key: "sidebar.build-province-manager",
+ // secondary: "secondary.build-province-manager",
+ // name: "province_manager_refahi",
+ // type: "page",
+ // route: "/dashboard/refahi/refahi-province-manager/build",
+ // icon: ,
+ // selected: false,
+ // permissions: ["manage_province_affairs_navgan"],
+ // },
],
[
{
diff --git a/src/pages/dashboard/bank-management/index.jsx b/src/pages/dashboard/navgan/bank-management/index.jsx
similarity index 95%
rename from src/pages/dashboard/bank-management/index.jsx
rename to src/pages/dashboard/navgan/bank-management/index.jsx
index 429f265..7c9db58 100644
--- a/src/pages/dashboard/bank-management/index.jsx
+++ b/src/pages/dashboard/navgan/bank-management/index.jsx
@@ -1,5 +1,5 @@
import { parse } from "next-useragent";
-import DashboardBankManagementComponent from "@/components/dashboard/bank-management";
+import DashboardBankManagementComponent from "@/components/dashboard/navgan/bank-management";
export default function BankManagement() {
return ;
diff --git a/src/pages/dashboard/loan-followup/index.jsx b/src/pages/dashboard/navgan/loan-followup/index.jsx
similarity index 96%
rename from src/pages/dashboard/loan-followup/index.jsx
rename to src/pages/dashboard/navgan/loan-followup/index.jsx
index fc3d7a6..e9e5256 100644
--- a/src/pages/dashboard/loan-followup/index.jsx
+++ b/src/pages/dashboard/navgan/loan-followup/index.jsx
@@ -1,5 +1,5 @@
import { parse } from "next-useragent";
-import DashboardLoanFollowUpComponent from "@/components/dashboard/loan-followup";
+import DashboardLoanFollowUpComponent from "@/components/dashboard/navgan/loan-followup";
export default function LoanFollowUp() {
return ;
diff --git a/src/pages/dashboard/navgan-loan-management/index.jsx b/src/pages/dashboard/navgan/navgan-loan-management/index.jsx
similarity index 84%
rename from src/pages/dashboard/navgan-loan-management/index.jsx
rename to src/pages/dashboard/navgan/navgan-loan-management/index.jsx
index 6bf8d46..19ebc08 100644
--- a/src/pages/dashboard/navgan-loan-management/index.jsx
+++ b/src/pages/dashboard/navgan/navgan-loan-management/index.jsx
@@ -1,5 +1,5 @@
import { parse } from "next-useragent";
-import DashboardNavganLoanManagementComponent from "@/components/dashboard/navgan-loan-management";
+import DashboardNavganLoanManagementComponent from "src/components/dashboard/navgan/navgan-loan-management";
export default function NavganLoanManagement() {
return ;
diff --git a/src/pages/dashboard/navgan-province-manager/index.jsx b/src/pages/dashboard/navgan/navgan-province-manager/index.jsx
similarity index 93%
rename from src/pages/dashboard/navgan-province-manager/index.jsx
rename to src/pages/dashboard/navgan/navgan-province-manager/index.jsx
index ff370ef..fa22e7f 100644
--- a/src/pages/dashboard/navgan-province-manager/index.jsx
+++ b/src/pages/dashboard/navgan/navgan-province-manager/index.jsx
@@ -1,4 +1,4 @@
-import DashboardNavganProvinceManagerComponent from "src/components/dashboard/navgan-province-manager";
+import DashboardNavganProvinceManagerComponent from "src/components/dashboard/navgan/navgan-province-manager";
import { parse } from "next-useragent";
export default function PassengerOffice() {
diff --git a/src/pages/dashboard/passenger-boss/index.jsx b/src/pages/dashboard/navgan/passenger-boss/index.jsx
similarity index 95%
rename from src/pages/dashboard/passenger-boss/index.jsx
rename to src/pages/dashboard/navgan/passenger-boss/index.jsx
index 440eddc..a11032e 100644
--- a/src/pages/dashboard/passenger-boss/index.jsx
+++ b/src/pages/dashboard/navgan/passenger-boss/index.jsx
@@ -1,4 +1,4 @@
-import DashboardPassengerBossComponent from "@/components/dashboard/passenger-boss";
+import DashboardPassengerBossComponent from "@/components/dashboard/navgan/passenger-boss";
import { parse } from "next-useragent";
export default function PassengerBoss() {
diff --git a/src/pages/dashboard/reserve-loan/index.jsx b/src/pages/dashboard/navgan/reserve-loan/index.jsx
similarity index 87%
rename from src/pages/dashboard/reserve-loan/index.jsx
rename to src/pages/dashboard/navgan/reserve-loan/index.jsx
index 6b6739c..f91ee65 100644
--- a/src/pages/dashboard/reserve-loan/index.jsx
+++ b/src/pages/dashboard/navgan/reserve-loan/index.jsx
@@ -1,5 +1,5 @@
import { parse } from "next-useragent";
-import DashboardReserveLoan from "@/components/dashboard/reserve-loan";
+import DashboardReserveLoan from "@/components/dashboard/navgan/reserve-loan";
export default function PassengerOffice() {
return ;
diff --git a/src/pages/dashboard/transportation-assistant/index.jsx b/src/pages/dashboard/navgan/transportation-assistant/index.jsx
similarity index 93%
rename from src/pages/dashboard/transportation-assistant/index.jsx
rename to src/pages/dashboard/navgan/transportation-assistant/index.jsx
index c98090e..3008760 100644
--- a/src/pages/dashboard/transportation-assistant/index.jsx
+++ b/src/pages/dashboard/navgan/transportation-assistant/index.jsx
@@ -1,4 +1,4 @@
-import DashboardTransportationAssistanceComponent from "@/components/dashboard/transportation-assistance";
+import DashboardTransportationAssistanceComponent from "@/components/dashboard/navgan/transportation-assistance";
import { parse } from "next-useragent";
export default function TransportationAssistance() {
diff --git a/src/pages/dashboard/province-head-expert/index.jsx b/src/pages/dashboard/province-head-expert/index.jsx
deleted file mode 100644
index 7863976..0000000
--- a/src/pages/dashboard/province-head-expert/index.jsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import { parse } from "next-useragent";
-import DashboardProvinceHeadExpertComponent from "@/components/dashboard/province-head-expert";
-
-export default function ProvinceHeadExpertOffice() {
- return ;
-}
-
-export async function getServerSideProps({ req, locale }) {
- const { isBot } = parse(req.headers["user-agent"]);
- return {
- props: {
- messages: (await import(`&/locales/${locale}/app.json`)).default,
- title: "Dashboard.province_head_expert",
- isBot,
- locale,
- layout: { name: "DashboardLayout", props: { permissions: ["manage_province_headquarter_refahi"] } },
- },
- };
-}
diff --git a/src/pages/dashboard/commercial-chief/index.jsx b/src/pages/dashboard/refahi/passenger-boss/build/index.jsx
similarity index 57%
rename from src/pages/dashboard/commercial-chief/index.jsx
rename to src/pages/dashboard/refahi/passenger-boss/build/index.jsx
index 5d5eec7..a59126d 100644
--- a/src/pages/dashboard/commercial-chief/index.jsx
+++ b/src/pages/dashboard/refahi/passenger-boss/build/index.jsx
@@ -1,8 +1,8 @@
+import DashboardPassengerBossComponent from "@/components/dashboard/refahi/passenger-boss/build";
import { parse } from "next-useragent";
-import DashboardCommercialChiefComponent from "@/components/dashboard/commercial-chief";
-export default function CommercialChief() {
- return ;
+export default function PassengerBoss() {
+ return ;
}
export async function getServerSideProps({ req, locale }) {
@@ -10,10 +10,10 @@ export async function getServerSideProps({ req, locale }) {
return {
props: {
messages: (await import(`&/locales/${locale}/app.json`)).default,
- title: "Dashboard.commercial_chief_page",
+ title: "Dashboard.passenger_boss_page",
isBot,
locale,
- layout: { name: "DashboardLayout", props: { permissions: ["manage_commercial_refahi"] } },
+ layout: { name: "DashboardLayout", props: { permissions: ["manage_province_working_group_refahi"] } },
},
};
}
diff --git a/src/pages/dashboard/inspector-expert/index.jsx b/src/pages/dashboard/refahi/passenger-boss/index.jsx
similarity index 57%
rename from src/pages/dashboard/inspector-expert/index.jsx
rename to src/pages/dashboard/refahi/passenger-boss/index.jsx
index 24994aa..ea1af8c 100644
--- a/src/pages/dashboard/inspector-expert/index.jsx
+++ b/src/pages/dashboard/refahi/passenger-boss/index.jsx
@@ -1,8 +1,8 @@
+import DashboardPassengerBossComponent from "@/components/dashboard/refahi/passenger-boss/restore";
import { parse } from "next-useragent";
-import DashboardInspectorExpertComponent from "@/components/dashboard/inspector-expert";
-export default function InspectorExpert() {
- return ;
+export default function PassengerBoss() {
+ return ;
}
export async function getServerSideProps({ req, locale }) {
@@ -10,10 +10,10 @@ export async function getServerSideProps({ req, locale }) {
return {
props: {
messages: (await import(`&/locales/${locale}/app.json`)).default,
- title: "Dashboard.inspector_expert_page",
+ title: "Dashboard.passenger_boss_page",
isBot,
locale,
- layout: { name: "DashboardLayout", props: { permissions: ["manage_inspector_refahi"] } },
+ layout: { name: "DashboardLayout", props: { permissions: ["manage_province_working_group_refahi"] } },
},
};
}
diff --git a/src/pages/dashboard/refahi/passenger-boss/print-report/index.jsx b/src/pages/dashboard/refahi/passenger-boss/print-report/index.jsx
new file mode 100644
index 0000000..063236f
--- /dev/null
+++ b/src/pages/dashboard/refahi/passenger-boss/print-report/index.jsx
@@ -0,0 +1,18 @@
+import { parse } from "next-useragent";
+import DashboardPassengerBossReportComponent from "@/components/dashboard/refahi/passenger-boss/print-report";
+
+export default function PassengerBoss() {
+ return ;
+}
+
+export async function getServerSideProps({ req, locale }) {
+ const { isBot } = parse(req.headers["user-agent"]);
+ return {
+ props: {
+ messages: (await import(`&/locales/${locale}/app.json`)).default,
+ title: "Dashboard.passenger_boss_report",
+ isBot,
+ locale,
+ },
+ };
+}
diff --git a/src/pages/dashboard/refahi/passenger-boss/restore/index.jsx b/src/pages/dashboard/refahi/passenger-boss/restore/index.jsx
new file mode 100644
index 0000000..ea1af8c
--- /dev/null
+++ b/src/pages/dashboard/refahi/passenger-boss/restore/index.jsx
@@ -0,0 +1,19 @@
+import DashboardPassengerBossComponent from "@/components/dashboard/refahi/passenger-boss/restore";
+import { parse } from "next-useragent";
+
+export default function PassengerBoss() {
+ return ;
+}
+
+export async function getServerSideProps({ req, locale }) {
+ const { isBot } = parse(req.headers["user-agent"]);
+ return {
+ props: {
+ messages: (await import(`&/locales/${locale}/app.json`)).default,
+ title: "Dashboard.passenger_boss_page",
+ isBot,
+ locale,
+ layout: { name: "DashboardLayout", props: { permissions: ["manage_province_working_group_refahi"] } },
+ },
+ };
+}
diff --git a/src/pages/dashboard/refahi-loan-management/index.jsx b/src/pages/dashboard/refahi/refahi-loan-management/index.jsx
similarity index 93%
rename from src/pages/dashboard/refahi-loan-management/index.jsx
rename to src/pages/dashboard/refahi/refahi-loan-management/index.jsx
index bf49b03..7f32cb7 100644
--- a/src/pages/dashboard/refahi-loan-management/index.jsx
+++ b/src/pages/dashboard/refahi/refahi-loan-management/index.jsx
@@ -1,5 +1,5 @@
import { parse } from "next-useragent";
-import DashboardRefahiLoanManagementComponent from "@/components/dashboard/refahi-loan-management";
+import DashboardRefahiLoanManagementComponent from "@/components/dashboard/refahi/refahi-loan-management";
export default function RefahiLoanManagement() {
return ;
diff --git a/src/pages/dashboard/refahi-province-manager/index.jsx b/src/pages/dashboard/refahi/refahi-province-manager/build/index.jsx
similarity index 76%
rename from src/pages/dashboard/refahi-province-manager/index.jsx
rename to src/pages/dashboard/refahi/refahi-province-manager/build/index.jsx
index 3653beb..c06bcd3 100644
--- a/src/pages/dashboard/refahi-province-manager/index.jsx
+++ b/src/pages/dashboard/refahi/refahi-province-manager/build/index.jsx
@@ -1,7 +1,7 @@
import { parse } from "next-useragent";
-import DashboardRefahiProvinceManagerComponent from "@/components/dashboard/refahi-province-manager";
+import DashboardRefahiProvinceManagerComponent from "@/components/dashboard/refahi/refahi-province-manager/build";
-export default function RefahiProvinceManager() {
+export default function PassengerOffice() {
return ;
}
@@ -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_refahi"] } },
+ layout: { name: "DashboardLayout", props: { permissions: ["manage_province_affairs_navgan"] } },//پرمیشن باید عوض بشه
},
};
}
diff --git a/src/pages/dashboard/refahi/refahi-province-manager/index.jsx b/src/pages/dashboard/refahi/refahi-province-manager/index.jsx
new file mode 100644
index 0000000..e42c0db
--- /dev/null
+++ b/src/pages/dashboard/refahi/refahi-province-manager/index.jsx
@@ -0,0 +1,19 @@
+import { parse } from "next-useragent";
+import DashboardRefahiProvinceManagerComponent from "@/components/dashboard/refahi/refahi-province-manager/restore";
+
+export default function PassengerOffice() {
+ return ;
+}
+
+export async function getServerSideProps({ req, locale }) {
+ const { isBot } = parse(req.headers["user-agent"]);
+ return {
+ props: {
+ messages: (await import(`&/locales/${locale}/app.json`)).default,
+ title: "Dashboard.province_manager_page",
+ isBot,
+ locale,
+ layout: { name: "DashboardLayout", props: { permissions: ["manage_province_affairs_navgan"] } },//پرمیشن باید عوض بشه
+ },
+ };
+}
diff --git a/src/pages/dashboard/refahi/refahi-province-manager/restore/index.jsx b/src/pages/dashboard/refahi/refahi-province-manager/restore/index.jsx
new file mode 100644
index 0000000..e42c0db
--- /dev/null
+++ b/src/pages/dashboard/refahi/refahi-province-manager/restore/index.jsx
@@ -0,0 +1,19 @@
+import { parse } from "next-useragent";
+import DashboardRefahiProvinceManagerComponent from "@/components/dashboard/refahi/refahi-province-manager/restore";
+
+export default function PassengerOffice() {
+ return ;
+}
+
+export async function getServerSideProps({ req, locale }) {
+ const { isBot } = parse(req.headers["user-agent"]);
+ return {
+ props: {
+ messages: (await import(`&/locales/${locale}/app.json`)).default,
+ title: "Dashboard.province_manager_page",
+ isBot,
+ locale,
+ layout: { name: "DashboardLayout", props: { permissions: ["manage_province_affairs_navgan"] } },//پرمیشن باید عوض بشه
+ },
+ };
+}
diff --git a/src/pages/dashboard/development-assistant/index.jsx b/src/pages/dashboard/refahi/transportation-assistant/build/index.jsx
similarity index 51%
rename from src/pages/dashboard/development-assistant/index.jsx
rename to src/pages/dashboard/refahi/transportation-assistant/build/index.jsx
index 6c8aa33..d9bb786 100644
--- a/src/pages/dashboard/development-assistant/index.jsx
+++ b/src/pages/dashboard/refahi/transportation-assistant/build/index.jsx
@@ -1,8 +1,8 @@
+import DashboardTransportationAssistanceComponent from "@/components/dashboard/refahi/transportation-assistance/build";
import { parse } from "next-useragent";
-import DashboardDevelopmentAssistantComponent from "@/components/dashboard/development-assistant";
-export default function DevelopmentAssistant() {
- return ;
+export default function TransportationAssistance() {
+ return ;
}
export async function getServerSideProps({ req, locale }) {
@@ -10,10 +10,10 @@ export async function getServerSideProps({ req, locale }) {
return {
props: {
messages: (await import(`&/locales/${locale}/app.json`)).default,
- title: "Dashboard.development_assistant_page",
+ title: "Dashboard.transportation_assistance",
isBot,
locale,
- layout: { name: "DashboardLayout", props: { permissions: ["manage_development_refahi"] } },
+ layout: { name: "DashboardLayout", props: { permissions: ["manage_transportation_navgan"] } }, //پرمیشن باید عوض بشه
},
};
}
diff --git a/src/pages/dashboard/refahi/transportation-assistant/index.jsx b/src/pages/dashboard/refahi/transportation-assistant/index.jsx
new file mode 100644
index 0000000..df0564e
--- /dev/null
+++ b/src/pages/dashboard/refahi/transportation-assistant/index.jsx
@@ -0,0 +1,19 @@
+import DashboardTransportationAssistanceComponent from "@/components/dashboard/refahi/transportation-assistance/restore";
+import { parse } from "next-useragent";
+
+export default function TransportationAssistance() {
+ return ;
+}
+
+export async function getServerSideProps({ req, locale }) {
+ const { isBot } = parse(req.headers["user-agent"]);
+ return {
+ props: {
+ messages: (await import(`&/locales/${locale}/app.json`)).default,
+ title: "Dashboard.transportation_assistance",
+ isBot,
+ locale,
+ layout: { name: "DashboardLayout", props: { permissions: ["manage_transportation_navgan"] } }, //پرمیشن باید عوض بشه
+ },
+ };
+}
diff --git a/src/pages/dashboard/refahi/transportation-assistant/restore/index.jsx b/src/pages/dashboard/refahi/transportation-assistant/restore/index.jsx
new file mode 100644
index 0000000..df0564e
--- /dev/null
+++ b/src/pages/dashboard/refahi/transportation-assistant/restore/index.jsx
@@ -0,0 +1,19 @@
+import DashboardTransportationAssistanceComponent from "@/components/dashboard/refahi/transportation-assistance/restore";
+import { parse } from "next-useragent";
+
+export default function TransportationAssistance() {
+ return ;
+}
+
+export async function getServerSideProps({ req, locale }) {
+ const { isBot } = parse(req.headers["user-agent"]);
+ return {
+ props: {
+ messages: (await import(`&/locales/${locale}/app.json`)).default,
+ title: "Dashboard.transportation_assistance",
+ isBot,
+ locale,
+ layout: { name: "DashboardLayout", props: { permissions: ["manage_transportation_navgan"] } }, //پرمیشن باید عوض بشه
+ },
+ };
+}