From c772d3422a7e74878ffe9360d4bc4f83c5034dac Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期一, 28 四月 2025 08:08:55 +0800
Subject: [PATCH] 任务完成问题修复
---
rsf-admin/src/page/basicInfo/loc/InitModal.jsx | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/rsf-admin/src/page/basicInfo/loc/InitModal.jsx b/rsf-admin/src/page/basicInfo/loc/InitModal.jsx
index a02d8b9..8704732 100644
--- a/rsf-admin/src/page/basicInfo/loc/InitModal.jsx
+++ b/rsf-admin/src/page/basicInfo/loc/InitModal.jsx
@@ -58,13 +58,15 @@
const InitModal = ({ open, setOpen }) => {
const refresh = useRefresh();
const translate = useTranslate();
-
+ const {filterValues} = useListContext(); // 鑾峰彇鍒楄〃涓婁笅鏂�
+
const notify = useNotify();
+ const [disabled, setDisabled] = useState(false)
const [formData, setFormData] = useState({
- "warehouseId": null,
- "areaId": undefined,
+ "warehouseId": filterValues.warehouseId,
+ "areaId": filterValues.areaId,
"endBay": undefined,
"endLev": undefined,
"endRow": undefined,
@@ -94,6 +96,7 @@
};
const handleSubmit = async () => {
+ setDisabled(true)
const res = await request.post(`/loc/init`, formData);
if (res?.data?.code === 200) {
setOpen(false);
@@ -101,12 +104,13 @@
} else {
notify(res.data.msg);
}
+ setDisabled(false)
}
return (
<Dialog open={open} maxWidth="md" fullWidth>
- <Form onSubmit={handleSubmit}>
+ <Form onSubmit={handleSubmit} defaultValues={filterValues}>
<DialogCloseButton onClose={handleClose} />
<DialogTitle>{translate('toolbar.locInit')}</DialogTitle>
<DialogContent sx={{ mt: 2 }}>
@@ -118,6 +122,7 @@
reference="warehouse"
>
<AutocompleteInput
+ debounce
label="table.field.loc.warehouseId"
optionText="name"
onChange={(value) => handleChange(value, 'warehouseId')}
@@ -150,8 +155,11 @@
<Grid item xs={4}>
<ReferenceArrayInput source="typeIds" reference="locType" >
- <SelectArrayInput label="table.field.loc.type" onChange={(e) => handleChange(e.target.value, 'typeIds')} />
+ <SelectArrayInput label="table.field.loc.type" validate={[required()]} onChange={(e) => handleChange(e.target.value, 'typeIds')} />
</ReferenceArrayInput>
+ {/* <ReferenceArrayInput source="typeIds" reference="dictData" filter={{}}>
+ <SelectArrayInput label="table.field.loc.type" onChange={(e) => handleChange(e.target.value, 'typeIds')} validate={[required()]} />
+ </ReferenceArrayInput> */}
</Grid>
<Grid item xs={4}>
@@ -232,10 +240,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