Переглянути джерело

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>


Завантаження…
Відмінити
Зберегти