Merge branch 'release/v1.0.1'
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
HOST="rms.witel.ir"
|
||||
NEXT_PUBLIC_VERSION="1.0.0"
|
||||
NEXT_PUBLIC_VERSION="1.0.1"
|
||||
NEXT_PUBLIC_API_URL="https://rms.witel.ir"
|
||||
NEXT_PUBLIC_MAPTILE_ENDPOINT="https://rmsmap.rmto.ir/141map"
|
||||
@@ -79,6 +79,22 @@ const CreateFactorContent = ({ row, mutate, rowId, setOpenCreateFactorDialog })
|
||||
<>
|
||||
<DialogContent dividers>
|
||||
<Grid container spacing={3} sx={{ alignItems: "center", justifyContent: "space-around" }}>
|
||||
<Grid item xs={12} sm={12} sx={{ display: "flex", alignItems: "center" }}>
|
||||
<Box sx={{ display: "flex", alignItems: "center" }}>
|
||||
<Chip
|
||||
icon={<RequestQuoteIcon />}
|
||||
label={
|
||||
<Typography variant="body2" sx={{ fontWeight: 600, color: "grey.700" }}>
|
||||
مبلغ کل خسارت برآورد شده
|
||||
</Typography>
|
||||
}
|
||||
/>
|
||||
</Box>
|
||||
<Divider sx={{ flex: 1, mx: 2 }} />
|
||||
<Typography variant="body2" sx={{ fontWeight: 600, color: "grey.800" }}>
|
||||
{(row.original?.sum / 1).toLocaleString() || "0"} ریال
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={12} sx={{ display: "flex", alignItems: "center" }}>
|
||||
<Box sx={{ display: "flex", alignItems: "center" }}>
|
||||
<Chip
|
||||
@@ -111,22 +127,6 @@ const CreateFactorContent = ({ row, mutate, rowId, setOpenCreateFactorDialog })
|
||||
{(row.original?.deposit_daghi_amount / 1).toLocaleString() || "0"} ریال
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={12} sx={{ display: "flex", alignItems: "center" }}>
|
||||
<Box sx={{ display: "flex", alignItems: "center" }}>
|
||||
<Chip
|
||||
icon={<RequestQuoteIcon />}
|
||||
label={
|
||||
<Typography variant="body2" sx={{ fontWeight: 600, color: "grey.700" }}>
|
||||
مبلغ کل خسارت برآورد شده
|
||||
</Typography>
|
||||
}
|
||||
/>
|
||||
</Box>
|
||||
<Divider sx={{ flex: 1, mx: 2 }} />
|
||||
<Typography variant="body2" sx={{ fontWeight: 600, color: "grey.800" }}>
|
||||
{(row.original?.sum / 1).toLocaleString() || "0"} ریال
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={12} sx={{ display: "flex", alignItems: "center" }}>
|
||||
<Box sx={{ display: "flex", alignItems: "center" }}>
|
||||
<Chip
|
||||
@@ -140,7 +140,11 @@ const CreateFactorContent = ({ row, mutate, rowId, setOpenCreateFactorDialog })
|
||||
</Box>
|
||||
<Divider sx={{ flex: 1, mx: 2 }} />
|
||||
<Typography variant="h5" sx={{ fontWeight: 600, color: "primary.main" }}>
|
||||
{(row.original?.sum / 1).toLocaleString() || "0"} ریال
|
||||
{(
|
||||
row.original?.sum -
|
||||
(row.original?.deposit_insurance_amount + row.original?.deposit_daghi_amount)
|
||||
).toLocaleString() || "0"}{" "}
|
||||
ریال
|
||||
</Typography>
|
||||
</Grid>
|
||||
{!factorCreated && (
|
||||
|
||||
@@ -23,7 +23,7 @@ const DamageItemContent = ({ rowId }) => {
|
||||
try {
|
||||
setLoading(true);
|
||||
const response = await request(`${GET_DAMAGE_ITEM_DETAILS}/${rowId}`);
|
||||
setData(response.data.data.damages);
|
||||
setData(response.data.data);
|
||||
} catch (error) {
|
||||
} finally {
|
||||
setLoading(false);
|
||||
@@ -38,7 +38,7 @@ const DamageItemContent = ({ rowId }) => {
|
||||
<DialogContent>
|
||||
{loading ? (
|
||||
<DialogLoading />
|
||||
) : data ? (
|
||||
) : data.damages ? (
|
||||
<TableContainer sx={{ maxHeight: 600 }}>
|
||||
<Table stickyHeader sx={{ minWidth: 800 }}>
|
||||
<TableHead>
|
||||
@@ -49,7 +49,7 @@ const DamageItemContent = ({ rowId }) => {
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
{data.map((item) => {
|
||||
{data.damages.map((item) => {
|
||||
return (
|
||||
<TableRow
|
||||
key={item.id}
|
||||
@@ -63,6 +63,12 @@ const DamageItemContent = ({ rowId }) => {
|
||||
</TableRow>
|
||||
);
|
||||
})}
|
||||
<TableRow sx={{ "&:last-child td, &:last-child th": { border: 0 } }}>
|
||||
<TableCell colSpan={2} align="center">
|
||||
اجرت نصب
|
||||
</TableCell>
|
||||
<TableCell>{(data.ojrate_nasb / 1).toLocaleString()}</TableCell>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { Button, DialogActions, DialogContent, FormControlLabel, RadioGroup, Stack } from "@mui/material";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
import Radio from "@mui/material/Radio";
|
||||
import StyledForm from "@/core/components/StyledForm";
|
||||
import { yupResolver } from "@hookform/resolvers/yup";
|
||||
import BeenhereIcon from "@mui/icons-material/Beenhere";
|
||||
import { Button, DialogActions, DialogContent, FormControlLabel, RadioGroup, Stack } from "@mui/material";
|
||||
import Radio from "@mui/material/Radio";
|
||||
import { useState } from "react";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
import { mixed, object, string } from "yup";
|
||||
import RegisterActionDone from "./RegisterActionDone";
|
||||
import RegisterActionUndone from "./RegisterActionUndone";
|
||||
import { yupResolver } from "@hookform/resolvers/yup";
|
||||
import { mixed, object, string } from "yup";
|
||||
import BeenhereIcon from "@mui/icons-material/Beenhere";
|
||||
|
||||
const RegisterActionContent = ({ setOpen, defaultValues, onBaseSubmit }) => {
|
||||
const [selectedOption, setSelectedOption] = useState(defaultValues?.rms_status || "1");
|
||||
@@ -19,7 +19,12 @@ const RegisterActionContent = ({ setOpen, defaultValues, onBaseSubmit }) => {
|
||||
description: string().required("توضیحات الزامی است"),
|
||||
start_point: mixed().when("rms_status", {
|
||||
is: "1",
|
||||
then: (schema) => schema.required("مکان اقدام الزامی است"),
|
||||
then: (schema) =>
|
||||
schema
|
||||
.test("start-point-required", "مکان اقدام الزامی است", function (value) {
|
||||
return !!value;
|
||||
})
|
||||
.required("مکان اقدام الزامی است"),
|
||||
otherwise: (schema) => schema.notRequired(),
|
||||
}),
|
||||
image_before_1: mixed().when("rms_status", {
|
||||
|
||||
@@ -6,18 +6,11 @@ import RestoreForm from "./RestoreForm";
|
||||
|
||||
const RowActions = ({ row, mutate }) => {
|
||||
const { data: userPermissions } = usePermissions();
|
||||
const hasSupervisePermission = userPermissions.some((item) =>
|
||||
["supervise-fast-react", "supervise-fast-react-province"].includes(item)
|
||||
);
|
||||
const hasRestorePermission = userPermissions.includes("restore-fast-react");
|
||||
return (
|
||||
<Box sx={{ display: "flex", gap: 1 }}>
|
||||
{hasSupervisePermission && row.original?.status === 0 && (
|
||||
<ConfirmForm rowId={row.getValue("road_observeds__id")} mutate={mutate} />
|
||||
)}
|
||||
{hasSupervisePermission && row.original?.status === 0 && (
|
||||
<RejectForm rowId={row.getValue("road_observeds__id")} mutate={mutate} />
|
||||
)}
|
||||
{row.original?.status === 0 && <ConfirmForm rowId={row.getValue("road_observeds__id")} mutate={mutate} />}
|
||||
{row.original?.status === 0 && <RejectForm rowId={row.getValue("road_observeds__id")} mutate={mutate} />}
|
||||
{hasRestorePermission && row.original?.status !== 0 && (
|
||||
<RestoreForm rowId={row.getValue("road_observeds__id")} mutate={mutate} />
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user