From b62484dd3f3b3b3a07a037a597bd370fd563c439 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期二, 25 三月 2025 15:20:05 +0800 Subject: [PATCH] Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop --- rsf-admin/src/page/warehouseAreas/BatchModal.jsx | 63 +++++++++++++++++++++++++------ 1 files changed, 50 insertions(+), 13 deletions(-) diff --git a/rsf-admin/src/page/warehouseAreas/BatchModal.jsx b/rsf-admin/src/page/warehouseAreas/BatchModal.jsx index 34ebb10..1f64a7b 100644 --- a/rsf-admin/src/page/warehouseAreas/BatchModal.jsx +++ b/rsf-admin/src/page/warehouseAreas/BatchModal.jsx @@ -51,7 +51,7 @@ import { DataGrid } from '@mui/x-data-grid'; import StatusSelectInput from "../components/StatusSelectInput"; -const InitModal = ({ open, setOpen }) => { +const InitModal = ({ open, setOpen, fieldType }) => { const refresh = useRefresh(); const translate = useTranslate(); @@ -59,7 +59,9 @@ const notify = useNotify(); const [formData, setFormData] = useState({ - 'status': null + 'status': null, + 'wareId': null, + 'flagMix': null, }); const { selectedIds, onUnselectItems } = useListContext(); @@ -75,7 +77,9 @@ const reset = () => { setFormData({ - 'status': null + 'status': null, + 'wareId': null, + 'flagMix': null, }) } @@ -103,10 +107,10 @@ const handleSubmit = async () => { const parmas = { id: selectedIds, - matnr: removeEmptyKeys(formData) + ...removeEmptyKeys(formData) } - const res = await request.post(`/matnr/modify`, parmas); + const res = await request.post(`/warehouseAreas/modify`, parmas); if (res?.data?.code === 200) { handleClose() @@ -116,20 +120,53 @@ } return ( - <Dialog open={open} maxWidth="md" fullWidth> + <Dialog open={open} maxWidth="xs" fullWidth> <Form onSubmit={handleSubmit}> <DialogCloseButton onClose={handleClose} /> <DialogTitle>{translate('toolbar.batch')}</DialogTitle> <DialogContent sx={{ mt: 2 }}> <Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}> <Grid container spacing={2}> - <Grid item xs={4}> - <StatusSelectInput - onChange={(e) => handleChange(e.target.value, 'status')} - defaultValue={''} - require={false} - /> - </Grid> + {fieldType === 'status' && + <Grid item xs={6}> + <StatusSelectInput + onChange={(e) => handleChange(e.target.value, 'status')} + defaultValue={''} + require={false} + /> + </Grid> + } + {fieldType === 'flagMix' && + <Grid item xs={6}> + <SelectInput + label="table.field.warehouseAreas.flagMix" + source="flagMix" + validate={[required()]} + onChange={(e) => handleChange(e.target.value, 'flagMix')} + choices={[ + { id: 0, name: '鍚�' }, + { id: 1, name: '鏄�' }, + ]} + /> + </Grid> + } + {fieldType === 'wareId' && + <Grid item xs={6}> + <ReferenceInput + source="warehouseId" + reference="warehouse" + + > + <AutocompleteInput + onChange={(value) => handleChange(value, 'warehouseId')} + label="table.field.warehouseAreas.wareId" + optionText="name" + validate={[required()]} + filterToQuery={(val) => ({ name: val })} + /> + </ReferenceInput> + </Grid> + } </Grid> </Box> -- Gitblit v1.9.1