fix-vsp rename fields

This commit is contained in:
PotapovaA 2026-07-02 18:10:35 +03:00
parent 944fbe4d7e
commit 2cc53b6846
3 changed files with 19 additions and 21 deletions

View File

@ -12,8 +12,8 @@ export const EVENT_CONFIGS = {
format: 'Утвержденный формат', format: 'Утвержденный формат',
opened_at: 'Дата открытия ВСП', opened_at: 'Дата открытия ВСП',
notes: 'Примечания', notes: 'Примечания',
location_form: 'Форма расположения ВСП', placement_type: 'Форма расположения ВСП',
numbers: 'Штатная численность ВСП', staff_count: 'Штатная численность ВСП',
total_area: 'Площадь помещений ВСП', total_area: 'Площадь помещений ВСП',
rent_contract_num: 'Номер договора аренды', rent_contract_num: 'Номер договора аренды',
rent_end_date: 'Срок окончания договора аренды', rent_end_date: 'Срок окончания договора аренды',
@ -22,7 +22,6 @@ export const EVENT_CONFIGS = {
closed_at: 'Дата закрытия ВСП', closed_at: 'Дата закрытия ВСП',
user_email: 'Почта пользователя', user_email: 'Почта пользователя',
staff_count: 'Кол-во работников', staff_count: 'Кол-во работников',
placement_type: 'Тип размещение',
is_active: 'Активный', is_active: 'Активный',
}, },
VSP_UPDATE: { VSP_UPDATE: {
@ -32,8 +31,8 @@ export const EVENT_CONFIGS = {
format: 'Утвержденный формат', format: 'Утвержденный формат',
opened_at: 'Дата открытия ВСП', opened_at: 'Дата открытия ВСП',
notes: 'Примечания', notes: 'Примечания',
location_form: 'Форма расположения ВСП', placement_type: 'Форма расположения ВСП',
numbers: 'Штатная численность ВСП', staff_count: 'Штатная численность ВСП',
total_area: 'Площадь помещений ВСП', total_area: 'Площадь помещений ВСП',
rent_contract_num: 'Номер договора аренды', rent_contract_num: 'Номер договора аренды',
rent_end_date: 'Срок окончания договора аренды', rent_end_date: 'Срок окончания договора аренды',
@ -42,7 +41,6 @@ export const EVENT_CONFIGS = {
closed_at: 'Дата закрытия ВСП', closed_at: 'Дата закрытия ВСП',
user_email: 'Почта пользователя', user_email: 'Почта пользователя',
staff_count: 'Кол-во работников', staff_count: 'Кол-во работников',
placement_type: 'Тип размещение',
is_active: 'Активный', is_active: 'Активный',
}, },
USER_ACCESS_GRANTED: { USER_ACCESS_GRANTED: {

View File

@ -43,8 +43,8 @@ const ModalEditAddVsp = ({
open_date: null, open_date: null,
close_date: null, close_date: null,
notes: '', notes: '',
location_form: '', placement_type: '',
numbers: '', staff_count: '',
area: null, area: null,
rent_contract_num: '', rent_contract_num: '',
rent_end_date: null, rent_end_date: null,
@ -94,8 +94,8 @@ const ModalEditAddVsp = ({
? new Date(initialData.close_date) ? new Date(initialData.close_date)
: null, : null,
notes: initialData.notes || '', notes: initialData.notes || '',
location_form: initialData.location_form || '', placement_type: initialData.placement_type || '',
numbers: initialData.staff_count?.toString() || '', staff_count: initialData.staff_count?.toString() || '',
area: initialData.area || null, area: initialData.area || null,
rent_contract_num: initialData.rent_contract_num || '', rent_contract_num: initialData.rent_contract_num || '',
rent_end_date: initialData.rent_end_date rent_end_date: initialData.rent_end_date
@ -114,8 +114,8 @@ const ModalEditAddVsp = ({
open_date: null, open_date: null,
close_date: null, close_date: null,
notes: '', notes: '',
location_form: '', placement_type: '',
numbers: '', staff_count: '',
area: null, area: null,
rent_contract_num: '', rent_contract_num: '',
rent_end_date: null, rent_end_date: null,
@ -215,7 +215,7 @@ const ModalEditAddVsp = ({
const submitData = { const submitData = {
...formData, ...formData,
numbers: formData.staff_count ? parseInt(formData.staff_count, 10) : null, staff_count: formData.staff_count ? parseInt(formData.staff_count, 10) : null,
area: formData.area ? parseFloat(formData.area) : null, area: formData.area ? parseFloat(formData.area) : null,
open_date: formData.open_date open_date: formData.open_date
? formData.open_date.toLocaleDateString('en-CA') ? formData.open_date.toLocaleDateString('en-CA')
@ -255,8 +255,8 @@ const ModalEditAddVsp = ({
open_date: null, open_date: null,
close_date: null, close_date: null,
notes: '', notes: '',
location_form: '', placement_type: '',
numbers: '', staff_count: '',
area: '', area: '',
rent_contract_num: '', rent_contract_num: '',
rent_end_date: null, rent_end_date: null,
@ -461,11 +461,11 @@ const ModalEditAddVsp = ({
<FieldLabel>Форма расположения ВСП</FieldLabel> <FieldLabel>Форма расположения ВСП</FieldLabel>
<StyledTextField <StyledTextField
select select
value={formData.location_form} value={formData.placement_type}
onChange={handleChange('location_form')} onChange={handleChange('placement_type')}
placeholder="Выберите форму расположения" placeholder="Выберите форму расположения"
error={!!errors.location_form} error={!!errors.placement_type}
helperText={errors.location_form} helperText={errors.placement_type}
disabled={loading} disabled={loading}
slotProps={{ slotProps={{
select: { select: {
@ -496,7 +496,7 @@ const ModalEditAddVsp = ({
<StyledTextField <StyledTextField
type="text" type="text"
value={formData.staff_count} value={formData.staff_count}
onChange={handleNumberChange('numbers')} onChange={handleNumberChange('staff_count')}
placeholder="Введите численность" placeholder="Введите численность"
error={!!errors.staff_count} error={!!errors.staff_count}
helperText={errors.staff_count} helperText={errors.staff_count}

View File

@ -192,7 +192,7 @@ const TableDictVsp = ({
enableSorting: false, enableSorting: false,
}, },
{ {
accessorKey: 'location_form', accessorKey: 'placement_type',
header: 'Форма расположения ВСП', header: 'Форма расположения ВСП',
size: 170, size: 170,
minSize: 140, minSize: 140,