From 384e2196a02471d972cb4516e70ffc0540729d9c Mon Sep 17 00:00:00 2001
From: lbq <1065079612@qq.com>
Date: 星期六, 07 二月 2026 10:53:15 +0800
Subject: [PATCH] 优化基础信息界面属性
---
rsf-admin/src/page/basicInfo/loc/LocCreate.jsx | 72 +++++++++++++++++++++++++++++------
1 files changed, 59 insertions(+), 13 deletions(-)
diff --git a/rsf-admin/src/page/basicInfo/loc/LocCreate.jsx b/rsf-admin/src/page/basicInfo/loc/LocCreate.jsx
index 0602179..e545f3a 100644
--- a/rsf-admin/src/page/basicInfo/loc/LocCreate.jsx
+++ b/rsf-admin/src/page/basicInfo/loc/LocCreate.jsx
@@ -16,6 +16,7 @@
useDataProvider,
useNotify,
Form,
+ SelectArrayInput,
useCreateController,
} from 'react-admin';
import {
@@ -30,13 +31,15 @@
import DialogCloseButton from "../../components/DialogCloseButton";
import StatusSelectInput from "../../components/StatusSelectInput";
import MemoInput from "../../components/MemoInput";
+import request from '@/utils/request';
+import DictionarySelect from "../../components/DictionarySelect";
const LocCreate = (props) => {
const { open, setOpen } = props;
+ const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_loc_type')) || [];
const translate = useTranslate();
const notify = useNotify();
-
const handleClose = (event, reason) => {
if (reason !== "backdropClick") {
setOpen(false);
@@ -51,6 +54,13 @@
const handleError = async (error) => {
notify(error.message || 'common.response.fail', { type: 'error', messageArgs: { _: error.message } });
};
+
+ const [warehouseId, setWrehouseId] = useState();
+
+ const warehouseChange = (val) => {
+ setWrehouseId(val)
+ }
+
return (
<>
@@ -86,13 +96,14 @@
<Grid container rowSpacing={2} columnSpacing={2}>
<Grid item xs={6} display="flex" gap={1}>
<ReferenceInput
- source="warehouseId$"
+ source="warehouseId"
reference="warehouse"
>
<AutocompleteInput
label="table.field.loc.warehouseId"
optionText="name"
validate={[required()]}
+ onChange={warehouseChange}
filterToQuery={(val) => ({ name: val })}
/>
</ReferenceInput>
@@ -101,6 +112,8 @@
<ReferenceInput
source="areaId"
reference="warehouseAreas"
+ sort={{ field: 'sort', order: 'ASC' }}
+ filter={{ warehouseId }}
>
<AutocompleteInput
label="table.field.loc.areaId"
@@ -119,7 +132,7 @@
/>
</Grid>
<Grid item xs={6} display="flex" gap={1}>
- <ReferenceInput
+ {/* <ReferenceInput
source="type"
reference="dictData"
filter={{ dictTypeCode: 'sys_loc_type' }}
@@ -131,7 +144,19 @@
parse={v => v}
validate={[required()]}
/>
- </ReferenceInput>
+ </ReferenceInput> */}
+ {/* <AutocompleteInput
+ choices={dicts}
+ source="type"
+ optionText="label"
+ label="table.field.loc.type"
+ optionValue="value"
+ parse={v => v}
+ validate={[required()]}
+ /> */}
+ <ReferenceArrayInput source="typeIds" reference="locType" >
+ <SelectArrayInput label="table.field.loc.type" validate={[required()]} />
+ </ReferenceArrayInput>
</Grid>
{/* <Grid item xs={6} display="flex" gap={1}>
<TextInput
@@ -140,7 +165,7 @@
parse={v => v}
/>
</Grid> */}
- <Grid item xs={6} display="flex" gap={1}>
+ {/* <Grid item xs={6} display="flex" gap={1}>
<NumberInput
label="table.field.loc.flagLogic"
source="flagLogic"
@@ -159,7 +184,7 @@
source="barcode"
parse={v => v}
/>
- </Grid>
+ </Grid> */}
{/* <Grid item xs={6} display="flex" gap={1}>
<TextInput
label="table.field.loc.unit"
@@ -174,7 +199,7 @@
parse={v => v}
/>
</Grid> */}
- <Grid item xs={6} display="flex" gap={1}>
+ {/* <Grid item xs={6} display="flex" gap={1}>
<NumberInput
label="table.field.loc.length"
source="length"
@@ -190,7 +215,7 @@
source="height"
validate={required()}
/>
- </Grid>
+ </Grid> */}
<Grid item xs={6} display="flex" gap={1}>
<NumberInput
label="table.field.loc.row"
@@ -212,10 +237,10 @@
<NumberInput
label="table.field.loc.channel"
source="channel"
- validate={required()}
+ // validate={required()}
/>
</Grid>
- <Grid item xs={6} display="flex" gap={1}>
+ {/* <Grid item xs={6} display="flex" gap={1}>
<NumberInput
label="table.field.loc.maxParts"
source="maxParts"
@@ -240,16 +265,37 @@
parse={v => v}
validate={required()}
/>
- </Grid>
-
+ </Grid> */}
<Grid item xs={6} display="flex" gap={1}>
+ <DictionarySelect
+ label={translate("table.field.loc.useStatus")}
+ name="useStatus"
+ size="small"
+ validate={[required()]}
+ dictTypeCode="sys_loc_use_stas"
+ />
+ {/* <ReferenceInput
+ source="useStatus"
+ reference="dictData"
+ filter={{ dictTypeCode: 'sys_loc_use_stas' }}
+ >
+ <AutocompleteInput
+ label="table.field.loc.useStatus"
+ optionText="label"
+ optionValue="value"
+ parse={v => v}
+ validate={[required()]}
+ />
+ </ReferenceInput> */}
+ </Grid>
+ {/* <Grid item xs={6} display="flex" gap={1}>
<StatusSelectInput />
</Grid>
<Grid item xs={12} display="flex" gap={1}>
<Stack direction="column" spacing={1} width={'100%'}>
<MemoInput />
</Stack>
- </Grid>
+ </Grid> */}
</Grid>
</DialogContent>
<DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}>
--
Gitblit v1.9.1