-
Мои отчеты за
+ {!userId &&
Мои отчеты за
}
{month}
diff --git a/src/pages/PartnerEmployeeReport/PartnerEmployeeReport.jsx b/src/pages/PartnerEmployeeReport/PartnerEmployeeReport.jsx
new file mode 100644
index 00000000..8906d88d
--- /dev/null
+++ b/src/pages/PartnerEmployeeReport/PartnerEmployeeReport.jsx
@@ -0,0 +1,131 @@
+import moment from "moment/moment";
+import React, { useEffect, useState } from "react";
+import { useDispatch, useSelector } from "react-redux";
+import { Navigate, useParams } from "react-router-dom";
+
+import { getRequestDates, setRequestDate } from "@redux/reportSlice";
+
+import { apiRequest } from "@api/request";
+
+import { getReports } from "@components/Calendar/calendarHelper";
+import { Footer } from "@components/Common/Footer/Footer";
+import { Loader } from "@components/Common/Loader/Loader";
+import { Navigation } from "@components/Navigation/Navigation";
+import { ProfileBreadcrumbs } from "@components/ProfileBreadcrumbs/ProfileBreadcrumbs";
+import { ProfileCalendarComponent } from "@components/ProfileCalendar/ProfileCalendarComponent";
+import { ProfileHeader } from "@components/ProfileHeader/ProfileHeader";
+
+import "./partnerEmployeeReport.scss";
+
+export const PartnerEmployeeReport = () => {
+ // if (
+ // localStorage.getItem("role_status") !== "18"
+ // ) {
+ // return ;
+ // }
+
+ const params = useParams();
+ const dispatch = useDispatch();
+ const [userInfo, setUserInfo] = useState({});
+ const [value, setValue] = useState(moment());
+ const [reports, setReports] = useState([]);
+ const [totalHours, setTotalHours] = useState(0);
+ const requestDates = useSelector(getRequestDates);
+ const [startRangeDays, setStartRangeDays] = useState(false);
+ const [startDate, setStartDate] = useState(null);
+ const [loader, setLoader] = useState(true);
+
+ useEffect(() => {
+ dispatch(setRequestDate(getReports(moment())));
+ }, []);
+
+ useEffect(() => {
+ apiRequest(`/resume?userId=${params.uuid}`).then((res) => {
+ setUserInfo(res);
+ });
+ }, []);
+
+ useEffect(() => {
+ setLoader(true);
+ if (!requestDates) {
+ return;
+ }
+ apiRequest(`/reports/index?${requestDates}&user_id=${params.uuid}`).then(
+ (reports) => {
+ let spendTime = 0;
+
+ reports
+ .filter(
+ (item) => new Date(item.created_at).getMonth() === value.month()
+ )
+ .map((report) => {
+ spendTime += report.task.reduce(
+ (acc, task) => acc + task.hours_spent,
+ 0
+ );
+ });
+
+ setTotalHours(Math.floor(spendTime));
+ setReports(reports);
+ setLoader(false);
+ }
+ );
+ }, [requestDates]);
+
+ return (
+
+
+
+
+
+ {!Object.keys(userInfo).length ? (
+
+
+
+ ) : (
+ <>
+
+
+
{userInfo.fio}
+
{userInfo.position}
+
+
+ {userInfo?.stack &&
+ userInfo.stack.map((skill, index) => {
+ return {skill};
+ })}
+
+
+
+ {loader ? (
+
+
+
+ ) : (
+
+
setValue(value)}
+ value={value}
+ reports={reports}
+ totalHours={totalHours}
+ startRangeDays={startRangeDays}
+ toggleRangeDays={() => setStartRangeDays(!startRangeDays)}
+ startDate={startDate}
+ setStartDateRange={(date) => setStartDate(date)}
+ />
+
+ )}
+
+ >
+ )}
+
+
+
+ );
+};
diff --git a/src/pages/PartnerEmployeeReport/partnerEmployeeReport.scss b/src/pages/PartnerEmployeeReport/partnerEmployeeReport.scss
new file mode 100644
index 00000000..7e5953d8
--- /dev/null
+++ b/src/pages/PartnerEmployeeReport/partnerEmployeeReport.scss
@@ -0,0 +1,70 @@
+.employeeReport {
+ background: #F1F1F1;
+ height: 100%;
+ min-height: 100vh;
+ font-family: "LabGrotesque", sans-serif;
+
+ .container {
+ margin-top: 23px;
+ }
+
+ &__info {
+ padding: 10px 15px;
+ background: white;
+ display: flex;
+ border-radius: 15px;
+ column-gap: 15px;
+ align-items: center;
+ }
+
+ &__name {
+ display: flex;
+ flex-direction: column;
+ row-gap: 10px;
+ width: 100%;
+ h2 {
+ font-size: 20px;
+ margin-bottom: 0;
+ }
+
+ p {
+ font-size: 15px;
+ }
+ }
+
+ &__skills {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 7px;
+ width: 100%;
+
+ span {
+ font-size: 12px;
+ line-height: 14px;
+ color: #263238;
+ background: #8DC63F;
+ border-radius: 12px;
+ padding: 5px;
+ max-width: 130px;
+ height: 24px;
+ display: flex;
+ align-items: center;
+ padding: 0 10px;
+ }
+ }
+
+ &__calendar {
+ width: 100%;
+ }
+
+ &__wrapper {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ min-height: 620px;
+ }
+
+ &__loader {
+ margin: 20px;
+ }
+}
diff --git a/src/pages/PartnerСategories/PartnerСategories.jsx b/src/pages/PartnerСategories/PartnerСategories.jsx
index e5982164..4ebf2784 100644
--- a/src/pages/PartnerСategories/PartnerСategories.jsx
+++ b/src/pages/PartnerСategories/PartnerСategories.jsx
@@ -7,6 +7,7 @@ import { apiRequest } from "@api/request";
// import { setPartnerEmployees } from "@redux/outstaffingSlice";
import { Footer } from "@components/Common/Footer/Footer";
+import { Loader } from "@components/Common/Loader/Loader";
import { Navigation } from "@components/Navigation/Navigation";
import PartnerPersonCard from "@components/PartnerPersonCard/PartnerPersonCard";
import { ProfileBreadcrumbs } from "@components/ProfileBreadcrumbs/ProfileBreadcrumbs";
@@ -32,9 +33,12 @@ export const PartnerCategories = () => {
}
const [staff, setStaff] = useState([]);
+ const [loader, setLoader] = useState(false);
useEffect(() => {
+ setLoader(true);
apiRequest("/project/my-employee").then((el) => {
+ setLoader(false);
setStaff(el.managerEmployees);
});
}, []);
@@ -149,55 +153,59 @@ export const PartnerCategories = () => {
Данные персонала
-
- {staff.map((card) => {
- return (
-
- );
- })}
- {/*{personalInfoItems.map((item, index) => {*/}
- {/* return (*/}
- {/*
{*/}
- {/* dispatch(setPartnerEmployees(mokPersons));*/}
- {/* }}*/}
- {/* >*/}
- {/*
*/}
- {/*
*/}
- {/*
{item.title}
*/}
- {/*
*/}
- {/*
*/}
- {/*
{item.description}
*/}
- {/*
*/}
- {/*
*/}
- {/*
*/}
- {/*
*/}
- {/* {!item.available && (*/}
- {/*
*/}
- {/*
У вас нет персонала из категории
*/}
- {/*
*/}
- {/*
*/}
- {/* )}*/}
- {/* */}
- {/* );*/}
- {/*})}*/}
-
+ {loader ? (
+
+ ) : (
+
+ {staff.map((card) => {
+ return (
+
+ );
+ })}
+ {/*{personalInfoItems.map((item, index) => {*/}
+ {/* return (*/}
+ {/*
{*/}
+ {/* dispatch(setPartnerEmployees(mokPersons));*/}
+ {/* }}*/}
+ {/* >*/}
+ {/*
*/}
+ {/*
*/}
+ {/*
{item.title}
*/}
+ {/*
*/}
+ {/*
*/}
+ {/*
{item.description}
*/}
+ {/*
*/}
+ {/*
*/}
+ {/*
*/}
+ {/*
*/}
+ {/* {!item.available && (*/}
+ {/*
*/}
+ {/*
У вас нет персонала из категории
*/}
+ {/*
*/}
+ {/*
*/}
+ {/* )}*/}
+ {/* */}
+ {/* );*/}
+ {/*})}*/}
+
+ )}