|  |  |  | 
|---|
|  |  |  | import StatusSelectInput from "../../components/StatusSelectInput"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const BatchModal = ({ open, setOpen }) => { | 
|---|
|  |  |  | const BatchModal = ({ open, setOpen, fieldType }) => { | 
|---|
|  |  |  | const refresh = useRefresh(); | 
|---|
|  |  |  | const translate = useTranslate(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | <Dialog open={open} maxWidth="md" fullWidth> | 
|---|
|  |  |  | <Dialog open={open} maxWidth="xs" fullWidth> | 
|---|
|  |  |  | <Form onSubmit={handleSubmit}> | 
|---|
|  |  |  | <DialogCloseButton onClose={handleClose} /> | 
|---|
|  |  |  | <DialogTitle>{translate('toolbar.batch')}</DialogTitle> | 
|---|
|  |  |  | <DialogContent sx={{ mt: 2 }}> | 
|---|
|  |  |  | <Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}> | 
|---|
|  |  |  | <Grid container spacing={2}> | 
|---|
|  |  |  | <Grid item xs={4}> | 
|---|
|  |  |  | <ReferenceInput | 
|---|
|  |  |  | source="warehouseId" | 
|---|
|  |  |  | reference="warehouse" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <AutocompleteInput | 
|---|
|  |  |  | label="table.field.loc.warehouseId" | 
|---|
|  |  |  | optionText="name" | 
|---|
|  |  |  | onChange={(value) => handleChange(value, 'warehouseId')} | 
|---|
|  |  |  | value={formData.warehouseId} | 
|---|
|  |  |  | filterToQuery={(val) => ({ name: val })} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </ReferenceInput> | 
|---|
|  |  |  | {fieldType === 'warehouseId' && | 
|---|
|  |  |  | <Grid item xs={6}> | 
|---|
|  |  |  | <ReferenceInput | 
|---|
|  |  |  | source="warehouseId" | 
|---|
|  |  |  | reference="warehouse" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <AutocompleteInput | 
|---|
|  |  |  | label="table.field.loc.warehouseId" | 
|---|
|  |  |  | optionText="name" | 
|---|
|  |  |  | value={formData.warehouseId} | 
|---|
|  |  |  | filterToQuery={(val) => ({ name: val })} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </ReferenceInput> | 
|---|
|  |  |  | </Grid> | 
|---|
|  |  |  | } | 
|---|
|  |  |  | {fieldType === 'areaId' && | 
|---|
|  |  |  | <Grid item xs={6}> | 
|---|
|  |  |  | <ReferenceInput | 
|---|
|  |  |  | source="areaId" | 
|---|
|  |  |  | reference="warehouseAreas" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <AutocompleteInput | 
|---|
|  |  |  | label="table.field.loc.areaId" | 
|---|
|  |  |  | optionText="name" | 
|---|
|  |  |  | onChange={(value) => handleChange(value, 'areaId')} | 
|---|
|  |  |  | value={formData.areaId} | 
|---|
|  |  |  | filterToQuery={(val) => ({ name: val })} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </ReferenceInput> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </Grid> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <Grid item xs={4}> | 
|---|
|  |  |  | <ReferenceInput | 
|---|
|  |  |  | source="areaId" | 
|---|
|  |  |  | reference="warehouseAreas" | 
|---|
|  |  |  | filter={{ warehouseId: formData.warehouseId }} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <AutocompleteInput | 
|---|
|  |  |  | label="table.field.loc.areaId" | 
|---|
|  |  |  | optionText="name" | 
|---|
|  |  |  | onChange={(value) => handleChange(value, 'areaId')} | 
|---|
|  |  |  | value={formData.areaId} | 
|---|
|  |  |  | filterToQuery={(val) => ({ name: val })} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </ReferenceInput> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </Grid> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <Grid item xs={4}> | 
|---|
|  |  |  | {/* <DictionarySelect | 
|---|
|  |  |  | </Grid> | 
|---|
|  |  |  | } | 
|---|
|  |  |  | {fieldType === 'typeIds' && | 
|---|
|  |  |  | <Grid item xs={6}> | 
|---|
|  |  |  | {/* <DictionarySelect | 
|---|
|  |  |  | label={translate("table.field.loc.type")} | 
|---|
|  |  |  | name="type" | 
|---|
|  |  |  | value={formData.type} | 
|---|
|  |  |  | 
|---|
|  |  |  | size="small" | 
|---|
|  |  |  | dictTypeCode="sys_loc_type" | 
|---|
|  |  |  | /> */} | 
|---|
|  |  |  | <ReferenceArrayInput source="typeIds" reference="locType" > | 
|---|
|  |  |  | <SelectArrayInput label="table.field.loc.type" onChange={(e) => handleChange(e.target.value, 'typeIds')} /> | 
|---|
|  |  |  | </ReferenceArrayInput> | 
|---|
|  |  |  | </Grid> | 
|---|
|  |  |  | <ReferenceArrayInput source="typeIds" reference="locType" > | 
|---|
|  |  |  | <SelectArrayInput label="table.field.loc.type" onChange={(e) => handleChange(e.target.value, 'typeIds')} /> | 
|---|
|  |  |  | </ReferenceArrayInput> | 
|---|
|  |  |  | </Grid> | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <Grid item xs={4}> | 
|---|
|  |  |  | <StatusSelectInput | 
|---|
|  |  |  | onChange={(e) => handleChange(e.target.value, 'status')} | 
|---|
|  |  |  | defaultValue={''} | 
|---|
|  |  |  | require={false} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Grid> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | {fieldType === 'status' && | 
|---|
|  |  |  | <Grid item xs={6}> | 
|---|
|  |  |  | <StatusSelectInput | 
|---|
|  |  |  | onChange={(e) => handleChange(e.target.value, 'status')} | 
|---|
|  |  |  | defaultValue={''} | 
|---|
|  |  |  | require={false} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Grid> | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </Grid> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </Box> | 
|---|