From ef4e00d941103884eede0037c62a6739f68ed5d5 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期五, 21 三月 2025 13:06:59 +0800 Subject: [PATCH] Merge branch 'front' of http://47.97.1.152:5880/r/wms-master into front --- rsf-admin/src/page/basicInfo/loc/LocCreate.jsx | 50 +++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 43 insertions(+), 7 deletions(-) diff --git a/rsf-admin/src/page/basicInfo/loc/LocCreate.jsx b/rsf-admin/src/page/basicInfo/loc/LocCreate.jsx index 8d4bcf8..3f63d03 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,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; @@ -37,7 +40,6 @@ const translate = useTranslate(); const notify = useNotify(); - const handleClose = (event, reason) => { if (reason !== "backdropClick") { setOpen(false); @@ -52,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 ( <> @@ -87,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> @@ -102,6 +112,7 @@ <ReferenceInput source="areaId" reference="warehouseAreas" + filter={{ warehouseId }} > <AutocompleteInput label="table.field.loc.areaId" @@ -133,7 +144,7 @@ validate={[required()]} /> </ReferenceInput> */} - <AutocompleteInput + {/* <AutocompleteInput choices={dicts} source="type" optionText="label" @@ -141,7 +152,10 @@ optionValue="value" parse={v => v} validate={[required()]} - /> + /> */} + <ReferenceArrayInput source="typeIds" reference="locType" > + <SelectArrayInput label="table.field.loc.type" /> + </ReferenceArrayInput> </Grid> {/* <Grid item xs={6} display="flex" gap={1}> <TextInput @@ -150,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" @@ -169,7 +183,7 @@ source="barcode" parse={v => v} /> - </Grid> + </Grid> */} {/* <Grid item xs={6} display="flex" gap={1}> <TextInput label="table.field.loc.unit" @@ -218,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" @@ -250,8 +264,30 @@ 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" + 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