浏览代码

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>


正在加载...
取消
保存