| | |
| | | NumberField, |
| | | required, |
| | | useRecordContext, |
| | | DeleteButton, |
| | | DeleteButton, SelectArrayInput, |
| | | } from 'react-admin'; |
| | | import { useWatch, useFormContext } from "react-hook-form"; |
| | | import { Stack, Grid, Box, Typography } from '@mui/material'; |
| | |
| | | import CustomerTopToolBar from "../components/EditTopToolBar"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import DictionarySelect from "../components/DictionarySelect"; |
| | | import DictionaryArraySelect from "../components/DictionaryArraySelect"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | |
| | | {translate('common.edit.title.main')} |
| | | </Typography> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.basStationArea.type" |
| | | source="type" |
| | | autoFocus |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.basStationArea.stationAreaName" |
| | | source="stationAreaName" |
| | |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.basStationArea.inAble" |
| | | source="inAble" |
| | | <ReferenceInput source="area" reference="warehouseAreas" sort={{ field: 'sort', order: 'ASC' }}> |
| | | <SelectInput |
| | | label="table.field.basStation.area" |
| | | optionText="name" |
| | | optionValue="id" |
| | | fullWidth |
| | | validate={[required()]} |
| | | /> |
| | | </ReferenceInput> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.basStationArea.outAble" |
| | | source="outAble" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.basStationArea.useStatus" |
| | | source="useStatus" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.basStationArea.area" |
| | | source="area" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.basStationArea.isCrossZone" |
| | | source="isCrossZone" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.basStationArea.crossZoneArea" |
| | | source="crossZoneArea" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.basStationArea.isWcs" |
| | | source="isWcs" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.basStationArea.wcsData" |
| | | source="wcsData" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.basStationArea.containerType" |
| | | source="containerType" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.basStationArea.barcode" |
| | | source="barcode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.basStationArea.autoTransfer" |
| | | source="autoTransfer" |
| | | <DictionaryArraySelect |
| | | label={translate("table.field.basStation.containerType")} |
| | | name="containerTypes" |
| | | size="small" |
| | | validate={[required()]} |
| | | dictTypeCode="sys_container_type" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | <ReferenceArrayInput source="stationAlias" reference="basStation"> |
| | | <SelectArrayInput |
| | | label="table.field.basStationArea.stationAlias" |
| | | source="stationAlias" |
| | | parse={v => v} |
| | | optionText="stationName" |
| | | optionValue="id" |
| | | fullWidth |
| | | validate={[required()]} |
| | | // validate={(value) => { |
| | | // if (value && value.length > 1) { |
| | | // return '只能选择一个模板'; |
| | | // } |
| | | // return undefined; |
| | | // }} |
| | | /> |
| | | </ReferenceArrayInput> |
| | | </Stack> |
| | | |
| | | </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> |