Files
toir-light-v2/frontend/src/resources/repair-order/RepairOrderEdit.tsx
2026-04-25 13:53:55 +00:00

41 lines
2.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { Edit, SimpleForm, TextInput, DateInput, SelectInput, BooleanInput, ReferenceInput, NumberInput } from 'react-admin';
const repairKindChoices = [
{ id: 'TO', name: 'Техническое обслуживание' },
{ id: 'TR', name: 'Текущий ремонт' },
{ id: 'TRE', name: 'Текущий расширенный ремонт' },
{ id: 'KR', name: 'Капитальный ремонт' },
{ id: 'AR', name: 'Аварийный ремонт' },
{ id: 'MP', name: 'Метрологическая поверка' },
];
const statusChoices = [
{ id: 'Draft', name: 'Черновик' },
{ id: 'Approved', name: 'Утверждена' },
{ id: 'InWork', name: 'В работе' },
{ id: 'Done', name: 'Выполнена' },
{ id: 'Cancelled', name: 'Отменена' },
];
export const RepairOrderEdit = () => (
<Edit>
<SimpleForm>
<TextInput disabled source="id" label="ID" />
<TextInput source="number" label="Номер заявки" />
<DateInput source="date" label="Дата заявки" />
<ReferenceInput source="equipmentId" reference="equipment" label="Оборудование">
<SelectInput optionText="name" />
</ReferenceInput>
<SelectInput source="repairKind" choices={repairKindChoices} label="Вид ремонта" />
<SelectInput source="status" choices={statusChoices} label="Статус" />
<DateInput source="plannedAt" label="Плановая дата начала" />
<DateInput source="startedAt" label="Фактическая дата начала" />
<DateInput source="completedAt" label="Фактическая дата завершения" />
<TextInput source="contractor" label="Подрядная организация" />
<NumberInput source="engineHoursAtRepair" label="Наработка на момент ремонта" step={0.01} />
<TextInput multiline source="description" label="Описание работ" />
<TextInput multiline source="notes" label="Примечания" />
<BooleanInput source="confirmed" label="Согласовано" />
</SimpleForm>
</Edit>
);