From 14ddde5c41d8d98fc9b67ebae72b6cdbca73330b Mon Sep 17 00:00:00 2001
From: skyouc <creaycat@gmail.com>
Date: 星期五, 25 四月 2025 20:45:10 +0800
Subject: [PATCH] 添加动态字段拦截器

---
 rsf-admin/src/page/warehouseAreas/WarehouseAreasEdit.jsx |   30 +++++++++++++-----------------
 1 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/rsf-admin/src/page/warehouseAreas/WarehouseAreasEdit.jsx b/rsf-admin/src/page/warehouseAreas/WarehouseAreasEdit.jsx
index e197ebd..cb67494 100644
--- a/rsf-admin/src/page/warehouseAreas/WarehouseAreasEdit.jsx
+++ b/rsf-admin/src/page/warehouseAreas/WarehouseAreasEdit.jsx
@@ -42,6 +42,7 @@
 
 const WarehouseAreasEdit = () => {
     const translate = useTranslate();
+    const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_ware_areas_type')) || [];
 
     return (
         <Edit
@@ -58,8 +59,8 @@
                 defaultValues={{}}
             // validate={(values) => { }}
             >
-                <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}>
-                    <Grid item xs={12} md={8}>
+                <Grid container width={{ xs: '100%', xl: '100%' }} rowSpacing={3} columnSpacing={3}>
+                    <Grid item xs={16} md={10}>
                         <Typography variant="h6" gutterBottom>
                             {translate('common.edit.title.main')}
                         </Typography>
@@ -72,23 +73,27 @@
                                 autoFocus
                             />
                         </Stack> */}
-                        <Stack direction='row' gap={2}>
+                        <Stack xs={16} direction='row' gap={2}>
                             <TextInput
                                 label="table.field.warehouseAreas.name"
                                 source="name"
                                 validate={[required()]}
                                 parse={v => v}
                             />
-                        </Stack>
-                        <Stack direction='row' gap={2}>
                             <TextInput
                                 label="table.field.warehouseAreas.code"
                                 source="code"
                                 validate={[required()]}
                                 parse={v => v}
                             />
-                        </Stack>
-                        <Stack direction='row' gap={2}>
+                            <AutocompleteInput
+                                choices={dicts}
+                                optionText="label"
+                                label="table.field.asnOrder.type"
+                                source="type"
+                                optionValue="value"
+                                parse={v => v}
+                            />
                             <ReferenceInput
                                 source="warehouseId"
                                 reference="warehouse"
@@ -113,8 +118,6 @@
                                     filterToQuery={(val) => ({ name: val })}
                                 />
                             </ReferenceInput>
-                        </Stack>
-                        <Stack direction='row' gap={2}>
                             <ReferenceInput
                                 source="supplierId"
                                 reference="companys"
@@ -126,8 +129,6 @@
                                     filterToQuery={(val) => ({ name: val })}
                                 />
                             </ReferenceInput>
-                        </Stack>
-                        <Stack direction='row' gap={2}>
                             <SelectInput
                                 label="table.field.warehouseAreas.flagMinus"
                                 source="flagMinus"
@@ -137,8 +138,6 @@
                                     { id: 1, name: '鏄�' },
                                 ]}
                             />
-                        </Stack>
-                        <Stack direction='row' gap={2}>
                             <SelectInput
                                 label="table.field.warehouseAreas.flagLabelMange"
                                 source="flagLabelMange"
@@ -148,8 +147,6 @@
                                     { id: 1, name: ' 鏄�' },
                                 ]}
                             />
-                        </Stack>
-                        <Stack direction='row' gap={2}>
                             <SelectInput
                                 label="table.field.warehouseAreas.flagMix"
                                 source="flagMix"
@@ -160,9 +157,8 @@
                                 ]}
                             />
                         </Stack>
-
                     </Grid>
-                    <Grid item xs={12} md={4}>
+                    <Grid item xs={8} md={2}>
                         <Typography variant="h6" gutterBottom>
                             {translate('common.edit.title.common')}
                         </Typography>

--
Gitblit v1.9.1