Refactor ChangeEquipmentStatus forms to include new fields
- Added a text input for "Номер" in both ChangeEquipmentStatusCreate and ChangeEquipmentStatusEdit components. - Rearranged the order of fields in the forms for better user experience. - Included the StatusChangeAttachmentsInput component to handle file attachments in both forms.
This commit is contained in:
@@ -8,11 +8,13 @@ import {
|
||||
TextInput as RaTextInput,
|
||||
} from 'react-admin';
|
||||
import { equipmentStatusChoices, equipmentOptionText } from '../equipment/shared';
|
||||
import { StatusChangeAttachmentsInput } from './StatusChangeAttachmentsInput';
|
||||
|
||||
export function ChangeEquipmentStatusCreate() {
|
||||
return (
|
||||
<Create>
|
||||
<SimpleForm>
|
||||
<RaTextInput source="number" label="Номер" />
|
||||
<ReferenceInput source="equipmentId" reference="equipment">
|
||||
<AutocompleteInput
|
||||
label="Оборудование"
|
||||
@@ -20,10 +22,10 @@ export function ChangeEquipmentStatusCreate() {
|
||||
filterToQuery={(searchText) => ({ q: searchText })}
|
||||
/>
|
||||
</ReferenceInput>
|
||||
<SelectInput source="newStatus" label="Новый статус" choices={equipmentStatusChoices} required />
|
||||
<DateInput source="date" label="Дата" required />
|
||||
<RaTextInput source="number" label="Номер" />
|
||||
<RaTextInput source="responsible" label="Ответственный" />
|
||||
<DateInput source="date" label="Дата" required />
|
||||
<SelectInput source="newStatus" label="Новый статус" choices={equipmentStatusChoices} required />
|
||||
<StatusChangeAttachmentsInput />
|
||||
</SimpleForm>
|
||||
</Create>
|
||||
);
|
||||
|
||||
@@ -14,6 +14,7 @@ export function ChangeEquipmentStatusEdit() {
|
||||
return (
|
||||
<Edit>
|
||||
<SimpleForm>
|
||||
<RaTextInput source="number" label="Номер" />
|
||||
<ReferenceInput source="equipmentId" reference="equipment">
|
||||
<AutocompleteInput
|
||||
label="Оборудование"
|
||||
@@ -21,10 +22,9 @@ export function ChangeEquipmentStatusEdit() {
|
||||
filterToQuery={(searchText) => ({ q: searchText })}
|
||||
/>
|
||||
</ReferenceInput>
|
||||
<SelectInput source="newStatus" label="Новый статус" choices={equipmentStatusChoices} />
|
||||
<DateInput source="date" label="Дата" />
|
||||
<RaTextInput source="number" label="Номер" />
|
||||
<RaTextInput source="responsible" label="Ответственный" />
|
||||
<DateInput source="date" label="Дата" />
|
||||
<SelectInput source="newStatus" label="Новый статус" choices={equipmentStatusChoices} />
|
||||
<StatusChangeAttachmentsInput />
|
||||
</SimpleForm>
|
||||
</Edit>
|
||||
|
||||
@@ -32,7 +32,6 @@ export function ChangeEquipmentStatusList() {
|
||||
return (
|
||||
<List filters={statusFilters} actions={<ListActions />} sort={{ field: 'date', order: 'DESC' }}>
|
||||
<Datagrid rowClick="show">
|
||||
<TextField source="id" />
|
||||
<ReferenceField source="equipmentId" reference="equipment" link="show">
|
||||
<TextField source="name" />
|
||||
</ReferenceField>
|
||||
|
||||
Reference in New Issue
Block a user