import { Button, IconButton, Popover, Tooltip, Typography, } from "@mui/material"; import { useContext, useState } from "react"; import { Grid } from "../../../../components/grid/Grid"; import { CLOSE_MODAL, DRAWER, OPEN_MODAL, } from "../../../../lib/redux/slices/appSlice"; import { provinceCloseAllocationService } from "../../services/province-close-allocation"; import { provinceGetAllRequests } from "../../services/province-get-all-requests"; import ArchiveIcon from "@mui/icons-material/Archive"; import ConstructionIcon from "@mui/icons-material/Construction"; import { ProvinceAllocation } from "../../../file/components/province-allocation/ProvinceAllocation"; import { useDispatch } from "react-redux"; import { AppContext } from "../../../../contexts/AppContext"; import TuneIcon from "@mui/icons-material/Tune"; import { ProvincePoultryRequestEnterConfirmationCode } from "../province-poultry-request-enter-confirmation-code/ProvincePoultryRequestEnterConfirmationCode"; export const ProvinceAllocateOperations = ({ item, remainQuantity, getItemFreeSaleInProvince, updateTable, }) => { const dispatch = useDispatch(); const [openNotif, , selectedDate1] = useContext(AppContext); const [anchorEl, setAnchorEl] = useState(null); const open = Boolean(anchorEl); const id = open ? "ProvinceAllocateRequests" : undefined; const handleClick = (event) => { setAnchorEl(event.currentTarget); }; const handleClose = () => { setAnchorEl(null); }; return (
{ handleClose(); if ( item?.poultryRequest?.priceConfirmation === true && !item?.poultryRequest?.inputPriceConfirmationCode ) { dispatch( OPEN_MODAL({ title: "ورود کد احراز", content: ( ), }) ); } else if (item?.provinceState === "pending") { dispatch( OPEN_MODAL({ title: "اطلاعیه سیستم", content: ( درخواست ابتدا باید توسط استان تایید شود! ), }) ); } else { dispatch( DRAWER({ title: "انجام عملیات تخصیص", // right: !(window.innerWidth <= 600), top: !(window.innerWidth <= 600), bottom: window.innerWidth <= 600, size: 1000, content: ( ), }) ); } }} > { handleClose(); dispatch( OPEN_MODAL({ title: "آیا مطمئن هستید؟", content: ( ), }) ); }} > {/* { handleClose(); navigate( ROUTE_PROVINCE_FILE + item?.poultryRequest?.process?.poultry?.poultryRequestId ); }} > */}
); };