feat: shipping warehouse and cost

This commit is contained in:
2024-07-18 04:56:20 +03:00
parent c4dc887305
commit 5c6e7cf5f5
21 changed files with 192 additions and 33 deletions

View File

@@ -41,8 +41,14 @@ export const useServicesTableColumns = () => {
enableGrouping: false,
enableSorting: false,
Cell: ({row}) => getPriceRow(row.original)
},
{
accessorKey: "cost",
header: "Себестоимость",
enableGrouping: false,
enableSorting: false,
},
], []);
}

View File

@@ -2,7 +2,7 @@ import {ServicePriceRangeSchema, ServiceSchema} from "../../../client";
import {useForm} from "@mantine/form";
import {ContextModalProps} from "@mantine/modals";
import BaseFormModal, {CreateEditFormProps} from "../../ClientsPage/modals/BaseFormModal/BaseFormModal.tsx";
import {TextInput} from "@mantine/core";
import {NumberInput, TextInput} from "@mantine/core";
import ServiceCategorySelect from "../components/ServiceCategorySelect/ServiceCategorySelect.tsx";
import ServiceTypeSelect from "../components/ServiceTypeSelect/ServiceTypeSelect.tsx";
import ServicePriceInput from "../components/ServicePriceInput/ServicePriceInput.tsx";
@@ -25,7 +25,8 @@ const CreateServiceModal = ({
name: ''
},
serviceType: -1,
priceRanges: [] as ServicePriceRangeSchema[]
priceRanges: [] as ServicePriceRangeSchema[],
cost: null
}
const form = useForm<ServiceSchema>({
@@ -72,6 +73,12 @@ const CreateServiceModal = ({
label={"Тип услуги"}
{...form.getInputProps('serviceType')}
/>
<NumberInput
placeholder={"Введите себестоимость услуги"}
label={"Себестоимость услуги"}
hideControls
{...form.getInputProps('cost')}
/>
<ServicePriceInput
singlePriceInputProps={{
hideControls: true,