From 183d1e50c7b9a040e39eec36de81e5331aa7b31c Mon Sep 17 00:00:00 2001 From: verou <857149855@qq.com> Date: 星期三, 26 三月 2025 08:58:12 +0800 Subject: [PATCH] Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop --- rsf-admin/src/page/basicInfo/loc/InitModal.jsx | 53 +++++++++++++++++++++++++++++++---------------------- 1 files changed, 31 insertions(+), 22 deletions(-) diff --git a/rsf-admin/src/page/basicInfo/loc/InitModal.jsx b/rsf-admin/src/page/basicInfo/loc/InitModal.jsx index 80c6a2b..931b943 100644 --- a/rsf-admin/src/page/basicInfo/loc/InitModal.jsx +++ b/rsf-admin/src/page/basicInfo/loc/InitModal.jsx @@ -19,6 +19,7 @@ useCreateController, useListContext, useRefresh, + SelectArrayInput } from 'react-admin'; import { Dialog, @@ -60,8 +61,10 @@ const notify = useNotify(); + const [disabled, setDisabled] = useState(false) const [formData, setFormData] = useState({ + "warehouseId": null, "areaId": undefined, "endBay": undefined, "endLev": undefined, @@ -70,7 +73,8 @@ "startBay": undefined, "startLev": undefined, "startRow": undefined, - "type": "" + "type": "", + "typeIds": undefined, }); const handleClose = (event, reason) => { @@ -91,6 +95,7 @@ }; const handleSubmit = async () => { + setDisabled(true) const res = await request.post(`/loc/init`, formData); if (res?.data?.code === 200) { setOpen(false); @@ -98,6 +103,7 @@ } else { notify(res.data.msg); } + setDisabled(false) } @@ -111,8 +117,26 @@ <Grid container spacing={2}> <Grid item xs={4}> <ReferenceInput + source="warehouseId" + reference="warehouse" + > + <AutocompleteInput + label="table.field.loc.warehouseId" + optionText="name" + onChange={(value) => handleChange(value, 'warehouseId')} + value={formData.warehouseId} + validate={[required()]} + filterToQuery={(val) => ({ name: val })} + /> + </ReferenceInput> + + </Grid> + + <Grid item xs={4}> + <ReferenceInput source="areaId" reference="warehouseAreas" + filter={{ warehouseId: formData.warehouseId }} > <AutocompleteInput label="table.field.loc.areaId" @@ -126,27 +150,11 @@ </Grid> - <Grid item xs={4}> - <DictionarySelect - label={translate("table.field.loc.locType")} - name="locType" - value={formData.locType} - onChange={(e) => handleChange(e.target.value, 'locType')} - size="small" - dictTypeCode="sys_width_type" - /> - </Grid> <Grid item xs={4}> - <DictionarySelect - label={translate("table.field.loc.type")} - name="type" - value={formData.type} - onChange={(e) => handleChange(e.target.value, 'type')} - size="small" - validate={[required()]} - dictTypeCode="sys_loc_type" - /> + <ReferenceArrayInput source="typeIds" reference="locType" > + <SelectArrayInput label="table.field.loc.type" onChange={(e) => handleChange(e.target.value, 'typeIds')} validate={[required()]} /> + </ReferenceArrayInput> </Grid> <Grid item xs={4}> @@ -227,10 +235,11 @@ </DialogContent> <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}> <Box sx={{ width: '100%', display: 'flex', justifyContent: 'space-between' }}> - <Button type="submit" variant="contained" startIcon={<SaveIcon />}> - 纭 + <Button disabled={disabled} type="submit" variant="contained" startIcon={<SaveIcon />} > + {translate('toolbar.confirm')} </Button> </Box> + </DialogActions> </Form> </Dialog> -- Gitblit v1.9.1