|
|
|
@@ -439,13 +439,13 @@ const [qcItems, setQcItems] = useState(dummyQCData) |
|
|
|
// } |
|
|
|
try { |
|
|
|
setIsPrinting(() => true) |
|
|
|
if ((formProps.watch("putAwayLines") ?? []).filter((line) => /[^0-9]/.test(String(line.printQty))).length > 0) { //TODO Improve |
|
|
|
alert("列印數量不正確!"); |
|
|
|
return; |
|
|
|
} |
|
|
|
// if ((formProps.watch("putAwayLines") ?? []).filter((line) => /[^0-9]/.test(String(line.printQty))).length > 0) { //TODO Improve |
|
|
|
// alert("列印數量不正確!"); |
|
|
|
// return; |
|
|
|
// } |
|
|
|
// console.log(pafRowSelectionModel) |
|
|
|
const printList = formProps.watch("putAwayLines")?.filter((line) => ((pafRowSelectionModel ?? []).some((model) => model === line.id))) ?? [] |
|
|
|
const printQty = printList.reduce((acc, cur) => acc + cur.printQty, 0) |
|
|
|
const printQty = 1 // printList.reduce((acc, cur) => acc + cur.printQty, 0) |
|
|
|
// console.log(printQty) |
|
|
|
const data: PrintQrCodeForSilRequest = { |
|
|
|
stockInLineId: itemDetail.id, |
|
|
|
@@ -530,7 +530,7 @@ const [qcItems, setQcItems] = useState(dummyQCData) |
|
|
|
color="primary" |
|
|
|
sx={{ mt: 1 }} |
|
|
|
onClick={handlePrint} |
|
|
|
disabled={isPrinting || printerCombo.length <= 0 || pafSubmitDisable} |
|
|
|
// disabled={isPrinting || printerCombo.length <= 0 || pafSubmitDisable} |
|
|
|
> |
|
|
|
{isPrinting ? t("Printing") : t("print")} |
|
|
|
</Button> |
|
|
|
|