| @@ -331,8 +331,11 @@ const PoDetail: React.FC<Props> = ({ po, warehouse, printerCombo }) => { | |||||
| const labelPrinters = useMemo(() => { | const labelPrinters = useMemo(() => { | ||||
| return (printerCombo ?? []).filter((p) => { | return (printerCombo ?? []).filter((p) => { | ||||
| const typeText = String(p.type ?? "").trim().toLowerCase(); | |||||
| if (typeText === "label") return true; | |||||
| // Backward compatibility for legacy rows without a reliable type value. | |||||
| const text = `${p.label ?? ""} ${p.name ?? ""} ${p.code ?? ""}`.toLowerCase(); | const text = `${p.label ?? ""} ${p.name ?? ""} ${p.code ?? ""}`.toLowerCase(); | ||||
| return text.includes("label"); | |||||
| return text.includes("label") || text.includes("標籤"); | |||||
| }); | }); | ||||
| }, [printerCombo]); | }, [printerCombo]); | ||||
| @@ -1090,7 +1093,7 @@ const PoDetail: React.FC<Props> = ({ po, warehouse, printerCombo }) => { | |||||
| <Button | <Button | ||||
| variant="contained" | variant="contained" | ||||
| onClick={openPrintDialog} | onClick={openPrintDialog} | ||||
| disabled={(printerCombo?.length ?? 0) <= 0} | |||||
| disabled={labelPrinters.length <= 0} | |||||
| > | > | ||||
| 選擇列印項目 | 選擇列印項目 | ||||
| </Button> | </Button> | ||||