fix after review
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import { Create, SimpleForm, TextInput } from 'react-admin';
|
||||
import { Create, SimpleForm, TextInput, NumberInput } from 'react-admin';
|
||||
|
||||
|
||||
export const EquipmentTypeCreate = () => (
|
||||
<Create>
|
||||
<SimpleForm>
|
||||
<TextInput source="code" label="code" isRequired />
|
||||
<TextInput source="name" label="name" isRequired />
|
||||
<TextInput source="manufacturer" label="manufacturer" />
|
||||
<TextInput source="maintenanceIntervalHours" label="maintenanceIntervalHours" />
|
||||
<TextInput source="overhaulIntervalHours" label="overhaulIntervalHours" />
|
||||
<TextInput source="code" label="Код вида оборудования" isRequired />
|
||||
<TextInput source="name" label="Наименование вида" isRequired />
|
||||
<TextInput source="manufacturer" label="Производитель" />
|
||||
<NumberInput source="maintenanceIntervalHours" label="Периодичность ТО, моточасов" />
|
||||
<NumberInput source="overhaulIntervalHours" label="Периодичность КР, моточасов" />
|
||||
</SimpleForm>
|
||||
</Create>
|
||||
);
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { Edit, SimpleForm, TextInput } from 'react-admin';
|
||||
import { Edit, SimpleForm, TextInput, NumberInput } from 'react-admin';
|
||||
|
||||
|
||||
export const EquipmentTypeEdit = () => (
|
||||
<Edit>
|
||||
<SimpleForm>
|
||||
<TextInput source="code" label="code" disabled />
|
||||
<TextInput source="name" label="name" isRequired />
|
||||
<TextInput source="manufacturer" label="manufacturer" />
|
||||
<TextInput source="maintenanceIntervalHours" label="maintenanceIntervalHours" />
|
||||
<TextInput source="overhaulIntervalHours" label="overhaulIntervalHours" />
|
||||
<TextInput source="code" label="Код вида оборудования" disabled />
|
||||
<TextInput source="name" label="Наименование вида" isRequired />
|
||||
<TextInput source="manufacturer" label="Производитель" />
|
||||
<NumberInput source="maintenanceIntervalHours" label="Периодичность ТО, моточасов" />
|
||||
<NumberInput source="overhaulIntervalHours" label="Периодичность КР, моточасов" />
|
||||
</SimpleForm>
|
||||
</Edit>
|
||||
);
|
||||
|
||||
@@ -13,8 +13,8 @@ import {
|
||||
|
||||
const equipmentTypeFilters = [
|
||||
<TextInput key="q" source="q" label="Поиск" alwaysOn />,
|
||||
<TextInput key="name" source="name" label="name" />,
|
||||
<TextInput key="manufacturer" source="manufacturer" label="manufacturer" />
|
||||
<TextInput key="name" source="name" label="Наименование вида" />,
|
||||
<TextInput key="manufacturer" source="manufacturer" label="Производитель" />
|
||||
];
|
||||
|
||||
const EquipmentTypeListActions = () => (
|
||||
@@ -28,11 +28,11 @@ const EquipmentTypeListActions = () => (
|
||||
export const EquipmentTypeList = () => (
|
||||
<List actions={<EquipmentTypeListActions />} filters={equipmentTypeFilters} sort={{ field: 'code', order: 'ASC' }}>
|
||||
<Datagrid rowClick="show">
|
||||
<TextField source="code" label="code" />
|
||||
<TextField source="name" label="name" />
|
||||
<TextField source="manufacturer" label="manufacturer" />
|
||||
<NumberField source="maintenanceIntervalHours" label="maintenanceIntervalHours" />
|
||||
<NumberField source="overhaulIntervalHours" label="overhaulIntervalHours" />
|
||||
<TextField source="code" label="Код вида оборудования" />
|
||||
<TextField source="name" label="Наименование вида" />
|
||||
<TextField source="manufacturer" label="Производитель" />
|
||||
<NumberField source="maintenanceIntervalHours" label="Периодичность ТО, моточасов" />
|
||||
<NumberField source="overhaulIntervalHours" label="Периодичность КР, моточасов" />
|
||||
</Datagrid>
|
||||
</List>
|
||||
);
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
import { Create, SimpleForm, TextInput, SelectInput, ReferenceInput, AutocompleteInput } from 'react-admin';
|
||||
import { Create, SimpleForm, TextInput, NumberInput, DateInput, SelectInput, ReferenceInput, AutocompleteInput } from 'react-admin';
|
||||
|
||||
const statusChoices = [
|
||||
{ id: 'Active', name: 'Active' },
|
||||
{ id: 'Repair', name: 'Repair' },
|
||||
{ id: 'Reserve', name: 'Reserve' },
|
||||
{ id: 'WriteOff', name: 'WriteOff' },
|
||||
{ id: 'Active', name: 'В эксплуатации' },
|
||||
{ id: 'Repair', name: 'В ремонте' },
|
||||
{ id: 'Reserve', name: 'В резерве' },
|
||||
{ id: 'WriteOff', name: 'Списано' },
|
||||
];
|
||||
|
||||
export const EquipmentCreate = () => (
|
||||
<Create>
|
||||
<SimpleForm>
|
||||
<TextInput source="inventoryNumber" label="inventoryNumber" isRequired />
|
||||
<TextInput source="serialNumber" label="serialNumber" />
|
||||
<TextInput source="name" label="name" isRequired />
|
||||
<ReferenceInput source="equipmentTypeCode" reference="equipment-types" label="equipmentTypeCode">
|
||||
<AutocompleteInput optionText={(record) => record.code ? `${record.code} — ${record.name ?? record.code}` : (record.name ?? record.id)} filterToQuery={(searchText) => ({ q: searchText })} />
|
||||
<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="status" choices={statusChoices} emptyText="Не выбрано" />
|
||||
<TextInput source="location" label="location" />
|
||||
<TextInput source="commissionedAt" label="commissionedAt" />
|
||||
<TextInput source="totalEngineHours" label="totalEngineHours" />
|
||||
<TextInput source="engineHoursSinceLastRepair" label="engineHoursSinceLastRepair" />
|
||||
<TextInput source="lastRepairAt" label="lastRepairAt" />
|
||||
<TextInput source="notes" label="notes" />
|
||||
<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>
|
||||
);
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
import { Edit, SimpleForm, TextInput, SelectInput, ReferenceInput, AutocompleteInput } from 'react-admin';
|
||||
import { Edit, SimpleForm, TextInput, NumberInput, DateInput, SelectInput, ReferenceInput, AutocompleteInput } from 'react-admin';
|
||||
|
||||
const statusChoices = [
|
||||
{ id: 'Active', name: 'Active' },
|
||||
{ id: 'Repair', name: 'Repair' },
|
||||
{ id: 'Reserve', name: 'Reserve' },
|
||||
{ id: 'WriteOff', name: 'WriteOff' },
|
||||
{ id: 'Active', name: 'В эксплуатации' },
|
||||
{ id: 'Repair', name: 'В ремонте' },
|
||||
{ id: 'Reserve', name: 'В резерве' },
|
||||
{ id: 'WriteOff', name: 'Списано' },
|
||||
];
|
||||
|
||||
export const EquipmentEdit = () => (
|
||||
<Edit>
|
||||
<SimpleForm>
|
||||
<TextInput source="id" label="id" disabled />
|
||||
<TextInput source="inventoryNumber" label="inventoryNumber" isRequired />
|
||||
<TextInput source="serialNumber" label="serialNumber" />
|
||||
<TextInput source="name" label="name" isRequired />
|
||||
<ReferenceInput source="equipmentTypeCode" reference="equipment-types" label="equipmentTypeCode">
|
||||
<AutocompleteInput optionText={(record) => record.code ? `${record.code} — ${record.name ?? record.code}` : (record.name ?? record.id)} filterToQuery={(searchText) => ({ q: searchText })} />
|
||||
<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="status" choices={statusChoices} emptyText="Не выбрано" />
|
||||
<TextInput source="location" label="location" />
|
||||
<TextInput source="commissionedAt" label="commissionedAt" />
|
||||
<TextInput source="totalEngineHours" label="totalEngineHours" />
|
||||
<TextInput source="engineHoursSinceLastRepair" label="engineHoursSinceLastRepair" />
|
||||
<TextInput source="lastRepairAt" label="lastRepairAt" />
|
||||
<TextInput source="notes" label="notes" />
|
||||
<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>
|
||||
</Edit>
|
||||
);
|
||||
|
||||
@@ -13,27 +13,60 @@ import {
|
||||
ReferenceField,
|
||||
SelectArrayInput,
|
||||
ReferenceInput,
|
||||
AutocompleteInput
|
||||
} from 'react-admin';
|
||||
AutocompleteInput,
|
||||
} from "react-admin";
|
||||
|
||||
const statusChoices = [
|
||||
{ id: 'Active', name: 'Active' },
|
||||
{ id: 'Repair', name: 'Repair' },
|
||||
{ id: 'Reserve', name: 'Reserve' },
|
||||
{ id: 'WriteOff', name: 'WriteOff' },
|
||||
{ id: "Active", name: "В эксплуатации" },
|
||||
{ id: "Repair", name: "В ремонте" },
|
||||
{ id: "Reserve", name: "В резерве" },
|
||||
{ id: "WriteOff", name: "Списано" },
|
||||
];
|
||||
|
||||
const equipmentFilters = [
|
||||
<TextInput key="q" source="q" label="Поиск" alwaysOn />,
|
||||
<TextInput key="inventoryNumber" source="inventoryNumber" label="inventoryNumber" />,
|
||||
<TextInput key="serialNumber" source="serialNumber" label="serialNumber" />,
|
||||
<TextInput key="name" source="name" label="name" />,
|
||||
<ReferenceInput key="equipmentTypeCode" source="equipmentTypeCode" reference="equipment-types" label="equipmentTypeCode">
|
||||
<AutocompleteInput optionText={(record) => record.code ? `${record.code} — ${record.name ?? record.code}` : (record.name ?? record.id)} filterToQuery={(searchText) => ({ q: searchText })} />
|
||||
<TextInput
|
||||
key="inventoryNumber"
|
||||
source="inventoryNumber"
|
||||
label="Инвентарный номер"
|
||||
/>,
|
||||
<TextInput
|
||||
key="serialNumber"
|
||||
source="serialNumber"
|
||||
label="Заводской (серийный) номер"
|
||||
/>,
|
||||
<TextInput
|
||||
key="name"
|
||||
source="name"
|
||||
label="Наименование единицы оборудования"
|
||||
/>,
|
||||
<ReferenceInput
|
||||
key="equipmentTypeCode"
|
||||
source="equipmentTypeCode"
|
||||
reference="equipment-types"
|
||||
label="Вид оборудования"
|
||||
>
|
||||
<AutocompleteInput
|
||||
optionText={(record) =>
|
||||
record.code
|
||||
? `${record.code} — ${record.name ?? record.code}`
|
||||
: (record.name ?? record.id)
|
||||
}
|
||||
filterToQuery={(searchText) => ({ q: searchText })}
|
||||
/>
|
||||
</ReferenceInput>,
|
||||
<SelectArrayInput key="status" source="status" label="status" choices={statusChoices} />,
|
||||
<TextInput key="location" source="location" label="location" />,
|
||||
<TextInput key="notes" source="notes" label="notes" />
|
||||
<SelectArrayInput
|
||||
key="status"
|
||||
source="status"
|
||||
label="Текущий статус"
|
||||
choices={statusChoices}
|
||||
/>,
|
||||
<TextInput
|
||||
key="location"
|
||||
source="location"
|
||||
label="Место эксплуатации / скважина / куст"
|
||||
/>,
|
||||
<TextInput key="notes" source="notes" label="Примечания" />,
|
||||
];
|
||||
|
||||
const EquipmentListActions = () => (
|
||||
@@ -45,22 +78,44 @@ const EquipmentListActions = () => (
|
||||
);
|
||||
|
||||
export const EquipmentList = () => (
|
||||
<List actions={<EquipmentListActions />} filters={equipmentFilters} sort={{ field: 'id', order: 'ASC' }}>
|
||||
<List
|
||||
actions={<EquipmentListActions />}
|
||||
filters={equipmentFilters}
|
||||
sort={{ field: "inventoryNumber", order: "ASC" }}
|
||||
>
|
||||
<Datagrid rowClick="show">
|
||||
<TextField source="id" label="id" />
|
||||
<TextField source="inventoryNumber" label="inventoryNumber" />
|
||||
<TextField source="serialNumber" label="serialNumber" />
|
||||
<TextField source="name" label="name" />
|
||||
<ReferenceField source="equipmentTypeCode" reference="equipment-types" label="equipmentTypeCode" link="show">
|
||||
<TextField source="name" />
|
||||
<TextField source="inventoryNumber" label="Инвентарный номер" />
|
||||
<TextField source="serialNumber" label="Заводской (серийный) номер" />
|
||||
<TextField source="name" label="Наименование единицы оборудования" />
|
||||
<ReferenceField
|
||||
source="equipmentTypeCode"
|
||||
reference="equipment-types"
|
||||
label="Вид оборудования"
|
||||
link="show"
|
||||
>
|
||||
<TextField source="code" />
|
||||
</ReferenceField>
|
||||
<SelectField source="status" label="status" choices={statusChoices} />
|
||||
<TextField source="location" label="location" />
|
||||
<DateField source="commissionedAt" label="commissionedAt" />
|
||||
<NumberField source="totalEngineHours" label="totalEngineHours" />
|
||||
<NumberField source="engineHoursSinceLastRepair" label="engineHoursSinceLastRepair" />
|
||||
<DateField source="lastRepairAt" label="lastRepairAt" />
|
||||
<TextField source="notes" label="notes" />
|
||||
<SelectField
|
||||
source="status"
|
||||
label="Текущий статус"
|
||||
choices={statusChoices}
|
||||
/>
|
||||
<TextField
|
||||
source="location"
|
||||
label="Место эксплуатации / скважина / куст"
|
||||
/>
|
||||
<DateField source="commissionedAt" label="Дата ввода в эксплуатацию" />
|
||||
<NumberField
|
||||
source="totalEngineHours"
|
||||
label="Общая наработка, моточасов"
|
||||
/>
|
||||
<NumberField
|
||||
source="engineHoursSinceLastRepair"
|
||||
label="Наработка с последнего ремонта, моточасов"
|
||||
/>
|
||||
<DateField source="lastRepairAt" label="Дата последнего ремонта" />
|
||||
<TextField source="notes" label="Примечания" />
|
||||
</Datagrid>
|
||||
</List>
|
||||
);
|
||||
|
||||
@@ -1,38 +1,38 @@
|
||||
import { Create, SimpleForm, TextInput, SelectInput, ReferenceInput, AutocompleteInput } from 'react-admin';
|
||||
import { Create, SimpleForm, TextInput, NumberInput, DateInput, SelectInput, ReferenceInput, AutocompleteInput } from 'react-admin';
|
||||
|
||||
const repairKindChoices = [
|
||||
{ id: 'TO', name: 'TO' },
|
||||
{ id: 'TR', name: 'TR' },
|
||||
{ id: 'TRE', name: 'TRE' },
|
||||
{ id: 'KR', name: 'KR' },
|
||||
{ id: 'AR', name: 'AR' },
|
||||
{ id: 'MP', name: 'MP' },
|
||||
{ id: 'TO', name: 'Техническое обслуживание' },
|
||||
{ id: 'TR', name: 'Текущий ремонт' },
|
||||
{ id: 'TRE', name: 'Текущий расширенный ремонт' },
|
||||
{ id: 'KR', name: 'Капитальный ремонт' },
|
||||
{ id: 'AR', name: 'Аварийный ремонт' },
|
||||
{ id: 'MP', name: 'Метрологическая поверка' },
|
||||
];
|
||||
|
||||
const statusChoices = [
|
||||
{ id: 'Draft', name: 'Draft' },
|
||||
{ id: 'Approved', name: 'Approved' },
|
||||
{ id: 'InWork', name: 'InWork' },
|
||||
{ id: 'Done', name: 'Done' },
|
||||
{ id: 'Cancelled', name: 'Cancelled' },
|
||||
{ id: 'Draft', name: 'Черновик' },
|
||||
{ id: 'Approved', name: 'Утверждена' },
|
||||
{ id: 'InWork', name: 'В работе' },
|
||||
{ id: 'Done', name: 'Выполнена' },
|
||||
{ id: 'Cancelled', name: 'Отменена' },
|
||||
];
|
||||
|
||||
export const RepairOrderCreate = () => (
|
||||
<Create>
|
||||
<SimpleForm>
|
||||
<TextInput source="number" label="number" isRequired />
|
||||
<ReferenceInput source="equipmentId" reference="equipment" label="equipmentId">
|
||||
<AutocompleteInput optionText={(record) => record.code ? `${record.code} — ${record.name ?? record.code}` : (record.name ?? record.id)} filterToQuery={(searchText) => ({ q: searchText })} />
|
||||
<TextInput source="number" label="Номер заявки" isRequired />
|
||||
<ReferenceInput source="equipmentId" reference="equipment">
|
||||
<AutocompleteInput label="Оборудование" optionText={(record) => record.inventoryNumber ? `${record.inventoryNumber} — ${record.name ?? record.inventoryNumber}` : (record.name ?? record.id)} filterToQuery={(searchText) => ({ q: searchText })} />
|
||||
</ReferenceInput>
|
||||
<SelectInput source="repairKind" label="repairKind" choices={repairKindChoices} emptyText="Не выбрано" />
|
||||
<SelectInput source="status" label="status" choices={statusChoices} emptyText="Не выбрано" />
|
||||
<TextInput source="plannedAt" label="plannedAt" />
|
||||
<TextInput source="startedAt" label="startedAt" />
|
||||
<TextInput source="completedAt" label="completedAt" />
|
||||
<TextInput source="contractor" label="contractor" />
|
||||
<TextInput source="engineHoursAtRepair" label="engineHoursAtRepair" />
|
||||
<TextInput source="description" label="description" />
|
||||
<TextInput source="notes" label="notes" />
|
||||
<SelectInput source="repairKind" label="Вид ремонта" choices={repairKindChoices} emptyText="Не выбрано" />
|
||||
<SelectInput source="status" label="Статус" choices={statusChoices} emptyText="Не выбрано" />
|
||||
<DateInput source="plannedAt" label="Плановая дата начала" />
|
||||
<DateInput source="startedAt" label="Фактическая дата начала" />
|
||||
<DateInput source="completedAt" label="Фактическая дата завершения" />
|
||||
<TextInput source="contractor" label="Подрядная организация (если внешний ремонт)" />
|
||||
<NumberInput source="engineHoursAtRepair" label="Наработка на момент ремонта, моточасов" />
|
||||
<TextInput source="description" label="Описание работ / дефекта" />
|
||||
<TextInput source="notes" label="Примечания" />
|
||||
</SimpleForm>
|
||||
</Create>
|
||||
);
|
||||
|
||||
@@ -1,39 +1,39 @@
|
||||
import { Edit, SimpleForm, TextInput, SelectInput, ReferenceInput, AutocompleteInput } from 'react-admin';
|
||||
import { Edit, SimpleForm, TextInput, NumberInput, DateInput, SelectInput, ReferenceInput, AutocompleteInput } from 'react-admin';
|
||||
|
||||
const repairKindChoices = [
|
||||
{ id: 'TO', name: 'TO' },
|
||||
{ id: 'TR', name: 'TR' },
|
||||
{ id: 'TRE', name: 'TRE' },
|
||||
{ id: 'KR', name: 'KR' },
|
||||
{ id: 'AR', name: 'AR' },
|
||||
{ id: 'MP', name: 'MP' },
|
||||
{ id: 'TO', name: 'Техническое обслуживание' },
|
||||
{ id: 'TR', name: 'Текущий ремонт' },
|
||||
{ id: 'TRE', name: 'Текущий расширенный ремонт' },
|
||||
{ id: 'KR', name: 'Капитальный ремонт' },
|
||||
{ id: 'AR', name: 'Аварийный ремонт' },
|
||||
{ id: 'MP', name: 'Метрологическая поверка' },
|
||||
];
|
||||
|
||||
const statusChoices = [
|
||||
{ id: 'Draft', name: 'Draft' },
|
||||
{ id: 'Approved', name: 'Approved' },
|
||||
{ id: 'InWork', name: 'InWork' },
|
||||
{ id: 'Done', name: 'Done' },
|
||||
{ id: 'Cancelled', name: 'Cancelled' },
|
||||
{ id: 'Draft', name: 'Черновик' },
|
||||
{ id: 'Approved', name: 'Утверждена' },
|
||||
{ id: 'InWork', name: 'В работе' },
|
||||
{ id: 'Done', name: 'Выполнена' },
|
||||
{ id: 'Cancelled', name: 'Отменена' },
|
||||
];
|
||||
|
||||
export const RepairOrderEdit = () => (
|
||||
<Edit>
|
||||
<SimpleForm>
|
||||
<TextInput source="id" label="id" disabled />
|
||||
<TextInput source="number" label="number" isRequired />
|
||||
<ReferenceInput source="equipmentId" reference="equipment" label="equipmentId">
|
||||
<AutocompleteInput optionText={(record) => record.code ? `${record.code} — ${record.name ?? record.code}` : (record.name ?? record.id)} filterToQuery={(searchText) => ({ q: searchText })} />
|
||||
<TextInput source="number" label="Номер заявки" isRequired />
|
||||
<ReferenceInput source="equipmentId" reference="equipment">
|
||||
<AutocompleteInput label="Оборудование" optionText={(record) => record.inventoryNumber ? `${record.inventoryNumber} — ${record.name ?? record.inventoryNumber}` : (record.name ?? record.id)} filterToQuery={(searchText) => ({ q: searchText })} />
|
||||
</ReferenceInput>
|
||||
<SelectInput source="repairKind" label="repairKind" choices={repairKindChoices} emptyText="Не выбрано" />
|
||||
<SelectInput source="status" label="status" choices={statusChoices} emptyText="Не выбрано" />
|
||||
<TextInput source="plannedAt" label="plannedAt" />
|
||||
<TextInput source="startedAt" label="startedAt" />
|
||||
<TextInput source="completedAt" label="completedAt" />
|
||||
<TextInput source="contractor" label="contractor" />
|
||||
<TextInput source="engineHoursAtRepair" label="engineHoursAtRepair" />
|
||||
<TextInput source="description" label="description" />
|
||||
<TextInput source="notes" label="notes" />
|
||||
<SelectInput source="repairKind" label="Вид ремонта" choices={repairKindChoices} emptyText="Не выбрано" />
|
||||
<SelectInput source="status" label="Статус" choices={statusChoices} emptyText="Не выбрано" />
|
||||
<DateInput source="plannedAt" label="Плановая дата начала" />
|
||||
<DateInput source="startedAt" label="Фактическая дата начала" />
|
||||
<DateInput source="completedAt" label="Фактическая дата завершения" />
|
||||
<TextInput source="contractor" label="Подрядная организация (если внешний ремонт)" />
|
||||
<NumberInput source="engineHoursAtRepair" label="Наработка на момент ремонта, моточасов" />
|
||||
<TextInput source="description" label="Описание работ / дефекта" />
|
||||
<TextInput source="notes" label="Примечания" />
|
||||
</SimpleForm>
|
||||
</Edit>
|
||||
);
|
||||
|
||||
@@ -18,33 +18,33 @@ import {
|
||||
} from 'react-admin';
|
||||
|
||||
const repairKindChoices = [
|
||||
{ id: 'TO', name: 'TO' },
|
||||
{ id: 'TR', name: 'TR' },
|
||||
{ id: 'TRE', name: 'TRE' },
|
||||
{ id: 'KR', name: 'KR' },
|
||||
{ id: 'AR', name: 'AR' },
|
||||
{ id: 'MP', name: 'MP' },
|
||||
{ id: 'TO', name: 'Техническое обслуживание' },
|
||||
{ id: 'TR', name: 'Текущий ремонт' },
|
||||
{ id: 'TRE', name: 'Текущий расширенный ремонт' },
|
||||
{ id: 'KR', name: 'Капитальный ремонт' },
|
||||
{ id: 'AR', name: 'Аварийный ремонт' },
|
||||
{ id: 'MP', name: 'Метрологическая поверка' },
|
||||
];
|
||||
|
||||
const statusChoices = [
|
||||
{ id: 'Draft', name: 'Draft' },
|
||||
{ id: 'Approved', name: 'Approved' },
|
||||
{ id: 'InWork', name: 'InWork' },
|
||||
{ id: 'Done', name: 'Done' },
|
||||
{ id: 'Cancelled', name: 'Cancelled' },
|
||||
{ id: 'Draft', name: 'Черновик' },
|
||||
{ id: 'Approved', name: 'Утверждена' },
|
||||
{ id: 'InWork', name: 'В работе' },
|
||||
{ id: 'Done', name: 'Выполнена' },
|
||||
{ id: 'Cancelled', name: 'Отменена' },
|
||||
];
|
||||
|
||||
const repairOrderFilters = [
|
||||
<TextInput key="q" source="q" label="Поиск" alwaysOn />,
|
||||
<TextInput key="number" source="number" label="number" />,
|
||||
<ReferenceInput key="equipmentId" source="equipmentId" reference="equipment" label="equipmentId">
|
||||
<AutocompleteInput optionText={(record) => record.code ? `${record.code} — ${record.name ?? record.code}` : (record.name ?? record.id)} filterToQuery={(searchText) => ({ q: searchText })} />
|
||||
<TextInput key="number" source="number" label="Номер заявки" />,
|
||||
<ReferenceInput key="equipmentId" source="equipmentId" reference="equipment" label="Оборудование">
|
||||
<AutocompleteInput optionText={(record) => record.inventoryNumber ? `${record.inventoryNumber} — ${record.name ?? record.inventoryNumber}` : (record.name ?? record.id)} filterToQuery={(searchText) => ({ q: searchText })} />
|
||||
</ReferenceInput>,
|
||||
<SelectInput key="repairKind" source="repairKind" label="repairKind" choices={repairKindChoices} emptyText="Все" />,
|
||||
<SelectArrayInput key="status" source="status" label="status" choices={statusChoices} />,
|
||||
<TextInput key="contractor" source="contractor" label="contractor" />,
|
||||
<TextInput key="description" source="description" label="description" />,
|
||||
<TextInput key="notes" source="notes" label="notes" />
|
||||
<SelectInput key="repairKind" source="repairKind" label="Вид ремонта" choices={repairKindChoices} emptyText="Все" />,
|
||||
<SelectArrayInput key="status" source="status" label="Статус" choices={statusChoices} />,
|
||||
<TextInput key="contractor" source="contractor" label="Подрядная организация (если внешний ремонт)" />,
|
||||
<TextInput key="description" source="description" label="Описание работ / дефекта" />,
|
||||
<TextInput key="notes" source="notes" label="Примечания" />
|
||||
];
|
||||
|
||||
const RepairOrderListActions = () => (
|
||||
@@ -56,22 +56,22 @@ const RepairOrderListActions = () => (
|
||||
);
|
||||
|
||||
export const RepairOrderList = () => (
|
||||
<List actions={<RepairOrderListActions />} filters={repairOrderFilters} sort={{ field: 'id', order: 'ASC' }}>
|
||||
<List actions={<RepairOrderListActions />} filters={repairOrderFilters} sort={{ field: 'number', order: 'ASC' }}>
|
||||
<Datagrid rowClick="show">
|
||||
<TextField source="id" label="id" />
|
||||
<TextField source="number" label="number" />
|
||||
<ReferenceField source="equipmentId" reference="equipment" label="equipmentId" link="show">
|
||||
<TextField source="name" />
|
||||
<TextField source="number" label="Номер заявки" />
|
||||
<ReferenceField source="equipmentId" reference="equipment" label="Оборудование" link="show">
|
||||
<TextField source="inventoryNumber" />
|
||||
</ReferenceField>
|
||||
<SelectField source="repairKind" label="repairKind" choices={repairKindChoices} />
|
||||
<SelectField source="status" label="status" choices={statusChoices} />
|
||||
<DateField source="plannedAt" label="plannedAt" />
|
||||
<DateField source="startedAt" label="startedAt" />
|
||||
<DateField source="completedAt" label="completedAt" />
|
||||
<TextField source="contractor" label="contractor" />
|
||||
<NumberField source="engineHoursAtRepair" label="engineHoursAtRepair" />
|
||||
<TextField source="description" label="description" />
|
||||
<TextField source="notes" label="notes" />
|
||||
<SelectField source="repairKind" label="Вид ремонта" choices={repairKindChoices} />
|
||||
<SelectField source="status" label="Статус" choices={statusChoices} />
|
||||
<DateField source="plannedAt" label="Плановая дата начала" />
|
||||
<DateField source="startedAt" label="Фактическая дата начала" />
|
||||
<DateField source="completedAt" label="Фактическая дата завершения" />
|
||||
<TextField source="contractor" label="Подрядная организация (если внешний ремонт)" />
|
||||
<NumberField source="engineHoursAtRepair" label="Наработка на момент ремонта, моточасов" />
|
||||
<TextField source="description" label="Описание работ / дефекта" />
|
||||
<TextField source="notes" label="Примечания" />
|
||||
</Datagrid>
|
||||
</List>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user