From ce2e0f216e22cc43a46e126b05609d23bb987539 Mon Sep 17 00:00:00 2001
From: verou <857149855@qq.com>
Date: 星期五, 21 三月 2025 13:35:00 +0800
Subject: [PATCH] fix:库位初始修改

---
 rsf-admin/src/page/basicInfo/loc/InitModal.jsx |   31 ++++++++++++++++++++-----------
 1 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/rsf-admin/src/page/basicInfo/loc/InitModal.jsx b/rsf-admin/src/page/basicInfo/loc/InitModal.jsx
index eab60e8..a02d8b9 100644
--- a/rsf-admin/src/page/basicInfo/loc/InitModal.jsx
+++ b/rsf-admin/src/page/basicInfo/loc/InitModal.jsx
@@ -63,6 +63,7 @@
     const notify = useNotify();
 
     const [formData, setFormData] = useState({
+        "warehouseId": null,
         "areaId": undefined,
         "endBay": undefined,
         "endLev": undefined,
@@ -113,8 +114,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,16 +147,6 @@
 
                             </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" >
@@ -224,7 +233,7 @@
                 <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 />}>
-                            纭
+                            {translate('toolbar.confirm')}
                         </Button>
                     </Box>
                 </DialogActions>

--
Gitblit v1.9.1