소스 검색

no message

master
MSI\derek 2 주 전
부모
커밋
ef10793131
1개의 변경된 파일28개의 추가작업 그리고 1개의 파일을 삭제
  1. +28
    -1
      src/components/PoDetail/PoDetail.tsx

+ 28
- 1
src/components/PoDetail/PoDetail.tsx 파일 보기

@@ -68,6 +68,7 @@ import PoInfoCard from "./PoInfoCard";
import { decimalFormatter, integerFormatter } from "@/app/utils/formatUtil";
import { fetchPoListClient } from "@/app/api/po/actions";
import { List, ListItem, ListItemButton, ListItemText, Divider } from "@mui/material";
import { createStockInLine } from "@/app/api/dashboard/actions";
//import { useRouter } from "next/navigation";


@@ -340,6 +341,27 @@ const PoDetail: React.FC<Props> = ({ po, qc, warehouse }) => {
[]
);

const handleStart = useCallback(
() => {
setTimeout(async () => {
// post stock in line
const oldId = row.id;
const postData = {
itemId: row.itemId,
itemNo: row.itemNo,
itemName: row.itemName,
purchaseOrderId: row.purchaseOrderId,
purchaseOrderLineId: row.id,
acceptedQty: secondReceiveQty || 0,
// acceptedQty: row.acceptedQty,
};
if (postData.acceptedQty === 0) return
const res = await createStockInLine(postData);
console.log(res);
}, 200);
},
[],
);
return (
<>
<TableRow
@@ -389,7 +411,12 @@ const PoDetail: React.FC<Props> = ({ po, qc, warehouse }) => {
/>
</TableCell>
<TableCell align="center">
<Button variant="contained">
<Button
variant="contained"
onClick={() =>
handleStart()
}
>
提交
</Button>
</TableCell>


불러오는 중...
취소
저장