diff --git a/src/components/PutAwayScan/PutAwayModal.tsx b/src/components/PutAwayScan/PutAwayModal.tsx index 331fa2b..ed234c5 100644 --- a/src/components/PutAwayScan/PutAwayModal.tsx +++ b/src/components/PutAwayScan/PutAwayModal.tsx @@ -52,11 +52,15 @@ const style = { left: "50%", transform: "translate(-50%, -50%)", bgcolor: "background.paper", - pt: 5, - px: 5, - pb: 5, - // width: "auto", - width: { xs: "90%", sm: "90%", md: "90%" }, + pt: { xs: 0.5, sm: 1, md: 1.5 }, + px: { xs: 1, sm: 1.5, md: 2 }, + pb: { xs: 0.5, sm: 1, md: 1.5 }, + width: { xs: "95%", sm: "85%", md: "75%", lg: "70%" }, + maxWidth: "900px", + maxHeight: { xs: "98vh", sm: "95vh", md: "90vh" }, + overflow: "hidden", + display: "flex", + flexDirection: "column", }; const scannerStyle = { @@ -65,11 +69,11 @@ const scannerStyle = { left: "50%", transform: "translate(-50%, -50%)", bgcolor: "background.paper", - pt: 5, - px: 5, - pb: 10, - // width: "auto", - width: { xs: "60%", sm: "60%", md: "60%" }, + pt: { xs: 2, sm: 3, md: 4 }, + px: { xs: 2, sm: 3, md: 4 }, + pb: { xs: 6, sm: 7, md: 8 }, + width: { xs: "85%", sm: "70%", md: "60%" }, + maxWidth: "600px", }; const PutAwayModal: React.FC = ({ open, onClose, warehouse, stockInLineId, warehouseId, scanner, addPutAwayHistory }) => { @@ -334,191 +338,249 @@ const PutAwayModal: React.FC = ({ open, onClose, warehouse, stockInLineId component="form" onSubmit={formProps.handleSubmit(onSubmit)} > - - - {itemDetail != undefined ? ( - <> - - - 處理上架 - - - {itemDetail.jobOrderId ? ( - - ) : ( - - )} - - - - - - - {verified? ( - <> - - - 掃瞄完成 - - - ) : ( - <> - - - 請掃瞄倉庫二維碼 - - - ) - } - - - - - {warehouseDisplay} {verified ? "" : `(建議)`} - - - - + + + + {itemDetail != undefined ? ( + <> + + + 處理上架 + + + + {itemDetail.jobOrderId ? ( + + ) : ( + + )} - - - + + + + { - const value = e.target.value; - validateQty(Number(value)); - setPutQty(Number(value)); - }} - onKeyDown={(e) => { - // Prevent non-numeric characters - if (["e", "E", "+", "-", "."].includes(e.key)) { - e.preventDefault(); + > + + {verified? ( + <> + + + 掃瞄完成 + + + ) : ( + <> + + + 請掃瞄倉庫二維碼 + + + ) } - }} - // onBlur={(e) => { - // const value = e.target.value; - // setPutQty(Number(value)); - // validateQty(Number(value)); - // }} - // disabled={true} - // {...register("acceptedQty", { - // required: "acceptedQty required!", - // })} - error={qtyError !== ""} - helperText={qtyError} - /> - - - - + + + + {warehouseDisplay} {verified ? "" : `(建議)`} + + + + + + + - + + {/* - - {/* */} + {t("scan warehouse")} + */} + - - - - - ) : ( - // - <> - - {t("scan loading")} - - - - )} + + + + ) : ( + // + <> + + {t("scan loading")} + + + + )} + - + = ({ open, onClose, warehouse, stockInLineId justifyContent: 'center', margin: 0, alignItems: 'center', - textAlign: 'center',}} + textAlign: 'center', + fontSize: { xs: "0.95rem", sm: "1.1rem", md: "1.3rem" } + }} > {t("Please scan warehouse qr code")} @@ -541,4 +605,4 @@ const PutAwayModal: React.FC = ({ open, onClose, warehouse, stockInLineId ); }; -export default PutAwayModal; +export default PutAwayModal; \ No newline at end of file