瀏覽代碼

Fix Label Printer Selection

production
kelvin.yau 2 天之前
父節點
當前提交
abe9fa16be
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. +5
    -2
      src/components/PoDetail/PoDetail.tsx

+ 5
- 2
src/components/PoDetail/PoDetail.tsx 查看文件

@@ -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>


Loading…
取消
儲存