Merge branch 'release/v1.8.0'
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
HOST="rms.witel.ir"
|
||||
NEXT_PUBLIC_VERSION="1.7.8"
|
||||
NEXT_PUBLIC_VERSION="1.8.0"
|
||||
NEXT_PUBLIC_API_URL="https://rms.witel.ir"
|
||||
NEXT_PUBLIC_MAPTILE_ENDPOINT="https://rmsmap.rmto.ir/141map"
|
||||
@@ -87,7 +87,9 @@ const DamageItem = ({ baseOnChange, baseDamageItems }) => {
|
||||
<Autocomplete
|
||||
options={damageItemList || []}
|
||||
size={"small"}
|
||||
getOptionLabel={(option) => `${option.title} - بروزرسانی: ${option.update_time ? moment(option.update_time).locale("fa").format("YYYY/MM/DD") : ""}` }
|
||||
getOptionLabel={(option) =>
|
||||
`${option.title} - بروزرسانی: ${option.update_time ? moment(option.update_time).locale("fa").format("YYYY/MM/DD") : ""}`
|
||||
}
|
||||
isOptionEqualToValue={(option, value) => option.id === value.id}
|
||||
loading={loadingDamageItemList}
|
||||
renderInput={(params) => (
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import { Close } from "@mui/icons-material";
|
||||
import { Dialog, DialogTitle, IconButton } from "@mui/material";
|
||||
import ChangeStatusForm from "./Form";
|
||||
|
||||
const ChangeStatusDialog = ({ open, setOpen, mutate, row }) => {
|
||||
return (
|
||||
<Dialog open={open} fullWidth maxWidth="xs">
|
||||
<IconButton
|
||||
aria-label="close"
|
||||
onClick={() => setOpen(false)}
|
||||
sx={(theme) => ({
|
||||
position: "absolute",
|
||||
right: 8,
|
||||
top: 8,
|
||||
zIndex: 50,
|
||||
color: theme.palette.grey[500],
|
||||
})}
|
||||
>
|
||||
<Close />
|
||||
</IconButton>
|
||||
<DialogTitle>تغییر وضعیت</DialogTitle>
|
||||
{open && <ChangeStatusForm setOpen={setOpen} mutate={mutate} row={row} />}
|
||||
</Dialog>
|
||||
);
|
||||
};
|
||||
export default ChangeStatusDialog;
|
||||
@@ -0,0 +1,96 @@
|
||||
import SelectBox from "@/core/components/SelectBox";
|
||||
import StyledForm from "@/core/components/StyledForm";
|
||||
import { CHANGE_STATUS_RECEIPT } from "@/core/utils/routes";
|
||||
import useRequest from "@/lib/hooks/useRequest";
|
||||
import { yupResolver } from "@hookform/resolvers/yup";
|
||||
import { Beenhere, ExitToApp } from "@mui/icons-material";
|
||||
import { Button, DialogActions, DialogContent, Grid, Stack } from "@mui/material";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
import { object, string } from "yup";
|
||||
|
||||
const validationSchema = object({
|
||||
status: string().required("وضعیت را مشخص کنید!"),
|
||||
});
|
||||
|
||||
const ChangeStatusForm = ({ setOpen, mutate, row }) => {
|
||||
const requestServer = useRequest({ notificationSuccess: true });
|
||||
const defaultValues = {
|
||||
status: row.original.status || "",
|
||||
};
|
||||
|
||||
const handleClose = () => {
|
||||
setOpen(false);
|
||||
};
|
||||
|
||||
const {
|
||||
control,
|
||||
handleSubmit,
|
||||
formState: { isSubmitting },
|
||||
} = useForm({
|
||||
defaultValues,
|
||||
resolver: yupResolver(validationSchema),
|
||||
mode: "all",
|
||||
});
|
||||
const onSubmitBase = async (data) => {
|
||||
const formData = new FormData();
|
||||
formData.append("status_id", data.status);
|
||||
await requestServer(`${CHANGE_STATUS_RECEIPT}/${row.original.id}`, "post", {
|
||||
data: formData,
|
||||
})
|
||||
.then((response) => {
|
||||
mutate();
|
||||
setOpen(false);
|
||||
})
|
||||
.catch((error) => {});
|
||||
};
|
||||
|
||||
return (
|
||||
<StyledForm onSubmit={handleSubmit(onSubmitBase)}>
|
||||
<DialogContent dividers sx={{ overflowY: "auto", maxHeight: "70vh" }}>
|
||||
<Stack>
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={12} sm={12} sx={{ display: "flex", alignItems: "center" }}>
|
||||
<Controller
|
||||
control={control}
|
||||
name={"status"}
|
||||
render={({ field, fieldState: { error } }) => (
|
||||
<SelectBox
|
||||
value={field.value}
|
||||
label="وضعیت"
|
||||
selectors={[
|
||||
{ id: 0, name_fa: "بدون اقدام" },
|
||||
{ id: 1, name_fa: "صدور نامه بیمه و کارشناسی داغی" },
|
||||
{ id: 2, name_fa: "فیش ها ثبت شده است" },
|
||||
{ id: 3, name_fa: "فاکتور صادر شده است" },
|
||||
{ id: 4, name_fa: "فاکتور پرداخت شده است" },
|
||||
{ id: 5, name_fa: "نامه پلیس راه صادر شده است" },
|
||||
]}
|
||||
schema={{ name: "name_fa", value: "id" }}
|
||||
error={error}
|
||||
onChange={field.onChange}
|
||||
helperText={error?.message}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Stack>
|
||||
</DialogContent>
|
||||
<DialogActions sx={{ alignItems: "center", justifyContent: "center" }}>
|
||||
<Button
|
||||
onClick={handleClose}
|
||||
variant="outlined"
|
||||
color="secondary"
|
||||
size="large"
|
||||
startIcon={<ExitToApp />}
|
||||
>
|
||||
بستن
|
||||
</Button>
|
||||
<Button variant="contained" size="large" disabled={isSubmitting} type={"submit"} endIcon={<Beenhere />}>
|
||||
{isSubmitting ? "در حال ثبت" : "ثبت"}
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</StyledForm>
|
||||
);
|
||||
};
|
||||
export default ChangeStatusForm;
|
||||
@@ -0,0 +1,19 @@
|
||||
import { Reply } from "@mui/icons-material";
|
||||
import { IconButton, Tooltip } from "@mui/material";
|
||||
import { useState } from "react";
|
||||
import ChangeStatusDialog from "./Dialog";
|
||||
|
||||
const ChangeStatus = ({ row, mutate }) => {
|
||||
const [open, setOpen] = useState(false);
|
||||
return (
|
||||
<>
|
||||
<Tooltip title="تغییر وضعیت">
|
||||
<IconButton color="primary" onClick={() => setOpen(true)}>
|
||||
<Reply />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<ChangeStatusDialog open={open} setOpen={setOpen} mutate={mutate} row={row} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default ChangeStatus;
|
||||
@@ -6,12 +6,13 @@ import SendToInsurance from "./SendToInsurance";
|
||||
import PoliceRahLetter from "./PoliceRahLetter";
|
||||
import EditForm from "../Form/EditForm";
|
||||
import { usePermissions } from "@/lib/hooks/usePermissions";
|
||||
import ChangeStatus from "./ChangeStatus";
|
||||
|
||||
const RowActions = ({ row, mutate }) => {
|
||||
const { data: userPermissions } = usePermissions();
|
||||
const hasDeletePermission = userPermissions.some((item) =>
|
||||
["delete-receipt", "delete-receipt-province"].includes(item)
|
||||
);
|
||||
const hasChangeStatusPermission = userPermissions.some((item) => ["change-accident-status"].includes(item));
|
||||
const hasDeletePermission = userPermissions.some((item) => ["delete-receipt"].includes(item));
|
||||
const hasDeleteProvincePermission = userPermissions.some((item) => ["delete-receipt-province"].includes(item));
|
||||
const hasEditPermission = userPermissions.some((item) => ["edit-receipt", "edit-receipt-province"].includes(item));
|
||||
return (
|
||||
<Box sx={{ display: "flex", gap: 1 }}>
|
||||
@@ -26,9 +27,10 @@ const RowActions = ({ row, mutate }) => {
|
||||
{hasEditPermission && [0].includes(row.original?.status) && (
|
||||
<EditForm row={row} mutate={mutate} rowId={row.getValue("id")} />
|
||||
)}
|
||||
{hasDeletePermission && [0].includes(row.original?.status) && (
|
||||
{(hasDeletePermission || (hasDeleteProvincePermission && [0].includes(row.original?.status))) && (
|
||||
<DeleteDialog mutate={mutate} rowId={row.getValue("id")} />
|
||||
)}
|
||||
{hasChangeStatusPermission && <ChangeStatus mutate={mutate} row={row} />}
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,12 +1,35 @@
|
||||
"use client";
|
||||
import PageTitle from "@/core/components/PageTitle";
|
||||
import { Stack } from "@mui/material";
|
||||
import { Alert, AlertTitle, List, ListItem, Stack, Typography } from "@mui/material";
|
||||
import OperatorList from "./OperatorList";
|
||||
import { useState } from "react";
|
||||
|
||||
const OperatorPage = () => {
|
||||
const [open, setOpen] = useState(true);
|
||||
return (
|
||||
<Stack spacing={1}>
|
||||
<PageTitle title={"کارتابل عملیات خسارات وارده بر ابنیه فنی و تاسیسات راه"} />
|
||||
{open && (
|
||||
<Alert severity="warning" onClose={() => setOpen(false)}>
|
||||
<AlertTitle>اطلاعیه مهم – خسارات وارده بر ابنیه فنی و تاسیسات راه</AlertTitle>
|
||||
<Typography variant="body2" gutterBottom>
|
||||
کارشناسان محترم،
|
||||
</Typography>
|
||||
<Typography variant="body2" gutterBottom>
|
||||
چنانچه خساراتی که قبلاً ثبت کردهاید به مرحله صدور فاکتور رسیده و پس از آن متوجه اشکالی در ثبت
|
||||
آنها شدهاید (مانند اشتباه در مبلغ یا سایر اطلاعات)، لازم است:
|
||||
</Typography>
|
||||
<List dense sx={{ listStyleType: "decimal", pl: 3 }}>
|
||||
<ListItem sx={{ display: "list-item" }}>کد یکتای خسارتهای مربوطه را استخراج نمایید.</ListItem>
|
||||
<ListItem sx={{ display: "list-item" }}>
|
||||
با پشتیبانی سامانه تماس بگیرید تا نسبت به حذف آن خسارات اقدام گردد.
|
||||
</ListItem>
|
||||
</List>
|
||||
<Typography variant="body2" fontWeight="bold">
|
||||
توجه: حذف خسارتهای مشکلدار بسیار حائز اهمیت است و بر امتیاز استانی شما تأثیر مستقیم دارد.
|
||||
</Typography>
|
||||
</Alert>
|
||||
)}
|
||||
<OperatorList />
|
||||
</Stack>
|
||||
);
|
||||
|
||||
@@ -138,8 +138,8 @@ const OperatorList = () => {
|
||||
props.dependencyFieldValue.value === ""
|
||||
? "empty"
|
||||
: loadingSubItemsList
|
||||
? "loading"
|
||||
: props.filterParameters.value
|
||||
? "loading"
|
||||
: props.filterParameters.value
|
||||
}
|
||||
columnSelectOption={getColumnSelectOptions}
|
||||
/>
|
||||
|
||||
@@ -138,8 +138,8 @@ const SupervisorList = () => {
|
||||
props.dependencyFieldValue?.value === ""
|
||||
? "empty"
|
||||
: loadingEdaratList
|
||||
? "loading"
|
||||
: props.filterParameters.value
|
||||
? "loading"
|
||||
: props.filterParameters.value
|
||||
}
|
||||
columnSelectOption={getColumnSelectOptions}
|
||||
/>
|
||||
@@ -238,8 +238,8 @@ const SupervisorList = () => {
|
||||
props.dependencyFieldValue.value === ""
|
||||
? "empty"
|
||||
: loadingSubItemsList
|
||||
? "loading"
|
||||
: props.filterParameters.value
|
||||
? "loading"
|
||||
: props.filterParameters.value
|
||||
}
|
||||
columnSelectOption={getColumnSelectOptions}
|
||||
/>
|
||||
@@ -336,7 +336,7 @@ const SupervisorList = () => {
|
||||
filterMode: "between",
|
||||
grow: false,
|
||||
size: 100,
|
||||
}
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -9,7 +9,12 @@ const Allocate = ({ row, setMachine, setOpenMachinesDialog }) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Button startIcon={<Done />} color="primary" sx={{ textTransform: "unset", alignSelf: "center" }} onClick={handleClick}>
|
||||
<Button
|
||||
startIcon={<Done />}
|
||||
color="primary"
|
||||
sx={{ textTransform: "unset", alignSelf: "center" }}
|
||||
onClick={handleClick}
|
||||
>
|
||||
تخصیص
|
||||
</Button>
|
||||
</>
|
||||
|
||||
@@ -128,8 +128,8 @@ const SupervisorList = () => {
|
||||
props.dependencyFieldValue?.value === ""
|
||||
? "empty"
|
||||
: loadingEdaratList
|
||||
? "loading"
|
||||
: props.filterParameters.value
|
||||
? "loading"
|
||||
: props.filterParameters.value
|
||||
}
|
||||
columnSelectOption={getColumnSelectOptions}
|
||||
/>
|
||||
|
||||
@@ -184,8 +184,6 @@ const ReportAccessRoadPage = () => {
|
||||
fetchData();
|
||||
}, [filterData]);
|
||||
|
||||
console.log(data);
|
||||
|
||||
return (
|
||||
<Stack spacing={1}>
|
||||
<PageTitle title={"گزارش بر اساس راه دسترسی غیر مجاز"} />
|
||||
|
||||
@@ -184,8 +184,6 @@ const ReportConstructionActivityPage = () => {
|
||||
fetchData();
|
||||
}, [filterData]);
|
||||
|
||||
console.log(data);
|
||||
|
||||
return (
|
||||
<Stack spacing={1}>
|
||||
<PageTitle title={"گزارش بر اساس ساخت و ساز غیر مجاز"} />
|
||||
|
||||
@@ -184,8 +184,6 @@ const ReportUtilityPassingActivityPage = () => {
|
||||
fetchData();
|
||||
}, [filterData]);
|
||||
|
||||
console.log(data);
|
||||
|
||||
return (
|
||||
<Stack spacing={1}>
|
||||
<PageTitle title={"گزارش بر اساس عبور تاسیسات زیربنایی غیر مجاز"} />
|
||||
|
||||
@@ -112,6 +112,7 @@ export const GET_INSURANCE = api + "/api/v3/receipts/generate_insurance_letter";
|
||||
export const GET_INSURANCE_PAGE = api + "/v2/receipt/send-to-insurance";
|
||||
export const GET_POLICERAH = api + "/api/v3/receipts/generate_police_document";
|
||||
export const GET_POLICERAH_PAGE = api + "/v2/receipt/document-release";
|
||||
export const CHANGE_STATUS_RECEIPT = api + "/api/v3/receipts/change_status";
|
||||
|
||||
// recept report
|
||||
export const GET_COUNTRY_RECEIPT_REPORT = api + "/api/v3/receipt_reports/country_report";
|
||||
|
||||
Reference in New Issue
Block a user