feat: deal group and stuff
This commit is contained in:
@@ -8,5 +8,6 @@ export type DealProductSchema = {
|
||||
product: ProductSchema;
|
||||
services: Array<DealProductServiceSchema>;
|
||||
quantity: number;
|
||||
comment?: string;
|
||||
};
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
ProductSchema,
|
||||
} from "../../../../../../client";
|
||||
import styles from "./ProductView.module.css";
|
||||
import { ActionIcon, Box, Flex, Image, NumberInput, rem, Text, Title, Tooltip } from "@mantine/core";
|
||||
import { ActionIcon, Box, Flex, Image, NumberInput, rem, Text, Textarea, Title, Tooltip } from "@mantine/core";
|
||||
import ProductServicesTable from "../ProductServicesTable/ProductServicesTable.tsx";
|
||||
import { isNil, isNumber } from "lodash";
|
||||
import { IconBarcode, IconEdit, IconTrash } from "@tabler/icons-react";
|
||||
@@ -35,13 +35,13 @@ export const ProductFieldNames: Partial<ProductFieldNames> = {
|
||||
additionalInfo: "Доп. информация",
|
||||
};
|
||||
const ProductView: FC<Props> = ({
|
||||
product,
|
||||
onDelete,
|
||||
onChange,
|
||||
onCopyServices,
|
||||
onKitAdd,
|
||||
onProductEdit,
|
||||
}) => {
|
||||
product,
|
||||
onDelete,
|
||||
onChange,
|
||||
onCopyServices,
|
||||
onKitAdd,
|
||||
onProductEdit,
|
||||
}) => {
|
||||
const { dealState } = useDealProductAndServiceTabState();
|
||||
const debouncedOnChange = useDebouncedCallback(async (item: DealProductSchema) => {
|
||||
if (!onChange) return;
|
||||
@@ -58,7 +58,7 @@ const ProductView: FC<Props> = ({
|
||||
onChange({
|
||||
...product,
|
||||
services: product.services.filter(
|
||||
service => service.service.id !== item.service.id
|
||||
service => service.service.id !== item.service.id,
|
||||
),
|
||||
});
|
||||
};
|
||||
@@ -75,7 +75,7 @@ const ProductView: FC<Props> = ({
|
||||
onChange({
|
||||
...product,
|
||||
services: product.services.map(service =>
|
||||
service.service.id === item.service.id ? item : service
|
||||
service.service.id === item.service.id ? item : service,
|
||||
),
|
||||
});
|
||||
};
|
||||
@@ -162,6 +162,24 @@ const ProductView: FC<Props> = ({
|
||||
}
|
||||
placeholder={"Введите количество товара"}
|
||||
/>
|
||||
<Textarea
|
||||
mih={rem(140)}
|
||||
styles={{
|
||||
wrapper: { height: "90%" },
|
||||
input: { height: "90%" },
|
||||
}}
|
||||
my={rem(10)}
|
||||
disabled={isLocked}
|
||||
defaultValue={product.comment}
|
||||
onChange={event => {
|
||||
if (!onChange) return;
|
||||
debouncedOnChange({
|
||||
...product,
|
||||
comment: event.currentTarget.value,
|
||||
});
|
||||
}}
|
||||
placeholder={"Введите комментарий для товара"}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className={styles["services-container"]}>
|
||||
|
||||
Reference in New Issue
Block a user