|
|
|
@@ -331,8 +331,11 @@ const PoDetail: React.FC<Props> = ({ po, warehouse, printerCombo }) => { |
|
|
|
|
|
|
|
const labelPrinters = useMemo(() => { |
|
|
|
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(); |
|
|
|
return text.includes("label"); |
|
|
|
return text.includes("label") || text.includes("標籤"); |
|
|
|
}); |
|
|
|
}, [printerCombo]); |
|
|
|
|
|
|
|
@@ -1090,7 +1093,7 @@ const PoDetail: React.FC<Props> = ({ po, warehouse, printerCombo }) => { |
|
|
|
<Button |
|
|
|
variant="contained" |
|
|
|
onClick={openPrintDialog} |
|
|
|
disabled={(printerCombo?.length ?? 0) <= 0} |
|
|
|
disabled={labelPrinters.length <= 0} |
|
|
|
> |
|
|
|
選擇列印項目 |
|
|
|
</Button> |
|
|
|
|