From 7a7a301c79a4d0606ae0d52b1e1e9c539b9297fe Mon Sep 17 00:00:00 2001 From: AmirHossein Mahmoodi Date: Wed, 24 Sep 2025 09:39:21 +0330 Subject: [PATCH] add documents --- .../damages/operator/OperatorList.jsx | 77 ++++++++++++++++++- .../RowActions/ButtonDownload/index.jsx | 13 ++++ 2 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 src/components/dashboard/damages/operator/RowActions/ButtonDownload/index.jsx diff --git a/src/components/dashboard/damages/operator/OperatorList.jsx b/src/components/dashboard/damages/operator/OperatorList.jsx index 50dd984..0c2fda0 100644 --- a/src/components/dashboard/damages/operator/OperatorList.jsx +++ b/src/components/dashboard/damages/operator/OperatorList.jsx @@ -2,20 +2,21 @@ import CustomSelectByDependency from "@/core/components/DataTable/filter/fieldsType/CustomSelectByDependency"; import DataTableWithAuth from "@/core/components/DataTableWithAuth"; import { GET_TECHNICAL_DAMAGE_OPERATOR_LIST } from "@/core/utils/routes"; +import { useAuth } from "@/lib/contexts/auth"; import useCities from "@/lib/hooks/useCities"; +import { usePermissions } from "@/lib/hooks/usePermissions"; import useProvinces from "@/lib/hooks/useProvince"; import { Box, Stack, Typography } from "@mui/material"; import moment from "jalali-moment"; import { useEffect, useMemo, useState } from "react"; import RowActions from "./RowActions"; +import ButtonDownload from "./RowActions/ButtonDownload"; import DamageItemDialog from "./RowActions/DamageItemDialog"; import DamageReportDialog from "./RowActions/DamageReport"; import ImageDialog from "./RowActions/ImageDialog"; import LocationForm from "./RowActions/LocationForm"; import ShowPlate from "./RowActions/ShowPlate"; import Toolbar from "./Toolbar"; -import { usePermissions } from "@/lib/hooks/usePermissions"; -import { useAuth } from "@/lib/contexts/auth"; const OperatorList = () => { const { data: userPermissions } = usePermissions(); @@ -447,6 +448,78 @@ const OperatorList = () => { }, ], }, + { + header: "مستندات", + id: "documents", + enableColumnFilter: false, + enableSorting: false, + grow: false, + size: 50, + columns: [ + { + header: "فیش واریزی بیمه", + id: "deposit_insurance_image", + enableColumnFilter: false, + enableSorting: false, + grow: false, + size: 100, + muiTableBodyCellProps: { + sx: { + borderLeft: "1px solid #e1e1e1", + py: 0, + "&:first-of-type": { + borderLeft: "unset", + }, + }, + }, + Cell: ({ row }) => { + return ( + + {row.original.deposit_insurance_image ? ( + + ) : ( + "-" + )} + + ); + }, + }, + { + header: "صورتجلسه داغی", + id: "deposit_daghi_image", + enableColumnFilter: false, + enableSorting: false, + grow: false, + size: 100, + muiTableBodyCellProps: { + sx: { + borderLeft: "1px solid #e1e1e1", + py: 0, + "&:first-of-type": { + borderLeft: "unset", + }, + }, + }, + Cell: ({ row }) => { + return ( + + {row.original.deposit_daghi_image ? ( + + ) : ( + "-" + )} + + ); + }, + }, + ], + }, { header: "اطلاعات واریز", id: "items", diff --git a/src/components/dashboard/damages/operator/RowActions/ButtonDownload/index.jsx b/src/components/dashboard/damages/operator/RowActions/ButtonDownload/index.jsx new file mode 100644 index 0000000..73e91ee --- /dev/null +++ b/src/components/dashboard/damages/operator/RowActions/ButtonDownload/index.jsx @@ -0,0 +1,13 @@ +import { Download } from "@mui/icons-material"; +import { IconButton, Tooltip } from "@mui/material"; + +const ButtonDownload = ({ url, title }) => { + return ( + + + + + + ); +}; +export default ButtonDownload;