lbq
23 小时以前 72139f39a0845f8de31fd44bc5dd7077df17d48e
rsf-admin/src/page/warehouseAreas/WarehouseAreasEdit.jsx
@@ -28,6 +28,8 @@
import CustomerTopToolBar from "../components/EditTopToolBar";
import MemoInput from "../components/MemoInput";
import StatusSelectInput from "../components/StatusSelectInput";
import DictionarySelect from "../components/DictionarySelect";
import DictSelect from "../components/DictSelect";
const FormToolbar = () => {
    const { getValues } = useFormContext();
@@ -59,8 +61,8 @@
                defaultValues={{}}
            // validate={(values) => { }}
            >
                <Grid container width={{ xs: '100%', xl: '100%' }} rowSpacing={3} columnSpacing={3}>
                    <Grid item xs={16} md={10}>
                <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={1} columnSpacing={3}>
                    <Grid item xs={12} md={6} display="flex" flexDirection="column" gap={1} sx={{ '& .MuiFormControl-root': { mb: 0 } }}>
                        <Typography variant="h6" gutterBottom>
                            {translate('common.edit.title.main')}
                        </Typography>
@@ -73,39 +75,118 @@
                                autoFocus
                            />
                        </Stack> */}
                        <Stack xs={16} direction='row' gap={2}>
                            <TextInput
                                label="table.field.warehouseAreas.name"
                                source="name"
                                validate={[required()]}
                                parse={v => v}
                            />
                        <Stack direction='row' gap={2}>
                            <ReferenceInput
                                source="warehouseId"
                                reference="warehouse"
                                autoFocus
                            >
                                <AutocompleteInput
                                    label="table.field.warehouseAreas.wareId"
                                    optionText="name"
                                    optionValue="id"
                                    validate={[required()]}
                                    filterToQuery={(val) => ({ name: val })}
                                />
                            </ReferenceInput>
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <TextInput
                                label="table.field.warehouseAreas.code"
                                source="code"
                                validate={[required()]}
                                parse={v => v}
                            />
                            <AutocompleteInput
                                choices={dicts}
                                optionText="label"
                                label="table.field.asnOrder.type"
                                source="type"
                                optionValue="value"
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <TextInput
                                label="table.field.warehouseAreas.name"
                                source="name"
                                validate={[required()]}
                                parse={v => v}
                            />
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <DictionarySelect
                                label='table.field.warehouseAreas.type'
                                name="type"
                                dictTypeCode="sys_ware_areas_type"
                                alwaysOn
                            />
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <SelectInput
                                label="table.field.warehouseAreas.flagMix"
                                source="flagMix"
                                validate={[required()]}
                                choices={[
                                    { id: 0, name: '否' },
                                    { id: 1, name: '是' },
                                ]}
                            />
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <SelectInput
                                label="table.field.warehouseAreas.flagMinus"
                                source="flagMinus"
                                validate={[required()]}
                                choices={[
                                    { id: 0, name: '否' },
                                    { id: 1, name: '是' },
                                ]}
                            />
                        </Stack>
                        {/* <Stack direction='row' gap={2}>
                            <ReferenceInput
                                source="warehouseId"
                                reference="warehouse"
                                source="shipperId"
                                reference="companys"
                                filter={{ type: 'shipper' }}
                            >
                                <AutocompleteInput
                                    label="table.field.warehouseAreas.wareId"
                                    label="table.field.warehouseAreas.shipperId"
                                    optionText="name"
                                    validate={[required()]}
                                    filterToQuery={(val) => ({ name: val })}
                                />
                            </ReferenceInput>
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <ReferenceInput
                                source="supplierId"
                                reference="companys"
                                filter={{ type: 'supplier' }}
                            >
                                <AutocompleteInput
                                    label="table.field.warehouseAreas.supplierId"
                                    optionText="name"
                                    filterToQuery={(val) => ({ name: val })}
                                />
                            </ReferenceInput>
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <StatusSelectInput />
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <TextInput
                                label="common.field.memo"
                                source="memo"
                                parse={v => v}
                                multiline
                            />
                        </Stack> */}
                    </Grid>
                    {/* <Grid item xs={8} md={2}>
                        <Typography variant="h6" gutterBottom>
                            {translate('common.edit.title.common')}
                        </Typography>
                        <StatusSelectInput />
                        <Box mt="2em" />
                        <MemoInput />
                    </Grid> */}
                    <Grid item xs={12} md={6} display="flex" flexDirection="column" gap={1} sx={{ '& .MuiFormControl-root': { mb: 0 } }}>
                        <Typography variant="h6" gutterBottom>
                            &nbsp;
                            {/* {translate('common.edit.title.main')} */}
                        </Typography>
                        <Stack direction='row' gap={2}>
                            <ReferenceInput
                                source="shipperId"
@@ -118,6 +199,17 @@
                                    filterToQuery={(val) => ({ name: val })}
                                />
                            </ReferenceInput>
                            {/* <SelectInput
                                label="table.field.warehouseAreas.flagLabelMange"
                                source="flagLabelMange"
                                validate={[required()]}
                                choices={[
                                    { id: 0, name: ' 否' },
                                    { id: 1, name: ' 是' },
                                ]}
                            /> */}
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <ReferenceInput
                                source="supplierId"
                                reference="companys"
@@ -129,42 +221,28 @@
                                    filterToQuery={(val) => ({ name: val })}
                                />
                            </ReferenceInput>
                        </Stack>
                        <Stack direction='row' gap={2}>
                            {/* <StatusSelectInput /> */}
                            <SelectInput
                                label="table.field.warehouseAreas.flagMinus"
                                source="flagMinus"
                                label="common.field.status"
                                source="status"
                                validate={[required()]}
                                choices={[
                                    { id: 0, name: '否' },
                                    { id: 1, name: '是' },
                                    { id: '1', name: 'common.enums.statusTrue' },
                                    { id: '0', name: 'common.enums.statusFalse' },
                                ]}
                            />
                            <SelectInput
                                label="table.field.warehouseAreas.flagLabelMange"
                                source="flagLabelMange"
                                validate={[required()]}
                                choices={[
                                    { id: 0, name: ' 否' },
                                    { id: 1, name: ' 是' },
                                ]}
                            />
                            <SelectInput
                                label="table.field.warehouseAreas.flagMix"
                                source="flagMix"
                                validate={[required()]}
                                choices={[
                                    { id: 0, name: '否' },
                                    { id: 1, name: '是' },
                                ]}
                                resettable
                            />
                        </Stack>
                    </Grid>
                    <Grid item xs={8} md={2}>
                        <Typography variant="h6" gutterBottom>
                            {translate('common.edit.title.common')}
                        </Typography>
                        <StatusSelectInput />
                        <Box mt="2em" />
                        <MemoInput />
                        <Stack direction='row' gap={2}>
                            <TextInput
                                label="common.field.memo"
                                source="memo"
                                parse={v => v}
                                multiline
                            />
                        </Stack>
                    </Grid>
                </Grid>
            </SimpleForm>