From 97c21abaebf6cb6cf15f8a7e3830676533d90dac Mon Sep 17 00:00:00 2001
From: skyouc <creaycat@gmail.com>
Date: 星期三, 26 十一月 2025 13:06:31 +0800
Subject: [PATCH] 添加库存明细功能
---
rsf-admin/src/page/locItem/LocItemPanel.jsx | 195 +++++++++++
rsf-admin/src/page/locItem/LocItemList.jsx | 214 ++++++++++++
rsf-admin/src/page/locItem/index.jsx | 18 +
rsf-admin/src/page/locItem/LocItemCreate.jsx | 270 +++++++++++++++
rsf-admin/src/page/locItem/LocItemEdit.jsx | 242 ++++++++++++++
rsf-server/src/main/java/locItem.sql | 45 ++
rsf-admin/src/page/ResourceContent.js | 3
rsf-admin/src/page/locPreview/LocPreviewList.jsx | 1
8 files changed, 988 insertions(+), 0 deletions(-)
diff --git a/rsf-admin/src/page/ResourceContent.js b/rsf-admin/src/page/ResourceContent.js
index 5b835c3..bc61dd8 100644
--- a/rsf-admin/src/page/ResourceContent.js
+++ b/rsf-admin/src/page/ResourceContent.js
@@ -56,6 +56,7 @@
import check from "./orders/check";
import checkDiff from "./orders/check/checkDiff";
import transfer from "./orders/transfer";
+import locItem from './locItem';
import locRevise from './stockManage/locRevise';
import locDeadReport from './statistics/deadTime';
import inStatistic from './statistics/inStockNum';
@@ -98,6 +99,8 @@
return warehouseStock;
case "loc":
return loc;
+ case "locItem":
+ return locItem;
case "container":
return container;
case "contract":
diff --git a/rsf-admin/src/page/locItem/LocItemCreate.jsx b/rsf-admin/src/page/locItem/LocItemCreate.jsx
new file mode 100644
index 0000000..9dc1fde
--- /dev/null
+++ b/rsf-admin/src/page/locItem/LocItemCreate.jsx
@@ -0,0 +1,270 @@
+import React, { useState, useRef, useEffect, useMemo } from "react";
+import {
+ CreateBase,
+ useTranslate,
+ TextInput,
+ NumberInput,
+ BooleanInput,
+ DateInput,
+ SaveButton,
+ SelectInput,
+ ReferenceInput,
+ ReferenceArrayInput,
+ AutocompleteInput,
+ Toolbar,
+ required,
+ useDataProvider,
+ useNotify,
+ Form,
+ useCreateController,
+} from 'react-admin';
+import {
+ Dialog,
+ DialogActions,
+ DialogContent,
+ DialogTitle,
+ Stack,
+ Grid,
+ Box,
+} from '@mui/material';
+import DialogCloseButton from "../components/DialogCloseButton";
+import StatusSelectInput from "../components/StatusSelectInput";
+import MemoInput from "../components/MemoInput";
+
+const LocItemCreate = (props) => {
+ const { open, setOpen } = props;
+
+ const translate = useTranslate();
+ const notify = useNotify();
+
+ const handleClose = (event, reason) => {
+ if (reason !== "backdropClick") {
+ setOpen(false);
+ }
+ };
+
+ const handleSuccess = async (data) => {
+ setOpen(false);
+ notify('common.response.success');
+ };
+
+ const handleError = async (error) => {
+ notify(error.message || 'common.response.fail', { type: 'error', messageArgs: { _: error.message } });
+ };
+
+ return (
+ <>
+ <CreateBase
+ record={{}}
+ transform={(data) => {
+ return data;
+ }}
+ mutationOptions={{ onSuccess: handleSuccess, onError: handleError }}
+ >
+ <Dialog
+ open={open}
+ onClose={handleClose}
+ aria-labelledby="form-dialog-title"
+ fullWidth
+ disableRestoreFocus
+ maxWidth="md" // 'xs' | 'sm' | 'md' | 'lg' | 'xl'
+ >
+ <Form>
+ <DialogTitle id="form-dialog-title" sx={{
+ position: 'sticky',
+ top: 0,
+ backgroundColor: 'background.paper',
+ zIndex: 1000
+ }}
+ >
+ {translate('create.title')}
+ <Box sx={{ position: 'absolute', top: 8, right: 8, zIndex: 1001 }}>
+ <DialogCloseButton onClose={handleClose} />
+ </Box>
+ </DialogTitle>
+ <DialogContent sx={{ mt: 2 }}>
+ <Grid container rowSpacing={2} columnSpacing={2}>
+ <Grid item xs={6} display="flex" gap={1}>
+ <NumberInput
+ label="table.field.locItem.locId"
+ source="locId"
+ autoFocus
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.locItem.locCode"
+ source="locCode"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <NumberInput
+ label="table.field.locItem.orderId"
+ source="orderId"
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.locItem.type"
+ source="type"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <NumberInput
+ label="table.field.locItem.orderItemId"
+ source="orderItemId"
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <NumberInput
+ label="table.field.locItem.wkType"
+ source="wkType"
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <NumberInput
+ label="table.field.locItem.matnrId"
+ source="matnrId"
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.locItem.maktx"
+ source="maktx"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.locItem.platItemId"
+ source="platItemId"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.locItem.platOrderCode"
+ source="platOrderCode"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.locItem.platWorkCode"
+ source="platWorkCode"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.locItem.projectCode"
+ source="projectCode"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.locItem.matnrCode"
+ source="matnrCode"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.locItem.trackCode"
+ source="trackCode"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.locItem.unit"
+ source="unit"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <NumberInput
+ label="table.field.locItem.anfme"
+ source="anfme"
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <NumberInput
+ label="table.field.locItem.qty"
+ source="qty"
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <NumberInput
+ label="table.field.locItem.workQty"
+ source="workQty"
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.locItem.batch"
+ source="batch"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.locItem.splrBatch"
+ source="splrBatch"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <NumberInput
+ label="table.field.locItem.splrId"
+ source="splrId"
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.locItem.spec"
+ source="spec"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.locItem.model"
+ source="model"
+ parse={v => v}
+ />
+ </Grid>
+ <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.locItem.fieldsIndex"
+ source="fieldsIndex"
+ parse={v => v}
+ />
+ </Grid>
+
+ <Grid item xs={6} display="flex" gap={1}>
+ <StatusSelectInput />
+ </Grid>
+ <Grid item xs={12} display="flex" gap={1}>
+ <Stack direction="column" spacing={1} width={'100%'}>
+ <MemoInput />
+ </Stack>
+ </Grid>
+ </Grid>
+ </DialogContent>
+ <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}>
+ <Toolbar sx={{ width: '100%', justifyContent: 'space-between' }} >
+ <SaveButton />
+ </Toolbar>
+ </DialogActions>
+ </Form>
+ </Dialog>
+ </CreateBase>
+ </>
+ )
+}
+
+export default LocItemCreate;
diff --git a/rsf-admin/src/page/locItem/LocItemEdit.jsx b/rsf-admin/src/page/locItem/LocItemEdit.jsx
new file mode 100644
index 0000000..8073eed
--- /dev/null
+++ b/rsf-admin/src/page/locItem/LocItemEdit.jsx
@@ -0,0 +1,242 @@
+import React, { useState, useRef, useEffect, useMemo } from "react";
+import {
+ Edit,
+ SimpleForm,
+ FormDataConsumer,
+ useTranslate,
+ TextInput,
+ NumberInput,
+ BooleanInput,
+ DateInput,
+ SelectInput,
+ ReferenceInput,
+ ReferenceArrayInput,
+ AutocompleteInput,
+ SaveButton,
+ Toolbar,
+ Labeled,
+ NumberField,
+ required,
+ useRecordContext,
+ DeleteButton,
+} 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";
+
+const FormToolbar = () => {
+ const { getValues } = useFormContext();
+
+ return (
+ <Toolbar sx={{ justifyContent: 'space-between' }}>
+ <SaveButton />
+ <DeleteButton mutationMode="optimistic" />
+ </Toolbar>
+ )
+}
+
+const LocItemEdit = () => {
+ const translate = useTranslate();
+
+ return (
+ <Edit
+ redirect="list"
+ mutationMode={EDIT_MODE}
+ actions={<CustomerTopToolBar />}
+ aside={<EditBaseAside />}
+ >
+ <SimpleForm
+ shouldUnregister
+ warnWhenUnsavedChanges
+ toolbar={<FormToolbar />}
+ mode="onTouched"
+ defaultValues={{}}
+ // validate={(values) => { }}
+ >
+ <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}>
+ <Grid item xs={12} md={8}>
+ <Typography variant="h6" gutterBottom>
+ {translate('common.edit.title.main')}
+ </Typography>
+ <Stack direction='row' gap={2}>
+ <NumberInput
+ label="table.field.locItem.locId"
+ source="locId"
+ autoFocus
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <TextInput
+ label="table.field.locItem.locCode"
+ source="locCode"
+ parse={v => v}
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <NumberInput
+ label="table.field.locItem.orderId"
+ source="orderId"
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <TextInput
+ label="table.field.locItem.type"
+ source="type"
+ parse={v => v}
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <NumberInput
+ label="table.field.locItem.orderItemId"
+ source="orderItemId"
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <NumberInput
+ label="table.field.locItem.wkType"
+ source="wkType"
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <NumberInput
+ label="table.field.locItem.matnrId"
+ source="matnrId"
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <TextInput
+ label="table.field.locItem.maktx"
+ source="maktx"
+ parse={v => v}
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <TextInput
+ label="table.field.locItem.platItemId"
+ source="platItemId"
+ parse={v => v}
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <TextInput
+ label="table.field.locItem.platOrderCode"
+ source="platOrderCode"
+ parse={v => v}
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <TextInput
+ label="table.field.locItem.platWorkCode"
+ source="platWorkCode"
+ parse={v => v}
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <TextInput
+ label="table.field.locItem.projectCode"
+ source="projectCode"
+ parse={v => v}
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <TextInput
+ label="table.field.locItem.matnrCode"
+ source="matnrCode"
+ parse={v => v}
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <TextInput
+ label="table.field.locItem.trackCode"
+ source="trackCode"
+ parse={v => v}
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <TextInput
+ label="table.field.locItem.unit"
+ source="unit"
+ parse={v => v}
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <NumberInput
+ label="table.field.locItem.anfme"
+ source="anfme"
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <NumberInput
+ label="table.field.locItem.qty"
+ source="qty"
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <NumberInput
+ label="table.field.locItem.workQty"
+ source="workQty"
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <TextInput
+ label="table.field.locItem.batch"
+ source="batch"
+ parse={v => v}
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <TextInput
+ label="table.field.locItem.splrBatch"
+ source="splrBatch"
+ parse={v => v}
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <NumberInput
+ label="table.field.locItem.splrId"
+ source="splrId"
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <TextInput
+ label="table.field.locItem.spec"
+ source="spec"
+ parse={v => v}
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <TextInput
+ label="table.field.locItem.model"
+ source="model"
+ parse={v => v}
+ />
+ </Stack>
+ <Stack direction='row' gap={2}>
+ <TextInput
+ label="table.field.locItem.fieldsIndex"
+ source="fieldsIndex"
+ parse={v => v}
+ />
+ </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>
+ </Edit >
+ )
+}
+
+export default LocItemEdit;
diff --git a/rsf-admin/src/page/locItem/LocItemList.jsx b/rsf-admin/src/page/locItem/LocItemList.jsx
new file mode 100644
index 0000000..9b3e38b
--- /dev/null
+++ b/rsf-admin/src/page/locItem/LocItemList.jsx
@@ -0,0 +1,214 @@
+import React, { useState, useRef, useEffect, useMemo, useCallback } from "react";
+import { useNavigate } from 'react-router-dom';
+import {
+ List,
+ DatagridConfigurable,
+ SearchInput,
+ TopToolbar,
+ SelectColumnsButton,
+ EditButton,
+ FilterButton,
+ CreateButton,
+ ExportButton,
+ BulkDeleteButton,
+ WrapperField,
+ useRecordContext,
+ useTranslate,
+ useNotify,
+ useListContext,
+ FunctionField,
+ TextField,
+ NumberField,
+ DateField,
+ BooleanField,
+ ReferenceField,
+ TextInput,
+ DateTimeInput,
+ DateInput,
+ SelectInput,
+ NumberInput,
+ useRefresh,
+ ReferenceInput,
+ ReferenceArrayInput,
+ AutocompleteInput,
+ DeleteButton,
+} from 'react-admin';
+import { Box, Typography, Card, Stack , LinearProgress} from '@mui/material';
+import { styled } from '@mui/material/styles';
+import LocItemCreate from "./LocItemCreate";
+import EmptyData from "../components/EmptyData";
+import PageDrawer from "../components/PageDrawer";
+import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting';
+import * as Common from '@/utils/common';
+import request from '@/utils/request';
+
+const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
+ '& .css-1vooibu-MuiSvgIcon-root': {
+ height: '.9em'
+ },
+ '& .RaDatagrid-row': {
+ cursor: 'auto'
+ },
+ '& .column-name': {
+ },
+ '& .opt': {
+ width: 200
+ },
+}));
+
+const filters = [
+ <SearchInput source="condition" alwaysOn />,
+ <NumberInput source="locId" label="table.field.locItem.locId" />,
+ <TextInput source="locCode" label="table.field.locItem.locCode" />,
+ <NumberInput source="matnrId" label="table.field.locItem.matnrId" />,
+ <TextInput source="maktx" label="table.field.locItem.maktx" />,
+ <TextInput source="matnrCode" label="table.field.locItem.matnrCode" />,
+ <TextInput source="unit" label="table.field.locItem.unit" />,
+ <NumberInput source="anfme" label="table.field.locItem.anfme" />,
+ <NumberInput source="qty" label="table.field.locItem.qty" />,
+ <TextInput source="batch" label="table.field.locItem.batch" />,
+ <TextInput source="spec" label="table.field.locItem.spec" />,
+ <TextInput source="model" label="table.field.locItem.model" />,
+ <TextInput source="fieldsIndex" label="table.field.locItem.fieldsIndex" />,
+ <TextInput label="common.field.memo" source="memo" />,
+ <SelectInput
+ label="common.field.status"
+ source="status"
+ choices={[
+ { id: '1', name: 'common.enums.statusTrue' },
+ { id: '0', name: 'common.enums.statusFalse' },
+ ]}
+ resettable
+ />,
+]
+
+const LocItemList = () => {
+ const translate = useTranslate();
+ const [createDialog, setCreateDialog] = useState(false);
+ const [drawerVal, setDrawerVal] = useState(false);
+
+ return (
+ <Box display="flex">
+ <List
+ sx={{
+ flexGrow: 1,
+ transition: (theme) =>
+ theme.transitions.create(['all'], {
+ duration: theme.transitions.duration.enteringScreen,
+ }),
+ marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0,
+ }}
+ title={"menu.locItem"}
+ empty={<EmptyData onClick={() => { setCreateDialog(true) }} />}
+ filters={filters}
+ sort={{ field: "create_time", order: "desc" }}
+ actions={(
+ <TopToolbar>
+ <FilterButton />
+ <SelectColumnsButton preferenceKey='locItem' />
+ </TopToolbar>
+ )}
+ perPage={DEFAULT_PAGE_SIZE}
+ >
+ <DynamicFields />
+ </List>
+ <LocItemCreate
+ open={createDialog}
+ setOpen={setCreateDialog}
+ />
+ <PageDrawer
+ title='LocItem Detail'
+ drawerVal={drawerVal}
+ setDrawerVal={setDrawerVal}
+ >
+ </PageDrawer>
+ </Box>
+ )
+}
+
+export default LocItemList;
+
+
+const DynamicFields = (props) => {
+ const translate = useTranslate();
+ const notify = useNotify();
+ const [columns, setColumns] = useState([]);
+ const { isLoading } = useListContext();
+ const refresh = useRefresh();
+ useEffect(() => {
+ getDynamicFields();
+ }, []);
+
+ const getDynamicFields = async () => {
+ const { data: { code, data, msg }, } = await request.get("/fields/enable/list");
+ if (code == 200) {
+ const arr = [
+ <NumberField source="id" />,
+ <NumberField source="locId" label="table.field.locItem.locId" />,
+ <TextField source="locCode" label="table.field.locItem.locCode" />,
+ <NumberField source="matnrId" label="table.field.locItem.matnrId" />,
+ <TextField source="maktx" label="table.field.locItem.maktx" />,
+ <TextField source="matnrCode" label="table.field.locItem.matnrCode" />,
+ <TextField source="unit" label="table.field.locItem.unit" />,
+ <NumberField source="anfme" label="table.field.locItem.anfme" />,
+ <TextField source="batch" label="table.field.locItem.batch" />,
+ <NumberField source="splrId" label="table.field.locItem.splrId" />,
+ <TextField source="spec" label="table.field.locItem.spec" />,
+ <TextField source="model" label="table.field.locItem.model" />
+ ]
+ const fields = data.map(el => <TextField key={el.fields} source={`extendFields.[${el.fields}]`} label={el.fieldsAlise} />)
+ const lastArr = [
+ <DateField source="updateTime" label="common.field.updateTime" showTime />,
+ <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}>
+ <TextField source="nickname" />
+ </ReferenceField>,
+ <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}>
+ <TextField source="nickname" />
+ </ReferenceField>,
+ <DateField source="createTime" label="common.field.createTime" showTime />,
+ <TextField source="memo" label="common.field.memo" sortable={false} />,
+ ]
+ setColumns([...arr, ...fields, ...lastArr]);
+
+ data.map(el => {
+ var i = 0;
+ filters.map((item) => {
+ if (item.key === el.fields) {
+ i = 1;
+ }
+ })
+ i === 0 && filters.push(<TextInput key={el.fields} source={el.fields} label={el.fieldsAlise} alwaysOn/>)
+ })
+
+ } else {
+ notify(msg);
+ }
+ }
+
+ return (
+ <Box sx={{ position: 'relative', minHeight: "60vh", }}>
+ {isLoading && (
+ <LinearProgress
+ sx={{
+ height: "2px",
+ position: 'absolute',
+ top: 0,
+ left: 0,
+ right: 0,
+ }}
+ />
+ )}
+ {columns.length > 0 &&
+ <StyledDatagrid
+ preferenceKey='locItem'
+ bulkActionButtons={false}
+ rowClick={(id, resource, record) => false}
+ expand={false}
+ expandSingle={true}
+ omit={['id', 'createTime', 'createBy', 'memo', 'splrId', 'locId', 'matnrId']}
+ >
+ {columns.map((column) => column)}
+ </StyledDatagrid>}
+ </Box>
+ )
+}
\ No newline at end of file
diff --git a/rsf-admin/src/page/locItem/LocItemPanel.jsx b/rsf-admin/src/page/locItem/LocItemPanel.jsx
new file mode 100644
index 0000000..db99b1f
--- /dev/null
+++ b/rsf-admin/src/page/locItem/LocItemPanel.jsx
@@ -0,0 +1,195 @@
+import React, { useState, useRef, useEffect, useMemo } from "react";
+import { Box, Card, CardContent, Grid, Typography, Tooltip } from '@mui/material';
+import {
+ useTranslate,
+ useRecordContext,
+} from 'react-admin';
+import PanelTypography from "../components/PanelTypography";
+import * as Common from '@/utils/common'
+
+const LocItemPanel = () => {
+ const record = useRecordContext();
+ if (!record) return null;
+ const translate = useTranslate();
+ return (
+ <>
+ <Card sx={{ width: { xs: 300, sm: 500, md: 600, lg: 800 }, margin: 'auto' }}>
+ <CardContent>
+ <Grid container spacing={2}>
+ <Grid item xs={12} sx={{ display: 'flex', justifyContent: 'space-between' }}>
+ <Typography variant="h6" gutterBottom align="left" sx={{
+ maxWidth: { xs: '100px', sm: '180px', md: '260px', lg: '360px' },
+ whiteSpace: 'nowrap',
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
+ }}>
+ {Common.camelToPascalWithSpaces(translate('table.field.locItem.id'))}: {record.id}
+ </Typography>
+ {/* inherit, primary, secondary, textPrimary, textSecondary, error */}
+ <Typography variant="h6" gutterBottom align="right" >
+ ID: {record.id}
+ </Typography>
+ </Grid>
+ </Grid>
+ <Grid container spacing={2}>
+ <Grid item xs={12} container alignContent="flex-end">
+ <Typography variant="caption" color="textSecondary" sx={{ wordWrap: 'break-word', wordBreak: 'break-all' }}>
+ {Common.camelToPascalWithSpaces(translate('common.field.memo'))}:{record.memo}
+ </Typography>
+ </Grid>
+ </Grid>
+ <Box height={20}> </Box>
+ <Grid container spacing={2}>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.locId"
+ property={record.locId}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.locCode"
+ property={record.locCode}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.orderId"
+ property={record.orderId}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.type"
+ property={record.type}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.orderItemId"
+ property={record.orderItemId}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.wkType"
+ property={record.wkType}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.matnrId"
+ property={record.matnrId}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.maktx"
+ property={record.maktx}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.platItemId"
+ property={record.platItemId}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.platOrderCode"
+ property={record.platOrderCode}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.platWorkCode"
+ property={record.platWorkCode}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.projectCode"
+ property={record.projectCode}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.matnrCode"
+ property={record.matnrCode}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.trackCode"
+ property={record.trackCode}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.unit"
+ property={record.unit}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.anfme"
+ property={record.anfme}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.qty"
+ property={record.qty}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.workQty"
+ property={record.workQty}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.batch"
+ property={record.batch}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.splrBatch"
+ property={record.splrBatch}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.splrId"
+ property={record.splrId}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.spec"
+ property={record.spec}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.model"
+ property={record.model}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.fieldsIndex"
+ property={record.fieldsIndex}
+ />
+ </Grid>
+
+ </Grid>
+ </CardContent>
+ </Card >
+ </>
+ );
+};
+
+export default LocItemPanel;
diff --git a/rsf-admin/src/page/locItem/index.jsx b/rsf-admin/src/page/locItem/index.jsx
new file mode 100644
index 0000000..a02f044
--- /dev/null
+++ b/rsf-admin/src/page/locItem/index.jsx
@@ -0,0 +1,18 @@
+import React, { useState, useRef, useEffect, useMemo } from "react";
+import {
+ ListGuesser,
+ EditGuesser,
+ ShowGuesser,
+} from "react-admin";
+
+import LocItemList from "./LocItemList";
+import LocItemEdit from "./LocItemEdit";
+
+export default {
+ list: LocItemList,
+ edit: LocItemEdit,
+ show: ShowGuesser,
+ recordRepresentation: (record) => {
+ return `${record.id}`
+ }
+};
diff --git a/rsf-admin/src/page/locPreview/LocPreviewList.jsx b/rsf-admin/src/page/locPreview/LocPreviewList.jsx
index a30d41a..bbe9a08 100644
--- a/rsf-admin/src/page/locPreview/LocPreviewList.jsx
+++ b/rsf-admin/src/page/locPreview/LocPreviewList.jsx
@@ -191,6 +191,7 @@
<NumberField source="row" label="table.field.loc.row" />
<NumberField source="col" label="table.field.loc.col" />
<NumberField source="lev" label="table.field.loc.lev" />
+ <NumberField source="isHalf$" label="table.field.loc.isHalf" />
<NumberField source="channel" label="table.field.loc.channel" />
<TextField source="useStatus$" label="table.field.loc.useStatus" />
<TextField source="updateBy$" label="common.field.updateBy" />
diff --git a/rsf-server/src/main/java/locItem.sql b/rsf-server/src/main/java/locItem.sql
new file mode 100644
index 0000000..3371ac4
--- /dev/null
+++ b/rsf-server/src/main/java/locItem.sql
@@ -0,0 +1,45 @@
+-- save locItem record
+-- mysql
+insert into `sys_menu` ( `name`, `parent_id`, `route`, `component`, `type`, `sort`, `tenant_id`, `status`) values ( 'menu.locItem', '0', '/manager/locItem', 'locItem', '0' , '0', '1' , '1');
+
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Query 搴撳瓨鏄庣粏', '', '1', 'manager:locItem:list', '0', '1', '1');
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Create 搴撳瓨鏄庣粏', '', '1', 'manager:locItem:save', '1', '1', '1');
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Update 搴撳瓨鏄庣粏', '', '1', 'manager:locItem:update', '2', '1', '1');
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Delete 搴撳瓨鏄庣粏', '', '1', 'manager:locItem:remove', '3', '1', '1');
+
+-- locale menu name
+locItem: 'LocItem',
+
+-- locale field
+locItem: {
+ locId: "locId",
+ locCode: "locCode",
+ orderId: "orderId",
+ type: "type",
+ orderItemId: "orderItemId",
+ wkType: "wkType",
+ matnrId: "matnrId",
+ maktx: "maktx",
+ platItemId: "platItemId",
+ platOrderCode: "platOrderCode",
+ platWorkCode: "platWorkCode",
+ projectCode: "projectCode",
+ matnrCode: "matnrCode",
+ trackCode: "trackCode",
+ unit: "unit",
+ anfme: "anfme",
+ qty: "qty",
+ workQty: "workQty",
+ batch: "batch",
+ splrBatch: "splrBatch",
+ splrId: "splrId",
+ spec: "spec",
+ model: "model",
+ fieldsIndex: "fieldsIndex",
+},
+
+-- ResourceContent
+import locItem from './locItem';
+
+case 'locItem':
+ return locItem;
--
Gitblit v1.9.1