diff --git a/.env.local.example b/.env.local.example index c9c0de0..640758f 100644 --- a/.env.local.example +++ b/.env.local.example @@ -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" \ No newline at end of file diff --git a/src/components/dashboard/damages/operator/Form/CreateFactor/CreateFactorContent.jsx b/src/components/dashboard/damages/operator/Form/CreateFactor/CreateFactorContent.jsx index 961f59c..711c1fa 100644 --- a/src/components/dashboard/damages/operator/Form/CreateFactor/CreateFactorContent.jsx +++ b/src/components/dashboard/damages/operator/Form/CreateFactor/CreateFactorContent.jsx @@ -79,6 +79,22 @@ const CreateFactorContent = ({ row, mutate, rowId, setOpenCreateFactorDialog }) <> + + + } + label={ + + مبلغ کل خسارت برآورد شده + + } + /> + + + + {(row.original?.sum / 1).toLocaleString() || "0"} ریال + + - - - } - label={ - - مبلغ کل خسارت برآورد شده - - } - /> - - - - {(row.original?.sum / 1).toLocaleString() || "0"} ریال - - - {(row.original?.sum / 1).toLocaleString() || "0"} ریال + {( + row.original?.sum - + (row.original?.deposit_insurance_amount + row.original?.deposit_daghi_amount) + ).toLocaleString() || "0"}{" "} + ریال {!factorCreated && ( diff --git a/src/components/dashboard/damages/operator/RowActions/DamageItemDialog/DamageItemContent.jsx b/src/components/dashboard/damages/operator/RowActions/DamageItemDialog/DamageItemContent.jsx index e9a76e5..74ef578 100644 --- a/src/components/dashboard/damages/operator/RowActions/DamageItemDialog/DamageItemContent.jsx +++ b/src/components/dashboard/damages/operator/RowActions/DamageItemDialog/DamageItemContent.jsx @@ -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 }) => { {loading ? ( - ) : data ? ( + ) : data.damages ? ( @@ -49,7 +49,7 @@ const DamageItemContent = ({ rowId }) => { - {data.map((item) => { + {data.damages.map((item) => { return ( { ); })} + + + اجرت نصب + + {(data.ojrate_nasb / 1).toLocaleString()} +
diff --git a/src/components/dashboard/fastReact/complaintList/Form/registerAction/RegisterActionContent.jsx b/src/components/dashboard/fastReact/complaintList/Form/registerAction/RegisterActionContent.jsx index c4830cb..131e72e 100644 --- a/src/components/dashboard/fastReact/complaintList/Form/registerAction/RegisterActionContent.jsx +++ b/src/components/dashboard/fastReact/complaintList/Form/registerAction/RegisterActionContent.jsx @@ -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", { diff --git a/src/components/dashboard/fastReact/supervisor/RowActions/index.jsx b/src/components/dashboard/fastReact/supervisor/RowActions/index.jsx index 37d03f4..10461f2 100644 --- a/src/components/dashboard/fastReact/supervisor/RowActions/index.jsx +++ b/src/components/dashboard/fastReact/supervisor/RowActions/index.jsx @@ -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 ( - {hasSupervisePermission && row.original?.status === 0 && ( - - )} - {hasSupervisePermission && row.original?.status === 0 && ( - - )} + {row.original?.status === 0 && } + {row.original?.status === 0 && } {hasRestorePermission && row.original?.status !== 0 && ( )}