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 | 158 ++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 122 insertions(+), 36 deletions(-)
diff --git a/rsf-admin/src/page/warehouseAreas/WarehouseAreasEdit.jsx b/rsf-admin/src/page/warehouseAreas/WarehouseAreasEdit.jsx
index 175500a..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,8 +61,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: '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>
@@ -73,12 +76,19 @@
/>
</Stack> */}
<Stack direction='row' gap={2}>
- <TextInput
- label="table.field.warehouseAreas.name"
- source="name"
- validate={[required()]}
- parse={v => v}
- />
+ <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
@@ -89,10 +99,47 @@
/>
</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}>
+ <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="companys"
- perPage={REFERENCE_INPUT_PAGESIZE}
filter={{ type: 'shipper' }}
>
<AutocompleteInput
@@ -116,18 +163,43 @@
</ReferenceInput>
</Stack>
<Stack direction='row' gap={2}>
- <SelectInput
- label="table.field.warehouseAreas.flagMinus"
- source="flagMinus"
- validate={[required()]}
- choices={[
- { id: 0, name: '鍚�' },
- { id: 1, name: '鏄�' },
- ]}
- />
+ <StatusSelectInput />
</Stack>
<Stack direction='row' gap={2}>
- <SelectInput
+ <TextInput
+ label="common.field.memo"
+ source="memo"
+ parse={v => v}
+ multiline
+ />
+ </Stack> */}
+ </Grid>
+ {/* <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>
+
+ {/* {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()]}
@@ -135,28 +207,42 @@
{ 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}>
- <SelectInput
- label="table.field.warehouseAreas.flagMix"
- source="flagMix"
- validate={[required()]}
- choices={[
- { id: 0, name: '鍚�' },
- { id: 1, name: '鏄�' },
- ]}
+ <TextInput
+ label="common.field.memo"
+ source="memo"
+ parse={v => v}
+ multiline
/>
</Stack>
-
- </Grid>
- <Grid item xs={12} md={4}>
- <Typography variant="h6" gutterBottom>
- {translate('common.edit.title.common')}
- </Typography>
- <StatusSelectInput />
- <Box mt="2em" />
- <MemoInput />
</Grid>
</Grid>
</SimpleForm>
--
Gitblit v1.9.1