| | |
| | | import MatListAside from './MatnrListAside'; |
| | | import { display, height } from "@mui/system"; |
| | | import DashboardIcon from '@mui/icons-material/Dashboard'; |
| | | import EditIcon from '@mui/icons-material/Edit'; |
| | | import request from '@/utils/request'; |
| | | import BatchModal from './BatchModal'; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | width: '200px' |
| | | }, |
| | | '& .RaList-main': { |
| | | minHeight: '80vh' |
| | | minHeight: '90vh' |
| | | }, |
| | | '& .column-name': { |
| | | }, |
| | |
| | | const { isLoading } = useListContext(); |
| | | |
| | | return ( |
| | | <Box sx={{ position: 'relative', minHeight: "40vh", }}> |
| | | <Box sx={{ position: 'relative', minHeight: "60vh", }}> |
| | | {isLoading && ( |
| | | <LinearProgress |
| | | sx={{ |
| | |
| | | |
| | | <StyledDatagrid |
| | | preferenceKey='matnr' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | bulkActionButtons={<> <BatchButton /><BulkDeleteButton mutationMode={OPERATE_MODE} /></>} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <MatnrPanel />} |
| | | expandSingle={true} |
| | |
| | | |
| | | <TooltipField source="name" label="table.field.matnr.name" cellClassName="name" /> |
| | | <TextField source="code" label="table.field.matnr.code" /> |
| | | <ReferenceField source="shipperId" label="table.field.matnr.shipperId" reference="shipper" link={false} sortable={false}> |
| | | <TextField source="shipperId$" label="table.field.matnr.shipperId" /> |
| | | {/* <ReferenceField source="shipperId" label="table.field.matnr.shipperId" reference="shipper" link={false} sortable={false}> |
| | | <TextField source="name" /> |
| | | </ReferenceField> |
| | | </ReferenceField> */} |
| | | <ReferenceField source="groupId" label="table.field.matnr.groupId" reference="matnrGroup" link={false} sortable={false}> |
| | | <TextField source="name" /> |
| | | </ReferenceField> |
| | | <ReferenceField source="rglarId" label="table.field.matnr.rglarId" reference="batchRegular" link={false} sortable={false}> |
| | | {/* <ReferenceField source="rglarId" label="table.field.matnr.rglarId" reference="batchRegular" link={false} sortable={false}> |
| | | <TextField source="code" /> |
| | | </ReferenceField> |
| | | </ReferenceField> */} |
| | | <TextField source="platCode" label="table.field.matnr.platCode" /> |
| | | <TextField source="spec" label="table.field.matnr.spec" /> |
| | | <TextField source="model" label="table.field.matnr.model" /> |
| | |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='matnr' /> |
| | | <MatnrList.Context.Provider value={'matnr'}> |
| | | <ImportButton /> |
| | | </MatnrList.Context.Provider> |
| | | <ImportButton value={'matnr'} parmas={{}} /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | |
| | | </Button>) |
| | | |
| | | ) |
| | | } |
| | | |
| | | const BatchButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | |
| | | return ( |
| | | <> |
| | | <Button onClick={() => setCreateDialog(true)} label={"toolbar.batch"}> |
| | | <EditIcon /> |
| | | </Button> |
| | | |
| | | <BatchModal |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | </> |
| | | |
| | | ) |
| | | } |