Просмотр исходного кода

Fix Label Printer Selection

production
kelvin.yau 2 дней назад
Родитель
Сommit
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>


Загрузка…
Отмена
Сохранить