From bb973749ca4152abfc21125bfcd4064d370214ac Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期一, 03 三月 2025 10:31:26 +0800
Subject: [PATCH] #优化 1. 修改物料分类树接口报错问题
---
rsf-admin/src/page/loc/LocEdit.jsx | 262 ++++++++++++++++++++++++++++------------------------
1 files changed, 141 insertions(+), 121 deletions(-)
diff --git a/rsf-admin/src/page/loc/LocEdit.jsx b/rsf-admin/src/page/loc/LocEdit.jsx
index 656f0d9..2b04603 100644
--- a/rsf-admin/src/page/loc/LocEdit.jsx
+++ b/rsf-admin/src/page/loc/LocEdit.jsx
@@ -59,132 +59,152 @@
// validate={(values) => { }}
>
<Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}>
- <Grid item xs={12} md={8}>
+ <Grid item xs={12} md={10}>
<Typography variant="h6" gutterBottom>
{translate('common.edit.title.main')}
</Typography>
- <Stack direction='row' gap={2}>
- <NumberInput
- label="table.field.loc.areaId"
- source="areaId"
- autoFocus
- validate={required()}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <TextInput
- label="table.field.loc.code"
- source="code"
- parse={v => v}
- validate={required()}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <TextInput
- label="table.field.loc.type"
- source="type"
- parse={v => v}
- validate={required()}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <TextInput
- label="table.field.loc.name"
- source="name"
- parse={v => v}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <NumberInput
- label="table.field.loc.flagLogic"
- source="flagLogic"
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <TextInput
- label="table.field.loc.fucAtrrs"
- source="fucAtrrs"
- parse={v => v}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <TextInput
- label="table.field.loc.barcode"
- source="barcode"
- parse={v => v}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <TextInput
- label="table.field.loc.unit"
- source="unit"
- parse={v => v}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <TextInput
- label="table.field.loc.size"
- source="size"
- parse={v => v}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <NumberInput
- label="table.field.loc.row"
- source="row"
- validate={required()}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <NumberInput
- label="table.field.loc.col"
- source="col"
- validate={required()}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <NumberInput
- label="table.field.loc.lev"
- source="lev"
- validate={required()}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <NumberInput
- label="table.field.loc.channel"
- source="channel"
- validate={required()}
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <NumberInput
- label="table.field.loc.maxParts"
- source="maxParts"
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <NumberInput
- label="table.field.loc.maxPack"
- source="maxPack"
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <NumberInput
- label="table.field.loc.flagLabelMange"
- source="flagLabelMange"
- />
- </Stack>
- <Stack direction='row' gap={2}>
- <TextInput
- label="table.field.loc.locAttrs"
- source="locAttrs"
- parse={v => v}
- validate={required()}
- />
- </Stack>
+ <Grid container rowSpacing={2} columnSpacing={2}>
+ <Grid item xs={6} display="flex" gap={1}>
+ <ReferenceInput
+ source="warehouseId$"
+ reference="warehouse"
+ >
+ <AutocompleteInput
+ label="table.field.loc.warehouseId"
+ optionText="name"
+ validate={[required()]}
+ filterToQuery={(val) => ({ name: val })}
+ />
+ </ReferenceInput>
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <ReferenceInput
+ source="areaId"
+ reference="warehouseAreas"
+ >
+ <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.loc.code"
+ source="code"
+ parse={v => v}
+ validate={required()}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.loc.type"
+ source="type"
+ parse={v => v}
+ validate={required()}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.loc.name"
+ source="name"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <NumberInput
+ label="table.field.loc.flagLogic"
+ source="flagLogic"
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.loc.fucAtrrs"
+ source="fucAtrrs"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.loc.barcode"
+ source="barcode"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.loc.unit"
+ source="unit"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.loc.size"
+ source="size"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <NumberInput
+ label="table.field.loc.row"
+ source="lrow"
+ validate={required()}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <NumberInput
+ label="table.field.loc.col"
+ source="col"
+ validate={required()}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <NumberInput
+ label="table.field.loc.lev"
+ source="lev"
+ validate={required()}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <NumberInput
+ label="table.field.loc.channel"
+ source="channel"
+ validate={required()}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <NumberInput
+ label="table.field.loc.maxParts"
+ source="maxParts"
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <NumberInput
+ label="table.field.loc.maxPack"
+ source="maxPack"
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <NumberInput
+ label="table.field.loc.flagLabelMange"
+ source="flagLabelMange"
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.loc.locAttrs"
+ source="locAttrs"
+ parse={v => v}
+ validate={required()}
+ />
+ </Grid>
+ </Grid>
</Grid>
- <Grid item xs={12} md={4}>
+ <Grid item xs={12} md={2}>
<Typography variant="h6" gutterBottom>
{translate('common.edit.title.common')}
</Typography>
--
Gitblit v1.9.1