From 1d71e8d6e37f7e992c9db9a77b9be86cb240afa1 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期五, 18 四月 2025 11:00:28 +0800
Subject: [PATCH] #修改 1. 收货通知单导入报错问题修复
---
rsf-admin/src/page/basicInfo/loc/InitModal.jsx | 40 ++++++++++++++++++++++++++++------------
1 files changed, 28 insertions(+), 12 deletions(-)
diff --git a/rsf-admin/src/page/basicInfo/loc/InitModal.jsx b/rsf-admin/src/page/basicInfo/loc/InitModal.jsx
index a677559..7d7ee4b 100644
--- a/rsf-admin/src/page/basicInfo/loc/InitModal.jsx
+++ b/rsf-admin/src/page/basicInfo/loc/InitModal.jsx
@@ -61,8 +61,10 @@
const notify = useNotify();
+ const [disabled, setDisabled] = useState(false)
const [formData, setFormData] = useState({
+ "warehouseId": null,
"areaId": undefined,
"endBay": undefined,
"endLev": undefined,
@@ -93,6 +95,7 @@
};
const handleSubmit = async () => {
+ setDisabled(true)
const res = await request.post(`/loc/init`, formData);
if (res?.data?.code === 200) {
setOpen(false);
@@ -100,6 +103,7 @@
} else {
notify(res.data.msg);
}
+ setDisabled(false)
}
@@ -113,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"
@@ -128,21 +150,14 @@
</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}>
<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}>
@@ -223,10 +238,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