diff --git a/frontend/src/axios/receiveItemUpdateAxios.js b/frontend/src/axios/receiveItemUpdateAxios.js index 8fc1527..0cc0b2a 100644 --- a/frontend/src/axios/receiveItemUpdateAxios.js +++ b/frontend/src/axios/receiveItemUpdateAxios.js @@ -1,7 +1,14 @@ import axios from "axios"; import swal from "sweetalert2"; axios.defaults.withCredentials = true; -const receiveItemUpdateAxios = (receiveCode, receiveItemNo, receiveCounts, selectWarehouse) => { +const receiveItemUpdateAxios = ( + receiveCode, + receiveItemNo, + receiveCounts, + selectWarehouse, + porderCode, + porderItemNo +) => { const modifyCount = receiveCounts.toString().replace(/,/g, "") || ""; const modifyWarehouseNo = selectWarehouse.toString().replace(/,/g, "") || ""; const receiveItems = { @@ -9,6 +16,8 @@ const receiveItemUpdateAxios = (receiveCode, receiveItemNo, receiveCounts, selec receiveItemNo: receiveItemNo, receiveCount: modifyCount, warehouseNo: modifyWarehouseNo, + pOrderCode: porderCode, + pOrderItemNo: porderItemNo, }; axios .patch("http://localhost:8888/api/receive-item/modify", receiveItems) diff --git a/frontend/src/views/dashboard/components/ReceiveComponents.js b/frontend/src/views/dashboard/components/ReceiveComponents.js index da0a3b1..b8dd23c 100644 --- a/frontend/src/views/dashboard/components/ReceiveComponents.js +++ b/frontend/src/views/dashboard/components/ReceiveComponents.js @@ -12,11 +12,12 @@ import { Checkbox, Pagination, styled, + Tooltip, + Chip, } from "@mui/material"; import { IconHammer } from "@tabler/icons"; import DeleteIcon from "@mui/icons-material/Delete"; import PageviewOutlinedIcon from "@mui/icons-material/PageviewOutlined"; -import AutoFixHighOutlinedIcon from "@mui/icons-material/AutoFixHighOutlined"; import AddCircleOutlineOutlinedIcon from "@mui/icons-material/AddCircleOutlineOutlined"; import { tableCellClasses } from "@mui/material/TableCell"; import DashboardCard from "../../../components/shared/DashboardCard"; @@ -39,6 +40,7 @@ import ReceiveModal from "./modal/ReceiveModal"; import pOrderWaitIngAxios from "src/axios/pOrderWaitIngAxios"; import receiveItemDeleteAxios from "src/axios/receiveItemDeleteAxios"; import receiveUpdateAxios from "src/axios/receiveUpdateAxios"; + const StyledTableCell = styled(TableCell)(({ theme }) => ({ [`&.${tableCellClasses.head}`]: { backgroundColor: "#505e82", @@ -61,6 +63,7 @@ const StyledTableRow = styled(TableRow)(({ theme, receiveCode, modifyReceive }) border: 0, }, })); + axios.defaults.withCredentials = true; const ReceiveComponents = () => { @@ -89,8 +92,10 @@ const ReceiveComponents = () => { const [childReceiveItem, setChildReceiveItem] = useState([]); const products = JSON.parse(JSON.stringify(productsData)); const realProducts = products?.data || []; - const [selectedStartDate, setSelectedStartDate] = useState(null); - const [selectedEndDate, setSelectedEndDate] = useState(null); + const [selectedStartDate, setSelectedStartDate] = useState( + new Date(new Date().getFullYear(), new Date().getMonth(), 1) + ); + const [selectedEndDate, setSelectedEndDate] = useState(new Date()); const receiveModalState = useSelector((state) => state.receiveModal); const [editMode, setEditMode] = useState({}); const [searchManager, setSearchManager] = useState(""); @@ -162,15 +167,6 @@ const ReceiveComponents = () => { } }, [selectedProducts]); - useEffect(() => { - if (selectedStartDate === null) { - setSelectedStartDate(new Date()); - } - if (selectedEndDate === null) { - setSelectedEndDate(new Date()); - } - }, []); - const handleClick = () => { let timerInterval; const findDateStart = new Date(selectedStartDate); @@ -218,40 +214,6 @@ const ReceiveComponents = () => { } }; - const handleModify = () => { - if (selectedProducts.length === 0) { - swal.fire({ - title: "선택 사항 없음", - text: "수정할 입고를 선택해주세요", - icon: "warning", - }); - } else if (selectedProducts.length >= 2) { - swal.fire({ - title: "선택 사항 초과", - text: "수정할 입고를 하나씩 선택해주세요", - icon: "warning", - }); - } else if (selectedProducts.length === 1) { - swal - .fire({ - title: "정말로 수정하시겠습니까?", - text: "해당하는 데이터의 창고재고도 함께 수정됩니다.", - icon: "warning", - showCancelButton: true, - confirmButtonColor: "#d33", - cancelButtonColor: "#3085", - confirmButtonText: "수정", - cancelButtonText: "취소", - }) - .then((result) => { - if (result.isConfirmed) { - setModifyReceiveCode(selectedProducts); - } - }); - } - setModifyReceiveCode("null"); - }; - const handleDelete = () => { swal .fire({ @@ -268,8 +230,10 @@ const ReceiveComponents = () => { if (result.isConfirmed) { if (selectedProducts.length > 0) { receiveDeleteAxios(selectedProducts); - dispatch(receiveListAll()); setReceiveItemData([]); + // dispatch(receiveListAll()); + console.log("삭제프로세스완료"); + window.location.reload(); } if (childReceiveItem.length > 0) { receiveItemDeleteAxios(childReceiveItem); @@ -475,6 +439,8 @@ const ReceiveComponents = () => { renderInput={(props) => } slotProps={{ textField: { size: "small" } }} sx={{ mr: 2 }} + minDate={new Date("2000-01-01")} + maxDate={new Date("2100-12-31")} /> { onChange={(newDate) => setSelectedEndDate(newDate)} renderInput={(props) => } slotProps={{ textField: { size: "small" } }} + minDate={new Date("2000-01-01")} + maxDate={new Date("2100-12-31")} /> @@ -507,16 +475,6 @@ const ReceiveComponents = () => { > 발주적용 -