|
@@ -182,7 +182,7 @@ const PoDetail: React.FC<Props> = ({ po, qc, warehouse }) => { |
|
|
const searchParams = useSearchParams(); |
|
|
const searchParams = useSearchParams(); |
|
|
|
|
|
|
|
|
const [row, setRow] = useState(rows[0]); |
|
|
const [row, setRow] = useState(rows[0]); |
|
|
const [stockInLine, setStockInLine] = useState<StockInLine[]>([]); |
|
|
|
|
|
|
|
|
const [stockInLine, setStockInLine] = useState<StockInLine[]>(rows[0].stockInLine); |
|
|
const [processedQty, setProcessedQty] = useState(rows[0].processed); |
|
|
const [processedQty, setProcessedQty] = useState(rows[0].processed); |
|
|
|
|
|
|
|
|
const router = useRouter(); |
|
|
const router = useRouter(); |
|
@@ -288,9 +288,9 @@ const PoDetail: React.FC<Props> = ({ po, qc, warehouse }) => { |
|
|
setRows(purchaseOrder.pol || []); |
|
|
setRows(purchaseOrder.pol || []); |
|
|
}, [purchaseOrder]); |
|
|
}, [purchaseOrder]); |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
setStockInLine([]) |
|
|
|
|
|
}, []); |
|
|
|
|
|
|
|
|
// useEffect(() => { |
|
|
|
|
|
// setStockInLine([]) |
|
|
|
|
|
// }, []); |
|
|
|
|
|
|
|
|
function Row(props: { row: PurchaseOrderLine }) { |
|
|
function Row(props: { row: PurchaseOrderLine }) { |
|
|
const { row } = props; |
|
|
const { row } = props; |
|
@@ -330,15 +330,16 @@ const PoDetail: React.FC<Props> = ({ po, qc, warehouse }) => { |
|
|
(id: number) => { |
|
|
(id: number) => { |
|
|
console.log(id) |
|
|
console.log(id) |
|
|
//rows = purchaseOrderLine |
|
|
//rows = purchaseOrderLine |
|
|
|
|
|
console.log(rows) |
|
|
const target = rows.find((r) => r.id === id) |
|
|
const target = rows.find((r) => r.id === id) |
|
|
const stockInLine = target!.stockInLine |
|
|
const stockInLine = target!.stockInLine |
|
|
console.log(stockInLine) |
|
|
console.log(stockInLine) |
|
|
console.log(stockInLine) |
|
|
|
|
|
setStockInLine(stockInLine) |
|
|
setStockInLine(stockInLine) |
|
|
|
|
|
setRow(target!) |
|
|
// console.log(pathname) |
|
|
// console.log(pathname) |
|
|
// router.replace(`/po/edit?id=${item.poId}&polId=${item.polId}&stockInLineId=${item.stockInLineId}`); |
|
|
// router.replace(`/po/edit?id=${item.poId}&polId=${item.polId}&stockInLineId=${item.stockInLineId}`); |
|
|
}, |
|
|
}, |
|
|
[] |
|
|
|
|
|
|
|
|
[rows] |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
const handleStart = useCallback( |
|
|
const handleStart = useCallback( |
|
|