From fd02009741fbc7bc520000edb0c19afb6c27f29e Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期三, 07 一月 2026 15:46:49 +0800
Subject: [PATCH] #

---
 rsf-admin/src/page/warehouseAreas/WarehouseAreasEdit.jsx |  182 +++++++++++++++++++++++++++++++++++----------
 1 files changed, 140 insertions(+), 42 deletions(-)

diff --git a/rsf-admin/src/page/warehouseAreas/WarehouseAreasEdit.jsx b/rsf-admin/src/page/warehouseAreas/WarehouseAreasEdit.jsx
index a9a513e..aea80ce 100644
--- a/rsf-admin/src/page/warehouseAreas/WarehouseAreasEdit.jsx
+++ b/rsf-admin/src/page/warehouseAreas/WarehouseAreasEdit.jsx
@@ -28,6 +28,8 @@
 import CustomerTopToolBar from "../components/EditTopToolBar";
 import MemoInput from "../components/MemoInput";
 import StatusSelectInput from "../components/StatusSelectInput";
+import DictionarySelect from "../components/DictionarySelect";
+import DictSelect from "../components/DictSelect";
 
 const FormToolbar = () => {
     const { getValues } = useFormContext();
@@ -42,6 +44,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,38 +61,86 @@
                 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: '80%' }} rowSpacing={1} columnSpacing={3}>
+                    <Grid item xs={12} md={6} display="flex" flexDirection="column" gap={1} sx={{ '& .MuiFormControl-root': { mb: 0 } }}>
                         <Typography variant="h6" gutterBottom>
                             {translate('common.edit.title.main')}
                         </Typography>
-                        <Stack direction='row' gap={2}>
+                        {/* <Stack direction='row' gap={2}>
                             <TextInput
                                 label="table.field.warehouseAreas.uuid"
                                 source="uuid"
                                 parse={v => v}
+                                validate={[required()]}
                                 autoFocus
+                            />
+                        </Stack> */}
+                        <Stack direction='row' gap={2}>
+                            <ReferenceInput
+                                source="warehouseId"
+                                reference="warehouse"
+                                autoFocus
+                            >
+                                <AutocompleteInput
+                                    label="table.field.warehouseAreas.wareId"
+                                    optionText="name"
+                                    optionValue="id"
+                                    validate={[required()]}
+                                    filterToQuery={(val) => ({ name: val })}
+                                />
+                            </ReferenceInput>
+                        </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}>
                             <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"
-                                parse={v => v}
+                            <DictionarySelect
+                                label='table.field.warehouseAreas.type'
+                                name="type"
+                                dictTypeCode="sys_ware_areas_type"
+                                alwaysOn                                
                             />
                         </Stack>
                         <Stack direction='row' gap={2}>
+                            <SelectInput
+                                label="table.field.warehouseAreas.flagMix"
+                                source="flagMix"
+                                validate={[required()]}
+                                choices={[
+                                    { id: 0, name: '鍚�' },
+                                    { id: 1, name: '鏄�' },
+                                ]}
+                            />
+                        </Stack>
+                        <Stack direction='row' gap={2}>
+                            <SelectInput
+                                label="table.field.warehouseAreas.flagMinus"
+                                source="flagMinus"
+                                validate={[required()]}
+                                choices={[
+                                    { id: 0, name: '鍚�' },
+                                    { id: 1, name: '鏄�' },
+                                ]}
+                            />
+                        </Stack>
+                        {/* <Stack direction='row' gap={2}>
                             <ReferenceInput
                                 source="shipperId"
-                                reference="shipper"
-                                perPage={REFERENCE_INPUT_PAGESIZE}
+                                reference="companys"
+                                filter={{ type: 'shipper' }}
                             >
                                 <AutocompleteInput
                                     label="table.field.warehouseAreas.shipperId"
@@ -99,52 +150,99 @@
                             </ReferenceInput>
                         </Stack>
                         <Stack direction='row' gap={2}>
-                            <NumberInput
-                                label="table.field.warehouseAreas.supplierId"
+                            <ReferenceInput
                                 source="supplierId"
-                            />
+                                reference="companys"
+                                filter={{ type: 'supplier' }}
+                            >
+                                <AutocompleteInput
+                                    label="table.field.warehouseAreas.supplierId"
+                                    optionText="name"
+                                    filterToQuery={(val) => ({ name: val })}
+                                />
+                            </ReferenceInput>
                         </Stack>
                         <Stack direction='row' gap={2}>
-                            <SelectInput
-                                label="table.field.warehouseAreas.flagMinus"
-                                source="flagMinus"
-                                choices={[
-                                    { id: 0, name: '鍚�' },
-                                    { id:  1, name: '鏄�' },
-                                ]}
-                            />
+                            <StatusSelectInput />
                         </Stack>
                         <Stack direction='row' gap={2}>
-                            <SelectInput
-                                label="table.field.warehouseAreas.flagLabelMange"
-                                source="flagLabelMange"
-                                choices={[
-                                    { id: 0, name: ' 鍚�' },
-                                    { id:  1, name: ' 鏄�' },
-                                ]}
-                                validate={required()}
+                            <TextInput
+                                label="common.field.memo"
+                                source="memo"
+                                parse={v => v}
+                                multiline
                             />
-                        </Stack>
-                        <Stack direction='row' gap={2}>
-                            <SelectInput
-                                label="table.field.warehouseAreas.flagMix"
-                                source="flagMix"
-                                choices={[
-                                    { id: 0, name: '鍚�' },
-                                    { id:  1, name: '鏄�' },
-                                ]}
-                                validate={required()}
-                            />
-                        </Stack>
-
+                        </Stack> */}
                     </Grid>
-                    <Grid item xs={12} md={4}>
+                    {/* <Grid item xs={8} md={2}>
                         <Typography variant="h6" gutterBottom>
                             {translate('common.edit.title.common')}
                         </Typography>
                         <StatusSelectInput />
                         <Box mt="2em" />
                         <MemoInput />
+                    </Grid> */}
+                    <Grid item xs={12} md={6} display="flex" flexDirection="column" gap={1} sx={{ '& .MuiFormControl-root': { mb: 0 } }}>
+                        <Typography variant="h6" gutterBottom>
+                            &nbsp;
+                            {/* {translate('common.edit.title.main')} */}
+                        </Typography>
+                        <Stack direction='row' gap={2}>
+                            <ReferenceInput
+                                source="shipperId"
+                                reference="companys"
+                                filter={{ type: 'shipper' }}
+                            >
+                                <AutocompleteInput
+                                    label="table.field.warehouseAreas.shipperId"
+                                    optionText="name"
+                                    filterToQuery={(val) => ({ name: val })}
+                                />
+                            </ReferenceInput>
+                            {/* <SelectInput
+                                label="table.field.warehouseAreas.flagLabelMange"
+                                source="flagLabelMange"
+                                validate={[required()]}
+                                choices={[
+                                    { id: 0, name: ' 鍚�' },
+                                    { id: 1, name: ' 鏄�' },
+                                ]}
+                            /> */}
+                        </Stack>
+                        <Stack direction='row' gap={2}>
+                            <ReferenceInput
+                                source="supplierId"
+                                reference="companys"
+                                filter={{ type: 'supplier' }}
+                            >
+                                <AutocompleteInput
+                                    label="table.field.warehouseAreas.supplierId"
+                                    optionText="name"
+                                    filterToQuery={(val) => ({ name: val })}
+                                />
+                            </ReferenceInput>
+                        </Stack>
+                        <Stack direction='row' gap={2}>
+                            {/* <StatusSelectInput /> */}
+                            <SelectInput
+                                label="common.field.status"
+                                source="status"
+                                validate={[required()]}
+                                choices={[
+                                    { id: '1', name: 'common.enums.statusTrue' },
+                                    { id: '0', name: 'common.enums.statusFalse' },
+                                ]}
+                                resettable
+                            />
+                        </Stack>
+                        <Stack direction='row' gap={2}>
+                            <TextInput
+                                label="common.field.memo"
+                                source="memo"
+                                parse={v => v}
+                                multiline
+                            />
+                        </Stack>
                     </Grid>
                 </Grid>
             </SimpleForm>

--
Gitblit v1.9.1