From 158ef0f443b9f36f8beb44853ed1f39449c45c1d Mon Sep 17 00:00:00 2001 From: yangyang Date: 星期五, 21 三月 2025 10:55:37 +0800 Subject: [PATCH] #修改 1. 动态扩展字段优化 2. 物料优化 --- rsf-admin/src/page/basicInfo/loc/LocEdit.jsx | 86 +++++++++--------------------------------- 1 files changed, 19 insertions(+), 67 deletions(-) diff --git a/rsf-admin/src/page/basicInfo/loc/LocEdit.jsx b/rsf-admin/src/page/basicInfo/loc/LocEdit.jsx index ab883db..1505a82 100644 --- a/rsf-admin/src/page/basicInfo/loc/LocEdit.jsx +++ b/rsf-admin/src/page/basicInfo/loc/LocEdit.jsx @@ -10,6 +10,7 @@ DateInput, SelectInput, ReferenceInput, + SelectArrayInput, ReferenceArrayInput, AutocompleteInput, SaveButton, @@ -19,6 +20,7 @@ required, useRecordContext, DeleteButton, + useNotify, } from 'react-admin'; import { useWatch, useFormContext } from "react-hook-form"; import { Stack, Grid, Box, Typography } from '@mui/material'; @@ -28,6 +30,7 @@ import CustomerTopToolBar from "../../components/EditTopToolBar"; import MemoInput from "../../components/MemoInput"; import StatusSelectInput from "../../components/StatusSelectInput"; +import request from '@/utils/request'; const FormToolbar = () => { const { getValues } = useFormContext(); @@ -42,6 +45,8 @@ const LocEdit = () => { const translate = useTranslate(); + const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_loc_type')) || []; + return ( <Edit @@ -66,7 +71,7 @@ <Grid container rowSpacing={2} columnSpacing={2}> <Grid item xs={6} display="flex" gap={1}> <ReferenceInput - source="warehouseId$" + source="warehouseId" reference="warehouse" > <AutocompleteInput @@ -99,39 +104,18 @@ /> </Grid> <Grid item xs={6} display="flex" gap={1}> - <TextInput - label="table.field.loc.type" + {/* <AutocompleteInput + choices={dicts} source="type" + optionText="label" + label="table.field.loc.type" + optionValue="value" 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} - /> + validate={[required()]} + /> */} + <ReferenceArrayInput source="typeIds" reference="locType" > + <SelectArrayInput label="table.field.loc.type" /> + </ReferenceArrayInput> </Grid> <Grid item xs={6} display="flex" gap={1}> <TextInput @@ -164,7 +148,7 @@ <Grid item xs={6} display="flex" gap={1}> <NumberInput label="table.field.loc.row" - source="lrow" + source="row" validate={required()} /> </Grid> @@ -182,41 +166,9 @@ 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> <Grid item xs={12} md={2}> <Typography variant="h6" gutterBottom> -- Gitblit v1.9.1