|  |  |  | 
|---|
|  |  |  | DeleteButton, | 
|---|
|  |  |  | useRefresh, | 
|---|
|  |  |  | Button, | 
|---|
|  |  |  | useList | 
|---|
|  |  |  | useList, | 
|---|
|  |  |  | } from 'react-admin'; | 
|---|
|  |  |  | import { Box, Typography, Card, Stack } from '@mui/material'; | 
|---|
|  |  |  | import { styled } from '@mui/material/styles'; | 
|---|
|  |  |  | import LocCreate from "./LocCreate"; | 
|---|
|  |  |  | import MatnrModal from "./MatnrModal"; | 
|---|
|  |  |  | import BindModal from "./BindModal"; | 
|---|
|  |  |  | import EmptyData from "../../components/EmptyData"; | 
|---|
|  |  |  | import DynamicField from "../../components/DynamicField"; | 
|---|
|  |  |  | import MyCreateButton from "../../components/MyCreateButton"; | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | '& .RaDatagrid-headerCell': { | 
|---|
|  |  |  | textAlign: 'left' | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | '& .RaDatagrid-rowCell': { | 
|---|
|  |  |  | textAlign: 'left' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | })); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const filters = [ | 
|---|
|  |  |  | <SearchInput source="condition" alwaysOn />, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <TextInput source="warehouseId$" label="table.field.loc.warehouseId" />, | 
|---|
|  |  |  | <TextInput source="areaId$" label="table.field.loc.areaId" />, | 
|---|
|  |  |  | <ReferenceInput | 
|---|
|  |  |  | source="warehouseId" | 
|---|
|  |  |  | label="table.field.loc.warehouseId" | 
|---|
|  |  |  | reference="warehouse" | 
|---|
|  |  |  | alwaysOn | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <AutocompleteInput | 
|---|
|  |  |  | label="table.field.loc.warehouseId" | 
|---|
|  |  |  | optionText="name" | 
|---|
|  |  |  | filterToQuery={(val) => ({ name: val })} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </ReferenceInput>, | 
|---|
|  |  |  | <ReferenceInput | 
|---|
|  |  |  | source="areaId" | 
|---|
|  |  |  | label="table.field.loc.areaId" | 
|---|
|  |  |  | reference="warehouseAreas" | 
|---|
|  |  |  | alwaysOn | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <AutocompleteInput | 
|---|
|  |  |  | label="table.field.loc.areaId" | 
|---|
|  |  |  | optionText="name" | 
|---|
|  |  |  | filterToQuery={(val) => ({ name: val })} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </ReferenceInput>, | 
|---|
|  |  |  | <TextInput source="code" label="table.field.loc.code" />, | 
|---|
|  |  |  | <TextInput source="type" label="table.field.loc.type" />, | 
|---|
|  |  |  | <TextInput source="name" label="table.field.loc.name" />, | 
|---|
|  |  |  | 
|---|
|  |  |  | bulkActionButtons={ | 
|---|
|  |  |  | <> | 
|---|
|  |  |  | <BatchButton /> | 
|---|
|  |  |  | <MatnrButton /> | 
|---|
|  |  |  | <BindButton /> | 
|---|
|  |  |  | <SubzoneButton /> | 
|---|
|  |  |  | <BulkDeleteButton /> | 
|---|
|  |  |  | </> | 
|---|
|  |  |  | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const MatnrButton = () => { | 
|---|
|  |  |  | const BindButton = () => { | 
|---|
|  |  |  | const record = useRecordContext(); | 
|---|
|  |  |  | const notify = useNotify(); | 
|---|
|  |  |  | const refresh = useRefresh(); | 
|---|
|  |  |  | 
|---|
|  |  |  | <LinkIcon /> | 
|---|
|  |  |  | </Button> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <MatnrModal | 
|---|
|  |  |  | <BindModal | 
|---|
|  |  |  | open={createDialog} | 
|---|
|  |  |  | setOpen={setCreateDialog} | 
|---|
|  |  |  | /> | 
|---|