build and format
This commit is contained in:
@@ -1,4 +1,14 @@
|
|||||||
import { Box, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, CircularProgress, Typography } from "@mui/material";
|
import {
|
||||||
|
Box,
|
||||||
|
Table,
|
||||||
|
TableBody,
|
||||||
|
TableCell,
|
||||||
|
TableContainer,
|
||||||
|
TableHead,
|
||||||
|
TableRow,
|
||||||
|
CircularProgress,
|
||||||
|
Typography,
|
||||||
|
} from "@mui/material";
|
||||||
import "moment/locale/fa";
|
import "moment/locale/fa";
|
||||||
import { useHistory } from "@/lib/hooks/useHistory";
|
import { useHistory } from "@/lib/hooks/useHistory";
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,14 @@
|
|||||||
import { Box, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, CircularProgress, Typography } from "@mui/material";
|
import {
|
||||||
|
Box,
|
||||||
|
Table,
|
||||||
|
TableBody,
|
||||||
|
TableCell,
|
||||||
|
TableContainer,
|
||||||
|
TableHead,
|
||||||
|
TableRow,
|
||||||
|
CircularProgress,
|
||||||
|
Typography,
|
||||||
|
} from "@mui/material";
|
||||||
import "moment/locale/fa";
|
import "moment/locale/fa";
|
||||||
import { useHistory } from "@/lib/hooks/useHistory";
|
import { useHistory } from "@/lib/hooks/useHistory";
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import ThumbUpIcon from "@mui/icons-material/ThumbUp";
|
|||||||
import { IconButton, Tooltip } from "@mui/material";
|
import { IconButton, Tooltip } from "@mui/material";
|
||||||
|
|
||||||
const ConfirmAction = ({ onClick, disabled }) => {
|
const ConfirmAction = ({ onClick, disabled }) => {
|
||||||
if (disabled) return
|
if (disabled) return;
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Tooltip title="تایید اقدام">
|
<Tooltip title="تایید اقدام">
|
||||||
|
|||||||
@@ -1,4 +1,14 @@
|
|||||||
import { Box, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, CircularProgress, Typography } from "@mui/material";
|
import {
|
||||||
|
Box,
|
||||||
|
Table,
|
||||||
|
TableBody,
|
||||||
|
TableCell,
|
||||||
|
TableContainer,
|
||||||
|
TableHead,
|
||||||
|
TableRow,
|
||||||
|
CircularProgress,
|
||||||
|
Typography,
|
||||||
|
} from "@mui/material";
|
||||||
import "moment/locale/fa";
|
import "moment/locale/fa";
|
||||||
import { useHistory } from "@/lib/hooks/useHistory";
|
import { useHistory } from "@/lib/hooks/useHistory";
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Reply } from "@mui/icons-material";
|
|||||||
import { IconButton, Tooltip } from "@mui/material";
|
import { IconButton, Tooltip } from "@mui/material";
|
||||||
|
|
||||||
const ReferralAction = ({ onClick, disabled }) => {
|
const ReferralAction = ({ onClick, disabled }) => {
|
||||||
if (disabled) return
|
if (disabled) return;
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Tooltip title="ارجاع درخواست">
|
<Tooltip title="ارجاع درخواست">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import ThumbDownIcon from "@mui/icons-material/ThumbDown";
|
|||||||
import { IconButton, Tooltip } from "@mui/material";
|
import { IconButton, Tooltip } from "@mui/material";
|
||||||
|
|
||||||
const RejectAction = ({ onClick, disabled }) => {
|
const RejectAction = ({ onClick, disabled }) => {
|
||||||
if (disabled) return
|
if (disabled) return;
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Tooltip title="عدم تایید اقدام">
|
<Tooltip title="عدم تایید اقدام">
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
import { Card, CardContent, CircularProgress, Stack, Typography } from "@mui/material";
|
import { Card, CardContent, CircularProgress, Stack, Typography } from "@mui/material";
|
||||||
|
|
||||||
const PrevCartableOpinion = ({ item }) => {
|
const PrevCartableOpinion = ({ item }) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack>
|
<Stack>
|
||||||
<Card variant="outlined">
|
<Card variant="outlined">
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<Typography variant="body2">{item.previous_state_name}: {item.action_name}</Typography>
|
<Typography variant="body2">
|
||||||
|
{item.previous_state_name}: {item.action_name}
|
||||||
|
</Typography>
|
||||||
<Typography variant="body2">توضیحات: {item.expert_description}</Typography>
|
<Typography variant="body2">توضیحات: {item.expert_description}</Typography>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
import {
|
import { Card, CardContent, Stack, Typography } from "@mui/material";
|
||||||
Card,
|
|
||||||
CardContent,
|
|
||||||
Stack,
|
|
||||||
Typography
|
|
||||||
} from "@mui/material";
|
|
||||||
|
|
||||||
const QuestionVerifyNeedRoadForm = ({ row }) => {
|
const QuestionVerifyNeedRoadForm = ({ row }) => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
import {
|
import { Card, CardContent, Stack, Typography } from "@mui/material";
|
||||||
Card,
|
|
||||||
CardContent,
|
|
||||||
Stack,
|
|
||||||
Typography
|
|
||||||
} from "@mui/material";
|
|
||||||
|
|
||||||
const QuestionVerifyRoadSafetyForm = ({ row }) => {
|
const QuestionVerifyRoadSafetyForm = ({ row }) => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Close } from "@mui/icons-material";
|
import { Close } from "@mui/icons-material";
|
||||||
import { Button, Dialog, DialogTitle, IconButton } from "@mui/material"
|
import { Button, Dialog, DialogTitle, IconButton } from "@mui/material";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import ReferForm from "./Form";
|
import ReferForm from "./Form";
|
||||||
|
|
||||||
@@ -8,10 +8,23 @@ const Refer = ({ rowId, mutate, handleClose, isSubmitting }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Button onClick={() => setOpenReferDialog(true)} variant="contained" color="error" disabled={isSubmitting} size="large">
|
<Button
|
||||||
|
onClick={() => setOpenReferDialog(true)}
|
||||||
|
variant="contained"
|
||||||
|
color="error"
|
||||||
|
disabled={isSubmitting}
|
||||||
|
size="large"
|
||||||
|
>
|
||||||
مخالفت
|
مخالفت
|
||||||
</Button>
|
</Button>
|
||||||
<Dialog open={openReferDialog} onClose={() => { setOpenReferDialog(false) }} maxWidth="xs" fullWidth>
|
<Dialog
|
||||||
|
open={openReferDialog}
|
||||||
|
onClose={() => {
|
||||||
|
setOpenReferDialog(false);
|
||||||
|
}}
|
||||||
|
maxWidth="xs"
|
||||||
|
fullWidth
|
||||||
|
>
|
||||||
<IconButton
|
<IconButton
|
||||||
aria-label="close"
|
aria-label="close"
|
||||||
onClick={() => setOpenReferDialog(false)}
|
onClick={() => setOpenReferDialog(false)}
|
||||||
@@ -26,9 +39,16 @@ const Refer = ({ rowId, mutate, handleClose, isSubmitting }) => {
|
|||||||
<Close />
|
<Close />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<DialogTitle>مخالفت و ارجاع به دفتر حریم</DialogTitle>
|
<DialogTitle>مخالفت و ارجاع به دفتر حریم</DialogTitle>
|
||||||
{openReferDialog && <ReferForm handleClose={handleClose} setOpenReferDialog={setOpenReferDialog} rowId={rowId} mutate={mutate} />}
|
{openReferDialog && (
|
||||||
|
<ReferForm
|
||||||
|
handleClose={handleClose}
|
||||||
|
setOpenReferDialog={setOpenReferDialog}
|
||||||
|
rowId={rowId}
|
||||||
|
mutate={mutate}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</>
|
</>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
export default Refer
|
export default Refer;
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ import { useState } from "react";
|
|||||||
import PrevCartableOpinion from "./PrevCartableOpinion";
|
import PrevCartableOpinion from "./PrevCartableOpinion";
|
||||||
import Questions from "./Questions";
|
import Questions from "./Questions";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const ConfirmRoadSafetyFormContext = ({ row, data, rowId, mutate, handleClose }) => {
|
const ConfirmRoadSafetyFormContext = ({ row, data, rowId, mutate, handleClose }) => {
|
||||||
const [tabState, setTabState] = useState(0);
|
const [tabState, setTabState] = useState(0);
|
||||||
|
|
||||||
@@ -56,7 +54,7 @@ const ConfirmRoadSafetyFormContext = ({ row, data, rowId, mutate, handleClose })
|
|||||||
>
|
>
|
||||||
{"بستن"}
|
{"بستن"}
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant="contained" size="large" onClick={() => setTabState(s => s + 1)}>
|
<Button variant="contained" size="large" onClick={() => setTabState((s) => s + 1)}>
|
||||||
مرحله بعد
|
مرحله بعد
|
||||||
</Button>
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
@@ -70,15 +68,10 @@ const ConfirmRoadSafetyFormContext = ({ row, data, rowId, mutate, handleClose })
|
|||||||
</Stack>
|
</Stack>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions sx={{ alignItems: "center", justifyContent: "center" }}>
|
<DialogActions sx={{ alignItems: "center", justifyContent: "center" }}>
|
||||||
<Button
|
<Button onClick={handlePrev} variant="outlined" color="secondary" size="large">
|
||||||
onClick={handlePrev}
|
|
||||||
variant="outlined"
|
|
||||||
color="secondary"
|
|
||||||
size="large"
|
|
||||||
>
|
|
||||||
مرحله قبل
|
مرحله قبل
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant="contained" size="large" onClick={() => setTabState(s => s + 1)}>
|
<Button variant="contained" size="large" onClick={() => setTabState((s) => s + 1)}>
|
||||||
مرحله بعد
|
مرحله بعد
|
||||||
</Button>
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
import { Card, CardContent, CircularProgress, Stack, Typography } from "@mui/material";
|
import { Card, CardContent, CircularProgress, Stack, Typography } from "@mui/material";
|
||||||
|
|
||||||
const PrevCartableOpinion = ({ item }) => {
|
const PrevCartableOpinion = ({ item }) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack>
|
<Stack>
|
||||||
<Card variant="outlined">
|
<Card variant="outlined">
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<Typography variant="body2">{item.previous_state_name}: {item.action_name}</Typography>
|
<Typography variant="body2">
|
||||||
|
{item.previous_state_name}: {item.action_name}
|
||||||
|
</Typography>
|
||||||
<Typography variant="body2">توضیحات: {item.expert_description}</Typography>
|
<Typography variant="body2">توضیحات: {item.expert_description}</Typography>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
import {
|
import { Card, CardContent, Stack, Typography } from "@mui/material";
|
||||||
Card,
|
|
||||||
CardContent,
|
|
||||||
Stack,
|
|
||||||
Typography
|
|
||||||
} from "@mui/material";
|
|
||||||
|
|
||||||
const QuestionVerifyNeedRoadForm = () => {
|
const QuestionVerifyNeedRoadForm = () => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
import {
|
import { Card, CardContent, Stack, Typography } from "@mui/material";
|
||||||
Card,
|
|
||||||
CardContent,
|
|
||||||
Stack,
|
|
||||||
Typography
|
|
||||||
} from "@mui/material";
|
|
||||||
|
|
||||||
const QuestionVerifyRoadSafetyForm = ({ row }) => {
|
const QuestionVerifyRoadSafetyForm = ({ row }) => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -23,15 +23,15 @@ const ReferForm = ({ rowId, mutate, handleClose, setOpenReferDialog }) => {
|
|||||||
const onSubmit = async (data) => {
|
const onSubmit = async (data) => {
|
||||||
await requestServer(`${REFER_VERIFY_NEADROAD_ROAD_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT}/${rowId}`, "post", {
|
await requestServer(`${REFER_VERIFY_NEADROAD_ROAD_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT}/${rowId}`, "post", {
|
||||||
data: {
|
data: {
|
||||||
expert_description: data.description
|
expert_description: data.description,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
handleClose();
|
handleClose();
|
||||||
setOpenReferDialog(false)
|
setOpenReferDialog(false);
|
||||||
mutate();
|
mutate();
|
||||||
})
|
})
|
||||||
.catch(() => { });
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -60,11 +60,17 @@ const ReferForm = ({ rowId, mutate, handleClose, setOpenReferDialog }) => {
|
|||||||
</Stack>
|
</Stack>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions sx={{ alignItems: "center", justifyContent: "center" }}>
|
<DialogActions sx={{ alignItems: "center", justifyContent: "center" }}>
|
||||||
<Button variant="contained" size="large" disabled={isSubmitting} type="button" onClick={handleSubmit(onSubmit)}>
|
<Button
|
||||||
|
variant="contained"
|
||||||
|
size="large"
|
||||||
|
disabled={isSubmitting}
|
||||||
|
type="button"
|
||||||
|
onClick={handleSubmit(onSubmit)}
|
||||||
|
>
|
||||||
ثبت
|
ثبت
|
||||||
</Button>
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</>
|
</>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
export default ReferForm
|
export default ReferForm;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Close } from "@mui/icons-material";
|
import { Close } from "@mui/icons-material";
|
||||||
import { Button, Dialog, DialogTitle, IconButton } from "@mui/material"
|
import { Button, Dialog, DialogTitle, IconButton } from "@mui/material";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import ReferForm from "./Form";
|
import ReferForm from "./Form";
|
||||||
|
|
||||||
@@ -8,10 +8,23 @@ const Refer = ({ rowId, mutate, handleClose, isSubmitting }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Button onClick={() => setOpenReferDialog(true)} variant="contained" color="error" disabled={isSubmitting} size="large">
|
<Button
|
||||||
|
onClick={() => setOpenReferDialog(true)}
|
||||||
|
variant="contained"
|
||||||
|
color="error"
|
||||||
|
disabled={isSubmitting}
|
||||||
|
size="large"
|
||||||
|
>
|
||||||
مخالفت
|
مخالفت
|
||||||
</Button>
|
</Button>
|
||||||
<Dialog open={openReferDialog} onClose={() => { setOpenReferDialog(false) }} maxWidth="xs" fullWidth>
|
<Dialog
|
||||||
|
open={openReferDialog}
|
||||||
|
onClose={() => {
|
||||||
|
setOpenReferDialog(false);
|
||||||
|
}}
|
||||||
|
maxWidth="xs"
|
||||||
|
fullWidth
|
||||||
|
>
|
||||||
<IconButton
|
<IconButton
|
||||||
aria-label="close"
|
aria-label="close"
|
||||||
onClick={() => setOpenReferDialog(false)}
|
onClick={() => setOpenReferDialog(false)}
|
||||||
@@ -26,9 +39,16 @@ const Refer = ({ rowId, mutate, handleClose, isSubmitting }) => {
|
|||||||
<Close />
|
<Close />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<DialogTitle>مخالفت و ارجاع به دفتر حریم</DialogTitle>
|
<DialogTitle>مخالفت و ارجاع به دفتر حریم</DialogTitle>
|
||||||
{openReferDialog && <ReferForm handleClose={handleClose} setOpenReferDialog={setOpenReferDialog} rowId={rowId} mutate={mutate} />}
|
{openReferDialog && (
|
||||||
|
<ReferForm
|
||||||
|
handleClose={handleClose}
|
||||||
|
setOpenReferDialog={setOpenReferDialog}
|
||||||
|
rowId={rowId}
|
||||||
|
mutate={mutate}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</>
|
</>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
export default Refer
|
export default Refer;
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
import StyledForm from "@/core/components/StyledForm";
|
import StyledForm from "@/core/components/StyledForm";
|
||||||
import { CONFIRM_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT, CONFIRM_VERIFY_NEADROAD_ROAD_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT } from "@/core/utils/routes";
|
import {
|
||||||
|
CONFIRM_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT,
|
||||||
|
CONFIRM_VERIFY_NEADROAD_ROAD_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT,
|
||||||
|
} from "@/core/utils/routes";
|
||||||
import useRequest from "@/lib/hooks/useRequest";
|
import useRequest from "@/lib/hooks/useRequest";
|
||||||
import { yupResolver } from "@hookform/resolvers/yup";
|
import { yupResolver } from "@hookform/resolvers/yup";
|
||||||
import { Button, DialogActions, DialogContent, Stack } from "@mui/material";
|
import { Button, DialogActions, DialogContent, Stack } from "@mui/material";
|
||||||
@@ -30,27 +33,33 @@ const Questions = ({ row, rowId, mutate, handleClose, handlePrev }) => {
|
|||||||
const onSubmit = async (data) => {
|
const onSubmit = async (data) => {
|
||||||
await requestServer(`${CONFIRM_VERIFY_NEADROAD_ROAD_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT}/${rowId}`, "post", {
|
await requestServer(`${CONFIRM_VERIFY_NEADROAD_ROAD_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT}/${rowId}`, "post", {
|
||||||
data: {
|
data: {
|
||||||
expert_description: data.description
|
expert_description: data.description,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
handleClose();
|
handleClose();
|
||||||
mutate();
|
mutate();
|
||||||
})
|
})
|
||||||
.catch(() => { });
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledForm onSubmit={handleSubmit(onSubmit)}>
|
<StyledForm onSubmit={handleSubmit(onSubmit)}>
|
||||||
<DialogContent dividers>
|
<DialogContent dividers>
|
||||||
<Stack >
|
<Stack>
|
||||||
<QuestionVerifyNeedRoadForm row={row} />
|
<QuestionVerifyNeedRoadForm row={row} />
|
||||||
<DescriptionForm control={control} />
|
<DescriptionForm control={control} />
|
||||||
</Stack>
|
</Stack>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions sx={{ alignItems: "center", justifyContent: "space-between" }}>
|
<DialogActions sx={{ alignItems: "center", justifyContent: "space-between" }}>
|
||||||
<Stack spacing={1} direction={'row'}>
|
<Stack spacing={1} direction={"row"}>
|
||||||
<Button onClick={handlePrev} variant="outlined" color="secondary" disabled={isSubmitting} size="large">
|
<Button
|
||||||
|
onClick={handlePrev}
|
||||||
|
variant="outlined"
|
||||||
|
color="secondary"
|
||||||
|
disabled={isSubmitting}
|
||||||
|
size="large"
|
||||||
|
>
|
||||||
{"مرحله قبلی"}
|
{"مرحله قبلی"}
|
||||||
</Button>
|
</Button>
|
||||||
<Refer rowId={rowId} mutate={mutate} handleClose={handleClose} isSubmitting={isSubmitting} />
|
<Refer rowId={rowId} mutate={mutate} handleClose={handleClose} isSubmitting={isSubmitting} />
|
||||||
@@ -60,6 +69,6 @@ const Questions = ({ row, rowId, mutate, handleClose, handlePrev }) => {
|
|||||||
</Button>
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</StyledForm>
|
</StyledForm>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
export default Questions
|
export default Questions;
|
||||||
|
|||||||
@@ -30,7 +30,13 @@ const ConfirmRoadSafetyDialog = ({ row, handleClose, rowId, mutate }) => {
|
|||||||
{loading ? (
|
{loading ? (
|
||||||
<DialogLoading />
|
<DialogLoading />
|
||||||
) : data ? (
|
) : data ? (
|
||||||
<ConfirmRoadSafetyFormContext row={row} rowId={rowId} data={data} mutate={mutate} handleClose={handleClose} />
|
<ConfirmRoadSafetyFormContext
|
||||||
|
row={row}
|
||||||
|
rowId={rowId}
|
||||||
|
data={data}
|
||||||
|
mutate={mutate}
|
||||||
|
handleClose={handleClose}
|
||||||
|
/>
|
||||||
) : (
|
) : (
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<Typography textAlign={"center"}>اطلاعات درخواست در سامانه یافت نشد</Typography>
|
<Typography textAlign={"center"}>اطلاعات درخواست در سامانه یافت نشد</Typography>
|
||||||
@@ -38,6 +44,5 @@ const ConfirmRoadSafetyDialog = ({ row, handleClose, rowId, mutate }) => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
}
|
export default ConfirmRoadSafetyDialog;
|
||||||
export default ConfirmRoadSafetyDialog
|
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ import { useState } from "react";
|
|||||||
import PrevCartableOpinion from "./PrevCartableOpinion";
|
import PrevCartableOpinion from "./PrevCartableOpinion";
|
||||||
import Questions from "./Questions";
|
import Questions from "./Questions";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const ConfirmRoadSafetyFormContext = ({ row, data, rowId, mutate, handleClose }) => {
|
const ConfirmRoadSafetyFormContext = ({ row, data, rowId, mutate, handleClose }) => {
|
||||||
const [tabState, setTabState] = useState(0);
|
const [tabState, setTabState] = useState(0);
|
||||||
|
|
||||||
@@ -56,7 +54,7 @@ const ConfirmRoadSafetyFormContext = ({ row, data, rowId, mutate, handleClose })
|
|||||||
>
|
>
|
||||||
{"بستن"}
|
{"بستن"}
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant="contained" size="large" onClick={() => setTabState(s => s + 1)}>
|
<Button variant="contained" size="large" onClick={() => setTabState((s) => s + 1)}>
|
||||||
مرحله بعد
|
مرحله بعد
|
||||||
</Button>
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
@@ -70,15 +68,10 @@ const ConfirmRoadSafetyFormContext = ({ row, data, rowId, mutate, handleClose })
|
|||||||
</Stack>
|
</Stack>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions sx={{ alignItems: "center", justifyContent: "center" }}>
|
<DialogActions sx={{ alignItems: "center", justifyContent: "center" }}>
|
||||||
<Button
|
<Button onClick={handlePrev} variant="outlined" color="secondary" size="large">
|
||||||
onClick={handlePrev}
|
|
||||||
variant="outlined"
|
|
||||||
color="secondary"
|
|
||||||
size="large"
|
|
||||||
>
|
|
||||||
مرحله قبل
|
مرحله قبل
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant="contained" size="large" onClick={() => setTabState(s => s + 1)}>
|
<Button variant="contained" size="large" onClick={() => setTabState((s) => s + 1)}>
|
||||||
مرحله بعد
|
مرحله بعد
|
||||||
</Button>
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
import { Card, CardContent, CircularProgress, Stack, Typography } from "@mui/material";
|
import { Card, CardContent, CircularProgress, Stack, Typography } from "@mui/material";
|
||||||
|
|
||||||
const PrevCartableOpinion = ({ item }) => {
|
const PrevCartableOpinion = ({ item }) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack>
|
<Stack>
|
||||||
<Card variant="outlined">
|
<Card variant="outlined">
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<Typography variant="body2">{item.previous_state_name}: {item.action_name}</Typography>
|
<Typography variant="body2">
|
||||||
|
{item.previous_state_name}: {item.action_name}
|
||||||
|
</Typography>
|
||||||
<Typography variant="body2">توضیحات: {item.expert_description}</Typography>
|
<Typography variant="body2">توضیحات: {item.expert_description}</Typography>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
import {
|
import { Card, CardContent, Stack, Typography } from "@mui/material";
|
||||||
Card,
|
|
||||||
CardContent,
|
|
||||||
Stack,
|
|
||||||
Typography
|
|
||||||
} from "@mui/material";
|
|
||||||
|
|
||||||
const QuestionVerifyNeedRoadForm = ({ row }) => {
|
const QuestionVerifyNeedRoadForm = ({ row }) => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -23,15 +23,15 @@ const ReferForm = ({ rowId, mutate, handleClose, setOpenReferDialog }) => {
|
|||||||
const onSubmit = async (data) => {
|
const onSubmit = async (data) => {
|
||||||
await requestServer(`${REFER_VERIFY_NEADROAD_ROAD_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT}/${rowId}`, "post", {
|
await requestServer(`${REFER_VERIFY_NEADROAD_ROAD_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT}/${rowId}`, "post", {
|
||||||
data: {
|
data: {
|
||||||
expert_description: data.description
|
expert_description: data.description,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
handleClose();
|
handleClose();
|
||||||
setOpenReferDialog(false)
|
setOpenReferDialog(false);
|
||||||
mutate();
|
mutate();
|
||||||
})
|
})
|
||||||
.catch(() => { });
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -60,11 +60,17 @@ const ReferForm = ({ rowId, mutate, handleClose, setOpenReferDialog }) => {
|
|||||||
</Stack>
|
</Stack>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions sx={{ alignItems: "center", justifyContent: "center" }}>
|
<DialogActions sx={{ alignItems: "center", justifyContent: "center" }}>
|
||||||
<Button variant="contained" size="large" disabled={isSubmitting} type="button" onClick={handleSubmit(onSubmit)}>
|
<Button
|
||||||
|
variant="contained"
|
||||||
|
size="large"
|
||||||
|
disabled={isSubmitting}
|
||||||
|
type="button"
|
||||||
|
onClick={handleSubmit(onSubmit)}
|
||||||
|
>
|
||||||
ثبت
|
ثبت
|
||||||
</Button>
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</>
|
</>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
export default ReferForm
|
export default ReferForm;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Close } from "@mui/icons-material";
|
import { Close } from "@mui/icons-material";
|
||||||
import { Button, Dialog, DialogTitle, IconButton } from "@mui/material"
|
import { Button, Dialog, DialogTitle, IconButton } from "@mui/material";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import ReferForm from "./Form";
|
import ReferForm from "./Form";
|
||||||
|
|
||||||
@@ -8,10 +8,23 @@ const Refer = ({ rowId, mutate, handleClose, isSubmitting }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Button onClick={() => setOpenReferDialog(true)} variant="contained" color="error" disabled={isSubmitting} size="large">
|
<Button
|
||||||
|
onClick={() => setOpenReferDialog(true)}
|
||||||
|
variant="contained"
|
||||||
|
color="error"
|
||||||
|
disabled={isSubmitting}
|
||||||
|
size="large"
|
||||||
|
>
|
||||||
مخالفت
|
مخالفت
|
||||||
</Button>
|
</Button>
|
||||||
<Dialog open={openReferDialog} onClose={() => { setOpenReferDialog(false) }} maxWidth="xs" fullWidth>
|
<Dialog
|
||||||
|
open={openReferDialog}
|
||||||
|
onClose={() => {
|
||||||
|
setOpenReferDialog(false);
|
||||||
|
}}
|
||||||
|
maxWidth="xs"
|
||||||
|
fullWidth
|
||||||
|
>
|
||||||
<IconButton
|
<IconButton
|
||||||
aria-label="close"
|
aria-label="close"
|
||||||
onClick={() => setOpenReferDialog(false)}
|
onClick={() => setOpenReferDialog(false)}
|
||||||
@@ -26,9 +39,16 @@ const Refer = ({ rowId, mutate, handleClose, isSubmitting }) => {
|
|||||||
<Close />
|
<Close />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<DialogTitle>مخالفت و ارجاع به دفتر حریم</DialogTitle>
|
<DialogTitle>مخالفت و ارجاع به دفتر حریم</DialogTitle>
|
||||||
{openReferDialog && <ReferForm handleClose={handleClose} setOpenReferDialog={setOpenReferDialog} rowId={rowId} mutate={mutate} />}
|
{openReferDialog && (
|
||||||
|
<ReferForm
|
||||||
|
handleClose={handleClose}
|
||||||
|
setOpenReferDialog={setOpenReferDialog}
|
||||||
|
rowId={rowId}
|
||||||
|
mutate={mutate}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</>
|
</>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
export default Refer
|
export default Refer;
|
||||||
|
|||||||
@@ -29,27 +29,33 @@ const Questions = ({ row, rowId, mutate, handleClose, handlePrev }) => {
|
|||||||
const onSubmit = async (data) => {
|
const onSubmit = async (data) => {
|
||||||
await requestServer(`${CONFIRM_VERIFY_NEADROAD_ROAD_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT}/${rowId}`, "post", {
|
await requestServer(`${CONFIRM_VERIFY_NEADROAD_ROAD_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT}/${rowId}`, "post", {
|
||||||
data: {
|
data: {
|
||||||
expert_description: data.description
|
expert_description: data.description,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
handleClose();
|
handleClose();
|
||||||
mutate();
|
mutate();
|
||||||
})
|
})
|
||||||
.catch(() => { });
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledForm onSubmit={handleSubmit(onSubmit)}>
|
<StyledForm onSubmit={handleSubmit(onSubmit)}>
|
||||||
<DialogContent dividers>
|
<DialogContent dividers>
|
||||||
<Stack >
|
<Stack>
|
||||||
<QuestionVerifyNeedRoadForm row={row} />
|
<QuestionVerifyNeedRoadForm row={row} />
|
||||||
<DescriptionForm control={control} />
|
<DescriptionForm control={control} />
|
||||||
</Stack>
|
</Stack>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions sx={{ alignItems: "center", justifyContent: "space-between" }}>
|
<DialogActions sx={{ alignItems: "center", justifyContent: "space-between" }}>
|
||||||
<Stack spacing={1} direction={'row'}>
|
<Stack spacing={1} direction={"row"}>
|
||||||
<Button onClick={handlePrev} variant="outlined" color="secondary" disabled={isSubmitting} size="large">
|
<Button
|
||||||
|
onClick={handlePrev}
|
||||||
|
variant="outlined"
|
||||||
|
color="secondary"
|
||||||
|
disabled={isSubmitting}
|
||||||
|
size="large"
|
||||||
|
>
|
||||||
{"مرحله قبلی"}
|
{"مرحله قبلی"}
|
||||||
</Button>
|
</Button>
|
||||||
<Refer rowId={rowId} mutate={mutate} handleClose={handleClose} isSubmitting={isSubmitting} />
|
<Refer rowId={rowId} mutate={mutate} handleClose={handleClose} isSubmitting={isSubmitting} />
|
||||||
@@ -59,6 +65,6 @@ const Questions = ({ row, rowId, mutate, handleClose, handlePrev }) => {
|
|||||||
</Button>
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</StyledForm>
|
</StyledForm>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
export default Questions
|
export default Questions;
|
||||||
|
|||||||
@@ -1,4 +1,14 @@
|
|||||||
import { Box, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, CircularProgress, Typography } from "@mui/material";
|
import {
|
||||||
|
Box,
|
||||||
|
Table,
|
||||||
|
TableBody,
|
||||||
|
TableCell,
|
||||||
|
TableContainer,
|
||||||
|
TableHead,
|
||||||
|
TableRow,
|
||||||
|
CircularProgress,
|
||||||
|
Typography,
|
||||||
|
} from "@mui/material";
|
||||||
import "moment/locale/fa";
|
import "moment/locale/fa";
|
||||||
import { useHistory } from "@/lib/hooks/useHistory";
|
import { useHistory } from "@/lib/hooks/useHistory";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user