| @@ -439,13 +439,13 @@ const [qcItems, setQcItems] = useState(dummyQCData) | |||||
| // } | // } | ||||
| try { | try { | ||||
| setIsPrinting(() => true) | 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) | // console.log(pafRowSelectionModel) | ||||
| const printList = formProps.watch("putAwayLines")?.filter((line) => ((pafRowSelectionModel ?? []).some((model) => model === line.id))) ?? [] | 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) | // console.log(printQty) | ||||
| const data: PrintQrCodeForSilRequest = { | const data: PrintQrCodeForSilRequest = { | ||||
| stockInLineId: itemDetail.id, | stockInLineId: itemDetail.id, | ||||
| @@ -530,7 +530,7 @@ const [qcItems, setQcItems] = useState(dummyQCData) | |||||
| color="primary" | color="primary" | ||||
| sx={{ mt: 1 }} | sx={{ mt: 1 }} | ||||
| onClick={handlePrint} | onClick={handlePrint} | ||||
| disabled={isPrinting || printerCombo.length <= 0 || pafSubmitDisable} | |||||
| // disabled={isPrinting || printerCombo.length <= 0 || pafSubmitDisable} | |||||
| > | > | ||||
| {isPrinting ? t("Printing") : t("print")} | {isPrinting ? t("Printing") : t("print")} | ||||
| </Button> | </Button> | ||||