Initial commit
This commit is contained in:
28
client/src/resources/equipment/EquipmentCreate.tsx
Normal file
28
client/src/resources/equipment/EquipmentCreate.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import { Create, SimpleForm, TextInput, NumberInput, DateInput, SelectInput, ReferenceInput, AutocompleteInput } from 'react-admin';
|
||||
|
||||
const statusChoices = [
|
||||
{ id: 'Active', name: 'В эксплуатации' },
|
||||
{ id: 'Repair', name: 'В ремонте' },
|
||||
{ id: 'Reserve', name: 'В резерве' },
|
||||
{ id: 'WriteOff', name: 'Списано' },
|
||||
];
|
||||
|
||||
export const EquipmentCreate = () => (
|
||||
<Create>
|
||||
<SimpleForm>
|
||||
<TextInput source="inventoryNumber" label="Инвентарный номер" isRequired />
|
||||
<TextInput source="serialNumber" label="Заводской (серийный) номер" />
|
||||
<TextInput source="name" label="Наименование единицы оборудования" isRequired />
|
||||
<ReferenceInput source="equipmentTypeCode" reference="equipment-types">
|
||||
<AutocompleteInput label="Вид оборудования" optionText={(record) => record.code ? `${record.code} — ${record.name ?? record.code}` : (record.name ?? record.id)} filterToQuery={(searchText) => ({ q: searchText })} />
|
||||
</ReferenceInput>
|
||||
<SelectInput source="status" label="Текущий статус" choices={statusChoices} emptyText="Не выбрано" />
|
||||
<TextInput source="location" label="Место эксплуатации / скважина / куст" />
|
||||
<DateInput source="commissionedAt" label="Дата ввода в эксплуатацию" />
|
||||
<NumberInput source="totalEngineHours" label="Общая наработка, моточасов" />
|
||||
<NumberInput source="engineHoursSinceLastRepair" label="Наработка с последнего ремонта, моточасов" />
|
||||
<DateInput source="lastRepairAt" label="Дата последнего ремонта" />
|
||||
<TextInput source="notes" label="Примечания" />
|
||||
</SimpleForm>
|
||||
</Create>
|
||||
);
|
||||
Reference in New Issue
Block a user