|  |  |  | 
|---|
|  |  |  | import { display, height, width } from "@mui/system"; | 
|---|
|  |  |  | import DashboardIcon from '@mui/icons-material/Dashboard'; | 
|---|
|  |  |  | import EditIcon from '@mui/icons-material/Edit'; | 
|---|
|  |  |  | import PrintIcon from '@mui/icons-material/Print'; | 
|---|
|  |  |  | import request from '@/utils/request'; | 
|---|
|  |  |  | import BatchModal from './BatchModal'; | 
|---|
|  |  |  | import PrintModal from './PrintModal'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ | 
|---|
|  |  |  | '& .css-1vooibu-MuiSvgIcon-root': { | 
|---|
|  |  |  | 
|---|
|  |  |  | <TextField key="purchaseUnit" source="purchaseUnit" label="table.field.matnr.purUnit" />, | 
|---|
|  |  |  | <TextField key="stockUnit" source="stockUnit" label="table.field.matnr.stockUnit" />, | 
|---|
|  |  |  | <TextField key="stockLeval$" source="stockLeval$" label="table.field.matnr.stockLevel" sortable={false} />, | 
|---|
|  |  |  | <TextField key="isLabelMange$" source="isLabelMange$" label="table.field.matnr.isLabelMange" sortable={false} />, | 
|---|
|  |  |  | <TextField key="flagLabelMange$" source="flagLabelMange$" label="table.field.matnr.isLabelMange" sortable={false} />, | 
|---|
|  |  |  | <NumberField key="safeQty" source="safeQty" label="table.field.matnr.safeQty" />, | 
|---|
|  |  |  | <NumberField key="minQty" source="minQty" label="table.field.matnr.minQty" />, | 
|---|
|  |  |  | <NumberField key="maxQty" source="maxQty" label="table.field.matnr.maxQty" />, | 
|---|
|  |  |  | 
|---|
|  |  |  | <BooleanField key="statusBool" source="statusBool" label="common.field.status" sortable={false} />, | 
|---|
|  |  |  | <TextField key="memo" source="memo" label="common.field.memo" sortable={false} />, | 
|---|
|  |  |  | ] | 
|---|
|  |  |  | const fields = data.map(el => <TextField key={el.fields} source={el.fields} label={el.fieldsAlise} />) | 
|---|
|  |  |  | const fields = data.map(el => <TextField key={el.fields} source={`extendFields.[${el.fields}]`} label={el.fieldsAlise} />) | 
|---|
|  |  |  | const opt = <WrapperField key="opt" cellClassName="opt" label="common.field.opt"> | 
|---|
|  |  |  | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> | 
|---|
|  |  |  | <EnableButton /> | 
|---|
|  |  |  | 
|---|
|  |  |  | {columns.length > 0 && | 
|---|
|  |  |  | <StyledDatagrid | 
|---|
|  |  |  | preferenceKey='matnr' | 
|---|
|  |  |  | bulkActionButtons={<> <BatchButton /><BulkDeleteButton mutationMode={OPERATE_MODE} /></>} | 
|---|
|  |  |  | bulkActionButtons={<> | 
|---|
|  |  |  | <BatchButton /> | 
|---|
|  |  |  | <PrintButton /> | 
|---|
|  |  |  | <BulkDeleteButton mutationMode={OPERATE_MODE} /> | 
|---|
|  |  |  | </>} | 
|---|
|  |  |  | rowClick={(id, resource, record) => false} | 
|---|
|  |  |  | omit={['id', 'shipperId', 'platCode', 'spec', 'model', 'weight', 'color', 'describle' | 
|---|
|  |  |  | , 'nromNum', 'unit', 'purchaseUnit', 'stockUnit', 'stockLeval', 'isLabelMange', 'safeQty' | 
|---|
|  |  |  | , 'minQty', 'maxQty', 'stagn', 'valid', 'validWarn', 'flagCheck', 'updateTime', 'updateBy' | 
|---|
|  |  |  | , 'createTime', 'createBy', 'memo', 'rglarId', 'groupId', 'stockLevel', 'isLabelMange']} | 
|---|
|  |  |  | , 'createTime', 'createBy', 'memo', 'rglarId', 'groupId', 'stockLevel']} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | {columns.map((column) => column)} | 
|---|
|  |  |  | </StyledDatagrid>} | 
|---|
|  |  |  | 
|---|
|  |  |  | </> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const PrintButton = () => { | 
|---|
|  |  |  | const record = useRecordContext(); | 
|---|
|  |  |  | const notify = useNotify(); | 
|---|
|  |  |  | const refresh = useRefresh(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const [createDialog, setCreateDialog] = useState(false); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | <> | 
|---|
|  |  |  | <Button color="secondary" onClick={() => setCreateDialog(true)} label={"toolbar.print"}> | 
|---|
|  |  |  | <PrintIcon /> | 
|---|
|  |  |  | </Button> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <PrintModal | 
|---|
|  |  |  | open={createDialog} | 
|---|
|  |  |  | setOpen={setCreateDialog} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | } | 
|---|