From c46d1d8c3b9875f051a6ec3c4a1d3fa7bd32e5db Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期四, 15 五月 2025 17:15:21 +0800
Subject: [PATCH] 新增库存管理 新增库存明细

---
 rsf-admin/src/page/warehouseAreas/WarehouseAreasEdit.jsx |   74 +++++++++++++++++++++++-------------
 1 files changed, 47 insertions(+), 27 deletions(-)

diff --git a/rsf-admin/src/page/warehouseAreas/WarehouseAreasEdit.jsx b/rsf-admin/src/page/warehouseAreas/WarehouseAreasEdit.jsx
index a9a513e..bf62c7b 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,38 +59,58 @@
                 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>
-                        <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}>
+                        </Stack> */}
+                        <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}
                             />
+                            <AutocompleteInput
+                                choices={dicts}
+                                optionText="label"
+                                label="table.field.warehouseAreas.type"
+                                source="type"
+                                optionValue="value"
+                                parse={v => v}
+                            />
+                            <ReferenceInput
+                                source="warehouseId"
+                                reference="warehouse"
+                            >
+                                <AutocompleteInput
+                                    label="table.field.warehouseAreas.wareId"
+                                    optionText="name"
+                                    validate={[required()]}
+                                    filterToQuery={(val) => ({ name: val })}
+                                />
+                            </ReferenceInput>
                         </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"
@@ -97,48 +118,47 @@
                                     filterToQuery={(val) => ({ name: val })}
                                 />
                             </ReferenceInput>
-                        </Stack>
-                        <Stack direction='row' gap={2}>
-                            <NumberInput
-                                label="table.field.warehouseAreas.supplierId"
+                            <ReferenceInput
                                 source="supplierId"
-                            />
-                        </Stack>
-                        <Stack direction='row' gap={2}>
+                                reference="companys"
+                                filter={{ type: 'supplier' }}
+                            >
+                                <AutocompleteInput
+                                    label="table.field.warehouseAreas.supplierId"
+                                    optionText="name"
+                                    filterToQuery={(val) => ({ name: val })}
+                                />
+                            </ReferenceInput>
                             <SelectInput
                                 label="table.field.warehouseAreas.flagMinus"
                                 source="flagMinus"
+                                validate={[required()]}
                                 choices={[
                                     { id: 0, name: '鍚�' },
-                                    { id:  1, name: '鏄�' },
+                                    { id: 1, name: '鏄�' },
                                 ]}
                             />
-                        </Stack>
-                        <Stack direction='row' gap={2}>
                             <SelectInput
                                 label="table.field.warehouseAreas.flagLabelMange"
                                 source="flagLabelMange"
+                                validate={[required()]}
                                 choices={[
                                     { id: 0, name: ' 鍚�' },
-                                    { id:  1, name: ' 鏄�' },
+                                    { id: 1, name: ' 鏄�' },
                                 ]}
-                                validate={required()}
                             />
-                        </Stack>
-                        <Stack direction='row' gap={2}>
                             <SelectInput
                                 label="table.field.warehouseAreas.flagMix"
                                 source="flagMix"
+                                validate={[required()]}
                                 choices={[
                                     { id: 0, name: '鍚�' },
-                                    { id:  1, name: '鏄�' },
+                                    { id: 1, name: '鏄�' },
                                 ]}
-                                validate={required()}
                             />
                         </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