| @@ -249,7 +249,7 @@ const PoDetail: React.FC<Props> = ({ po, qc, warehouse }) => { | |||||
| if (result) { | if (result) { | ||||
| setPurchaseOrder(result); | setPurchaseOrder(result); | ||||
| setRows(result.pol || []); | setRows(result.pol || []); | ||||
| if (result.pol && result.pol.length > 0) { | |||||
| if (result.pol && result.pol.length > 0 && result.id !== selectedPoId) { | |||||
| setSelectedRow(result.pol[0]); | setSelectedRow(result.pol[0]); | ||||
| setStockInLine(result.pol[0].stockInLine); | setStockInLine(result.pol[0].stockInLine); | ||||
| setProcessedQty(result.pol[0].processed); | setProcessedQty(result.pol[0].processed); | ||||
| @@ -793,7 +793,7 @@ const PoDetail: React.FC<Props> = ({ po, qc, warehouse }) => { | |||||
| <Grid container xs={12} justifyContent="start"> | <Grid container xs={12} justifyContent="start"> | ||||
| <Grid item xs={12}> | <Grid item xs={12}> | ||||
| <Typography variant="h6"> | <Typography variant="h6"> | ||||
| {selectedRow ? `已選擇: ${selectedRow?.itemNo ? selectedRow.itemNo : 'N/A'} - ${selectedRow?.itemName ? selectedRow?.itemName : 'N/A'}}` : "未選擇貨品"} | |||||
| {selectedRow ? `已選擇: ${selectedRow?.itemNo ? selectedRow.itemNo : 'N/A'} - ${selectedRow?.itemName ? selectedRow?.itemName : 'N/A'}` : "未選擇貨品"} | |||||
| </Typography> | </Typography> | ||||
| </Grid> | </Grid> | ||||
| <Grid item xs={12}> | <Grid item xs={12}> | ||||