diff --git a/src/food-market.web/src/pages/EmployeesPage.tsx b/src/food-market.web/src/pages/EmployeesPage.tsx index 1cf2302..9381014 100644 --- a/src/food-market.web/src/pages/EmployeesPage.tsx +++ b/src/food-market.web/src/pages/EmployeesPage.tsx @@ -8,7 +8,7 @@ import { Pagination } from '@/components/Pagination' import { SearchBar } from '@/components/SearchBar' import { Button } from '@/components/Button' import { Modal } from '@/components/Modal' -import { Field, TextInput, TextArea, Checkbox } from '@/components/Field' +import { Field, TextInput, TextArea, Checkbox, MoneyInput } from '@/components/Field' import { PhoneInput } from '@/components/PhoneInput' import { useCatalogList, useCatalogMutations } from '@/lib/useCatalog' import type { PagedResult, RetailPoint } from '@/lib/types' @@ -51,7 +51,10 @@ interface Form { position: string email: string phone: string - salary: string + /** Денежное значение в валюте организации (берётся из useOrgSettings). + * Используется MoneyInput, который сам формирует с копейками или без + * в зависимости от org-setting allowFractionalPrices. */ + salary: number | null taxNumber: string description: string imageUrl: string @@ -64,7 +67,7 @@ interface Form { const blankForm = (): Form => ({ lastName: '', firstName: '', middleName: '', position: '', email: '', phone: '', - salary: '', taxNumber: '', description: '', imageUrl: '', + salary: null, taxNumber: '', description: '', imageUrl: '', roleId: '', isActive: true, retailPointIds: [], createAccount: true, @@ -113,7 +116,7 @@ export function EmployeesPage() { const payload = { lastName: form.lastName, firstName: form.firstName, middleName: form.middleName || null, position: form.position || null, email: form.email || null, phone: form.phone || null, - salary: form.salary ? Number(form.salary) : null, + salary: form.salary, taxNumber: form.taxNumber || null, description: form.description || null, imageUrl: form.imageUrl || null, @@ -178,7 +181,7 @@ export function EmployeesPage() { setForm({ id: r.id, lastName: r.lastName, firstName: r.firstName, middleName: r.middleName ?? '', position: r.position ?? '', email: r.email ?? '', phone: r.phone ?? '', - salary: r.salary != null ? String(r.salary) : '', + salary: r.salary, taxNumber: r.taxNumber ?? '', description: r.description ?? '', imageUrl: r.imageUrl ?? '', roleId: r.roleId, isActive: r.isActive, retailPointIds: r.retailPointIds, createAccount: false, @@ -296,7 +299,7 @@ export function EmployeesPage() {