debug province head expert
This commit is contained in:
@@ -82,6 +82,7 @@
|
||||
"transportation_assistance": "معاونت حمل و نقل",
|
||||
"change_password": "تغییر رمز عبور",
|
||||
"province_manager_page": "مدیر کل استانی",
|
||||
"province_head_expert": "کارشناس ستادی",
|
||||
"passenger_office_page": "اداره مسافر",
|
||||
"machinary_office_page": "ماشین آلات",
|
||||
"development_assistant": "معاون توسعه",
|
||||
@@ -268,7 +269,7 @@
|
||||
"proposed_amount_positive": "مقدار پیشنهادی باید مثبت باشد"
|
||||
},
|
||||
"ReviseDialog": {
|
||||
"confirm": "تایید",
|
||||
"revise": "ویرایش",
|
||||
"button-cancel": "بستن",
|
||||
"button-confirm": "تایید",
|
||||
"description_error": "وارد کردن توضیحات الزامی است!",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {REJECT_NAVGAV_PROVINCE_MANAGER} from "@/core/data/apiRoutes";
|
||||
import {REJECT_NAVGAN_PROVINCE_MANAGER} from "@/core/data/apiRoutes";
|
||||
import {
|
||||
Button,
|
||||
Dialog,
|
||||
@@ -46,7 +46,7 @@ const Reject = ({rowId, fetchUrl, mutate}) => {
|
||||
formData.append("expert_description", values.description);
|
||||
if (values.reject_img != null) formData.append("attachment", values.reject_img);
|
||||
|
||||
requestServer(`${REJECT_NAVGAV_PROVINCE_MANAGER}/${rowId}`, 'post', {
|
||||
requestServer(`${REJECT_NAVGAN_PROVINCE_MANAGER}/${rowId}`, 'post', {
|
||||
data: formData,
|
||||
}).then((response) => {
|
||||
mutate(fetchUrl)
|
||||
|
||||
@@ -35,7 +35,7 @@ const Confirm = ({rowId, fetchUrl, mutate}) => {
|
||||
},
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
if (values.description != "") formData.append("expert_description", values.description);
|
||||
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', {
|
||||
|
||||
@@ -43,7 +43,7 @@ const Reject = ({rowId, fetchUrl, mutate}) => {
|
||||
validationSchema,
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
formData.append("expert_description", values.description);
|
||||
formData.append("description", values.description);
|
||||
if (values.reject_img != null) formData.append("attachment", values.reject_img);
|
||||
|
||||
requestServer(`${REJECT_PROVINCE_HEAD_EXPERT}/${rowId}`, 'post', {
|
||||
|
||||
@@ -11,23 +11,29 @@ import {
|
||||
TextField,
|
||||
Tooltip,
|
||||
} from "@mui/material";
|
||||
import ThumbUpAltIcon from "@mui/icons-material/ThumbUpAlt";
|
||||
import EditIcon from '@mui/icons-material/Edit';
|
||||
import {useFormik} from "formik";
|
||||
import {REVISE_PROVINCE_HEAD_EXPERT} from "@/core/data/apiRoutes";
|
||||
import useRequest from "@/lib/app/hooks/useRequest";
|
||||
import * as Yup from "yup";
|
||||
|
||||
const Revise = ({rowId, fetchUrl, mutate}) => {
|
||||
const t = useTranslations();
|
||||
const [openConfirmDialog, setOpenConfirmDialog] = useState(false);
|
||||
const requestServer = useRequest({auth: true})
|
||||
|
||||
const validationSchema = Yup.object().shape({
|
||||
description: Yup.string().required(t("RejectDialog.description_error")),
|
||||
});
|
||||
|
||||
const formik = useFormik({
|
||||
initialValues: {
|
||||
description: "",
|
||||
},
|
||||
validationSchema,
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
if (values.description != "") formData.append("expert_description", values.description);
|
||||
if (values.description != "") formData.append("description", values.description);
|
||||
|
||||
requestServer(`${REVISE_PROVINCE_HEAD_EXPERT}/${rowId}`, 'post', {
|
||||
data: formData,
|
||||
@@ -46,19 +52,19 @@ const Revise = ({rowId, fetchUrl, mutate}) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tooltip title={t("ReviseDialog.confirm")}>
|
||||
<Tooltip title={t("ReviseDialog.revise")}>
|
||||
<IconButton
|
||||
color="primary"
|
||||
onClick={() => {
|
||||
setOpenConfirmDialog(true)
|
||||
}}
|
||||
>
|
||||
<ThumbUpAltIcon/>
|
||||
<EditIcon/>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Dialog fullWidth open={openConfirmDialog}
|
||||
PaperProps={{sx: {boxShadow: 'rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px'}}}>
|
||||
<DialogTitle>{t("ReviseDialog.confirm")}</DialogTitle>
|
||||
<DialogTitle>{t("ReviseDialog.revise")}</DialogTitle>
|
||||
<DialogContent>
|
||||
<Stack spacing={2}>
|
||||
<Stack>
|
||||
@@ -66,10 +72,14 @@ const Revise = ({rowId, fetchUrl, mutate}) => {
|
||||
name="description"
|
||||
multiline
|
||||
rows={8}
|
||||
label={<>
|
||||
<span>{t("ReviseDialog.description")}</span><small>{t("ReviseDialog.optional")}</small></>}
|
||||
label={t("ReviseDialog.description")}
|
||||
value={formik.values.description}
|
||||
onChange={handleDescriptionChange}
|
||||
onBlur={formik.handleBlur("description")}
|
||||
error={
|
||||
formik.touched.description && Boolean(formik.errors.description)
|
||||
}
|
||||
helperText={formik.touched.description && formik.errors.description}
|
||||
fullWidth
|
||||
variant="outlined"
|
||||
sx={{mt: 1}}
|
||||
|
||||
@@ -161,37 +161,37 @@ function DashboardProvinceHeadExpertComponent() {
|
||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||
),
|
||||
},
|
||||
{
|
||||
accessorFn: (row) => row.navgan_id,
|
||||
id: "navgan_id",
|
||||
header: t("ProvinceHeadExpert.navgan_id"),
|
||||
enableColumnFilter: true,
|
||||
datatype: "numeric",
|
||||
filterFn: "equals",
|
||||
columnFilterModeOptions: [
|
||||
"equals",
|
||||
"notEquals",
|
||||
"contains",
|
||||
"lessThan",
|
||||
"greaterThan",
|
||||
"between",
|
||||
],
|
||||
Cell: ({renderedCellValue}) => (
|
||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||
),
|
||||
},
|
||||
{
|
||||
accessorFn: (row) => row.vehicle_type,
|
||||
id: "vehicle_type",
|
||||
header: t("ProvinceHeadExpert.vehicle_type"),
|
||||
enableColumnFilter: true,
|
||||
datatype: "text",
|
||||
filterFn: "contains",
|
||||
columnFilterModeOptions: ["contains", "equals", "notEquals"],
|
||||
Cell: ({renderedCellValue}) => (
|
||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||
),
|
||||
},
|
||||
// {
|
||||
// accessorFn: (row) => row.navgan_id,
|
||||
// id: "navgan_id",
|
||||
// header: t("ProvinceHeadExpert.navgan_id"),
|
||||
// enableColumnFilter: true,
|
||||
// datatype: "numeric",
|
||||
// filterFn: "equals",
|
||||
// columnFilterModeOptions: [
|
||||
// "equals",
|
||||
// "notEquals",
|
||||
// "contains",
|
||||
// "lessThan",
|
||||
// "greaterThan",
|
||||
// "between",
|
||||
// ],
|
||||
// Cell: ({renderedCellValue}) => (
|
||||
// <Typography variant="body2">{renderedCellValue}</Typography>
|
||||
// ),
|
||||
// },
|
||||
// {
|
||||
// accessorFn: (row) => row.vehicle_type,
|
||||
// id: "vehicle_type",
|
||||
// header: t("ProvinceHeadExpert.vehicle_type"),
|
||||
// enableColumnFilter: true,
|
||||
// datatype: "text",
|
||||
// filterFn: "contains",
|
||||
// columnFilterModeOptions: ["contains", "equals", "notEquals"],
|
||||
// Cell: ({renderedCellValue}) => (
|
||||
// <Typography variant="body2">{renderedCellValue}</Typography>
|
||||
// ),
|
||||
// },
|
||||
{
|
||||
accessorFn: (row) => row.state_name,
|
||||
id: "state_id",
|
||||
|
||||
@@ -88,29 +88,6 @@ export const CONFIRM_REFAHI_PROVINCE_MANAGER =
|
||||
export const REJECT_REFAHI_PROVINCE_MANAGER =
|
||||
BASE_URL + "/dashboard/refahi_province_manager/reject";
|
||||
//refahi 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
|
||||
|
||||
// development assistant
|
||||
export const GET_DEVELOPMENT_ASSISTANT =
|
||||
@@ -148,6 +125,6 @@ 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/edit";
|
||||
BASE_URL + "/dashboard/province_head_expert/revise";
|
||||
//province head expert
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import AirlineSeatReclineNormalIcon from "@mui/icons-material/AirlineSeatRecline
|
||||
import DirectionsRailwayIcon from "@mui/icons-material/DirectionsRailway";
|
||||
import AssignmentIndIcon from "@mui/icons-material/AssignmentInd";
|
||||
import DesktopWindowsIcon from "@mui/icons-material/DesktopWindows";
|
||||
import GavelIcon from '@mui/icons-material/Gavel';
|
||||
|
||||
const sidebarMenu = [
|
||||
[
|
||||
@@ -41,14 +42,7 @@ const sidebarMenu = [
|
||||
selected: false,
|
||||
role: "passenger_office_chief",
|
||||
},
|
||||
{
|
||||
key: "sidebar.commercial-chief",
|
||||
type: "page",
|
||||
route: "/dashboard/commercial-chief",
|
||||
icon: <AssignmentIndIcon/>,
|
||||
selected: false,
|
||||
role: "commercial_chief",
|
||||
},
|
||||
|
||||
{
|
||||
key: "sidebar.transportation-assistant",
|
||||
type: "page",
|
||||
@@ -76,12 +70,12 @@ const sidebarMenu = [
|
||||
role: "province_manager",
|
||||
},
|
||||
{
|
||||
key: "sidebar.development-assistant",
|
||||
key: "sidebar.commercial-chief",
|
||||
type: "page",
|
||||
route: "/dashboard/development-assistant",
|
||||
icon: <DesktopWindowsIcon/>,
|
||||
route: "/dashboard/commercial-chief",
|
||||
icon: <AssignmentIndIcon/>,
|
||||
selected: false,
|
||||
role: "development_assistant",
|
||||
role: "commercial_chief",
|
||||
},
|
||||
{
|
||||
key: "sidebar.development-assistant",
|
||||
@@ -103,7 +97,7 @@ const sidebarMenu = [
|
||||
key: "sidebar.province-head-expert",
|
||||
type: "page",
|
||||
route: "/dashboard/province-head-expert",
|
||||
icon: <DesktopWindowsIcon/>,
|
||||
icon: <GavelIcon/>,
|
||||
selected: false,
|
||||
role: "province_head_expert",
|
||||
},
|
||||
|
||||
@@ -19,7 +19,7 @@ export async function getServerSideProps({req, locale}) {
|
||||
return {
|
||||
props: {
|
||||
messages: (await import(`&/locales/${locale}/app.json`)).default,
|
||||
title: "Dashboard.province_manager_page",
|
||||
title: "Dashboard.province_head_expert",
|
||||
isBot,
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user