From 3cea95e98c16b2fe15dec2820c3e714b8ce6b926 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期一, 01 九月 2025 15:21:00 +0800
Subject: [PATCH] 添加跑库限制
---
rsf-admin/src/page/basicInfo/loc/LocCreate.jsx | 45 +++++++++++++++++++++++++++++++++++++++------
1 files changed, 39 insertions(+), 6 deletions(-)
diff --git a/rsf-admin/src/page/basicInfo/loc/LocCreate.jsx b/rsf-admin/src/page/basicInfo/loc/LocCreate.jsx
index df6e281..23465f9 100644
--- a/rsf-admin/src/page/basicInfo/loc/LocCreate.jsx
+++ b/rsf-admin/src/page/basicInfo/loc/LocCreate.jsx
@@ -31,6 +31,8 @@
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;
@@ -38,7 +40,6 @@
const translate = useTranslate();
const notify = useNotify();
-
const handleClose = (event, reason) => {
if (reason !== "backdropClick") {
setOpen(false);
@@ -53,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 (
<>
@@ -88,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>
@@ -103,6 +112,7 @@
<ReferenceInput
source="areaId"
reference="warehouseAreas"
+ filter={{ warehouseId }}
>
<AutocompleteInput
label="table.field.loc.areaId"
@@ -144,7 +154,7 @@
validate={[required()]}
/> */}
<ReferenceArrayInput source="typeIds" reference="locType" >
- <SelectArrayInput label="table.field.loc.type" />
+ <SelectArrayInput label="table.field.loc.type" validate={[required()]} />
</ReferenceArrayInput>
</Grid>
{/* <Grid item xs={6} display="flex" gap={1}>
@@ -154,7 +164,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"
@@ -173,7 +183,7 @@
source="barcode"
parse={v => v}
/>
- </Grid>
+ </Grid> */}
{/* <Grid item xs={6} display="flex" gap={1}>
<TextInput
label="table.field.loc.unit"
@@ -222,7 +232,7 @@
validate={required()}
/>
</Grid>
- <Grid item xs={6} display="flex" gap={1}>
+ {/* <Grid item xs={6} display="flex" gap={1}>
<NumberInput
label="table.field.loc.channel"
source="channel"
@@ -254,8 +264,31 @@
parse={v => v}
validate={required()}
/>
+ </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>
--
Gitblit v1.9.1