Feature/amiriis receipt report
This commit is contained in:
6
src/app/(withAuth)/dashboard/receipt/report/page.js
Normal file
6
src/app/(withAuth)/dashboard/receipt/report/page.js
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import ReceiptReportPage from "@/components/dashboard/receipt/report"
|
||||||
|
|
||||||
|
const Page = () => {
|
||||||
|
return <ReceiptReportPage />
|
||||||
|
}
|
||||||
|
export default Page
|
||||||
72
src/components/dashboard/receipt/report/ExcelPrint/index.jsx
Normal file
72
src/components/dashboard/receipt/report/ExcelPrint/index.jsx
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
"use client";
|
||||||
|
import { EXPORT_COUNTRY_RECEIPT_REPORT, EXPORT_PROVINCE_RECEIPT_REPORT } from "@/core/utils/routes";
|
||||||
|
import useRequest from "@/lib/hooks/useRequest";
|
||||||
|
import { useTheme } from "@emotion/react";
|
||||||
|
import DescriptionIcon from "@mui/icons-material/Description";
|
||||||
|
import { Button, CircularProgress, IconButton, useMediaQuery } from "@mui/material";
|
||||||
|
import FileSaver from "file-saver";
|
||||||
|
import moment from "jalali-moment";
|
||||||
|
import { useMemo, useState } from "react";
|
||||||
|
|
||||||
|
const PrintExcel = ({ table, filterData }) => {
|
||||||
|
const theme = useTheme();
|
||||||
|
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
const requestServer = useRequest({ notificationSuccess: true });
|
||||||
|
const activeFilters = Object.entries(filterData).reduce((acc, [key, filter]) => {
|
||||||
|
if (filter.value) {
|
||||||
|
acc.push({ id: filter.id, value: filter.value });
|
||||||
|
}
|
||||||
|
return acc;
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const filterParams = useMemo(() => {
|
||||||
|
const params = new URLSearchParams();
|
||||||
|
activeFilters.length > 0 &&
|
||||||
|
activeFilters.map((filter, index) => {
|
||||||
|
params.set(`${filter.id}`, filter.value);
|
||||||
|
});
|
||||||
|
return params;
|
||||||
|
}, [activeFilters]);
|
||||||
|
|
||||||
|
const clickHandler = () => {
|
||||||
|
setLoading(true);
|
||||||
|
const CountryOrProvince = activeFilters.find((item) => item.id === "province_id");
|
||||||
|
const requestUrl =
|
||||||
|
CountryOrProvince.value === "-1" ? EXPORT_COUNTRY_RECEIPT_REPORT : EXPORT_PROVINCE_RECEIPT_REPORT;
|
||||||
|
requestServer(`${requestUrl}?${filterParams}`, "get", {
|
||||||
|
requestOptions: { responseType: "blob" },
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
const filename = `خروجی کارتابل گزارشات خسارات وارده بر ابنیه فنی تاریخ_${moment().format("jYYYY_jMM_jDD")}.xlsx`;
|
||||||
|
FileSaver.saveAs(response.data, filename);
|
||||||
|
})
|
||||||
|
.catch(() => { })
|
||||||
|
.finally(() => {
|
||||||
|
setLoading(false);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{isMobile ? (
|
||||||
|
<IconButton aria-label="خروجی اکسل" color="primary" onClick={clickHandler}>
|
||||||
|
<DescriptionIcon sx={{ fontSize: "25px" }} />
|
||||||
|
</IconButton>
|
||||||
|
) : (
|
||||||
|
<Button
|
||||||
|
color="primary"
|
||||||
|
variant="contained"
|
||||||
|
size="small"
|
||||||
|
disabled={loading}
|
||||||
|
sx={{ textTransform: "unset", alignSelf: "center" }}
|
||||||
|
startIcon={loading ? <CircularProgress size={18} color="inherit" /> : <DescriptionIcon />}
|
||||||
|
onClick={clickHandler}
|
||||||
|
>
|
||||||
|
خروجی اکسل
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default PrintExcel;
|
||||||
242
src/components/dashboard/receipt/report/ReportLists.jsx
Normal file
242
src/components/dashboard/receipt/report/ReportLists.jsx
Normal file
@@ -0,0 +1,242 @@
|
|||||||
|
"use client";
|
||||||
|
import DataTableWithAuth from "@/core/components/DataTableWithAuth";
|
||||||
|
import { Box } from "@mui/material";
|
||||||
|
import { useMemo } from "react";
|
||||||
|
import Toolbar from "./Toolbar";
|
||||||
|
|
||||||
|
const ReportLists = ({ data, specialFilter }) => {
|
||||||
|
const columns = useMemo(() => {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
accessorKey: "edare_name",
|
||||||
|
header: "اداره کل",
|
||||||
|
id: "edare_name",
|
||||||
|
enableColumnFilter: false,
|
||||||
|
enableSorting: false,
|
||||||
|
datatype: "text",
|
||||||
|
grow: false,
|
||||||
|
size: 50,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "tedade",
|
||||||
|
header: "تعداد کل",
|
||||||
|
id: "tedade",
|
||||||
|
enableColumnFilter: false,
|
||||||
|
enableSorting: false,
|
||||||
|
datatype: "text",
|
||||||
|
grow: false,
|
||||||
|
size: 50,
|
||||||
|
muiTableBodyCellProps: {
|
||||||
|
sx: {
|
||||||
|
textAlign: "center",
|
||||||
|
borderLeft: "1px solid #e1e1e1",
|
||||||
|
py: 0,
|
||||||
|
"&:first-of-type": {
|
||||||
|
borderLeft: "unset",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Cell: ({ renderedCellValue }) => {
|
||||||
|
return (renderedCellValue / 1).toLocaleString();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
header: "تعداد نحوه شناسایی خسارت",
|
||||||
|
enableColumnFilter: false,
|
||||||
|
enableSorting: false,
|
||||||
|
datatype: "text",
|
||||||
|
grow: false,
|
||||||
|
size: 50,
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
accessorKey: "policeCount",
|
||||||
|
header: "گزارش پلیس راه",
|
||||||
|
id: "policeCount",
|
||||||
|
enableColumnFilter: false,
|
||||||
|
enableSorting: false,
|
||||||
|
datatype: "text",
|
||||||
|
grow: false,
|
||||||
|
size: 50,
|
||||||
|
muiTableBodyCellProps: {
|
||||||
|
sx: {
|
||||||
|
textAlign: "center",
|
||||||
|
borderLeft: "1px solid #e1e1e1",
|
||||||
|
py: 0,
|
||||||
|
"&:first-of-type": {
|
||||||
|
borderLeft: "unset",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Cell: ({ renderedCellValue }) => {
|
||||||
|
return (renderedCellValue / 1).toLocaleString();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "gashtCount",
|
||||||
|
header: "گزارش گشت راهداری",
|
||||||
|
id: "gashtCount",
|
||||||
|
enableColumnFilter: false,
|
||||||
|
enableSorting: false,
|
||||||
|
datatype: "text",
|
||||||
|
grow: false,
|
||||||
|
size: 50,
|
||||||
|
muiTableBodyCellProps: {
|
||||||
|
sx: {
|
||||||
|
textAlign: "center",
|
||||||
|
borderLeft: "1px solid #e1e1e1",
|
||||||
|
py: 0,
|
||||||
|
"&:first-of-type": {
|
||||||
|
borderLeft: "unset",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Cell: ({ renderedCellValue }) => {
|
||||||
|
return (renderedCellValue / 1).toLocaleString();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "kesartAll",
|
||||||
|
header: "مبلغ کل خسارات ثبت شده (ریال)",
|
||||||
|
id: "kesartAll",
|
||||||
|
enableColumnFilter: false,
|
||||||
|
enableSorting: false,
|
||||||
|
datatype: "text",
|
||||||
|
grow: false,
|
||||||
|
size: 50,
|
||||||
|
muiTableBodyCellProps: {
|
||||||
|
sx: {
|
||||||
|
textAlign: "center",
|
||||||
|
borderLeft: "1px solid #e1e1e1",
|
||||||
|
py: 0,
|
||||||
|
"&:first-of-type": {
|
||||||
|
borderLeft: "unset",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Cell: ({ renderedCellValue }) => {
|
||||||
|
return (renderedCellValue / 1).toLocaleString();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "vosolAll",
|
||||||
|
header: "کل مبلغ وصول شده (ریال)",
|
||||||
|
id: "vosolAll",
|
||||||
|
enableColumnFilter: false,
|
||||||
|
enableSorting: false,
|
||||||
|
datatype: "text",
|
||||||
|
grow: false,
|
||||||
|
size: 50,
|
||||||
|
muiTableBodyCellProps: {
|
||||||
|
sx: {
|
||||||
|
textAlign: "center",
|
||||||
|
borderLeft: "1px solid #e1e1e1",
|
||||||
|
py: 0,
|
||||||
|
"&:first-of-type": {
|
||||||
|
borderLeft: "unset",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Cell: ({ renderedCellValue }) => {
|
||||||
|
return (renderedCellValue / 1).toLocaleString();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
header: "مبلغ وصول شده به تفکیک نوع پرداخت (ریال)",
|
||||||
|
enableColumnFilter: false,
|
||||||
|
enableSorting: false,
|
||||||
|
datatype: "text",
|
||||||
|
grow: false,
|
||||||
|
size: 50,
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
accessorKey: "fish",
|
||||||
|
header: "فیش",
|
||||||
|
id: "fish",
|
||||||
|
enableColumnFilter: false,
|
||||||
|
enableSorting: false,
|
||||||
|
datatype: "text",
|
||||||
|
grow: false,
|
||||||
|
size: 50,
|
||||||
|
muiTableBodyCellProps: {
|
||||||
|
sx: {
|
||||||
|
textAlign: "center",
|
||||||
|
borderLeft: "1px solid #e1e1e1",
|
||||||
|
py: 0,
|
||||||
|
"&:first-of-type": {
|
||||||
|
borderLeft: "unset",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Cell: ({ renderedCellValue }) => {
|
||||||
|
return (renderedCellValue / 1).toLocaleString();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "bime",
|
||||||
|
header: "بیمه",
|
||||||
|
id: "bime",
|
||||||
|
enableColumnFilter: false,
|
||||||
|
enableSorting: false,
|
||||||
|
datatype: "text",
|
||||||
|
grow: false,
|
||||||
|
size: 50,
|
||||||
|
muiTableBodyCellProps: {
|
||||||
|
sx: {
|
||||||
|
textAlign: "center",
|
||||||
|
borderLeft: "1px solid #e1e1e1",
|
||||||
|
py: 0,
|
||||||
|
"&:first-of-type": {
|
||||||
|
borderLeft: "unset",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Cell: ({ renderedCellValue }) => {
|
||||||
|
return (renderedCellValue / 1).toLocaleString();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "daghi",
|
||||||
|
header: "داغی",
|
||||||
|
id: "daghi",
|
||||||
|
enableColumnFilter: false,
|
||||||
|
enableSorting: false,
|
||||||
|
datatype: "text",
|
||||||
|
grow: false,
|
||||||
|
size: 50,
|
||||||
|
muiTableBodyCellProps: {
|
||||||
|
sx: {
|
||||||
|
textAlign: "center",
|
||||||
|
borderLeft: "1px solid #e1e1e1",
|
||||||
|
py: 0,
|
||||||
|
"&:first-of-type": {
|
||||||
|
borderLeft: "unset",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Cell: ({ renderedCellValue }) => {
|
||||||
|
return (renderedCellValue / 1).toLocaleString();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Box sx={{ p: 1, border: 1, borderColor: "divider", borderRadius: 1 }}>
|
||||||
|
<DataTableWithAuth
|
||||||
|
TableToolbar={Toolbar}
|
||||||
|
columns={columns}
|
||||||
|
// data={data.data}
|
||||||
|
data={[]}
|
||||||
|
page_name={"receiptReport"}
|
||||||
|
table_name={"receiptReportList"}
|
||||||
|
specialFilter={specialFilter}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ReportLists;
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import { Controller } from "react-hook-form";
|
||||||
|
import MuiDatePicker from "@/core/components/MuiDatePicker";
|
||||||
|
import React from "react";
|
||||||
|
import moment from "jalali-moment";
|
||||||
|
|
||||||
|
const FromDateController = ({ control }) => {
|
||||||
|
return (
|
||||||
|
<Controller
|
||||||
|
name="from_date"
|
||||||
|
control={control}
|
||||||
|
render={({ field: { onChange, value }, fieldState: { error } }) => (
|
||||||
|
<MuiDatePicker
|
||||||
|
name="from_date"
|
||||||
|
error={!!error}
|
||||||
|
value={value}
|
||||||
|
label={'تاریخ تصادف (از تاریخ)'}
|
||||||
|
placeholder={"از تاریخ"}
|
||||||
|
setFieldValue={(name, newValue) => {
|
||||||
|
const formattedDate = moment(new Date(newValue)).locale("en").format("YYYY-MM-DD");
|
||||||
|
onChange(formattedDate); // Update the field value in react-hook-form
|
||||||
|
}}
|
||||||
|
helperText={error ? error.message : null}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default FromDateController;
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
import { Button, Grid, LinearProgress, Typography } from "@mui/material";
|
||||||
|
import SearchIcon from "@mui/icons-material/Search";
|
||||||
|
import React from "react";
|
||||||
|
import FromDateController from "./FromDateController";
|
||||||
|
import ToDateController from "./ToDateController";
|
||||||
|
import SelectProvince from "./SelectProvince";
|
||||||
|
import { Controller } from "react-hook-form";
|
||||||
|
|
||||||
|
const SearchReportField = ({ control, hasProvincesPermission }) => {
|
||||||
|
return (
|
||||||
|
<Grid container spacing={2} sx={{ py: 2 }}>
|
||||||
|
<Grid item xs={12} md={hasProvincesPermission ? 3 : 4}>
|
||||||
|
<FromDateController control={control} />
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12} md={hasProvincesPermission ? 3 : 4}>
|
||||||
|
<ToDateController control={control} />
|
||||||
|
</Grid>
|
||||||
|
{hasProvincesPermission && (
|
||||||
|
<Grid item xs={12} md={3}>
|
||||||
|
<SelectProvince control={control} />
|
||||||
|
</Grid>
|
||||||
|
)}
|
||||||
|
<Grid item xs={12} md={hasProvincesPermission ? 3 : 4}>
|
||||||
|
<Controller
|
||||||
|
name="submitButton"
|
||||||
|
control={control}
|
||||||
|
render={({ field: { value, onChange }, formState: { isSubmitting } }) => (
|
||||||
|
<Button
|
||||||
|
variant="contained"
|
||||||
|
size="medium"
|
||||||
|
type="submit"
|
||||||
|
disabled={isSubmitting}
|
||||||
|
endIcon={<SearchIcon />}
|
||||||
|
fullWidth
|
||||||
|
>
|
||||||
|
{isSubmitting ? "درحال دریافت اطلاعات" : "جستجو"}
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default SearchReportField;
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
import { Controller } from "react-hook-form";
|
||||||
|
import MuiDatePicker from "@/core/components/MuiDatePicker";
|
||||||
|
import React from "react";
|
||||||
|
import { FormControl, FormHelperText, InputLabel, LinearProgress, MenuItem, Select, Typography } from "@mui/material";
|
||||||
|
import useProvinces from "@/lib/hooks/useProvince";
|
||||||
|
|
||||||
|
const SelectProvince = ({ control }) => {
|
||||||
|
const { provinces, loadingProvinces, errorProvinces } = useProvinces();
|
||||||
|
return (
|
||||||
|
<Controller
|
||||||
|
name="province_id"
|
||||||
|
control={control}
|
||||||
|
render={({ field, fieldState: { error } }) => (
|
||||||
|
<FormControl error={!!error} size="small" fullWidth>
|
||||||
|
<InputLabel id="demo-error-label">استان</InputLabel>
|
||||||
|
<Select
|
||||||
|
{...field}
|
||||||
|
labelId="demo-error-label"
|
||||||
|
id="province_id"
|
||||||
|
value={loadingProvinces ? "loading" : field.value || ""}
|
||||||
|
label="استان"
|
||||||
|
onChange={field.onChange}
|
||||||
|
>
|
||||||
|
{loadingProvinces ? (
|
||||||
|
<MenuItem value={"loading"}>در حال بارگذاری...</MenuItem>
|
||||||
|
) : errorProvinces ? (
|
||||||
|
<MenuItem value={"error"}>خطا در بارگذاری</MenuItem>
|
||||||
|
) : (
|
||||||
|
[
|
||||||
|
<MenuItem key="-1" value={"-1"}>
|
||||||
|
کل کشور
|
||||||
|
</MenuItem>,
|
||||||
|
...provinces.map((province) => (
|
||||||
|
<MenuItem key={province.id} value={province.id}>
|
||||||
|
{province.name_fa}
|
||||||
|
</MenuItem>
|
||||||
|
)),
|
||||||
|
]
|
||||||
|
)}
|
||||||
|
</Select>
|
||||||
|
{error && <FormHelperText>{error.message}</FormHelperText>}
|
||||||
|
</FormControl>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default SelectProvince;
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import { Controller, useWatch } from "react-hook-form";
|
||||||
|
import MuiDatePicker from "@/core/components/MuiDatePicker";
|
||||||
|
import React from "react";
|
||||||
|
import moment from "jalali-moment";
|
||||||
|
|
||||||
|
const ToDateController = ({ control }) => {
|
||||||
|
const minDate = useWatch({ control, name: "from_date" });
|
||||||
|
return (
|
||||||
|
<Controller
|
||||||
|
name="date_to"
|
||||||
|
control={control}
|
||||||
|
render={({ field: { onChange, value }, fieldState: { error } }) => (
|
||||||
|
<MuiDatePicker
|
||||||
|
name="date_to"
|
||||||
|
minDate={minDate}
|
||||||
|
error={!!error}
|
||||||
|
value={value}
|
||||||
|
label={'تاریخ تصادف (تا تاریخ)'}
|
||||||
|
placeholder={"تا تاریخ"}
|
||||||
|
setFieldValue={(name, newValue) => {
|
||||||
|
const formattedDate = moment(new Date(newValue)).locale("en").format("YYYY-MM-DD");
|
||||||
|
onChange(formattedDate); // Update the field value in react-hook-form
|
||||||
|
}}
|
||||||
|
helperText={error ? error.message : null}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default ToDateController;
|
||||||
13
src/components/dashboard/receipt/report/Search/index.jsx
Normal file
13
src/components/dashboard/receipt/report/Search/index.jsx
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import StyledForm from "@/core/components/StyledForm";
|
||||||
|
import SearchReportField from "./SearchReportField";
|
||||||
|
|
||||||
|
const SearchReportList = ({ handleSubmit, onSearchSubmit, control, hasProvincesPermission }) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<StyledForm onSubmit={handleSubmit(onSearchSubmit)}>
|
||||||
|
<SearchReportField control={control} hasProvincesPermission={hasProvincesPermission} />
|
||||||
|
</StyledForm>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default SearchReportList;
|
||||||
11
src/components/dashboard/receipt/report/Toolbar.jsx
Normal file
11
src/components/dashboard/receipt/report/Toolbar.jsx
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import PrintExcel from "./ExcelPrint";
|
||||||
|
import { Box } from "@mui/material";
|
||||||
|
|
||||||
|
const Toolbar = ({ table, filterData, mutate }) => {
|
||||||
|
return (
|
||||||
|
<Box sx={{ display: "flex", gap: 1 }}>
|
||||||
|
<PrintExcel table={table} filterData={filterData} />
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default Toolbar;
|
||||||
135
src/components/dashboard/receipt/report/index.jsx
Normal file
135
src/components/dashboard/receipt/report/index.jsx
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
'use client'
|
||||||
|
import PageTitle from "@/core/components/PageTitle";
|
||||||
|
import { GET_CITY_RECEIPT_REPORT, GET_PROVINCE_RECEIPT_REPORT } from "@/core/utils/routes";
|
||||||
|
import { useAuth } from "@/lib/contexts/auth";
|
||||||
|
import { usePermissions } from "@/lib/hooks/usePermissions";
|
||||||
|
import useRequest from "@/lib/hooks/useRequest";
|
||||||
|
import { yupResolver } from "@hookform/resolvers/yup";
|
||||||
|
import { LinearProgress, Stack } from "@mui/material";
|
||||||
|
import moment from "jalali-moment";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import { useForm } from "react-hook-form";
|
||||||
|
import * as yup from "yup";
|
||||||
|
import SearchReportList from "./Search";
|
||||||
|
import ReportLists from "./ReportLists";
|
||||||
|
|
||||||
|
const ReceiptReportPage = () => {
|
||||||
|
const [data, setData] = useState([]);
|
||||||
|
const { data: userPermissions } = usePermissions();
|
||||||
|
const { user } = useAuth();
|
||||||
|
const requestServer = useRequest();
|
||||||
|
const hasProvincesPermission = userPermissions?.includes("show-receipt");
|
||||||
|
|
||||||
|
const defaultValues = {
|
||||||
|
from_date: moment(new Date()).format("YYYY-MM-DD"),
|
||||||
|
date_to: moment(new Date()).format("YYYY-MM-DD"),
|
||||||
|
province_id: hasProvincesPermission ? "-1" : user.province_id,
|
||||||
|
};
|
||||||
|
const defaultFilter = [
|
||||||
|
{ value: `${defaultValues.province_id}`, datatype: "numeric", id: "province_id", fn: "equals" },
|
||||||
|
{ value: `${defaultValues.from_date}`, datatype: "date", id: "from_date", fn: "between" },
|
||||||
|
{ value: `${defaultValues.date_to}`, datatype: "date", id: "date_to", fn: "between" },
|
||||||
|
];
|
||||||
|
const [specialFilter, setSpecialFilter] = useState(defaultFilter);
|
||||||
|
|
||||||
|
const onSearchSubmit = async (data) => {
|
||||||
|
const params = new URLSearchParams();
|
||||||
|
params.set("from_date", `${data.from_date}`);
|
||||||
|
params.set("date_to", `${data.date_to}`);
|
||||||
|
setSpecialFilter([
|
||||||
|
{ value: `${data.province_id}`, datatype: "numeric", id: "province_id", fn: "equals" },
|
||||||
|
{ value: `${data.from_date}`, datatype: "date", id: "from_date", fn: "between" },
|
||||||
|
{ value: `${data.date_to}`, datatype: "date", id: "date_to", fn: "between" },
|
||||||
|
]);
|
||||||
|
if (data.province_id === "-1") {
|
||||||
|
try {
|
||||||
|
const response = await requestServer(`${GET_PROVINCE_RECEIPT_REPORT}?${params}`);
|
||||||
|
const result = response.data.data;
|
||||||
|
const nationalReportForItem = result.activities.find((report) => report.province_id === -1);
|
||||||
|
const nationalReport = {
|
||||||
|
edare_name: "کل کشور",
|
||||||
|
...nationalReportForItem,
|
||||||
|
};
|
||||||
|
|
||||||
|
setData({
|
||||||
|
data: [
|
||||||
|
nationalReport,
|
||||||
|
...result.provinces.map((province) => {
|
||||||
|
const filteredReports = result.activities.find(
|
||||||
|
(report) => report.province_id === province.id
|
||||||
|
);
|
||||||
|
return {
|
||||||
|
...filteredReports,
|
||||||
|
edare_name: province.name_fa,
|
||||||
|
};
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
filters: data,
|
||||||
|
});
|
||||||
|
} catch (e) { }
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
params.set("province_id", `${data.province_id}`);
|
||||||
|
const response = await requestServer(`${GET_CITY_RECEIPT_REPORT}?${params}`);
|
||||||
|
const result = response.data.data;
|
||||||
|
const nationalReportForItem = result.activities.find((report) => report.edare_id === "-1");
|
||||||
|
const nationalReport = {
|
||||||
|
...nationalReportForItem,
|
||||||
|
edare_name: "کل استان",
|
||||||
|
};
|
||||||
|
setData({
|
||||||
|
data: [
|
||||||
|
nationalReport,
|
||||||
|
...result.edarateShahri.map((edare) => {
|
||||||
|
const filteredReports = result.activities.find((report) => report.edare_id == edare.id);
|
||||||
|
return {
|
||||||
|
edare_name: edare.name_fa,
|
||||||
|
...filteredReports,
|
||||||
|
};
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
filters: data,
|
||||||
|
});
|
||||||
|
} catch (e) { }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!userPermissions) return
|
||||||
|
onSearchSubmit(defaultValues);
|
||||||
|
}, [userPermissions]);
|
||||||
|
|
||||||
|
const validationSchema = yup.object().shape({
|
||||||
|
from_date: yup
|
||||||
|
.string()
|
||||||
|
.required("تاریخ شروع الزامی است!")
|
||||||
|
.matches(/^\d{4}-\d{2}-\d{2}$/, "تاریخ شروع الزامی است!")
|
||||||
|
.test("is-valid-date", "تاریخ شروع معتبر نیست!", (value) => moment(value, "YYYY-MM-DD", true).isValid()),
|
||||||
|
date_to: yup
|
||||||
|
.string()
|
||||||
|
.required("تاریخ پایان الزامی است!")
|
||||||
|
.matches(/^\d{4}-\d{2}-\d{2}$/, "تاریخ پایان الزامی است!")
|
||||||
|
.test("is-valid-date", "تاریخ پایان معتبر نیست!", (value) => moment(value, "YYYY-MM-DD", true).isValid()),
|
||||||
|
province_id: yup.string().nullable(),
|
||||||
|
});
|
||||||
|
|
||||||
|
const { control, handleSubmit } = useForm({
|
||||||
|
defaultValues,
|
||||||
|
resolver: yupResolver(validationSchema),
|
||||||
|
mode: "onBlur",
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Stack spacing={1}>
|
||||||
|
<PageTitle title={"گزارش خسارات وارده بر ابنیه فنی"} />
|
||||||
|
<SearchReportList
|
||||||
|
control={control}
|
||||||
|
hasProvincesPermission={hasProvincesPermission}
|
||||||
|
handleSubmit={handleSubmit}
|
||||||
|
onSearchSubmit={onSearchSubmit}
|
||||||
|
/>
|
||||||
|
{!data ? <LinearProgress /> : <ReportLists specialFilter={specialFilter} data={data} />}
|
||||||
|
</Stack>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
export default ReceiptReportPage
|
||||||
@@ -13,6 +13,7 @@ const FromDateController = ({ control }) => {
|
|||||||
name="from_date"
|
name="from_date"
|
||||||
error={!!error}
|
error={!!error}
|
||||||
value={value}
|
value={value}
|
||||||
|
label={'تاریخ فعالیت (از تاریخ)'}
|
||||||
placeholder={"از تاریخ"}
|
placeholder={"از تاریخ"}
|
||||||
setFieldValue={(name, newValue) => {
|
setFieldValue={(name, newValue) => {
|
||||||
const formattedDate = moment(new Date(newValue)).locale("en").format("YYYY-MM-DD");
|
const formattedDate = moment(new Date(newValue)).locale("en").format("YYYY-MM-DD");
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ const ToDateController = ({ control }) => {
|
|||||||
minDate={minDate}
|
minDate={minDate}
|
||||||
error={!!error}
|
error={!!error}
|
||||||
value={value}
|
value={value}
|
||||||
|
label={'تاریخ فعالیت (تا تاریخ)'}
|
||||||
placeholder={"تا تاریخ"}
|
placeholder={"تا تاریخ"}
|
||||||
setFieldValue={(name, newValue) => {
|
setFieldValue={(name, newValue) => {
|
||||||
const formattedDate = moment(new Date(newValue)).locale("en").format("YYYY-MM-DD");
|
const formattedDate = moment(new Date(newValue)).locale("en").format("YYYY-MM-DD");
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const ReportPage = () => {
|
|||||||
|
|
||||||
const { user } = useAuth();
|
const { user } = useAuth();
|
||||||
const requestServer = useRequest();
|
const requestServer = useRequest();
|
||||||
const hasProvincesPermission = userPermissions.includes("show-road-item-supervise-cartable");
|
const hasProvincesPermission = userPermissions?.includes("show-road-item-supervise-cartable");
|
||||||
|
|
||||||
const defaultValues = {
|
const defaultValues = {
|
||||||
from_date: moment(new Date()).format("YYYY-MM-DD"),
|
from_date: moment(new Date()).format("YYYY-MM-DD"),
|
||||||
@@ -52,8 +52,8 @@ const ReportPage = () => {
|
|||||||
edare_name: "کل کشور",
|
edare_name: "کل کشور",
|
||||||
sum: result.activities.length
|
sum: result.activities.length
|
||||||
? result.activities
|
? result.activities
|
||||||
.filter((report) => report.p === -1)
|
.filter((report) => report.p === -1)
|
||||||
.reduce((acc, report) => acc + (report.s || 0), 0)
|
.reduce((acc, report) => acc + (report.s || 0), 0)
|
||||||
: 0,
|
: 0,
|
||||||
};
|
};
|
||||||
itemsList.forEach((item) => {
|
itemsList.forEach((item) => {
|
||||||
@@ -82,7 +82,7 @@ const ReportPage = () => {
|
|||||||
],
|
],
|
||||||
filters: data,
|
filters: data,
|
||||||
});
|
});
|
||||||
} catch (e) {}
|
} catch (e) { }
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
params.set("province_id", `${data.province_id}`);
|
params.set("province_id", `${data.province_id}`);
|
||||||
@@ -92,8 +92,8 @@ const ReportPage = () => {
|
|||||||
edare_name: "کل استان",
|
edare_name: "کل استان",
|
||||||
sum: result.activities.length
|
sum: result.activities.length
|
||||||
? result.activities
|
? result.activities
|
||||||
.filter((report) => report.c === -1)
|
.filter((report) => report.c === -1)
|
||||||
.reduce((acc, report) => acc + (report.s || 0), 0)
|
.reduce((acc, report) => acc + (report.s || 0), 0)
|
||||||
: 0,
|
: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -126,14 +126,15 @@ const ReportPage = () => {
|
|||||||
],
|
],
|
||||||
filters: data,
|
filters: data,
|
||||||
});
|
});
|
||||||
} catch (e) {}
|
} catch (e) { }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (!userPermissions) return
|
||||||
if (itemsList.length === 0) return;
|
if (itemsList.length === 0) return;
|
||||||
onSearchSubmit(defaultValues);
|
onSearchSubmit(defaultValues);
|
||||||
}, [itemsList]);
|
}, [itemsList, userPermissions]);
|
||||||
|
|
||||||
const validationSchema = yup.object().shape({
|
const validationSchema = yup.object().shape({
|
||||||
from_date: yup
|
from_date: yup
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ const FromDateController = ({ control }) => {
|
|||||||
name="from_date"
|
name="from_date"
|
||||||
error={!!error}
|
error={!!error}
|
||||||
value={value}
|
value={value}
|
||||||
|
label={'تاریخ فعالیت (از تاریخ)'}
|
||||||
placeholder={"از تاریخ"}
|
placeholder={"از تاریخ"}
|
||||||
setFieldValue={(name, newValue) => {
|
setFieldValue={(name, newValue) => {
|
||||||
const formattedDate = moment(new Date(newValue)).locale("en").format("YYYY-MM-DD");
|
const formattedDate = moment(new Date(newValue)).locale("en").format("YYYY-MM-DD");
|
||||||
|
|||||||
@@ -15,10 +15,11 @@ const ToDateController = ({ control }) => {
|
|||||||
minDate={minDate}
|
minDate={minDate}
|
||||||
error={!!error}
|
error={!!error}
|
||||||
value={value}
|
value={value}
|
||||||
|
label={'تاریخ فعالیت (تا تاریخ)'}
|
||||||
placeholder={"تا تاریخ"}
|
placeholder={"تا تاریخ"}
|
||||||
setFieldValue={(name, newValue) => {
|
setFieldValue={(name, newValue) => {
|
||||||
const formattedDate = moment(new Date(newValue)).locale("en").format("YYYY-MM-DD");
|
const formattedDate = moment(new Date(newValue)).locale("en").format("YYYY-MM-DD");
|
||||||
onChange(formattedDate); // Update the field value in react-hook-form
|
onChange(formattedDate);
|
||||||
}}
|
}}
|
||||||
helperText={error ? error.message : null}
|
helperText={error ? error.message : null}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ const SubItemsReports = () => {
|
|||||||
const { data: userPermissions } = usePermissions();
|
const { data: userPermissions } = usePermissions();
|
||||||
const { user } = useAuth();
|
const { user } = useAuth();
|
||||||
const requestServer = useRequest();
|
const requestServer = useRequest();
|
||||||
const hasProvincesPermission = userPermissions.includes("show-road-item-supervise-cartable");
|
const hasProvincesPermission = userPermissions?.includes("show-road-item-supervise-cartable");
|
||||||
|
|
||||||
const defaultValues = {
|
const defaultValues = {
|
||||||
from_date: moment(new Date()).format("YYYY-MM-DD"),
|
from_date: moment(new Date()).format("YYYY-MM-DD"),
|
||||||
@@ -166,7 +166,7 @@ const SubItemsReports = () => {
|
|||||||
columns: createColumns(result.sub_items),
|
columns: createColumns(result.sub_items),
|
||||||
filters: data,
|
filters: data,
|
||||||
});
|
});
|
||||||
} catch (e) {}
|
} catch (e) { }
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
params.set("province_id", `${data.province_id}`);
|
params.set("province_id", `${data.province_id}`);
|
||||||
@@ -216,8 +216,9 @@ const SubItemsReports = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (!userPermissions) return
|
||||||
onSearchSubmit(defaultValues);
|
onSearchSubmit(defaultValues);
|
||||||
}, []);
|
}, [userPermissions]);
|
||||||
|
|
||||||
const validationSchema = yup.object().shape({
|
const validationSchema = yup.object().shape({
|
||||||
from_date: yup
|
from_date: yup
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import { usePermissions } from "@/lib/hooks/usePermissions";
|
|||||||
|
|
||||||
const RowActions = ({ row, mutate }) => {
|
const RowActions = ({ row, mutate }) => {
|
||||||
const { data: userPermissions } = usePermissions();
|
const { data: userPermissions } = usePermissions();
|
||||||
const hasDeletePermission = userPermissions.includes("delete-road-item");
|
const hasDeletePermission = userPermissions?.includes("delete-road-item");
|
||||||
const hasRestorePermission = userPermissions.includes("restore-road-item");
|
const hasRestorePermission = userPermissions?.includes("restore-road-item");
|
||||||
return (
|
return (
|
||||||
<Box sx={{ display: "flex", gap: 1 }}>
|
<Box sx={{ display: "flex", gap: 1 }}>
|
||||||
{row.original.status === 0 && row.original.can_supervise === 1 && (
|
{row.original.status === 0 && row.original.can_supervise === 1 && (
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ const SupervisorList = () => {
|
|||||||
{ value: 2, label: "عدم تایید" },
|
{ value: 2, label: "عدم تایید" },
|
||||||
];
|
];
|
||||||
const { data: userPermissions } = usePermissions();
|
const { data: userPermissions } = usePermissions();
|
||||||
const hasCountryPermission = userPermissions.includes("show-road-item-supervise-cartable");
|
const hasCountryPermission = userPermissions?.includes("show-road-item-supervise-cartable");
|
||||||
const { user } = useAuth();
|
const { user } = useAuth();
|
||||||
const columns = useMemo(() => {
|
const columns = useMemo(() => {
|
||||||
const dynamicColumns = {
|
const dynamicColumns = {
|
||||||
@@ -125,8 +125,8 @@ const SupervisorList = () => {
|
|||||||
props.dependencyFieldValue?.value === ""
|
props.dependencyFieldValue?.value === ""
|
||||||
? "empty"
|
? "empty"
|
||||||
: loadingEdaratList
|
: loadingEdaratList
|
||||||
? "loading"
|
? "loading"
|
||||||
: props.filterParameters.value
|
: props.filterParameters.value
|
||||||
}
|
}
|
||||||
columnSelectOption={getColumnSelectOptions}
|
columnSelectOption={getColumnSelectOptions}
|
||||||
/>
|
/>
|
||||||
@@ -217,8 +217,8 @@ const SupervisorList = () => {
|
|||||||
props.dependencyFieldValue.value === ""
|
props.dependencyFieldValue.value === ""
|
||||||
? "empty"
|
? "empty"
|
||||||
: loadingSubItemsList
|
: loadingSubItemsList
|
||||||
? "loading"
|
? "loading"
|
||||||
: props.filterParameters.value
|
: props.filterParameters.value
|
||||||
}
|
}
|
||||||
columnSelectOption={getColumnSelectOptions}
|
columnSelectOption={getColumnSelectOptions}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ const FromDateController = ({ control }) => {
|
|||||||
name="from_date"
|
name="from_date"
|
||||||
error={!!error}
|
error={!!error}
|
||||||
value={value}
|
value={value}
|
||||||
|
label={'تاریخ شروع (از تاریخ)'}
|
||||||
placeholder={"از تاریخ"}
|
placeholder={"از تاریخ"}
|
||||||
setFieldValue={(name, newValue) => {
|
setFieldValue={(name, newValue) => {
|
||||||
const formattedDate = moment(new Date(newValue)).locale("en").format("YYYY-MM-DD");
|
const formattedDate = moment(new Date(newValue)).locale("en").format("YYYY-MM-DD");
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ const ToDateController = ({ control }) => {
|
|||||||
minDate={minDate}
|
minDate={minDate}
|
||||||
error={!!error}
|
error={!!error}
|
||||||
value={value}
|
value={value}
|
||||||
|
label={'تاریخ شروع (تا تاریخ)'}
|
||||||
placeholder={"تا تاریخ"}
|
placeholder={"تا تاریخ"}
|
||||||
setFieldValue={(name, newValue) => {
|
setFieldValue={(name, newValue) => {
|
||||||
const formattedDate = moment(new Date(newValue)).locale("en").format("YYYY-MM-DD");
|
const formattedDate = moment(new Date(newValue)).locale("en").format("YYYY-MM-DD");
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ const ReportPage = () => {
|
|||||||
const { data: userPermissions } = usePermissions();
|
const { data: userPermissions } = usePermissions();
|
||||||
const { user } = useAuth();
|
const { user } = useAuth();
|
||||||
const requestServer = useRequest();
|
const requestServer = useRequest();
|
||||||
const hasProvincesPermission = userPermissions.includes("show-road-patrol-supervise-cartable");
|
const hasProvincesPermission = userPermissions?.includes("show-road-patrol-supervise-cartable");
|
||||||
|
|
||||||
const defaultValues = {
|
const defaultValues = {
|
||||||
from_date: moment(new Date()).format("YYYY-MM-DD"),
|
from_date: moment(new Date()).format("YYYY-MM-DD"),
|
||||||
@@ -66,7 +66,7 @@ const ReportPage = () => {
|
|||||||
],
|
],
|
||||||
filters: data,
|
filters: data,
|
||||||
});
|
});
|
||||||
} catch (e) {}
|
} catch (e) { }
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
params.set("province_id", `${data.province_id}`);
|
params.set("province_id", `${data.province_id}`);
|
||||||
@@ -90,13 +90,14 @@ const ReportPage = () => {
|
|||||||
],
|
],
|
||||||
filters: data,
|
filters: data,
|
||||||
});
|
});
|
||||||
} catch (e) {}
|
} catch (e) { }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (!userPermissions) return
|
||||||
onSearchSubmit(defaultValues);
|
onSearchSubmit(defaultValues);
|
||||||
}, []);
|
}, [userPermissions]);
|
||||||
|
|
||||||
const validationSchema = yup.object().shape({
|
const validationSchema = yup.object().shape({
|
||||||
from_date: yup
|
from_date: yup
|
||||||
@@ -119,7 +120,7 @@ const ReportPage = () => {
|
|||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
<Stack spacing={1}>
|
<Stack spacing={1}>
|
||||||
<PageTitle title={"گزارشات گشت راهداری"} />
|
<PageTitle title={"گزارش گشت راهداری"} />
|
||||||
<SearchReportList
|
<SearchReportList
|
||||||
control={control}
|
control={control}
|
||||||
hasProvincesPermission={hasProvincesPermission}
|
hasProvincesPermission={hasProvincesPermission}
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import { usePermissions } from "@/lib/hooks/usePermissions";
|
|||||||
|
|
||||||
const RowActions = ({ row, mutate }) => {
|
const RowActions = ({ row, mutate }) => {
|
||||||
const { data: userPermissions } = usePermissions();
|
const { data: userPermissions } = usePermissions();
|
||||||
const hasPartialDeletePermission = userPermissions.includes("partial-delete-road-patrol");
|
const hasPartialDeletePermission = userPermissions?.includes("partial-delete-road-patrol");
|
||||||
const hasCompleteDeletePermission = userPermissions.includes("complete-delete-road-patrol");
|
const hasCompleteDeletePermission = userPermissions?.includes("complete-delete-road-patrol");
|
||||||
return (
|
return (
|
||||||
<Box sx={{ display: "flex", gap: 1 }}>
|
<Box sx={{ display: "flex", gap: 1 }}>
|
||||||
{hasPartialDeletePermission | hasCompleteDeletePermission && (
|
{hasPartialDeletePermission | hasCompleteDeletePermission && (
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import { useAuth } from "@/lib/contexts/auth";
|
|||||||
|
|
||||||
const SupervisorList = () => {
|
const SupervisorList = () => {
|
||||||
const { data: userPermissions } = usePermissions();
|
const { data: userPermissions } = usePermissions();
|
||||||
const hasCountryPermission = userPermissions.includes("show-road-patrol-supervise-cartable");
|
const hasCountryPermission = userPermissions?.includes("show-road-patrol-supervise-cartable");
|
||||||
const { user } = useAuth();
|
const { user } = useAuth();
|
||||||
const columns = useMemo(() => {
|
const columns = useMemo(() => {
|
||||||
const dynamicColumns = {
|
const dynamicColumns = {
|
||||||
@@ -119,8 +119,8 @@ const SupervisorList = () => {
|
|||||||
props.dependencyFieldValue?.value === ""
|
props.dependencyFieldValue?.value === ""
|
||||||
? "empty"
|
? "empty"
|
||||||
: loadingEdaratList
|
: loadingEdaratList
|
||||||
? "loading"
|
? "loading"
|
||||||
: props.filterParameters.value
|
: props.filterParameters.value
|
||||||
}
|
}
|
||||||
columnSelectOption={getColumnSelectOptions}
|
columnSelectOption={getColumnSelectOptions}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -485,9 +485,9 @@ export const pageMenu = [
|
|||||||
id: "receiptManagmentReport",
|
id: "receiptManagmentReport",
|
||||||
label: "گزارش ها",
|
label: "گزارش ها",
|
||||||
type: "page",
|
type: "page",
|
||||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/receipt/report",
|
route: "/dashboard/receipt/report",
|
||||||
icon: <AssessmentIcon sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <AssessmentIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
permissions: ["all"],
|
permissions: ["show-receipt", 'show-receipt-province'],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -79,6 +79,12 @@ export const GET_IMAGES_ROAD_ITEM = api + "/api/v3/road_items/files";
|
|||||||
export const GET_CMMS_MACHINE_ROAD_ITEM = api + "/api/v3/road_items/machines";
|
export const GET_CMMS_MACHINE_ROAD_ITEM = api + "/api/v3/road_items/machines";
|
||||||
export const GET_RAHDARAN_ROAD_ITEM = api + "/api/v3/road_items/rahdaran";
|
export const GET_RAHDARAN_ROAD_ITEM = api + "/api/v3/road_items/rahdaran";
|
||||||
|
|
||||||
|
// recept report
|
||||||
|
export const GET_PROVINCE_RECEIPT_REPORT = api + "/api/v3/receipt_reports/country_activity";
|
||||||
|
export const GET_CITY_RECEIPT_REPORT = api + "/api/v3/receipt_reports/province_activity";
|
||||||
|
export const EXPORT_COUNTRY_RECEIPT_REPORT = api + "/api/v3/receipt_reports/country_activity_excel";
|
||||||
|
export const EXPORT_PROVINCE_RECEIPT_REPORT = api + "/api/v3/receipt_reports/province_activity_excel";
|
||||||
|
|
||||||
// damage items
|
// damage items
|
||||||
export const GET_RECEIPT_DAMAGE_ITEMS_LIST = api + "/api/v3/damages";
|
export const GET_RECEIPT_DAMAGE_ITEMS_LIST = api + "/api/v3/damages";
|
||||||
export const CREATE_RECEIPT_DAMAGE_ITEMS = api + "/api/v3/damages";
|
export const CREATE_RECEIPT_DAMAGE_ITEMS = api + "/api/v3/damages";
|
||||||
@@ -88,5 +94,6 @@ export const ATIVITY_RECEIPT_DAMAGE_ITEMS = api + "/api/v3/damages/activate";
|
|||||||
// damage receipt
|
// damage receipt
|
||||||
export const GET_TECHNICAL_DAMAGE_OPERATOR_LIST = api + "/api/v3/receipts";
|
export const GET_TECHNICAL_DAMAGE_OPERATOR_LIST = api + "/api/v3/receipts";
|
||||||
export const GET_DAMAGE_ITEM_LIST = api + "/api/v3/damages/list";
|
export const GET_DAMAGE_ITEM_LIST = api + "/api/v3/damages/list";
|
||||||
|
|
||||||
// activity code log
|
// activity code log
|
||||||
export const ACTIVITY_LOG = api + "/api/v3/profile/add_activity";
|
export const ACTIVITY_LOG = api + "/api/v3/profile/add_activity";
|
||||||
|
|||||||
Reference in New Issue
Block a user