| | |
| | | locAreaMat: { |
| | | code: "code", |
| | | depict: "depict", |
| | | name: "name", |
| | | warehouseId: "warehouseId", |
| | | areaId: "areaId", |
| | | }, |
| | | locAreaMatRela: { |
| | | areaId: "areaId", |
| | |
| | | locAreaMat: { |
| | | code: "逻辑编码", |
| | | depict: "逻辑描述", |
| | | name: "名称", |
| | | warehouseId: "仓库", |
| | | areaId: "库区", |
| | | }, |
| | | locAreaMatRela: { |
| | | areaId: "库区", |
| | |
| | | notify(error.message || 'common.response.fail', { type: 'error', messageArgs: { _: error.message } }); |
| | | }; |
| | | |
| | | |
| | | const [warehouseId, setWrehouseId] = useState(); |
| | | const warehouseChange = (val) => { |
| | | setWrehouseId(val) |
| | | } |
| | | |
| | | return ( |
| | | <> |
| | | <CreateBase |
| | |
| | | autoFocus |
| | | /> |
| | | </Grid> |
| | | {/* <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.locAreaMat.warehouseId" |
| | | source="warehouseId" |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.locAreaMat.name" |
| | | source="name" |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.locAreaMat.areaId" |
| | | source="areaId" |
| | | <ReferenceInput |
| | | source="warehouseId" |
| | | reference="warehouse" |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.loc.warehouseId" |
| | | optionText="name" |
| | | validate={[required()]} |
| | | onChange={warehouseChange} |
| | | filterToQuery={(val) => ({ name: val })} |
| | | /> |
| | | </Grid> */} |
| | | </ReferenceInput> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <ReferenceInput |
| | | source="areaId" |
| | | reference="warehouseAreas" |
| | | filter={{ warehouseId }} |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.loc.areaId" |
| | | optionText="name" |
| | | validate={[required()]} |
| | | filterToQuery={(val) => ({ name: val })} |
| | | /> |
| | | </ReferenceInput> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.locAreaMat.depict" |
| | |
| | | const LocAreaMatEdit = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [warehouseId, setWrehouseId] = useState(); |
| | | const warehouseChange = (val) => { |
| | | setWrehouseId(val) |
| | | } |
| | | |
| | | return ( |
| | | <Edit |
| | | redirect="list" |
| | |
| | | autoFocus |
| | | /> |
| | | </Stack> |
| | | {/* <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.locAreaMat.warehouseId" |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.locAreaMat.name" |
| | | source="name" |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <ReferenceInput |
| | | source="warehouseId" |
| | | reference="warehouse" |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.loc.warehouseId" |
| | | optionText="name" |
| | | validate={[required()]} |
| | | onChange={warehouseChange} |
| | | filterToQuery={(val) => ({ name: val })} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.locAreaMat.areaId" |
| | | </ReferenceInput> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <ReferenceInput |
| | | source="areaId" |
| | | reference="warehouseAreas" |
| | | filter={{ warehouseId }} |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.loc.areaId" |
| | | optionText="name" |
| | | validate={[required()]} |
| | | filterToQuery={(val) => ({ name: val })} |
| | | /> |
| | | </Stack> */} |
| | | </ReferenceInput> |
| | | </Grid> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.locAreaMat.depict" |
| | |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="code" label="table.field.locAreaMat.code" /> |
| | | {/* <NumberField source="warehouseId" label="table.field.locAreaMat.warehouseId" /> |
| | | <NumberField source="areaId" label="table.field.locAreaMat.areaId" /> */} |
| | | <TextField source="name" label="table.field.locAreaMat.name" /> |
| | | <TextField source="warehouseId$" label="table.field.locAreaMat.warehouseId" /> |
| | | <TextField source="areaId$" label="table.field.locAreaMat.areaId" /> |
| | | |
| | | <TextField source="depict" label="table.field.locAreaMat.depict" /> |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | |
| | | }; |
| | | |
| | | const downloadTemplate = async (type) => { |
| | | const res = await request.post(`/${value}/template/download`, {}) |
| | | const res = await request.post(`/${value}/template/download`, {}, { |
| | | responseType: "blob", |
| | | }) |
| | | const url = window.URL.createObjectURL( |
| | | new Blob([res.data], { type: res.headers["content-type"] }), |
| | | ); |