verou
2025-04-10 34079a90f7fbdd0f1c47aeb75588628ebf21f15a
rsf-admin/src/page/waitPakinLog/WaitPakinLogEdit.jsx
@@ -28,12 +28,13 @@
import CustomerTopToolBar from "../components/EditTopToolBar";
import MemoInput from "../components/MemoInput";
import StatusSelectInput from "../components/StatusSelectInput";
import WaitPakinItemLogList from "./WaitPakinItemLogList";
const FormToolbar = () => {
    const { getValues } = useFormContext();
    return (
        <Toolbar sx={{ justifyContent: 'space-between' }}>
        <Toolbar sx={{ justifyContent: 'end' }}>
            <SaveButton />
            <DeleteButton mutationMode="optimistic" />
        </Toolbar>
@@ -44,76 +45,62 @@
    const translate = useTranslate();
    return (
        <Edit
            redirect="list"
            mutationMode={EDIT_MODE}
            actions={<CustomerTopToolBar />}
            aside={<EditBaseAside />}
        >
            <SimpleForm
                shouldUnregister
                warnWhenUnsavedChanges
                toolbar={<FormToolbar />}
                mode="onTouched"
                defaultValues={{}}
            // validate={(values) => { }}
        <>
            <Edit
                redirect="list"
                mutationMode={EDIT_MODE}
                actions={<CustomerTopToolBar />}
                aside={<EditBaseAside />}
            >
                <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}>
                    <Grid item xs={12} md={8}>
                        <Typography variant="h6" gutterBottom>
                            {translate('common.edit.title.main')}
                        </Typography>
                        <Stack direction='row' gap={2}>
                            <NumberInput
                                label="table.field.waitPakinLog.pakinId"
                                source="pakinId"
                                autoFocus
                            />
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <TextInput
                                label="table.field.waitPakinLog.code"
                                source="code"
                                parse={v => v}
                            />
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <TextInput
                                label="table.field.waitPakinLog.barcode"
                                source="barcode"
                                parse={v => v}
                            />
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <NumberInput
                                label="table.field.waitPakinLog.anfme"
                                source="anfme"
                            />
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <SelectInput
                                label="table.field.waitPakinLog.ioStatus"
                                source="ioStatus"
                                choices={[
                                    { id: 0, name: '待入库' },
                                    { id:  1, name: ' 入库中' },
                                ]}
                                validate={required()}
                            />
                        </Stack>
                <SimpleForm
                    shouldUnregister
                    warnWhenUnsavedChanges
                    toolbar={<FormToolbar />}
                    mode="onTouched"
                    defaultValues={{}}
                // validate={(values) => { }}
                >
                    <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}>
                        <Grid item xs={24} md={12}>
                            <Typography variant="h6" gutterBottom>
                                {translate('common.edit.title.main')}
                            </Typography>
                            <Stack direction='row' gap={2}>
                                <NumberInput
                                    label="table.field.waitPakinLog.pakinId"
                                    source="pakinId"
                                    autoFocus
                                />
                                <TextInput
                                    label="table.field.waitPakinLog.code"
                                    source="code"
                                    parse={v => v}
                                />
                                <TextInput
                                    label="table.field.waitPakinLog.barcode"
                                    source="barcode"
                                    parse={v => v}
                                />
                                <NumberInput
                                    label="table.field.waitPakinLog.anfme"
                                    source="anfme"
                                />
                                <SelectInput
                                    label="table.field.waitPakinLog.ioStatus"
                                    source="ioStatus"
                                    choices={[
                                        { id: 0, name: '待入库' },
                                        { id: 1, name: ' 入库中' },
                                    ]}
                                    validate={required()}
                                />
                            </Stack>
                        </Grid>
                    </Grid>
                    <Grid item xs={12} md={4}>
                        <Typography variant="h6" gutterBottom>
                            {translate('common.edit.title.common')}
                        </Typography>
                        <StatusSelectInput />
                        <Box mt="2em" />
                        <MemoInput />
                    </Grid>
                </Grid>
            </SimpleForm>
        </Edit >
                </SimpleForm>
            </Edit >
            <WaitPakinItemLogList />
        </>
    )
}