| | |
| | | const EditContent = ({ editRecord }) => { |
| | | const { resource } = useCreateContext(); |
| | | const translate = useTranslate(); |
| | | |
| | | const { update } = useFieldArray({ name: "parCode" }) |
| | | const formContext = useFormContext() |
| | | |
| | | const pChange = (val) => { |
| | | if (val > 0) { |
| | |
| | | const http = async (val) => { |
| | | const res = await request.post(`/matnrGroup/page`, { id: val }); |
| | | const code = res.data.data.records[0].code || '' |
| | | editRecord && (editRecord.parCode = code); |
| | | update(code) |
| | | |
| | | formContext.setValue('parCode', code) |
| | | |
| | | } |
| | | return ( |
| | | <Grid container rowSpacing={2} columnSpacing={2}> |
| | |
| | | <TextInput |
| | | label="table.field.matnrGroup.parCode" |
| | | source="parCode" |
| | | value={'11'} |
| | | readOnly |
| | | /> |
| | | </Grid> |
| | |
| | | disableRestoreFocus |
| | | maxWidth="md" // 'xs' | 'sm' | 'md' | 'lg' | 'xl' |
| | | > |
| | | <Form record={editRecord} onSubmit={onSubmit}> |
| | | <Form record={editRecord || {}} onSubmit={onSubmit}> |
| | | <DialogTitle id="form-dialog-title" sx={{ |
| | | position: 'sticky', |
| | | top: 0, |