From d0c039c4924ab4348d5a44738f8359ed8f622a74 Mon Sep 17 00:00:00 2001 From: verou <857149855@qq.com> Date: 星期一, 07 四月 2025 17:05:06 +0800 Subject: [PATCH] Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop --- rsf-admin/src/page/basicInfo/matnr/MatnrEdit.jsx | 22 +++++++++++++++++----- 1 files changed, 17 insertions(+), 5 deletions(-) diff --git a/rsf-admin/src/page/basicInfo/matnr/MatnrEdit.jsx b/rsf-admin/src/page/basicInfo/matnr/MatnrEdit.jsx index 96274af..ffec017 100644 --- a/rsf-admin/src/page/basicInfo/matnr/MatnrEdit.jsx +++ b/rsf-admin/src/page/basicInfo/matnr/MatnrEdit.jsx @@ -22,7 +22,7 @@ useNotify, } from 'react-admin'; import PropTypes from 'prop-types'; -import { useWatch, useFormContext } from "react-hook-form"; +import { useWatch, useFormContext, useForm, useFormState } from "react-hook-form"; import { Stack, Grid, Box, Typography, Tabs, Tab, } from '@mui/material'; import * as Common from '@/utils/common'; import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; @@ -33,7 +33,7 @@ import TreeSelectInput from "@/page/components/TreeSelectInput"; import request from '@/utils/request'; const FormToolbar = () => { - const { getValues } = useFormContext(); + const { getValues } = useFormState(); return ( <Toolbar sx={{ justifyContent: 'space-between' }}> <SaveButton /> @@ -74,6 +74,7 @@ const MatnrEdit = () => { const translate = useTranslate(); const [value, setValue] = React.useState(0); + const form = useForm(); const notify = useNotify(); const [dynamicFields, setDynamicFields] = useState([]); @@ -88,6 +89,7 @@ if (code === 200) { setDynamicFields(data || []) + } else { notify(msg); } @@ -100,7 +102,7 @@ redirect="list" mutationMode={EDIT_MODE} actions={<CustomerTopToolBar />} - aside={<EditBaseAside />} + title={"menu.matnr"} > <SimpleForm shouldUnregister @@ -144,7 +146,6 @@ <Grid item xs={6} display="flex" gap={1}> <ReferenceInput source="shipperId" reference="companys" filter={{ type: 'shipper' }}> <AutocompleteInput - validate={[required()]} label="table.field.matnr.shipperId" optionText="name" filterToQuery={(val) => ({ name: val })} @@ -255,7 +256,7 @@ <Grid item xs={6} display="flex" gap={1}> <SelectInput label="table.field.matnr.isLabelMange" - source="isLabelMange" + source="flagLabelMange" choices={[ { id: 0, name: ' 鍚�' }, { id: 1, name: ' 鏄�' }, @@ -270,6 +271,7 @@ <TextInput label={item.fieldsAlise} source={item.fields} + validate={item.unique === 1 ? required() : false} /> </Grid> ) @@ -318,6 +320,16 @@ source="valid" /> </Grid> + <Grid item xs={6} display="flex" gap={1}> + <SelectInput + label="table.field.matnr.flagCheck" + source="flagCheck" + choices={[ + { id: 0, name: ' 鍚�' }, + { id: 1, name: ' 鏄�' }, + ]} + /> + </Grid> </Grid> </CustomTabPanel> <CustomTabPanel value={value} index={2}> -- Gitblit v1.9.1