|  |  | 
 |  |  |     NumberField, | 
 |  |  |     required, | 
 |  |  |     useRecordContext, | 
 |  |  |     useGetRecordId, | 
 |  |  |     useGetOne, | 
 |  |  |     DeleteButton, | 
 |  |  | } from 'react-admin'; | 
 |  |  | import { useWatch, useFormContext } from "react-hook-form"; | 
 |  |  | import { Stack, Grid, Box, Typography } from '@mui/material'; | 
 |  |  | import * as Common from '@/utils/common'; | 
 |  |  | import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; | 
 |  |  | import EditBaseAside from "@/page/components/EditBaseAside"; | 
 |  |  | import CustomerTopToolBar from "@/page/components/EditTopToolBar"; | 
 |  |  | import MemoInput from "@/page/components/MemoInput"; | 
 |  |  | import StatusSelectInput from "@/page/components/StatusSelectInput"; | 
 |  |  | import CustomerTopToolBar from "@/page/components/EditTopToolBar"; | 
 |  |  | import { Stack, Grid, Box, Typography } from '@mui/material'; | 
 |  |  | import EditBaseAside from "@/page/components/EditBaseAside"; | 
 |  |  | import { useWatch, useFormContext } from "react-hook-form"; | 
 |  |  | import MemoInput from "@/page/components/MemoInput"; | 
 |  |  | import ReviseLogList from "./ReviseLogList"; | 
 |  |  | import * as Common from '@/utils/common'; | 
 |  |  |  | 
 |  |  |  | 
 |  |  | const LocReviseEdit = () => { | 
 |  |  |     const translate = useTranslate(); | 
 |  |  |     const [disabled, setDisabled] = useState(false); | 
 |  |  |  | 
 |  |  |     const orderId = useGetRecordId(); | 
 |  |  |     const {data, isPending} =  useGetOne("locRevise", {id: orderId}); | 
 |  |  |     console.log(data); | 
 |  |  |  | 
 |  |  |     const FormToolbar = () => { | 
 |  |  |         return ( | 
 |  |  | 
 |  |  |                 <SimpleForm | 
 |  |  |                     shouldUnregister | 
 |  |  |                     warnWhenUnsavedChanges | 
 |  |  |                     toolbar={<FormToolbar />} | 
 |  |  |                     toolbar={false} | 
 |  |  |                     mode="onTouched" | 
 |  |  |                     sx={{ | 
 |  |  |                         "& .MuiFormLabel-root.MuiInputLabel-root.Mui-disabled": { | 
 |  |  |                             bgcolor: 'white', | 
 |  |  |                             WebkitTextFillColor: "rgba(0, 0, 0)" | 
 |  |  |                         }, | 
 |  |  |  | 
 |  |  |                         "& .MuiInputBase-input.MuiFilledInput-input.Mui-disabled": { | 
 |  |  |                             bgcolor: 'white', | 
 |  |  |                             WebkitTextFillColor: "rgba(0, 0, 0)" | 
 |  |  |                         } | 
 |  |  |                     }} | 
 |  |  |                     defaultValues={{}} | 
 |  |  |                     // sx={{ | 
 |  |  |                     //     "& .MuiFormLabel-root.MuiInputLabel-root.Mui-disabled": { | 
 |  |  | 
 |  |  |                                     label="table.field.locRevise.type" | 
 |  |  |                                     source="type" | 
 |  |  |                                     choices={[ | 
 |  |  |                                         { id: 0, name: ' 库存调整' }, | 
 |  |  |                                         { id: 1, name: ' 库存调整' }, | 
 |  |  |                                         { id: 2, name: ' 盘点调整' }, | 
 |  |  |                                     ]} | 
 |  |  |                                     readOnly | 
 |  |  |                                 /> | 
 |  |  |                                 <NumberInput | 
 |  |  |                                     label="table.field.locRevise.anfme" | 
 |  |  |                                     source="anfme" | 
 |  |  |                                     readOnly | 
 |  |  |                                 /> | 
 |  |  |                             </Stack> | 
 |  |  |                             <Stack direction='row' gap={2}> | 
 |  |  |                                 <NumberInput | 
 |  |  |                                     label="table.field.locRevise.reviseQty" | 
 |  |  |                                     source="reviseQty" | 
 |  |  |                                     readOnly | 
 |  |  |                                 /> | 
 |  |  |                                 <SelectInput | 
 |  |  |                                     label="table.field.locRevise.exceStatus" | 
 |  |  | 
 |  |  |                                         { id: 1, name: '执行中' }, | 
 |  |  |                                         { id: 2, name: '执行完成' }, | 
 |  |  |                                     ]} | 
 |  |  |                                     readOnly | 
 |  |  |                                 /> | 
 |  |  |                                 <TextInput | 
 |  |  |                                     label="table.field.locRevise.areaName" | 
 |  |  |                                     source="orgAreaName" | 
 |  |  |                                     source="areaName" | 
 |  |  |                                     parse={v => v} | 
 |  |  |                                     readOnly | 
 |  |  |                                 /> | 
 |  |  |                             </Stack> | 
 |  |  |                         </Grid> | 
 |  |  |                     </Grid> | 
 |  |  |                 </SimpleForm> | 
 |  |  |             </Edit > | 
 |  |  |             <ReviseLogList /> | 
 |  |  |             <ReviseLogList record = {data}/> | 
 |  |  |         </> | 
 |  |  |     ) | 
 |  |  | } |