From b0932123072a837e376e64de2c3417f045462cc3 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期二, 08 四月 2025 17:27:32 +0800
Subject: [PATCH] 新增PDA一键收货功能

---
 rsf-admin/src/page/basicInfo/matnr/MatnrEdit.jsx |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/rsf-admin/src/page/basicInfo/matnr/MatnrEdit.jsx b/rsf-admin/src/page/basicInfo/matnr/MatnrEdit.jsx
index c86aeef..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([]);
@@ -87,6 +88,7 @@
         } = await request.get("/fields/enable/list");
         if (code === 200) {
             setDynamicFields(data || [])
+
 
         } else {
             notify(msg);
@@ -268,8 +270,8 @@
                                         <Grid key={item.id} item xs={6} display="flex" gap={1}>
                                             <TextInput
                                                 label={item.fieldsAlise}
-                                                source={`extendFields.[${item.fields}]`}
-                                                validate={required()}
+                                                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