diff --git a/src/webparts/requestPortal/forms/RecruitingHire/RecruitingHireForm.tsx b/src/webparts/requestPortal/forms/RecruitingHire/RecruitingHireForm.tsx index b061296..44129b5 100644 --- a/src/webparts/requestPortal/forms/RecruitingHire/RecruitingHireForm.tsx +++ b/src/webparts/requestPortal/forms/RecruitingHire/RecruitingHireForm.tsx @@ -185,7 +185,7 @@ const RecruitingHireForm: React.FC = ({ (login) => approval.getJobTitle(login) ); - const isValid = data.CandidateName.trim().length > 0 && data.Position.trim().length > 0; + const isValid = data.HireCandidateName.trim().length > 0 && data.Position.trim().length > 0; const validate = (): string | undefined => { if (!isValid) return 'Заполните обязательные поля: Ф.И.О. кандидата, Должность.'; if (requestTypeIdState.error) return `Не удалось определить тип заявки: ${requestTypeIdState.error}`; diff --git a/src/webparts/requestPortal/forms/RecruitingHire/load.ts b/src/webparts/requestPortal/forms/RecruitingHire/load.ts index 505634b..dfba7e7 100644 --- a/src/webparts/requestPortal/forms/RecruitingHire/load.ts +++ b/src/webparts/requestPortal/forms/RecruitingHire/load.ts @@ -16,8 +16,8 @@ function parseJsonArray(raw: unknown): T[] { // Скалярные поля (текст/выбор/число/дата) — читаем как есть, приводим к строке. const SCALAR_FIELDS: (keyof IFormData)[] = [ - 'Phone', 'HireType', 'ReplacedEmployee', 'Project', 'ProjectId', 'ProjectCode', - 'CandidateName', 'HireDate', 'Position', 'WorkKind', + 'Phone', 'HireType', 'HireReplacedEmployee', 'Project', 'ProjectId', 'ProjectCode', + 'HireCandidateName', 'HireHireDate', 'Position', 'WorkKind', 'Department', 'DepartmentId', 'SiteLocation', 'PpeHeight', 'PpeClothingSize', 'PpeShoeSize', 'ProbationPeriod', 'SalaryProbation', 'SalaryAfterProbation', 'WorkSchedule', 'WorkScheduleOther', 'AgencyName', 'AgencyTerms', @@ -58,7 +58,7 @@ export async function loadHireRequest(itemId: number, listId?: string): Promise< const value = item[key]; if (value === null || value === undefined) { writable[key] = ''; - } else if (key === 'HireDate' && typeof value === 'string') { + } else if (key === 'HireHireDate' && typeof value === 'string') { writable[key] = value.slice(0, 10); // ISO → YYYY-MM-DD для input type=date } else { writable[key] = String(value); diff --git a/src/webparts/requestPortal/forms/RecruitingHire/model.ts b/src/webparts/requestPortal/forms/RecruitingHire/model.ts index f6f1575..4fd8822 100644 --- a/src/webparts/requestPortal/forms/RecruitingHire/model.ts +++ b/src/webparts/requestPortal/forms/RecruitingHire/model.ts @@ -18,7 +18,16 @@ export interface IFormData { Companies: ICompany[]; // мультивыбор компаний (справочник), хранится CompaniesJson Phone: string; HireType: string; - ReplacedEmployee: string; + /** + * Префикс Hire — обход коллизии managed properties: этот internalName + * (без префикса) используется и в форме «Реферальная программа» — + * ДРУГИМ полем с ДРУГИМ Id. Search индексировал managed property только у + * одного из двух списков сайта (см. sp-write props/field в tools; тот же + * приём, что VacancyOpenReason в RecruitingSelection). CandidateName и + * HireDate ниже переименованы по той же причине; ReferralForm НЕ трогать — + * там имя осталось прежним. + */ + HireReplacedEmployee: string; // Проект/объект (справочник /Project) — справочное поле, на маршрут // согласования НЕ влияет (в отличие от RecruitingSelection/TmcTransfer). Project: string; @@ -30,8 +39,8 @@ export interface IFormData { SelectionRequestListId: string; // url партиции заявки на подбор (→ rplist) SelectionRequestCode: string; // уникальный код для подписи/ссылки // Кандидат - CandidateName: string; - HireDate: string; + HireCandidateName: string; + HireHireDate: string; Position: string; WorkKind: string; /** @@ -75,15 +84,15 @@ export const EMPTY_DATA: IFormData = { Companies: [], Phone: '', HireType: '', - ReplacedEmployee: '', + HireReplacedEmployee: '', Project: '', ProjectId: '', ProjectCode: '', SelectionRequestId: '', SelectionRequestListId: '', SelectionRequestCode: '', - CandidateName: '', - HireDate: '', + HireCandidateName: '', + HireHireDate: '', Position: '', WorkKind: '', Department: '', diff --git a/src/webparts/requestPortal/forms/RecruitingHire/provisioning.json b/src/webparts/requestPortal/forms/RecruitingHire/provisioning.json index 90d0063..655749c 100644 --- a/src/webparts/requestPortal/forms/RecruitingHire/provisioning.json +++ b/src/webparts/requestPortal/forms/RecruitingHire/provisioning.json @@ -8,7 +8,7 @@ { "internalName": "Phone", "title": "Телефон", "type": "Text" }, { "internalName": "HireType", "title": "Тип приёма", "type": "Choice", "choices": ["Новый сотрудник", "Вместо уволенного"] }, - { "internalName": "ReplacedEmployee", "title": "Взамен кого (Ф.И.О. уволенного)", "type": "Text" }, + { "internalName": "HireReplacedEmployee", "title": "Взамен кого (Ф.И.О. уволенного)", "type": "Text" }, { "internalName": "Project", "title": "Проект", "type": "Text" }, { "internalName": "ProjectId", "title": "Проект — Id", "type": "Text" }, @@ -18,8 +18,8 @@ { "internalName": "SelectionRequestListId", "title": "Заявка на подбор — партиция (listId)", "type": "Text" }, { "internalName": "SelectionRequestCode", "title": "Заявка на подбор — код", "type": "Text" }, - { "internalName": "CandidateName", "title": "Ф.И.О. кандидата", "type": "Text", "required": true }, - { "internalName": "HireDate", "title": "Дата приёма", "type": "DateTime", "dateOnly": true }, + { "internalName": "HireCandidateName", "title": "Ф.И.О. кандидата", "type": "Text", "required": true }, + { "internalName": "HireHireDate", "title": "Дата приёма", "type": "DateTime", "dateOnly": true }, { "internalName": "Position", "title": "Должность", "type": "Text", "required": true }, { "internalName": "WorkKind", "title": "Вид работ", "type": "Text" }, { "internalName": "SiteName", "title": "Отдел / участок (устарело)", "type": "Text" }, diff --git a/src/webparts/requestPortal/forms/RecruitingHire/sections/ApplicationSection.tsx b/src/webparts/requestPortal/forms/RecruitingHire/sections/ApplicationSection.tsx index 2da4c09..3098978 100644 --- a/src/webparts/requestPortal/forms/RecruitingHire/sections/ApplicationSection.tsx +++ b/src/webparts/requestPortal/forms/RecruitingHire/sections/ApplicationSection.tsx @@ -10,7 +10,7 @@ export const ApplicationSection: React.FC = ({ data, set, context const handleHireTypeChange = (value: string): void => { set('HireType', value); if (value !== HIRE_TYPE_REPLACEMENT) { - set('ReplacedEmployee', ''); // при не-замене очищаем скрытое поле + set('HireReplacedEmployee', ''); // при не-замене очищаем скрытое поле } }; @@ -54,11 +54,11 @@ export const ApplicationSection: React.FC = ({ data, set, context /> {isReplacement && ( - + set('ReplacedEmployee', v)} + id="HireReplacedEmployee" + value={data.HireReplacedEmployee} + onChange={(v) => set('HireReplacedEmployee', v)} /> )} diff --git a/src/webparts/requestPortal/forms/RecruitingHire/sections/CandidateSection.tsx b/src/webparts/requestPortal/forms/RecruitingHire/sections/CandidateSection.tsx index 437847b..bba23f7 100644 --- a/src/webparts/requestPortal/forms/RecruitingHire/sections/CandidateSection.tsx +++ b/src/webparts/requestPortal/forms/RecruitingHire/sections/CandidateSection.tsx @@ -5,11 +5,11 @@ import { ISectionProps } from '../model'; export const CandidateSection: React.FC = ({ data, set, context }) => ( - - set('CandidateName', v)} /> + + set('HireCandidateName', v)} /> - - set('HireDate', v)} /> + + set('HireHireDate', v)} /> set('Position', v)} /> diff --git a/src/webparts/requestPortal/forms/RecruitingHire/submit.ts b/src/webparts/requestPortal/forms/RecruitingHire/submit.ts index cab3a43..e0b4121 100644 --- a/src/webparts/requestPortal/forms/RecruitingHire/submit.ts +++ b/src/webparts/requestPortal/forms/RecruitingHire/submit.ts @@ -16,7 +16,7 @@ export function hireApprovalService(listId?: string): ApprovalListService { /** Осмысленный заголовок элемента списка (системная колонка Title). */ function buildTitle(data: IFormData): string { - return ['Прием', data.CandidateName, data.Position].filter(Boolean).join(' — '); + return ['Прием', data.HireCandidateName, data.Position].filter(Boolean).join(' — '); } /** Поля элемента списка данных из модели формы (текст/выбор/даты/числа). */ diff --git a/src/webparts/requestPortal/forms/WorkplaceSetup/prefill.ts b/src/webparts/requestPortal/forms/WorkplaceSetup/prefill.ts index 8a06909..603c1c8 100644 --- a/src/webparts/requestPortal/forms/WorkplaceSetup/prefill.ts +++ b/src/webparts/requestPortal/forms/WorkplaceSetup/prefill.ts @@ -9,12 +9,12 @@ export async function loadPrefillFromHire(hireId: number): Promise { const { data: hire } = await loadHireRequest(hireId); return { ...EMPTY_DATA, - FullName: hire.CandidateName, + FullName: hire.HireCandidateName, Phone: hire.Phone, Position: hire.Position, Department: hire.Department, WorkKind: hire.WorkKind, Location: hire.SiteLocation, - StartDate: hire.HireDate + StartDate: hire.HireHireDate }; }