From ea2904d7ca03b42f5783cd659fe71c0fbedd2277 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期一, 11 八月 2025 17:05:21 +0800 Subject: [PATCH] Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop --- rsf-admin/src/page/basicInfo/loc/BindModal.jsx | 72 ++++++++++++++++++++++------------- 1 files changed, 45 insertions(+), 27 deletions(-) diff --git a/rsf-admin/src/page/basicInfo/loc/BindModal.jsx b/rsf-admin/src/page/basicInfo/loc/BindModal.jsx index dac65d2..dcba413 100644 --- a/rsf-admin/src/page/basicInfo/loc/BindModal.jsx +++ b/rsf-admin/src/page/basicInfo/loc/BindModal.jsx @@ -24,9 +24,11 @@ Form, useCreateController, useListContext, + SearchInput, useRefresh, List, - SelectArrayInput + SelectArrayInput, + useListController } from 'react-admin'; import { Dialog, @@ -59,7 +61,7 @@ import StatusSelectInput from "../../components/StatusSelectInput"; import TreeSelectInput from "@/page/components/TreeSelectInput"; import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_ITEM_PAGE_SIZE } from '@/config/setting'; - +import ConfirmationNumber from '@mui/icons-material/ConfirmationNumber'; const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ '& .css-1vooibu-MuiSvgIcon-root': { @@ -72,20 +74,22 @@ }, })); +const filters = [ + <SearchInput source="condition" alwaysOn />, +] + const MatnrModal = ({ open, setOpen }) => { const refresh = useRefresh(); const translate = useTranslate(); const notify = useNotify(); - const [options, setOptions] = useState[{ - condition: null - }]; + const [formData, setFormData] = useState({ areaMatId: null, groupId: null, matnrId: null, }); - const { selectedIds, onUnselectItems } = useListContext(); + const { selectedIds, onUnselectItems, onSelectAll } = useListContext(); const handleClose = (event, reason) => { if (reason !== "backdropClick") { setOpen(false); @@ -146,14 +150,14 @@ } return ( - <Dialog open={open} maxWidth="xl" fullWidth> + <Dialog open={open} maxWidth="md" fullWidth> <Form onSubmit={handleSubmit}> <DialogCloseButton onClose={handleClose} /> <DialogTitle>{translate('toolbar.bindmatnr')}</DialogTitle> <DialogContent sx={{ mt: 2 }}> - <Box sx={{ display: 'flex', flexDirection: 'column', gap: 3, height: 700 }}> - <Grid container spacing={2}> - <Grid item xs={4}> + <Box sx={{ display: 'flex', flexDirection: 'column', gap: 3, height: 200 }}> + <Grid container spacing={3}> + <Grid item xs={3}> <ReferenceInput source="areaMatId" reference="locAreaMat" @@ -168,7 +172,7 @@ /> </ReferenceInput> </Grid> - <Grid item xs={4}> + <Grid item xs={3}> <TreeSelectInput label="table.field.locAreaMatRela.groupId" resource={'matnrGroup'} @@ -177,20 +181,20 @@ onChange={(e) => handleChange(e.target.value, 'groupId')} /> </Grid> - <Grid item xs={4}> - <TextInput></TextInput> - </Grid> - </Grid> - <Grid item xs={4}> - <List + <Grid item xs={3}> + {/* </Grid> */} + {/* <Grid item xs={4}> */} + {/* <List resource="matnr" filter={{ groupId: formData.groupId }} + storeKey="matnrSelectList" + filters={filters} empty={false} actions={<></>} > <StyledDatagrid preferenceKey='matnr' - bulkActionButtons={<></>} + bulkActionButtons={<> <SelectMatnrs></SelectMatnrs> </>} rowClick={false} omit={['id', 'createTime', 'createBy', 'memo', 'poDetlId', 'matnrId', 'asnId']} > @@ -213,14 +217,15 @@ <BooleanField key="statusBool" source="statusBool" label="common.field.status" sortable={false} />, <TextField key="memo" source="memo" label="common.field.memo" sortable={false} />, </StyledDatagrid> - </List> - {/* <ReferenceArrayInput source="matnrId" reference="matnr" filter={{ groupId: formData.groupId }}> - <SelectArrayInput - label="table.field.locAreaMatRela.matnrId" - value={formData.matnrId} - onChange={(e) => handleChange(e.target.value, 'matnrId')} - /> - </ReferenceArrayInput> */} + </List> */} + <ReferenceArrayInput source="matnrId" reference="matnr" filter={{ groupId: formData.groupId }}> + <SelectArrayInput + label="table.field.locAreaMatRela.matnrId" + value={formData.matnrId} + onChange={(e) => handleChange(e.target.value, 'matnrId')} + /> + </ReferenceArrayInput> + </Grid> </Grid> </Box> </DialogContent> @@ -236,4 +241,17 @@ ); } -export default MatnrModal; \ No newline at end of file +export default MatnrModal; + +const SelectMatnrs = () => { + const { selectedIds, data, isPending, onUnselectItems } = useListContext(); + const clickMatnrs = () => { + onUnselectItems() + } + + return ( + <Button label={"toolbar.confirmSelect"} onClick={clickMatnrs}> + <ConfirmationNumber /> + </Button> + ) +} -- Gitblit v1.9.1