Merge branch 'dev' of http://47.97.1.152:5880/r/wms-master into dev
# Conflicts:
# rsf-admin/src/page/matnr/MatnrList.jsx
| | |
| | | dashboard: 'Dashboard', |
| | | basicInfo: 'BasicInfo', |
| | | settings: 'Settings', |
| | | basicInfo: 'BasicInfo', |
| | | system: 'System', |
| | | user: 'User', |
| | | role: 'Role', |
| | |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { Box, Typography, Card, Stack,LinearProgress } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import MatnrCreate from "./MatnrCreate"; |
| | | import MatnrPanel from "./MatnrPanel"; |
| | |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | import ImportButton from "../components/ImportButton"; |
| | | import MatListAside from './MatnrListAside'; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | <TextInput source="describle" label="table.field.matnr.describle" />, |
| | | <NumberInput source="nromNum" label="table.field.matnr.nromNum" />, |
| | | <TextInput source="unit" label="table.field.matnr.unit" />, |
| | | <TextInput source="purUnit" label="table.field.matnr.purUnit" />, |
| | | <TextInput source="purchaseUnit" label="table.field.matnr.purUnit" />, |
| | | <TextInput source="stockUnit" label="table.field.matnr.stockUnit" />, |
| | | <SelectInput source="stockLevel" label="table.field.matnr.stockLevel" |
| | | <SelectInput source="stockLeval" label="table.field.matnr.stockLevel" |
| | | choices={[ |
| | | { id: 0, name: ' A' }, |
| | | { id: 1, name: ' B' }, |
| | |
| | | />, |
| | | ] |
| | | |
| | | const MatnrList = () => { |
| | | const MatnrListContent = (props) => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const { isLoading } = useListContext(); |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | | <Box sx={{ position: 'relative' }}> |
| | | {isLoading && ( |
| | | <LinearProgress |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(['all'], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | height: "2px", |
| | | position: 'absolute', |
| | | top: 0, |
| | | left: 0, |
| | | right: 0, |
| | | }} |
| | | title={"menu.matnr"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='matnr' /> |
| | | <ImportButton /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | /> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='matnr' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | |
| | | <ReferenceField source="shipperId" label="table.field.matnr.shipperId" reference="shipper" link={false} sortable={false}> |
| | | <TextField source="name" /> |
| | | </ReferenceField> |
| | | <ReferenceField source="groupId" label="table.field.matnr.groupId" reference="matnrGroup" link={false} sortable={false}> |
| | | <ReferenceField source="groupId" label="table.field.matnr.groupId" reference="matnrGroup" link={false} sortable={false} alwaysOn> |
| | | <TextField source="code" /> |
| | | </ReferenceField> |
| | | <ReferenceField source="rglarId" label="table.field.matnr.rglarId" reference="rglarId" link={false} sortable={false}> |
| | |
| | | <TextField source="describle" label="table.field.matnr.describle" /> |
| | | <NumberField source="nromNum" label="table.field.matnr.nromNum" /> |
| | | <TextField source="unit" label="table.field.matnr.unit" /> |
| | | <TextField source="purUnit" label="table.field.matnr.purUnit" /> |
| | | <TextField source="purchaseUnit" label="table.field.matnr.purUnit" /> |
| | | <TextField source="stockUnit" label="table.field.matnr.stockUnit" /> |
| | | <TextField source="stockLeval$" label="table.field.matnr.stockLevel" sortable={false} /> |
| | | <TextField source="isLabelMange$" label="table.field.matnr.isLabelMange" sortable={false} /> |
| | |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </Box> |
| | | ); |
| | | |
| | | } |
| | | |
| | | const MatnrList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | | |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(['all'], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.matnr"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='matnr' /> |
| | | <ImportButton /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | aside={ <MatListAside /> } |
| | | > |
| | | <MatnrListContent /> |
| | | </List> |
| | | <MatnrCreate |
| | | open={createDialog} |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo, useCallback } from "react"; |
| | | import request from '@/utils/request'; |
| | | import { |
| | | SavedQueriesList, |
| | | FilterLiveSearch, |
| | | FilterList, |
| | | FilterListItem, |
| | | useStore, |
| | | FilterFormInput, |
| | | FilterLiveForm, |
| | | TextInput, |
| | | useGetList |
| | | } from 'react-admin'; |
| | | import BookmarkIcon from '@mui/icons-material/BookmarkBorder'; |
| | | import { Box, Typography, Card, CardContent, useTheme, TextField } from '@mui/material'; |
| | | import { RichTreeView } from "@mui/x-tree-view/RichTreeView"; |
| | | import { TreeItem2 } from "@mui/x-tree-view/TreeItem2"; |
| | | import WcIcon from '@mui/icons-material/Wc'; |
| | | import AccessTimeIcon from '@mui/icons-material/AccessTime'; |
| | | import { useForm, Controller } from "react-hook-form"; |
| | | |
| | | const MatListAside = () => { |
| | | const theme = useTheme(); |
| | | const treeData = [ |
| | | { |
| | | id: '0655', |
| | | label: '0655', |
| | | editable: true, |
| | | children: [ |
| | | { |
| | | id: 'grid-community', label: '@mui/x-data-grid', editable: true, children: [ |
| | | { id: 'grid-community22', label: '@mui/x-data-grid', editable: true },] |
| | | }, |
| | | { id: 'grid-pro', label: '@mui/x-data-grid-pro', editable: true }, |
| | | { id: 'grid-premium', label: '@mui/x-data-grid-premium', editable: true }, |
| | | ], |
| | | }, |
| | | { |
| | | id: 'pickers', |
| | | label: 'Date and Time pickers', |
| | | children: [ |
| | | { |
| | | id: 'pickers-community', |
| | | label: '@mui/x-date-pickers', |
| | | disabled: true, |
| | | }, |
| | | { id: 'pickers-pro', label: '@mui/x-date-pickers-pro', editable: true }, |
| | | ], |
| | | }, |
| | | { |
| | | id: 'charts', |
| | | label: 'Charts', |
| | | children: [{ id: 'charts-community', label: '@mui/x-charts' }], |
| | | }, |
| | | { |
| | | id: 'tree-view', |
| | | label: 'Tree View', |
| | | children: [{ id: 'tree-view-community', label: '@mui/x-tree-view' }], |
| | | }, |
| | | { |
| | | id: 'tree-view2', |
| | | label: 'Tree View3', |
| | | children: [{ id: 'tree-view-community1', label: '@mui/x-tree-view' }], |
| | | }, |
| | | ]; |
| | | |
| | | |
| | | |
| | | const CustomCheckbox = React.forwardRef(function CustomCheckbox(props, ref) { |
| | | return <input type="checkbox" ref={ref} {...props} />; |
| | | }); |
| | | |
| | | const CustomTreeItem = React.forwardRef(function CustomTreeItem(props, ref) { |
| | | return ( |
| | | <TreeItem2 |
| | | {...props} |
| | | ref={ref} |
| | | slots={{ |
| | | checkbox: CustomCheckbox, |
| | | }} |
| | | /> |
| | | ); |
| | | }); |
| | | |
| | | |
| | | return ( |
| | | <Card |
| | | sx={{ |
| | | display: { xs: 'none', md: 'block', }, |
| | | order: -1, |
| | | mr: 2, |
| | | mt: 8, |
| | | alignSelf: 'flex-start', |
| | | border: theme.palette.mode === 'light' && '1px solid #e0e0e3', |
| | | width: 250 |
| | | }} |
| | | > |
| | | <CardContent> |
| | | <SavedQueriesList icon={<BookmarkIcon />} /> |
| | | <FilterLiveSearch source='groupId' hiddenLabel /> |
| | | <RichTreeView |
| | | defaultExpandedItems={['grid', 'pickers']} |
| | | expansionTrigger="iconContainer" |
| | | items={ treeData } |
| | | slots={ CustomTreeItem } |
| | | /> |
| | | </CardContent> |
| | | </Card> |
| | | ) |
| | | } |
| | | |
| | | export default MatListAside; |