add report shift with name + fix bug manage shift
parent
644f19eebe
commit
03c72dbf95
14
.env
14
.env
|
@ -1,9 +1,9 @@
|
|||
NODE_ENV="development"
|
||||
|
||||
NEXT_PUBLIC_SERVER_URL=http://192.168.1.12:32767
|
||||
NEXT_PUBLIC_PUBLIC_URL=http://192.168.1.12:32767
|
||||
NEXT_PUBLIC_API_URL=http://192.168.1.12:32767/api
|
||||
NEXT_PUBLIC_VERSION=0.3.0
|
||||
# NEXT_PUBLIC_SERVER_URL=http://192.168.1.12:32767
|
||||
# NEXT_PUBLIC_PUBLIC_URL=http://192.168.1.12:32767
|
||||
# NEXT_PUBLIC_API_URL=http://192.168.1.12:32767/api
|
||||
# NEXT_PUBLIC_VERSION=0.3.0
|
||||
|
||||
# SECURE_LOCAL_STORAGE_HASH_KEY=f1da2b2c7a4c446934267fea631102ec389b5b99
|
||||
# NEXT_PUBLIC_API_URL_IMAGE=https://192.168.88.12:49154/Files/ReportImages
|
||||
|
@ -15,8 +15,8 @@ NEXT_PUBLIC_VERSION=0.3.0
|
|||
|
||||
|
||||
|
||||
# NEXT_PUBLIC_SERVER_URL=https://api.brizco.io
|
||||
# NEXT_PUBLIC_PUBLIC_URL=https://api.brizco.io
|
||||
# NEXT_PUBLIC_API_URL=https://api.brizco.io/api
|
||||
NEXT_PUBLIC_SERVER_URL=https://api.brizco.io
|
||||
NEXT_PUBLIC_PUBLIC_URL=https://api.brizco.io
|
||||
NEXT_PUBLIC_API_URL=https://api.brizco.io/api
|
||||
# NEXT_PUBLIC_API_URL_IMAGE=https://api.macsonline.ir/Files/ReportImages
|
||||
# NEXT_PUBLIC_API_URL_BackUp=https://api.macsonline.ir/Files/BackUps
|
|
@ -0,0 +1,164 @@
|
|||
"use client";
|
||||
|
||||
import React, { useContext, useEffect, useRef, useState } from "react";
|
||||
import { BottomSheet } from "react-spring-bottom-sheet";
|
||||
import Input from "plugins/Input/page";
|
||||
import AppContext from "@ctx/AppContext";
|
||||
import SimpleReactValidator from "simple-react-validator";
|
||||
import CheckBoxBriz from "plugins/CheckBoxBriz/page";
|
||||
import Buttonbriz from "plugins/Buttonbriz/page";
|
||||
import { toast } from "react-toastify";
|
||||
import PersianNumber from "plugins/PersianNumber";
|
||||
import moment from "jalali-moment";
|
||||
|
||||
const BottomSheetReportManageShift = (props) => {
|
||||
const CTX = useContext(AppContext);
|
||||
const shiftplansData = CTX.state.shiftPlansData;
|
||||
const [shiftplans, setShiftplans] = useState([]);
|
||||
|
||||
// const reportDetail = CTX.state.reportDetail;
|
||||
|
||||
// const handleSendReport_SHIFTPLAN = () => {
|
||||
// CTX.ReportShiftPlan(reportDetail?.shiftId);
|
||||
// CTX.setBottomSheetReportManageShiftOpen(false);
|
||||
// };
|
||||
|
||||
// const handleSendReport_TASK = () => {
|
||||
// CTX.ReportTask();
|
||||
// CTX.setBottomSheetReportManageShiftOpen(false);
|
||||
// };
|
||||
|
||||
const handleBottomSheetCreateRole = (e) => {
|
||||
if (e.type == "OPEN") {
|
||||
CTX.GetShifPlans(0, 12);
|
||||
}
|
||||
};
|
||||
|
||||
const groupObjectsByPlanFor = (responseData) => {
|
||||
const groupedData = {};
|
||||
|
||||
// Iterate through the array
|
||||
responseData.forEach((obj) => {
|
||||
const { planFor } = obj;
|
||||
|
||||
// If the planFor value is not in the groupedData object, create a new array
|
||||
if (!groupedData[planFor]) {
|
||||
groupedData[planFor] = [obj];
|
||||
} else {
|
||||
// If the planFor value already exists, push the object into the existing array
|
||||
groupedData[planFor].push(obj);
|
||||
}
|
||||
});
|
||||
|
||||
// Sort the objects within each group by the planFor date
|
||||
Object.keys(groupedData).forEach((key) => {
|
||||
groupedData[key].sort(
|
||||
(a, b) => new Date(a.planFor) - new Date(b.planFor)
|
||||
);
|
||||
});
|
||||
|
||||
// Convert the groupedData object into an array of objects
|
||||
const groupedArray = Object.keys(groupedData).map((key) => ({
|
||||
planFor: key,
|
||||
data: groupedData[key],
|
||||
}));
|
||||
|
||||
// Sort the groupedArray by the planFor date
|
||||
groupedArray.sort((a, b) => new Date(a.planFor) - new Date(b.planFor));
|
||||
|
||||
console.log(groupedArray);
|
||||
setShiftplans(groupedArray);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
groupObjectsByPlanFor(shiftplansData);
|
||||
}, [shiftplansData]);
|
||||
|
||||
console.log(shiftplans);
|
||||
|
||||
return (
|
||||
<BottomSheet
|
||||
onSpringStart={(e) => handleBottomSheetCreateRole(e)}
|
||||
open={CTX.state.BottomSheetReportManageShiftOpen}
|
||||
onDismiss={() => CTX.setBottomSheetReportManageShiftOpen(false)}
|
||||
blocking={false}
|
||||
>
|
||||
<div className="text-center py-2 bg-primary-300 ">
|
||||
<p className="mb-0 text-white relative top-[-5px]">گزارشات</p>
|
||||
</div>
|
||||
|
||||
<div className="px-3 pt-10 ">
|
||||
<p id="MYTEXT" className="mb-0 text-center text-sm font-light">
|
||||
{shiftplans?.map((e, index) => (
|
||||
<>
|
||||
<div className={`h-fit mb-10`}>
|
||||
<div className={`flex justify-between rtl`}>
|
||||
<div className="flex">
|
||||
<PersianNumber
|
||||
number={moment(e.planFor).format("jYYYY/jM/jD")}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<>
|
||||
{e.data.map((e) => (
|
||||
<div className=" rtl">
|
||||
<div className="flex justify-between">
|
||||
<div className="ml-2 rounded-xl ">
|
||||
<p className="text-sm mb-0 text-gray-700 font-medium">
|
||||
{" "}
|
||||
{e.shiftTitle}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-wrap">
|
||||
{e.users.map((i) => (
|
||||
<div className="flex p-1 rounded-full w-fit ">
|
||||
<p className="mb-0 text-[12px] font-medium">
|
||||
{i.positionName} :{" "}
|
||||
</p>{" "}
|
||||
<p className="mb-0 text-[12px] mr-1">
|
||||
{i.userFullName}
|
||||
</p>
|
||||
</div>
|
||||
))}
|
||||
<div className="flex p-1 rounded-full w-fit ">
|
||||
<p className="mb-0 text-[12px] font-medium text-red-600 ">
|
||||
سوپروایزر :{" "}
|
||||
</p>{" "}
|
||||
<p className="mb-0 text-[12px] mr-1 font-medium text-red-600 ">
|
||||
{e.supervisorFullName}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</>
|
||||
</div>
|
||||
</>
|
||||
))}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className=" p-4">
|
||||
<Buttonbriz
|
||||
title="کپی کردن متن "
|
||||
color="INFO"
|
||||
icon="CHECK"
|
||||
buttonEvent={() => {
|
||||
var text = document.getElementById("MYTEXT").innerText;
|
||||
var elem = document.createElement("textarea");
|
||||
document.body.appendChild(elem);
|
||||
elem.value = text;
|
||||
elem.select();
|
||||
document.execCommand("copy");
|
||||
document.body.removeChild(elem);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</BottomSheet>
|
||||
);
|
||||
};
|
||||
|
||||
export default BottomSheetReportManageShift;
|
|
@ -348,6 +348,47 @@ const Home = (props) => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div className="rtl mt-2">
|
||||
<div className="flex ">
|
||||
<div className="w-[50px] h-[50px] rounded-2xl bg-white shadow">
|
||||
<svg
|
||||
width="25"
|
||||
height="25"
|
||||
viewBox="0 0 251 226"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-3"
|
||||
s
|
||||
>
|
||||
<path
|
||||
d="M246.65 100.5L196.612 13.0002C194.463 9.19349 191.338 6.02857 187.559 3.83143C183.78 1.63429 179.483 0.48438 175.112 0.50016H75.062C70.6812 0.545125 66.3859 1.71914 62.5912 3.9088C58.7966 6.09846 55.6307 9.22974 53.3995 13.0002L3.36204 100.5C1.16661 104.3 0.0107422 108.611 0.0107422 113C0.0107422 117.389 1.16661 121.7 3.36204 125.5L53.3995 213C55.6307 216.771 58.7966 219.902 62.5912 222.092C66.3859 224.281 70.6812 225.455 75.062 225.5H175.137C179.507 225.515 183.801 224.365 187.578 222.167C191.355 219.97 194.478 216.806 196.625 213L246.662 125.5C248.857 121.7 250.013 117.389 250.013 113C250.013 108.611 248.845 104.3 246.65 100.5ZM175 200.5H74.9995L24.9995 113L74.9995 25.5002H175L225 113L175 200.5Z"
|
||||
fill="#ABABAB"
|
||||
/>
|
||||
<path
|
||||
d="M112 63.5C112 56.5964 117.596 51 124.5 51V51C131.404 51 137 56.5964 137 63.5V126C137 132.904 131.404 138.5 124.5 138.5V138.5C117.596 138.5 112 132.904 112 126V63.5Z"
|
||||
fill="#ABABAB"
|
||||
/>
|
||||
<path
|
||||
d="M124.5 173C131.404 173 137 167.404 137 160.5C137 153.596 131.404 148 124.5 148C117.596 148 112 153.596 112 160.5C112 167.404 117.596 173 124.5 173Z"
|
||||
fill="#ABABAB"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<div
|
||||
className="mx-2 mt-1"
|
||||
onClick={() => CTX.setBottomSheetReportManageShiftOpen(true)}
|
||||
>
|
||||
<h3 className="text-sm font-bold ">
|
||||
{" "}
|
||||
شیفت های هفته <small className="text-red-500">(new)</small>
|
||||
</h3>
|
||||
<p className="mb-0 text-right text-sm text-gray-500">
|
||||
خروجی متن
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="rtl mt-4">
|
||||
<div className="flex ">
|
||||
<div className="w-[50px] h-[50px] rounded-2xl bg-white shadow">
|
||||
|
|
|
@ -20,6 +20,7 @@ import TimePicker from "plugins/TimePicker/page";
|
|||
import axios from "axios";
|
||||
import "rc-slider/assets/index.css";
|
||||
import BottomSheetReport from "plugins/BottomSheet/BottomSheetReport";
|
||||
import BottomSheetReportManageShift from "plugins/BottomSheet/BottomSheetReportManageShift";
|
||||
|
||||
const inter = Inter({ subsets: ["latin"] });
|
||||
|
||||
|
@ -59,6 +60,10 @@ export default function RootLayout({ children }) {
|
|||
useState(false);
|
||||
|
||||
const [BottomSheetReportOpen, setBottomSheetReportOpen] = useState(false);
|
||||
const [
|
||||
BottomSheetReportManageShiftOpen,
|
||||
setBottomSheetReportManageShiftOpen,
|
||||
] = useState(false);
|
||||
|
||||
// BigPlus
|
||||
const [BigPlusOpen, setBigPlusOpen] = useState(false);
|
||||
|
@ -929,61 +934,62 @@ export default function RootLayout({ children }) {
|
|||
setLoading(false);
|
||||
}
|
||||
};
|
||||
const UpdateShiftPlan = async (body, id) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const data = await Chapar.put(
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/shift/plan`,
|
||||
body,
|
||||
// const UpdateShiftPlan = async (body, id) => {
|
||||
// setLoading(true);
|
||||
// try {
|
||||
// const data = await Chapar.put(
|
||||
// `${process.env.NEXT_PUBLIC_API_URL}/shift/plan`,
|
||||
// body,
|
||||
|
||||
{
|
||||
headers: {
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
toast.success(`شیفت ویرایش شد`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
// {
|
||||
// headers: {
|
||||
// Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
// },
|
||||
// }
|
||||
// );
|
||||
// toast.success(`شیفت ویرایش شد`, {
|
||||
// position: "bottom-right",
|
||||
// closeOnClick: true,
|
||||
// });
|
||||
|
||||
setLoading(false);
|
||||
setShiftPlanData(id);
|
||||
router.push("/shifts");
|
||||
} catch ({ error, status }) {
|
||||
toast.error(`${error?.response?.data?.message}`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
const CreateShifPlan = async (body) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const data = await Chapar.post(
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/shift/plan`,
|
||||
JSON.stringify(body),
|
||||
{
|
||||
headers: {
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
toast.success(`مدیریت شیفت ساخته شد`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
// setLoading(false);
|
||||
// setShiftPlanData(id);
|
||||
// router.push("/shifts");
|
||||
// } catch ({ error, status }) {
|
||||
// toast.error(`${error?.response?.data?.message}`, {
|
||||
// position: "bottom-right",
|
||||
// closeOnClick: true,
|
||||
// });
|
||||
// setLoading(false);
|
||||
// }
|
||||
// };
|
||||
// const CreateShifPlan = async (body) => {
|
||||
// setLoading(true);
|
||||
// try {
|
||||
// const data = await Chapar.post(
|
||||
// `${process.env.NEXT_PUBLIC_API_URL}/shift/plan`,
|
||||
// JSON.stringify(body),
|
||||
// {
|
||||
// headers: {
|
||||
// Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
// },
|
||||
// }
|
||||
// );
|
||||
// toast.success(`مدیریت شیفت ساخته شد`, {
|
||||
// position: "bottom-right",
|
||||
// closeOnClick: true,
|
||||
// });
|
||||
|
||||
router.push("/shifts");
|
||||
} catch ({ error, status }) {
|
||||
toast.error(`${error?.response?.data?.message}`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
// router.push("/shifts");
|
||||
|
||||
// } catch ({ error, status }) {
|
||||
// toast.error(`${error?.response?.data?.message}`, {
|
||||
// position: "bottom-right",
|
||||
// closeOnClick: true,
|
||||
// });
|
||||
// setLoading(false);
|
||||
// }
|
||||
// };
|
||||
const GetShifPlans = async (page, dataFilter) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
|
@ -1669,6 +1675,7 @@ export default function RootLayout({ children }) {
|
|||
BottomFilterActivitiesOpen,
|
||||
homePageData,
|
||||
typeTask,
|
||||
BottomSheetReportManageShiftOpen,
|
||||
},
|
||||
setBottomSheetCreateRoleOpen,
|
||||
setBottomSheetCreateEmployeesOpen,
|
||||
|
@ -1768,7 +1775,7 @@ export default function RootLayout({ children }) {
|
|||
setRoutineShiftPlan,
|
||||
GetRoutineShiftPlan,
|
||||
setBottomSheetAddUserToPositionShiftPlanOpen,
|
||||
CreateShifPlan,
|
||||
// CreateShifPlan,
|
||||
setBottomSheetChangeRoleOpen,
|
||||
setActivitiesData,
|
||||
GetActivity,
|
||||
|
@ -1779,7 +1786,7 @@ export default function RootLayout({ children }) {
|
|||
CloseShift,
|
||||
setShiftPlanData,
|
||||
GetShiftPlan,
|
||||
UpdateShiftPlan,
|
||||
// UpdateShiftPlan,
|
||||
setStopGetTasks,
|
||||
setPageGetTasks,
|
||||
setStopGetActivities,
|
||||
|
@ -1794,6 +1801,7 @@ export default function RootLayout({ children }) {
|
|||
setHomePageData,
|
||||
GetHomePageData,
|
||||
setTypeTask,
|
||||
setBottomSheetReportManageShiftOpen,
|
||||
}}
|
||||
>
|
||||
<html lang="en">
|
||||
|
@ -1803,78 +1811,9 @@ export default function RootLayout({ children }) {
|
|||
<ToastContainer position="bottom-right" closeOnClick={true} rtl />
|
||||
<Loading />
|
||||
<BottomSheetReport />
|
||||
<BottomSheetReportManageShift />
|
||||
|
||||
{openTimePicker && <TimePicker />}
|
||||
{/* {BigPlusOpen ? (
|
||||
<div className="fixed w-full top-0 z-[120] ">
|
||||
<motion.div
|
||||
animate={{ opacity: [0, 0.5, 1] }}
|
||||
transition={{ duration: 0.3 }}
|
||||
>
|
||||
<div className="h-screen bg-BigPlus ">
|
||||
<div className="flex justify-center">
|
||||
<div className="bg-primary-200 w-[60px] h-[60px] rounded-full fixed bottom-[37px] ">
|
||||
<div
|
||||
onClick={() => {
|
||||
closeBigPlusPage();
|
||||
}}
|
||||
>
|
||||
<svg
|
||||
width="25"
|
||||
height="25"
|
||||
viewBox="0 0 16 16"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className={`mx-auto mt-[16px] transition-all ${
|
||||
BigPlusRotateIcon ? " rotate-45" : " rotate-0"
|
||||
} `}
|
||||
>
|
||||
<path
|
||||
d="M14 6H10V2C10 1.46957 9.78929 0.960859 9.41421 0.585786C9.03914 0.210714 8.53043 0 8 0C7.46957 0 6.96086 0.210714 6.58579 0.585786C6.21071 0.960859 6 1.46957 6 2L6.071 6H2C1.46957 6 0.960859 6.21071 0.585786 6.58579C0.210714 6.96086 0 7.46957 0 8C0 8.53043 0.210714 9.03914 0.585786 9.41421C0.960859 9.78929 1.46957 10 2 10L6.071 9.929L6 14C6 14.5304 6.21071 15.0391 6.58579 15.4142C6.96086 15.7893 7.46957 16 8 16C8.53043 16 9.03914 15.7893 9.41421 15.4142C9.78929 15.0391 10 14.5304 10 14V9.929L14 10C14.5304 10 15.0391 9.78929 15.4142 9.41421C15.7893 9.03914 16 8.53043 16 8C16 7.46957 15.7893 6.96086 15.4142 6.58579C15.0391 6.21071 14.5304 6 14 6Z"
|
||||
fill="white"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="fixed bottom-[110px] w-full px-3 ">
|
||||
<Link href={"/shifts/complete-shift"}>
|
||||
<div
|
||||
className="bg-secondary-200 p-3 my-2 w-full rounded-full"
|
||||
onClick={() => closeBigPlusPage()}
|
||||
>
|
||||
<p className="mb-0 text-center text-white">بستن شیفت</p>
|
||||
</div>
|
||||
</Link>
|
||||
|
||||
<div className="flex justify-between w-full">
|
||||
<Link href={"/dsdasd"}>
|
||||
<div
|
||||
className="w-full p-3 rounded-full bg-secondaryDark-100 px-4"
|
||||
onClick={() => closeBigPlusPage()}
|
||||
>
|
||||
<p className="mb-0 text-white">
|
||||
افزودن خرید جدیـــــد
|
||||
</p>
|
||||
</div>
|
||||
</Link>
|
||||
|
||||
<Link href={"/tasks/add-task?new=true"}>
|
||||
<div
|
||||
className="w-full p-3 rounded-full bg-secondaryDark-100 px-4"
|
||||
onClick={() => closeBigPlusPage()}
|
||||
>
|
||||
<p className="mb-0 text-white">افزودن وظیفه جدید</p>
|
||||
</div>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</motion.div>
|
||||
</div>
|
||||
) : (
|
||||
""
|
||||
)} */}
|
||||
</body>
|
||||
</html>
|
||||
</AppContext.Provider>
|
||||
|
|
|
@ -15,6 +15,7 @@ import BottomManageShift from "plugins/BottomSheet/BottomManageShift";
|
|||
import BottomSheetAddUserToPositionShiftPlan from "plugins/BottomSheet/BottomSheetAddUserToPositionShiftPlan";
|
||||
import Buttonbriz from "plugins/Buttonbriz/page";
|
||||
import GoBack from "plugins/GoBack/page";
|
||||
import Chapar from "plugins/Chapar";
|
||||
|
||||
const Calendar = () => {
|
||||
const CTX = useContext(AppContext);
|
||||
|
@ -144,11 +145,74 @@ const Calendar = () => {
|
|||
);
|
||||
};
|
||||
|
||||
const UpdateShiftPlan = async (body, id) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const data = await Chapar.put(
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/shift/plan`,
|
||||
body,
|
||||
|
||||
{
|
||||
headers: {
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
toast.success(`شیفت ویرایش شد`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
|
||||
CTX.setLoading(false);
|
||||
CTX.setShiftPlanData(id);
|
||||
router.push("/shifts");
|
||||
} catch ({ error, status }) {
|
||||
toast.error(`${error?.response?.data?.message}`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
CTX.setLoading(false);
|
||||
}
|
||||
};
|
||||
const CreateShifPlan = async (body) => {
|
||||
CTX.setLoading(true);
|
||||
try {
|
||||
const data = await Chapar.post(
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/shift/plan`,
|
||||
JSON.stringify(body),
|
||||
{
|
||||
headers: {
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
toast.success(`مدیریت شیفت ساخته شد`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
|
||||
setSelectDay(null);
|
||||
setShiftsPlan([]);
|
||||
setSuperId(null);
|
||||
setUserAndPositionIds([]);
|
||||
setShiftPlanSteps(1);
|
||||
CTX.setLoading(false);
|
||||
|
||||
// router.push("/shifts");
|
||||
} catch ({ error, status }) {
|
||||
toast.error(`${error?.response?.data?.message}`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
CTX.setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleCreateShiftPlan = (update) => {
|
||||
if (update == "UPDATE") {
|
||||
CTX.UpdateShiftPlan(bodyUpdate);
|
||||
UpdateShiftPlan(bodyUpdate);
|
||||
} else {
|
||||
CTX.CreateShifPlan(body);
|
||||
CreateShifPlan(body);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -404,7 +468,6 @@ const Calendar = () => {
|
|||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className=" text-right mt-3 mb-5">
|
||||
<p className="mb-0 font-medium m">پرسنل را انتخاب کنید</p>
|
||||
</div>
|
||||
|
@ -471,7 +534,6 @@ const Calendar = () => {
|
|||
</div>
|
||||
</div>
|
||||
))}
|
||||
|
||||
<div className="mt-8">
|
||||
<div className=" text-right mt-3">
|
||||
<p className="mb-0 font-medium">
|
||||
|
@ -503,29 +565,6 @@ const Calendar = () => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div className="mt-8">
|
||||
<p className="mb-0 font-medium ">غیر فعال کردن شیفت </p>
|
||||
<div
|
||||
className={`flex rtl tr03 border-[2px] border-transparent py-2 ${
|
||||
1 ? "animate-pulse-1 " : ""
|
||||
}`}
|
||||
>
|
||||
<div>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={1 ? true : false}
|
||||
defaultValue={true}
|
||||
className="w-[40px] h-[40px] !rounded-xl ml-2 custom-checkbox mt-1"
|
||||
name="hasSchengenRelative"
|
||||
// onClick={(e) => setRoleCheckBox(e.target.checked)}
|
||||
/>
|
||||
</div>
|
||||
<p className="mb-0 text-right mt-1 text-[12px] text-red-600 font-medium">
|
||||
با خاموش کردن شیفت فعالیت ها برای افراد داخل شیفت خاموش میشود{" "}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="mt-5">
|
||||
{editManageShift ? (
|
||||
<Buttonbriz
|
||||
|
|
Loading…
Reference in New Issue