|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const WarehouseAreasEdit = () => { | 
|---|
|  |  |  | const translate = useTranslate(); | 
|---|
|  |  |  | const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_ware_areas_type')) || []; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | <Edit | 
|---|
|  |  |  | 
|---|
|  |  |  | defaultValues={{}} | 
|---|
|  |  |  | // validate={(values) => { }} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}> | 
|---|
|  |  |  | <Grid item xs={12} md={8}> | 
|---|
|  |  |  | <Grid container width={{ xs: '100%', xl: '100%' }} rowSpacing={3} columnSpacing={3}> | 
|---|
|  |  |  | <Grid item xs={16} md={10}> | 
|---|
|  |  |  | <Typography variant="h6" gutterBottom> | 
|---|
|  |  |  | {translate('common.edit.title.main')} | 
|---|
|  |  |  | </Typography> | 
|---|
|  |  |  | 
|---|
|  |  |  | autoFocus | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> */} | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <Stack xs={16} direction='row' gap={2}> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.warehouseAreas.name" | 
|---|
|  |  |  | source="name" | 
|---|
|  |  |  | validate={[required()]} | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.warehouseAreas.code" | 
|---|
|  |  |  | source="code" | 
|---|
|  |  |  | validate={[required()]} | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <AutocompleteInput | 
|---|
|  |  |  | choices={dicts} | 
|---|
|  |  |  | optionText="label" | 
|---|
|  |  |  | label="table.field.asnOrder.type" | 
|---|
|  |  |  | source="type" | 
|---|
|  |  |  | optionValue="value" | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <ReferenceInput | 
|---|
|  |  |  | source="wareId" | 
|---|
|  |  |  | source="warehouseId" | 
|---|
|  |  |  | reference="warehouse" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <AutocompleteInput | 
|---|
|  |  |  | label="table.field.warehouseAreas.wareId" | 
|---|
|  |  |  | optionText="name" | 
|---|
|  |  |  | validate={[required()]} | 
|---|
|  |  |  | filterToQuery={(val) => ({ name: val })} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </ReferenceInput> | 
|---|
|  |  |  | 
|---|
|  |  |  | filterToQuery={(val) => ({ name: val })} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </ReferenceInput> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <ReferenceInput | 
|---|
|  |  |  | source="supplierId" | 
|---|
|  |  |  | reference="companys" | 
|---|
|  |  |  | 
|---|
|  |  |  | filterToQuery={(val) => ({ name: val })} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </ReferenceInput> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <SelectInput | 
|---|
|  |  |  | label="table.field.warehouseAreas.flagMinus" | 
|---|
|  |  |  | source="flagMinus" | 
|---|
|  |  |  | 
|---|
|  |  |  | { id: 1, name: '是' }, | 
|---|
|  |  |  | ]} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <SelectInput | 
|---|
|  |  |  | label="table.field.warehouseAreas.flagLabelMange" | 
|---|
|  |  |  | source="flagLabelMange" | 
|---|
|  |  |  | 
|---|
|  |  |  | { id: 1, name: ' 是' }, | 
|---|
|  |  |  | ]} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <SelectInput | 
|---|
|  |  |  | label="table.field.warehouseAreas.flagMix" | 
|---|
|  |  |  | source="flagMix" | 
|---|
|  |  |  | 
|---|
|  |  |  | ]} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </Grid> | 
|---|
|  |  |  | <Grid item xs={12} md={4}> | 
|---|
|  |  |  | <Grid item xs={8} md={2}> | 
|---|
|  |  |  | <Typography variant="h6" gutterBottom> | 
|---|
|  |  |  | {translate('common.edit.title.common')} | 
|---|
|  |  |  | </Typography> | 
|---|