From 60a665f3c576f8fe368ddfaabc9117a9c5dd47bf Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期六, 02 八月 2025 09:56:30 +0800 Subject: [PATCH] Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop --- rsf-admin/src/page/locPreview/LocPreviewEdit.jsx | 94 +++++++++++++++++----------------------------- 1 files changed, 35 insertions(+), 59 deletions(-) diff --git a/rsf-admin/src/page/locItem/LocItemEdit.jsx b/rsf-admin/src/page/locPreview/LocPreviewEdit.jsx similarity index 79% rename from rsf-admin/src/page/locItem/LocItemEdit.jsx rename to rsf-admin/src/page/locPreview/LocPreviewEdit.jsx index 0274fb8..5033a64 100644 --- a/rsf-admin/src/page/locItem/LocItemEdit.jsx +++ b/rsf-admin/src/page/locPreview/LocPreviewEdit.jsx @@ -22,28 +22,20 @@ DeleteButton, useNotify, } from 'react-admin'; -import { useWatch, useFormContext } from "react-hook-form"; -import { Stack, Grid, Box, Typography } from '@mui/material'; -import * as Common from '@/utils/common'; import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; -import EditBaseAside from "../components/EditBaseAside"; -import CustomerTopToolBar from "../components/EditTopToolBar"; -import MemoInput from "../components/MemoInput"; import StatusSelectInput from "../components/StatusSelectInput"; -import request from '@/utils/request'; import DictionarySelect from "../components/DictionarySelect"; -import LocQueryList from "./LocQueryList"; +import CustomerTopToolBar from "../components/EditTopToolBar"; +import { Stack, Grid, Box, Typography } from '@mui/material'; +import { useWatch, useFormContext } from "react-hook-form"; +import EditBaseAside from "../components/EditBaseAside"; +import MemoInput from "../components/MemoInput"; +import LocPreviewItems from "./LocPreviewItems"; +import * as Common from '@/utils/common'; +import request from '@/utils/request'; -const FormToolbar = () => { - const { getValues } = useFormContext(); - return ( - <Toolbar sx={{ justifyContent: 'end' }}> - </Toolbar> - ) -} - -const LocItemEdit = () => { +const LocPreviewEdit = () => { const translate = useTranslate(); const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_loc_type')) || []; const [warehouseId, setWrehouseId] = useState(); @@ -55,7 +47,6 @@ return ( <> <Edit - redirect="list" mutationMode={EDIT_MODE} actions={<CustomerTopToolBar />} aside={<EditBaseAside />} @@ -66,26 +57,23 @@ warnWhenUnsavedChanges toolbar={false} mode="onTouched" - defaultValues={{}} + sx={{ + "& .MuiFormLabel-root.MuiInputLabel-root.Mui-disabled": { + bgcolor: 'white', + WebkitTextFillColor: "rgba(0, 0, 0)" + }, + "& .MuiInputBase-input.MuiFilledInput-input.Mui-disabled": { + bgcolor: 'white', + WebkitTextFillColor: "rgba(0, 0, 0)" + }, + "& .MuiFilledInput-root.MuiInputBase-sizeSmall": { + bgcolor: 'white', + } + }} // validate={(values) => { }} > - <Grid container width={{ xs: '100%', xl: '90%' }} rowSpacing={3} columnSpacing={3} - sx={{ - "& .MuiFormLabel-root.MuiInputLabel-root.Mui-disabled": { - bgcolor: 'white', - WebkitTextFillColor: "rgba(0, 0, 0)" - }, - - "& .MuiInputBase-input.MuiFilledInput-input.Mui-disabled": { - bgcolor: 'white', - WebkitTextFillColor: "rgba(0, 0, 0)" - }, - "& .MuiFilledInput-root.MuiInputBase-sizeSmall": { - bgcolor: 'white', - } - }} - > - <Grid item xs={12} md={10}> + <Grid container width={{ xs: '100%', xl: '90%' }} rowSpacing={3} columnSpacing={3}> + <Grid item xs={12} md={12}> <Typography variant="h6" gutterBottom> {translate('common.edit.title.main')} </Typography> @@ -98,10 +86,10 @@ <AutocompleteInput label="table.field.loc.warehouseId" optionText="name" - readOnly validate={[required()]} onChange={warehouseChange} filterToQuery={(val) => ({ name: val })} + readOnly /> </ReferenceInput> <ReferenceInput @@ -112,94 +100,82 @@ <AutocompleteInput label="table.field.loc.areaId" optionText="name" - readOnly validate={[required()]} filterToQuery={(val) => ({ name: val })} + readOnly /> </ReferenceInput> <TextInput label="table.field.loc.code" source="code" parse={v => v} - readOnly validate={required()} + readOnly /> <NumberInput label="table.field.loc.length" source="length" readOnly - validate={required()} /> <NumberInput label="table.field.loc.width" source="width" readOnly - validate={required()} /> <NumberInput label="table.field.loc.height" source="height" readOnly - validate={required()} /> </Grid> <Grid item display="flex" gap={1}> <ReferenceArrayInput source="typeIds" reference="locType" > - <SelectArrayInput label="table.field.loc.type" readOnly validate={[required()]} /> + <SelectArrayInput label="table.field.loc.type" readOnly/> </ReferenceArrayInput> <TextInput label="table.field.loc.unit" source="unit" - readOnly parse={v => v} + readOnly /> <DictionarySelect label={translate("table.field.loc.useStatus")} name="useStatus" validate={[required()]} - readOnly size="small" dictTypeCode="sys_loc_use_stas" + readOnly /> <NumberInput label="table.field.loc.row" source="row" - readOnly validate={required()} + readOnly /> <NumberInput label="table.field.loc.col" source="col" - readOnly validate={required()} + readOnly /> - <NumberInput label="table.field.loc.lev" source="lev" - readOnly validate={required()} + readOnly /> </Grid> </Grid> </Grid> - {/* <Grid item xs={12} md={2}> - <Typography variant="h6" gutterBottom> - {translate('common.edit.title.common')} - </Typography> - <StatusSelectInput readOnly /> - <Box mt="2em" /> - <MemoInput /> - </Grid> */} </Grid> </SimpleForm> </Edit > - <LocQueryList /> + <LocPreviewItems /> </> ) } -export default LocItemEdit; +export default LocPreviewEdit; -- Gitblit v1.9.1