41 lines
2.1 KiB
TypeScript
41 lines
2.1 KiB
TypeScript
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>
|
||
); |