git init
This commit is contained in:
13
client/src/resources/equipment-type/EquipmentTypeCreate.tsx
Normal file
13
client/src/resources/equipment-type/EquipmentTypeCreate.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Create, SimpleForm, TextInput, NumberInput } from 'react-admin';
|
||||
|
||||
export const EquipmentTypeCreate = () => (
|
||||
<Create>
|
||||
<SimpleForm>
|
||||
<TextInput source="code" label="Код" isRequired />
|
||||
<TextInput source="name" label="Наименование" isRequired />
|
||||
<TextInput source="manufacturer" label="Производитель" />
|
||||
<NumberInput source="maintenanceIntervalHours" label="Периодичность ТО (ч)" />
|
||||
<NumberInput source="overhaulIntervalHours" label="Периодичность КР (ч)" />
|
||||
</SimpleForm>
|
||||
</Create>
|
||||
);
|
||||
13
client/src/resources/equipment-type/EquipmentTypeEdit.tsx
Normal file
13
client/src/resources/equipment-type/EquipmentTypeEdit.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Edit, SimpleForm, TextInput, NumberInput } from 'react-admin';
|
||||
|
||||
export const EquipmentTypeEdit = () => (
|
||||
<Edit>
|
||||
<SimpleForm>
|
||||
<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
client/src/resources/equipment-type/EquipmentTypeList.tsx
Normal file
13
client/src/resources/equipment-type/EquipmentTypeList.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { List, Datagrid, TextField, NumberField } from 'react-admin';
|
||||
|
||||
export const EquipmentTypeList = () => (
|
||||
<List>
|
||||
<Datagrid rowClick="show">
|
||||
<TextField source="code" label="Код" />
|
||||
<TextField source="name" label="Наименование" />
|
||||
<TextField source="manufacturer" label="Производитель" />
|
||||
<NumberField source="maintenanceIntervalHours" label="Периодичность ТО (ч)" />
|
||||
<NumberField source="overhaulIntervalHours" label="Периодичность КР (ч)" />
|
||||
</Datagrid>
|
||||
</List>
|
||||
);
|
||||
13
client/src/resources/equipment-type/EquipmentTypeShow.tsx
Normal file
13
client/src/resources/equipment-type/EquipmentTypeShow.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Show, SimpleShowLayout, TextField, NumberField } from 'react-admin';
|
||||
|
||||
export const EquipmentTypeShow = () => (
|
||||
<Show>
|
||||
<SimpleShowLayout>
|
||||
<TextField source="code" label="Код" />
|
||||
<TextField source="name" label="Наименование" />
|
||||
<TextField source="manufacturer" label="Производитель" />
|
||||
<NumberField source="maintenanceIntervalHours" label="Периодичность ТО (ч)" />
|
||||
<NumberField source="overhaulIntervalHours" label="Периодичность КР (ч)" />
|
||||
</SimpleShowLayout>
|
||||
</Show>
|
||||
);
|
||||
36
client/src/resources/equipment/EquipmentCreate.tsx
Normal file
36
client/src/resources/equipment/EquipmentCreate.tsx
Normal file
@@ -0,0 +1,36 @@
|
||||
import {
|
||||
Create,
|
||||
SimpleForm,
|
||||
TextInput,
|
||||
NumberInput,
|
||||
DateInput,
|
||||
SelectInput,
|
||||
ReferenceInput,
|
||||
} 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" label="Вид оборудования">
|
||||
<SelectInput optionText="name" optionValue="code" isRequired />
|
||||
</ReferenceInput>
|
||||
<SelectInput source="status" label="Статус" choices={statusChoices} defaultValue="Active" />
|
||||
<TextInput source="location" label="Место эксплуатации" />
|
||||
<DateInput source="commissionedAt" label="Дата ввода в эксплуатацию" />
|
||||
<NumberInput source="totalEngineHours" label="Общая наработка (ч)" />
|
||||
<NumberInput source="engineHoursSinceLastRepair" label="Наработка с последнего ремонта (ч)" />
|
||||
<DateInput source="lastRepairAt" label="Дата последнего ремонта" />
|
||||
<TextInput source="notes" label="Примечания" multiline />
|
||||
</SimpleForm>
|
||||
</Create>
|
||||
);
|
||||
36
client/src/resources/equipment/EquipmentEdit.tsx
Normal file
36
client/src/resources/equipment/EquipmentEdit.tsx
Normal file
@@ -0,0 +1,36 @@
|
||||
import {
|
||||
Edit,
|
||||
SimpleForm,
|
||||
TextInput,
|
||||
NumberInput,
|
||||
DateInput,
|
||||
SelectInput,
|
||||
ReferenceInput,
|
||||
} from 'react-admin';
|
||||
|
||||
const statusChoices = [
|
||||
{ id: 'Active', name: 'В эксплуатации' },
|
||||
{ id: 'Repair', name: 'В ремонте' },
|
||||
{ id: 'Reserve', name: 'В резерве' },
|
||||
{ id: 'WriteOff', name: 'Списано' },
|
||||
];
|
||||
|
||||
export const EquipmentEdit = () => (
|
||||
<Edit>
|
||||
<SimpleForm>
|
||||
<TextInput source="inventoryNumber" label="Инвентарный номер" isRequired />
|
||||
<TextInput source="serialNumber" label="Заводской номер" />
|
||||
<TextInput source="name" label="Наименование" isRequired />
|
||||
<ReferenceInput source="equipmentTypeCode" reference="equipment-types" label="Вид оборудования">
|
||||
<SelectInput optionText="name" optionValue="code" isRequired />
|
||||
</ReferenceInput>
|
||||
<SelectInput source="status" label="Статус" choices={statusChoices} />
|
||||
<TextInput source="location" label="Место эксплуатации" />
|
||||
<DateInput source="commissionedAt" label="Дата ввода в эксплуатацию" />
|
||||
<NumberInput source="totalEngineHours" label="Общая наработка (ч)" />
|
||||
<NumberInput source="engineHoursSinceLastRepair" label="Наработка с последнего ремонта (ч)" />
|
||||
<DateInput source="lastRepairAt" label="Дата последнего ремонта" />
|
||||
<TextInput source="notes" label="Примечания" multiline />
|
||||
</SimpleForm>
|
||||
</Edit>
|
||||
);
|
||||
30
client/src/resources/equipment/EquipmentList.tsx
Normal file
30
client/src/resources/equipment/EquipmentList.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import {
|
||||
List,
|
||||
Datagrid,
|
||||
TextField,
|
||||
NumberField,
|
||||
SelectField,
|
||||
ReferenceField,
|
||||
} from 'react-admin';
|
||||
|
||||
const statusChoices = [
|
||||
{ id: 'Active', name: 'В эксплуатации' },
|
||||
{ id: 'Repair', name: 'В ремонте' },
|
||||
{ id: 'Reserve', name: 'В резерве' },
|
||||
{ id: 'WriteOff', name: 'Списано' },
|
||||
];
|
||||
|
||||
export const EquipmentList = () => (
|
||||
<List>
|
||||
<Datagrid rowClick="show">
|
||||
<TextField source="inventoryNumber" label="Инвентарный номер" />
|
||||
<TextField source="name" label="Наименование" />
|
||||
<ReferenceField source="equipmentTypeCode" reference="equipment-types" label="Вид оборудования" link="show">
|
||||
<TextField source="name" />
|
||||
</ReferenceField>
|
||||
<SelectField source="status" label="Статус" choices={statusChoices} />
|
||||
<TextField source="location" label="Место эксплуатации" />
|
||||
<NumberField source="totalEngineHours" label="Наработка (ч)" />
|
||||
</Datagrid>
|
||||
</List>
|
||||
);
|
||||
36
client/src/resources/equipment/EquipmentShow.tsx
Normal file
36
client/src/resources/equipment/EquipmentShow.tsx
Normal file
@@ -0,0 +1,36 @@
|
||||
import {
|
||||
Show,
|
||||
SimpleShowLayout,
|
||||
TextField,
|
||||
NumberField,
|
||||
DateField,
|
||||
SelectField,
|
||||
ReferenceField,
|
||||
} from 'react-admin';
|
||||
|
||||
const statusChoices = [
|
||||
{ id: 'Active', name: 'В эксплуатации' },
|
||||
{ id: 'Repair', name: 'В ремонте' },
|
||||
{ id: 'Reserve', name: 'В резерве' },
|
||||
{ id: 'WriteOff', name: 'Списано' },
|
||||
];
|
||||
|
||||
export const EquipmentShow = () => (
|
||||
<Show>
|
||||
<SimpleShowLayout>
|
||||
<TextField source="inventoryNumber" label="Инвентарный номер" />
|
||||
<TextField source="serialNumber" label="Заводской номер" />
|
||||
<TextField source="name" label="Наименование" />
|
||||
<ReferenceField source="equipmentTypeCode" reference="equipment-types" label="Вид оборудования" link="show">
|
||||
<TextField source="name" />
|
||||
</ReferenceField>
|
||||
<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="Примечания" />
|
||||
</SimpleShowLayout>
|
||||
</Show>
|
||||
);
|
||||
46
client/src/resources/repair-order/RepairOrderCreate.tsx
Normal file
46
client/src/resources/repair-order/RepairOrderCreate.tsx
Normal file
@@ -0,0 +1,46 @@
|
||||
import {
|
||||
Create,
|
||||
SimpleForm,
|
||||
TextInput,
|
||||
NumberInput,
|
||||
DateInput,
|
||||
SelectInput,
|
||||
ReferenceInput,
|
||||
} 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 RepairOrderCreate = () => (
|
||||
<Create>
|
||||
<SimpleForm>
|
||||
<TextInput source="number" label="Номер заявки" isRequired />
|
||||
<ReferenceInput source="equipmentId" reference="equipment" label="Оборудование">
|
||||
<SelectInput optionText="name" isRequired />
|
||||
</ReferenceInput>
|
||||
<SelectInput source="repairKind" label="Вид ремонта" choices={repairKindChoices} isRequired />
|
||||
<SelectInput source="status" label="Статус" choices={statusChoices} defaultValue="Draft" />
|
||||
<DateInput source="plannedAt" label="Плановая дата начала" isRequired />
|
||||
<DateInput source="startedAt" label="Фактическая дата начала" />
|
||||
<DateInput source="completedAt" label="Фактическая дата завершения" />
|
||||
<TextInput source="contractor" label="Подрядная организация" />
|
||||
<NumberInput source="engineHoursAtRepair" label="Наработка на момент ремонта (ч)" />
|
||||
<TextInput source="description" label="Описание работ / дефекта" multiline />
|
||||
<TextInput source="notes" label="Примечания" multiline />
|
||||
</SimpleForm>
|
||||
</Create>
|
||||
);
|
||||
46
client/src/resources/repair-order/RepairOrderEdit.tsx
Normal file
46
client/src/resources/repair-order/RepairOrderEdit.tsx
Normal file
@@ -0,0 +1,46 @@
|
||||
import {
|
||||
Edit,
|
||||
SimpleForm,
|
||||
TextInput,
|
||||
NumberInput,
|
||||
DateInput,
|
||||
SelectInput,
|
||||
ReferenceInput,
|
||||
} 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 source="number" label="Номер заявки" isRequired />
|
||||
<ReferenceInput source="equipmentId" reference="equipment" label="Оборудование">
|
||||
<SelectInput optionText="name" isRequired />
|
||||
</ReferenceInput>
|
||||
<SelectInput source="repairKind" label="Вид ремонта" choices={repairKindChoices} isRequired />
|
||||
<SelectInput source="status" label="Статус" choices={statusChoices} />
|
||||
<DateInput source="plannedAt" label="Плановая дата начала" isRequired />
|
||||
<DateInput source="startedAt" label="Фактическая дата начала" />
|
||||
<DateInput source="completedAt" label="Фактическая дата завершения" />
|
||||
<TextInput source="contractor" label="Подрядная организация" />
|
||||
<NumberInput source="engineHoursAtRepair" label="Наработка на момент ремонта (ч)" />
|
||||
<TextInput source="description" label="Описание работ / дефекта" multiline />
|
||||
<TextInput source="notes" label="Примечания" multiline />
|
||||
</SimpleForm>
|
||||
</Edit>
|
||||
);
|
||||
40
client/src/resources/repair-order/RepairOrderList.tsx
Normal file
40
client/src/resources/repair-order/RepairOrderList.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
import {
|
||||
List,
|
||||
Datagrid,
|
||||
TextField,
|
||||
DateField,
|
||||
SelectField,
|
||||
ReferenceField,
|
||||
} 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 RepairOrderList = () => (
|
||||
<List>
|
||||
<Datagrid rowClick="show">
|
||||
<TextField source="number" label="Номер" />
|
||||
<ReferenceField source="equipmentId" reference="equipment" label="Оборудование" link="show">
|
||||
<TextField source="name" />
|
||||
</ReferenceField>
|
||||
<SelectField source="repairKind" label="Вид ремонта" choices={repairKindChoices} />
|
||||
<SelectField source="status" label="Статус" choices={statusChoices} />
|
||||
<DateField source="plannedAt" label="Плановая дата" />
|
||||
<TextField source="contractor" label="Подрядчик" />
|
||||
</Datagrid>
|
||||
</List>
|
||||
);
|
||||
46
client/src/resources/repair-order/RepairOrderShow.tsx
Normal file
46
client/src/resources/repair-order/RepairOrderShow.tsx
Normal file
@@ -0,0 +1,46 @@
|
||||
import {
|
||||
Show,
|
||||
SimpleShowLayout,
|
||||
TextField,
|
||||
NumberField,
|
||||
DateField,
|
||||
SelectField,
|
||||
ReferenceField,
|
||||
} 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 RepairOrderShow = () => (
|
||||
<Show>
|
||||
<SimpleShowLayout>
|
||||
<TextField source="number" label="Номер заявки" />
|
||||
<ReferenceField source="equipmentId" reference="equipment" label="Оборудование" link="show">
|
||||
<TextField source="name" />
|
||||
</ReferenceField>
|
||||
<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="Примечания" />
|
||||
</SimpleShowLayout>
|
||||
</Show>
|
||||
);
|
||||
Reference in New Issue
Block a user