employeeReport

This commit is contained in:
Mikola
2024-02-02 18:43:52 +03:00
parent dafb05619d
commit 5825015706
9 changed files with 308 additions and 80 deletions

View File

@ -53,7 +53,7 @@ export const Navigation = () => {
name: "Запросы"
},
{
path: "/categories",
path: "/employees",
name: "Персонал"
},
{

View File

@ -15,7 +15,7 @@ export const PartnerPersonCard = ({ name, img, userId }) => {
</div>
<div className="partnerPersonCard__info">
<h2 className="partnerPersonCard__name">{name}</h2>
<Link className="partnerPersonCard__report" to={`calendar/${userId}`}>
<Link className="partnerPersonCard__report" to={`/profile/employees/report/${userId}`}>
Подробный отчет
<div className="partnerPersonCard__more">
<img src={rightArrow} alt="arrow" />

View File

@ -32,6 +32,7 @@ import rectangle from "assets/images/rectangle__calendar.png";
export const ProfileCalendarComponent = React.memo(
({
userId,
value,
setValueHandler,
reports,
@ -94,9 +95,17 @@ export const ProfileCalendarComponent = React.memo(
new Date(day).getMonth() + 1
)}-${correctDay(new Date(day).getDate())}` === date.created_at
) {
return `../view/${date.created_at}`;
if (userId) {
return `../view/${date.created_at}/${userId}`
}
return `../view/${date.created_at}/${localStorage.getItem("id")}`;
}
}
if (userId) {
return "#"
}
return "../../report";
}
@ -114,7 +123,7 @@ export const ProfileCalendarComponent = React.memo(
startDate._d
)}`;
apiRequest(
`/reports/index?${requestDates}&user_id =${localStorage.getItem("id")}`
`/reports/index?${requestDates}&user_id=${userId ? userId : localStorage.getItem("id")}`
).then((reports) => {
let spendTime = 0;
reports.map((report) => {
@ -163,7 +172,9 @@ export const ProfileCalendarComponent = React.memo(
<div className="calendar-component">
<div className="calendar-component__header">
<div className="calendar-component__header-info">
<h3>Мои отчеты за </h3>
{!userId &&
<h3>Мои отчеты за </h3>
}
<p className="calendar__hours">
{month}&nbsp;
<span>