fix: fixed key letter in residual qr codes

This commit is contained in:
2025-01-17 17:01:02 +04:00
parent 1b9880a65a
commit a4279edda9
4 changed files with 10 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
import { Button, Flex, Stack, Title } from "@mantine/core"; import { Button, Flex, Stack, Text, Title } from "@mantine/core";
import useReceiptBox from "../hooks/useReceiptBox.tsx"; import useReceiptBox from "../hooks/useReceiptBox.tsx";
import ReceiptProducts from "./ReceiptProducts.tsx"; import ReceiptProducts from "./ReceiptProducts.tsx";
import InlineButton from "../../../../../components/InlineButton/InlineButton.tsx"; import InlineButton from "../../../../../components/InlineButton/InlineButton.tsx";
@@ -16,6 +16,8 @@ const ReceiptBoxEditor = ({ boxId }: Props) => {
onCreateProductClick, onCreateProductClick,
} = useReceiptBox({ boxId }); } = useReceiptBox({ boxId });
if (!box) return <Text>Короб c ID K{boxId} не найден</Text>;
const backButton = ( const backButton = (
<Button <Button
variant={"default"} variant={"default"}

View File

@@ -18,7 +18,7 @@ const ReceiptPalletEditor = ({ palletId }: Props) => {
onCreateBoxClick, onCreateBoxClick,
} = useReceiptPallet({ palletId }); } = useReceiptPallet({ palletId });
if (!pallet) return <Text>Паллет c ID П{palletId} не найден</Text>; if (!pallet) return <Text>Паллет c ID P{palletId} не найден</Text>;
const createButtons = () => { const createButtons = () => {
const isBoxes = pallet.boxes.length > 0; const isBoxes = pallet.boxes.length > 0;

View File

@@ -22,7 +22,7 @@ const ReceiptQrCodeScan = () => {
const checkQrScannedCorrectly = () => { const checkQrScannedCorrectly = () => {
if ( if (
scannedValue.length < 2 scannedValue.length < 2
|| (scannedValue[0] !== "П" && scannedValue[0] !== "К") || (scannedValue[0] !== "P" && scannedValue[0] !== "K")
|| Number.isNaN(getId()) || Number.isNaN(getId())
) { ) {
notifications.error({ message: `Считанный ID ${scannedValue} некорректный` }); notifications.error({ message: `Считанный ID ${scannedValue} некорректный` });
@@ -55,7 +55,7 @@ const ReceiptQrCodeScan = () => {
); );
} }
if (scannedValue.length > 0 && scannedValue[0] === "К") { if (scannedValue.length > 0 && scannedValue[0] === "K") {
return <ReceiptBoxEditor boxId={getId()} />; return <ReceiptBoxEditor boxId={getId()} />;
} }
return <ReceiptPalletEditor palletId={getId()} />; return <ReceiptPalletEditor palletId={getId()} />;

View File

@@ -1,6 +1,6 @@
import { createLazyFileRoute } from '@tanstack/react-router' import { createLazyFileRoute } from "@tanstack/react-router";
import ReceiptPage from "../pages/ReceiptPage/ui/ReceiptPage.tsx"; import ReceiptPage from "../pages/ReceiptPage/ui/ReceiptPage.tsx";
export const Route = createLazyFileRoute('/receipt')({ export const Route = createLazyFileRoute("/receipt")({
component: () => <ReceiptPage />, component: ReceiptPage,
}) });