| | |
| | | import ConfirmModal from "@/page/components/ConfirmModal"; |
| | | import { DataGrid } from '@mui/x-data-grid'; |
| | | import request from '@/utils/request'; |
| | | import { haveChildren } from '@/utils/common'; |
| | | |
| | | |
| | | const LocAreaMatPanel = () => { |
| | | const record = useRecordContext(); |
| | |
| | | } |
| | | |
| | | const [parmas, setParmas] = useState({ |
| | | current: 1, |
| | | pageSize: 99, |
| | | areaMatId: record.id, |
| | | locTypeId: '', |
| | | groupId: '', |
| | |
| | | const { data: { code, data, msg } } = await request.get(`/locAreaMatRela/groups/${record.id}`); |
| | | |
| | | if (code === 200) { |
| | | setMatnrTree(data || []) |
| | | setMatnrTree(haveChildren(data) || []) |
| | | } else { |
| | | notify(msg); |
| | | } |
| | |
| | | const { data: { code, data, msg } } = await request.get(`/locAreaMatRela/locType/${record.id}`); |
| | | |
| | | if (code === 200) { |
| | | setLocTree(data || []) |
| | | setLocTree(haveChildren(data) || []) |
| | | } else { |
| | | notify(msg); |
| | | } |
| | |
| | | disableColumnMenu={true} |
| | | disableColumnSorting |
| | | disableMultipleColumnsSorting |
| | | columnBufferPx={100} |
| | | initialState={{ |
| | | pagination: { |
| | | paginationModel: { |
| | | pageSize: 10, |
| | | }, |
| | | }, |
| | | }} |
| | | pageSizeOptions={[10]} |
| | | /> |
| | | </Grid> |
| | | </Grid> |
| | |
| | | const handleNodeSelect = (event, nodeId) => { |
| | | event.stopPropagation(); |
| | | parmas.groupId = nodeId; |
| | | parmas.locTypeId = ''; |
| | | setParmas(parmas) |
| | | reload() |
| | | }; |
| | |
| | | const handleNodeSelect = (event, nodeId) => { |
| | | event.stopPropagation(); |
| | | parmas.locTypeId = nodeId; |
| | | parmas.groupId = ''; |
| | | setParmas(parmas) |
| | | reload() |
| | | }; |