diff --git a/example.env.local b/example.env.local
index ae86658..72c18d1 100644
--- a/example.env.local
+++ b/example.env.local
@@ -1,5 +1,5 @@
NEXT_PUBLIC_API_NAME = "Loan Facilities Dashboard"
-NEXT_PUBLIC_API_VERSION = "2.2.3"
+NEXT_PUBLIC_API_VERSION = "2.3.0"
NEXT_PUBLIC_DEFAULT_LANGUAGE = "fa"
NEXT_PUBLIC_DEFAULT_DIRECTION = "rtl"
diff --git a/public/locales/fa/app.json b/public/locales/fa/app.json
index cbdb81d..c13b5d1 100644
--- a/public/locales/fa/app.json
+++ b/public/locales/fa/app.json
@@ -218,6 +218,7 @@
"navgan_id": "کد ناوگان",
"vehicle_type": "نوع ماشین",
"state_name": "وضعیت درخواست",
+ "revert": "ارجاع به معاون حمل و نقل",
"confirm": "تایید نهایی و ارجاع به بانک",
"upload_file_unit": "فایل بارگذاری شده باید حداکثر 5Mb باشد",
"upload_file_format": "فرمت قابل قبول : png,jpg,pdf",
@@ -233,6 +234,7 @@
"button-reserve-confirm": "رزرو",
"city_name": "شهرستان",
"plate_number": "پلاک",
+ "refer_reason": "علت ارجاع",
"statement_count": "تعداد صورت وضعیت",
"id": "کد یکتا",
"score": "اولویت",
@@ -253,7 +255,7 @@
"navgan_id": "کد ناوگان",
"vehicle_type": "نوع ماشین",
"state_name": "وضعیت درخواست",
- "confirm": "ارجاع به معاون حمل و نقل",
+ "confirm": "تایید و ارجاع به معاون حمل و نقل",
"upload_file": "فایل خود را بارگذاری کنید(اختیاری)",
"upload_expert_img": "فایل گزارش کارشناسی را بارگذاری کنید",
"upload_file_required": "وارد کردن گزارش کارشناسی الزامیست",
@@ -352,6 +354,7 @@
"TransportationAssistance": {
"name": "نام",
"city_name": "شهرستان",
+ "refer_reason": "علت ارجاع",
"plate_number": "پلاک",
"id": "کد یکتا",
"facility_bank": "سهم بانک",
@@ -378,7 +381,8 @@
"navgan_id": "کد ناوگان",
"vehicle_type": "نوع ماشین",
"state_name": "وضعیت درخواست",
- "confirm": "ارجاع به مدیر کل",
+ "confirm": "تایید و ارجاع به مدیر کل",
+ "revert": "ارجاع به کارتابل کارگروه",
"upload_file_unit": "فایل بارگذاری شده باید حداکثر 5Mb باشد",
"upload_file_format": "فرمت قابل قبول : png,jpg,pdf",
"excel_report": "گزارش اکسل",
@@ -488,7 +492,7 @@
"updated_at": "تاریخ بروزرسانی"
},
"ConfirmDialog": {
- "confirm": "ارجاع",
+ "confirm": "تایید",
"month": "(ماه)",
"context": "آیا از تایید این آیتم اطمینان دارید؟",
"button-cancel": "بستن",
@@ -580,6 +584,15 @@
"description_error": "وارد کردن توضیحات الزامی است!",
"choose_file": "انتخاب فایل"
},
+ "RevertDialog": {
+ "typography": "آیا میخواهید این درخواست را رد کنید ؟",
+ "revert": "ارجاع",
+ "context": "آیا از عدم تایید این آیتم اطمینان دارید؟",
+ "button-cancel": "بستن",
+ "button-revert": "ارجاع",
+ "description": "توضیحات خود را وارد نمائید",
+ "description_error": "وارد کردن توضیحات الزامی است!"
+ },
"EditDialog": {
"edit_approved_amount": "ویرایش مبلغ مصوب",
"description_error": "وارد کردن توضیحات الزامی است!",
diff --git a/src/components/dashboard/navgan-province-manager/Form/RevertForm/RevertContent.jsx b/src/components/dashboard/navgan-province-manager/Form/RevertForm/RevertContent.jsx
new file mode 100644
index 0000000..23f4268
--- /dev/null
+++ b/src/components/dashboard/navgan-province-manager/Form/RevertForm/RevertContent.jsx
@@ -0,0 +1,79 @@
+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";
+
+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("RevertDialog.description_error")),
+ });
+
+ const formik = useFormik({
+ initialValues: {
+ description: "",
+ },
+ validationSchema,
+ onSubmit: (values, {setSubmitting}) => {
+ requestServer(`${REJECT_TRANSPORTATION_ASSISTANCE}/${rowId}`, 'post', {
+ data: {
+ expert_description: values.description
+ },
+ }).then(() => {
+ setOpenRevertDialog(false)
+ mutate()
+ update_notification()
+ }).catch(() => {
+ }).finally(() => {
+ setSubmitting(false);
+ });
+ },
+ });
+
+ const handleDescriptionChange = (event) => {
+ formik.setFieldValue("description", event.target.value);
+ formik.handleChange(event);
+ };
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+ >
+ )
+}
+export default RevertContent
\ No newline at end of file
diff --git a/src/components/dashboard/navgan-province-manager/Form/RevertForm/index.jsx b/src/components/dashboard/navgan-province-manager/Form/RevertForm/index.jsx
new file mode 100644
index 0000000..5229058
--- /dev/null
+++ b/src/components/dashboard/navgan-province-manager/Form/RevertForm/index.jsx
@@ -0,0 +1,25 @@
+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";
+
+const Revert = ({rowId, mutate}) => {
+ const t = useTranslations();
+ const [openRevertDialog, setOpenRevertDialog] = useState(false);
+ return (
+ <>
+
+ setOpenRevertDialog(true)}>
+
+
+
+
+ >
+ )
+}
+export default Revert
\ No newline at end of file
diff --git a/src/components/dashboard/navgan-province-manager/TableRowActions.jsx b/src/components/dashboard/navgan-province-manager/TableRowActions.jsx
index 69f9d6f..c5b1843 100644
--- a/src/components/dashboard/navgan-province-manager/TableRowActions.jsx
+++ b/src/components/dashboard/navgan-province-manager/TableRowActions.jsx
@@ -1,6 +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";
const TableRow = ({row, mutate}) => {
@@ -10,6 +11,10 @@ const TableRow = ({row, mutate}) => {
rowId={row.getValue("id")}
mutate={mutate}
/>
+
),
},
+ {
+ accessorFn: (row) => row.refer_reason,
+ id: "refer_reason",
+ header: t("PassengerBoss.refer_reason"),
+ enableColumnFilter: false,
+ datatype: "text",
+ filterFn: "contains",
+ columnFilterModeOptions: ["contains", "equals", "notEquals"],
+ Cell: ({renderedCellValue, row}) => {
+ return (
+ {renderedCellValue}
+ )
+ },
+ },
{
accessorFn: (row) => row.state_name,
id: "state_id",
diff --git a/src/components/dashboard/transportation-assistance/Form/RevertForm/RevertContent.jsx b/src/components/dashboard/transportation-assistance/Form/RevertForm/RevertContent.jsx
new file mode 100644
index 0000000..1a2e524
--- /dev/null
+++ b/src/components/dashboard/transportation-assistance/Form/RevertForm/RevertContent.jsx
@@ -0,0 +1,79 @@
+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";
+
+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("RevertDialog.description_error")),
+ });
+
+ const formik = useFormik({
+ initialValues: {
+ description: "",
+ },
+ validationSchema,
+ onSubmit: (values, {setSubmitting}) => {
+ requestServer(`${REJECT_TRANSPORTATION_ASSISTANCE}/${rowId}`, 'post', {
+ data: {
+ expert_description : values.description
+ },
+ }).then(() => {
+ setOpenRevertDialog(false)
+ mutate()
+ update_notification()
+ }).catch(() => {
+ }).finally(() => {
+ setSubmitting(false);
+ });
+ },
+ });
+
+ const handleDescriptionChange = (event) => {
+ formik.setFieldValue("description", event.target.value);
+ formik.handleChange(event);
+ };
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+ >
+ )
+}
+export default RevertContent
\ No newline at end of file
diff --git a/src/components/dashboard/transportation-assistance/Form/RevertForm/index.jsx b/src/components/dashboard/transportation-assistance/Form/RevertForm/index.jsx
new file mode 100644
index 0000000..316ce8b
--- /dev/null
+++ b/src/components/dashboard/transportation-assistance/Form/RevertForm/index.jsx
@@ -0,0 +1,25 @@
+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";
+
+const Revert = ({rowId, mutate}) => {
+ const t = useTranslations();
+ const [openRevertDialog, setOpenRevertDialog] = useState(false);
+ return (
+ <>
+
+ setOpenRevertDialog(true)}>
+
+
+
+
+ >
+ )
+}
+export default Revert
\ No newline at end of file
diff --git a/src/components/dashboard/transportation-assistance/TableRowActions.jsx b/src/components/dashboard/transportation-assistance/TableRowActions.jsx
index 69f9d6f..22e3ebd 100644
--- a/src/components/dashboard/transportation-assistance/TableRowActions.jsx
+++ b/src/components/dashboard/transportation-assistance/TableRowActions.jsx
@@ -1,6 +1,7 @@
import {Box} from "@mui/material";
import Confirm from "./Form/ConfirmForm";
import Reject from "./Form/RejectForm";
+import Revert from "@/components/dashboard/transportation-assistance/Form/RevertForm";
const TableRow = ({row, mutate}) => {
@@ -10,6 +11,10 @@ const TableRow = ({row, mutate}) => {
rowId={row.getValue("id")}
mutate={mutate}
/>
+
{renderedCellValue}
),
},
+ {
+ accessorFn: (row) => row.refer_reason,
+ id: "refer_reason",
+ header: t("TransportationAssistance.refer_reason"),
+ enableColumnFilter: false,
+ datatype: "text",
+ filterFn: "contains",
+ columnFilterModeOptions: ["contains", "equals", "notEquals"],
+ Cell: ({renderedCellValue, row}) => {
+ return (
+ {renderedCellValue}
+ )
+ },
+ },
{
accessorFn: (row) => row.state_name,
id: "state_id",