crap
This commit is contained in:
@@ -4,7 +4,7 @@ import {BaseTable} from "../../../../components/BaseTable/BaseTable.tsx";
|
||||
import {MRT_TableOptions} from "mantine-react-table";
|
||||
import {useProductsTableColumns} from "./columns.tsx";
|
||||
import {ActionIcon, Flex, Tooltip} from "@mantine/core";
|
||||
import {IconEdit, IconTrash} from "@tabler/icons-react";
|
||||
import {IconBarcode, IconEdit, IconTrash} from "@tabler/icons-react";
|
||||
import {CRUDTableProps} from "../../../../types/CRUDTable.tsx";
|
||||
import {modals} from "@mantine/modals";
|
||||
|
||||
@@ -23,6 +23,16 @@ const ProductsTable: FC<CRUDTableProps<ProductSchema>> = ({items, onDelete, onCh
|
||||
}
|
||||
})
|
||||
}
|
||||
const onPrintBarcodeClick = (product: ProductSchema) => {
|
||||
modals.openContextModal({
|
||||
modal: "printBarcode",
|
||||
title: 'Печать штрихкода',
|
||||
withCloseButton: true,
|
||||
innerProps: {
|
||||
productId: product.id
|
||||
}
|
||||
})
|
||||
}
|
||||
return (
|
||||
<BaseTable
|
||||
ref={tableRef}
|
||||
@@ -33,6 +43,13 @@ const ProductsTable: FC<CRUDTableProps<ProductSchema>> = ({items, onDelete, onCh
|
||||
enableRowActions: true,
|
||||
renderRowActions: ({row}) => (
|
||||
<Flex gap="md">
|
||||
<Tooltip label="Печать штрихкода">
|
||||
<ActionIcon
|
||||
onClick={() => onPrintBarcodeClick(row.original)}
|
||||
variant={"default"}>
|
||||
<IconBarcode/>
|
||||
</ActionIcon>
|
||||
</Tooltip>
|
||||
<Tooltip label="Редактировать">
|
||||
<ActionIcon
|
||||
onClick={() => onEditClick(row.original)}
|
||||
|
||||
@@ -9,7 +9,6 @@ import {notifications} from "../../../shared/lib/notifications.ts";
|
||||
import {CreateProductRequest} from "../types.ts";
|
||||
import {ProductSchema, ProductService} from "../../../client";
|
||||
import useProductsList from "../hooks/useProductsList.tsx";
|
||||
import ProductSelect from "../../../components/ProductSelect/ProductSelect.tsx";
|
||||
|
||||
export const ProductsPage: FC = () => {
|
||||
const [clientId, setClientId] = useState(-1);
|
||||
@@ -90,11 +89,7 @@ export const ProductsPage: FC = () => {
|
||||
onClick={() => onCreateProductClick()}
|
||||
variant={"default"}
|
||||
>Создать</Button>
|
||||
<ProductSelect
|
||||
onChange={event => console.log(event)}
|
||||
clientId={8}
|
||||
limit={10}
|
||||
/>
|
||||
|
||||
</div>
|
||||
</PageBlock>
|
||||
<PageBlock>
|
||||
|
||||
Reference in New Issue
Block a user