From 284cec8871453c0b7ee978d2a8e6e2cdd378e9d9 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期五, 08 八月 2025 16:06:49 +0800 Subject: [PATCH] Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop --- rsf-admin/src/page/statistics/deadTime/LocItemDeadList.jsx | 163 +++++++++++++++++++++++ rsf-admin/src/page/basicInfo/loc/LocItemList.jsx | 4 rsf-admin/src/i18n/zh.js | 4 rsf-admin/src/page/statistics/deadTime/index.jsx | 16 ++ rsf-admin/src/page/statistics/inStockNum/index.jsx | 16 ++ rsf-admin/src/i18n/en.js | 3 rsf-admin/src/page/ResourceContent.js | 4 rsf-admin/src/page/orders/asnOrder/AsnOrderModal.jsx | 5 rsf-admin/src/page/statistics/inStockNum/InStockNumList.jsx | 164 +++++++++++++++++++++++ 9 files changed, 374 insertions(+), 5 deletions(-) diff --git a/rsf-admin/src/i18n/en.js b/rsf-admin/src/i18n/en.js index 09e744f..32dd056 100644 --- a/rsf-admin/src/i18n/en.js +++ b/rsf-admin/src/i18n/en.js @@ -212,6 +212,8 @@ checkDiff: 'Check Diff', transfer: 'Transfer', locRevise: 'Loc Revise', + statisticReport: 'Statistical Report', + locDeadReport: 'Locs Dead Report', stockStatistic: 'Stock Statistic', }, table: { @@ -1147,6 +1149,7 @@ anfme: "anfme", outQty: 'Revise Qty', qty: 'Qty', + deadTime: 'Dead (Days锛�', workQty: 'Work Qty', reviseQty: 'Revise Qty', batch: "batch", diff --git a/rsf-admin/src/i18n/zh.js b/rsf-admin/src/i18n/zh.js index 9301985..e30ae5a 100644 --- a/rsf-admin/src/i18n/zh.js +++ b/rsf-admin/src/i18n/zh.js @@ -219,8 +219,9 @@ transfer: '璋冩嫈鍗�', transferItem: '璋冩嫈鍗曟槑缁�', locRevise: '搴撳瓨璋冩暣', + statisticReport: '鏃ュ織鎶ヨ〃', + locDeadReport : '搴撳瓨鍋滄粸鎶ヨ〃', stockStatistic: '鏃ュ簱瀛樼粺璁�', - }, table: { field: { @@ -1157,6 +1158,7 @@ trackCode: "璺熻釜鐮�", workQty: '鎵ц鏁�', reviseQty: '瀹為檯鏁伴噺', + deadTime: '鍋滅暀鏃堕棿锛堝ぉ锛�', qty: '瀹屾垚鏁�', batch: "鎵规", splrBatch: "鎵规", diff --git a/rsf-admin/src/page/ResourceContent.js b/rsf-admin/src/page/ResourceContent.js index eb79b43..211fb4b 100644 --- a/rsf-admin/src/page/ResourceContent.js +++ b/rsf-admin/src/page/ResourceContent.js @@ -57,7 +57,7 @@ import checkDiff from "./orders/check/checkDiff"; import transfer from "./orders/transfer"; import locRevise from './stockManage/locRevise'; - +import locDeadReport from './statistics/deadTime'; const ResourceContent = (node) => { switch (node.component) { @@ -167,6 +167,8 @@ return transfer; case "locRevise": return locRevise; + case "locDeadReport": + return locDeadReport; default: return { list: ListGuesser, diff --git a/rsf-admin/src/page/basicInfo/loc/LocItemList.jsx b/rsf-admin/src/page/basicInfo/loc/LocItemList.jsx index 308d7b3..6e2d6b2 100644 --- a/rsf-admin/src/page/basicInfo/loc/LocItemList.jsx +++ b/rsf-admin/src/page/basicInfo/loc/LocItemList.jsx @@ -114,9 +114,7 @@ actions={( <TopToolbar> <FilterButton /> - {/* <MyCreateButton onClick={() => { setCreateDialog(true) }} /> */} <SelectColumnsButton preferenceKey='locItem' /> - {/* <MyExportButton /> */} </TopToolbar> )} perPage={DEFAULT_ITEM_PAGE_SIZE} @@ -154,7 +152,7 @@ <TextField source="memo" label="common.field.memo" sortable={false} /> <WrapperField cellClassName="opt" label="common.field.opt"> <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> - <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> + <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} redirect={false}/> </WrapperField> </StyledDatagrid> </List> diff --git a/rsf-admin/src/page/orders/asnOrder/AsnOrderModal.jsx b/rsf-admin/src/page/orders/asnOrder/AsnOrderModal.jsx index dd16e72..d26ea4c 100644 --- a/rsf-admin/src/page/orders/asnOrder/AsnOrderModal.jsx +++ b/rsf-admin/src/page/orders/asnOrder/AsnOrderModal.jsx @@ -200,6 +200,11 @@ const handleDeleteItem = () => { + if (selectedRows.length === 0) { + notify('璇烽�夋嫨瑕佸垹闄ょ殑琛�', {type: 'warning'}); + return; + } + const newTableData = _.filter(tabelData, (item) => !selectedRows.includes(item.id)); setTableData(newTableData); } diff --git a/rsf-admin/src/page/statistics/deadTime/LocItemDeadList.jsx b/rsf-admin/src/page/statistics/deadTime/LocItemDeadList.jsx new file mode 100644 index 0000000..b9a85d3 --- /dev/null +++ b/rsf-admin/src/page/statistics/deadTime/LocItemDeadList.jsx @@ -0,0 +1,163 @@ +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, + ReferenceInput, + ReferenceArrayInput, + AutocompleteInput, + DeleteButton, + useGetRecordId, +} from 'react-admin'; + +import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_ITEM_PAGE_SIZE, DEFAULT_PAGE_SIZE } from '@/config/setting'; +import { Box, Typography, Card, Stack } from '@mui/material'; +import { styled } from '@mui/material/styles'; +import { display, width } from "@mui/system"; +import { color } from "framer-motion"; + +const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ + '& .css-1vooibu-MuiSvgIcon-root': { + height: '.9em' + }, + '& .RaDatagrid-row': { + cursor: 'auto' + }, + '& .column-deadTime': { + width: 140, + textAlign: 'center', + color: 'red', + }, + + '& .RaDatagrid-headerCell': { + color: 'black', + }, + + '& .column-maktx': { + width: 150 + }, + '& .opt': { + width: 200 + }, +})); + +const filters = [ + <SearchInput source="condition" alwaysOn />, + <DateInput label='common.time.after' source="timeStart" />, + <DateInput label='common.time.before' source="timeEnd" />, + <NumberInput source="locId" label="table.field.locItem.locId" />, + <NumberInput source="orderId" label="table.field.locItem.orderId" />, + <TextInput source="type$" label="table.field.locItem.type" />, + <NumberInput source="orderItemId" label="table.field.locItem.orderItemId" />, + <NumberInput source="wkType$" label="table.field.locItem.wkType" />, + <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="trackCode" label="table.field.locItem.trackCode" />, + <TextInput source="unit" label="table.field.locItem.unit" />, + <NumberInput source="anfme" label="table.field.locItem.anfme" />, + <TextInput source="batch" label="table.field.locItem.batch" />, + <TextInput source="splrBatch" label="table.field.locItem.splrBatch" />, + <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 LocItemDeadList = () => { + const translate = useTranslate(); + const [createDialog, setCreateDialog] = useState(false); + const [drawerVal, setDrawerVal] = useState(false); + + return ( + <Box display="flex"> + <List + resource="inStock/num" + sx={{ + flexGrow: 1, + transition: (theme) => + theme.transitions.create(['all'], { + duration: theme.transitions.duration.enteringScreen, + }), + }} + title={"menu.locItem"} + empty={false} + filters={filters} + sort={{ field: "create_time", order: "asc" }} + actions={( + <TopToolbar> + <FilterButton /> + <SelectColumnsButton preferenceKey='locItem' /> + </TopToolbar> + )} + perPage={DEFAULT_PAGE_SIZE} + > + <StyledDatagrid + preferenceKey='InStockNumList' + bulkActionButtons={false} + rowClick={(id, resource, record) => false} + expand={false} + expandSingle={true} + omit={['id', 'locId', 'orderId', 'orderItemId', 'matnrId', 'trackCode', 'fieldsIndex', 'splrBatch', 'memo']} + > + <NumberField source="id" /> + <TextField source="locCode" label="table.field.locItem.locCode" /> + <NumberField source="deadTime" label="table.field.locItem.deadTime" /> + <NumberField source="locId" label="table.field.locItem.locId" /> + <NumberField source="matnrId" label="table.field.locItem.matnrId" /> + <TextField source="matnrCode" label="table.field.locItem.matnrCode" /> + <TextField source="maktx" label="table.field.locItem.maktx" /> + <NumberField source="anfme" label="table.field.locItem.anfme" /> + <TextField source="batch" label="table.field.locItem.batch" /> + <TextField source="trackCode" label="table.field.locItem.trackCode" /> + <TextField source="unit" label="table.field.locItem.unit" /> + <TextField source="splrBatch" label="table.field.locItem.splrBatch" /> + <TextField source="spec" label="table.field.locItem.spec" /> + <TextField source="model" label="table.field.locItem.model" /> + <TextField source="fieldsIndex" label="table.field.locItem.fieldsIndex" /> + <TextField source="updateBy$" label="common.field.updateBy" /> + <DateField source="updateTime" label="common.field.updateTime" showTime /> + <TextField source="createBy$" label="common.field.createBy" /> + <DateField source="createTime" label="common.field.createTime" showTime /> + <BooleanField source="statusBool" label="common.field.status" sortable={false} /> + <TextField source="memo" label="common.field.memo" sortable={false} /> + </StyledDatagrid> + </List> + </Box> + ) +} + +export default LocItemDeadList; diff --git a/rsf-admin/src/page/statistics/deadTime/index.jsx b/rsf-admin/src/page/statistics/deadTime/index.jsx new file mode 100644 index 0000000..5c9f98b --- /dev/null +++ b/rsf-admin/src/page/statistics/deadTime/index.jsx @@ -0,0 +1,16 @@ +import React, { useState, useRef, useEffect, useMemo } from "react"; +import { + ListGuesser, + EditGuesser, + ShowGuesser, +} from "react-admin"; + +import LocItemDeadList from "./LocItemDeadList"; + +export default { + list: LocItemDeadList, + show: ShowGuesser, + recordRepresentation: (record) => { + return `${record.id}` + } +}; diff --git a/rsf-admin/src/page/statistics/inStockNum/InStockNumList.jsx b/rsf-admin/src/page/statistics/inStockNum/InStockNumList.jsx new file mode 100644 index 0000000..662b688 --- /dev/null +++ b/rsf-admin/src/page/statistics/inStockNum/InStockNumList.jsx @@ -0,0 +1,164 @@ +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, + ReferenceInput, + ReferenceArrayInput, + AutocompleteInput, + DeleteButton, + useGetRecordId, +} from 'react-admin'; + +import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_ITEM_PAGE_SIZE, DEFAULT_PAGE_SIZE } from '@/config/setting'; +import { Box, Typography, Card, Stack } from '@mui/material'; +import { styled } from '@mui/material/styles'; +import { display, width } from "@mui/system"; +import { color } from "framer-motion"; + +const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ + '& .css-1vooibu-MuiSvgIcon-root': { + height: '.9em' + }, + '& .RaDatagrid-row': { + cursor: 'auto' + }, + '& .column-deadTime': { + width: 140, + textAlign: 'center', + color: 'red', + }, + + '& .RaDatagrid-headerCell': { + color: 'black', + }, + + '& .column-maktx': { + width: 150 + }, + '& .opt': { + width: 200 + }, +})); + +const filters = [ + <SearchInput source="condition" alwaysOn />, + <DateInput label='common.time.after' source="timeStart" />, + <DateInput label='common.time.before' source="timeEnd" />, + <NumberInput source="locId" label="table.field.locItem.locId" />, + <NumberInput source="orderId" label="table.field.locItem.orderId" />, + <TextInput source="type$" label="table.field.locItem.type" />, + <NumberInput source="orderItemId" label="table.field.locItem.orderItemId" />, + <NumberInput source="wkType$" label="table.field.locItem.wkType" />, + <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="trackCode" label="table.field.locItem.trackCode" />, + <TextInput source="unit" label="table.field.locItem.unit" />, + <NumberInput source="anfme" label="table.field.locItem.anfme" />, + <TextInput source="batch" label="table.field.locItem.batch" />, + <TextInput source="splrBatch" label="table.field.locItem.splrBatch" />, + <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 InStockNumList = () => { + const translate = useTranslate(); + const [createDialog, setCreateDialog] = useState(false); + const [drawerVal, setDrawerVal] = useState(false); + + return ( + <Box display="flex"> + <List + resource="locItem" + 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={false} + filters={filters} + sort={{ field: "create_time", order: "asc" }} + actions={( + <TopToolbar> + <FilterButton /> + <SelectColumnsButton preferenceKey='locItem' /> + </TopToolbar> + )} + perPage={DEFAULT_PAGE_SIZE} + > + <StyledDatagrid + preferenceKey='locDeadReport' + bulkActionButtons={false} + rowClick={(id, resource, record) => false} + expand={false} + expandSingle={true} + omit={['id', 'locId', 'orderId', 'orderItemId', 'matnrId', 'trackCode', 'fieldsIndex', 'splrBatch', 'memo']} + > + <NumberField source="id" /> + <TextField source="locCode" label="table.field.locItem.locCode" /> + <NumberField source="deadTime" label="table.field.locItem.deadTime" /> + <NumberField source="locId" label="table.field.locItem.locId" /> + <NumberField source="matnrId" label="table.field.locItem.matnrId" /> + <TextField source="matnrCode" label="table.field.locItem.matnrCode" /> + <TextField source="maktx" label="table.field.locItem.maktx" /> + <NumberField source="anfme" label="table.field.locItem.anfme" /> + <TextField source="batch" label="table.field.locItem.batch" /> + <TextField source="trackCode" label="table.field.locItem.trackCode" /> + <TextField source="unit" label="table.field.locItem.unit" /> + <TextField source="splrBatch" label="table.field.locItem.splrBatch" /> + <TextField source="spec" label="table.field.locItem.spec" /> + <TextField source="model" label="table.field.locItem.model" /> + <TextField source="fieldsIndex" label="table.field.locItem.fieldsIndex" /> + <TextField source="updateBy$" label="common.field.updateBy" /> + <DateField source="updateTime" label="common.field.updateTime" showTime /> + <TextField source="createBy$" label="common.field.createBy" /> + <DateField source="createTime" label="common.field.createTime" showTime /> + <BooleanField source="statusBool" label="common.field.status" sortable={false} /> + <TextField source="memo" label="common.field.memo" sortable={false} /> + </StyledDatagrid> + </List> + </Box> + ) +} + +export default InStockNumList; diff --git a/rsf-admin/src/page/statistics/inStockNum/index.jsx b/rsf-admin/src/page/statistics/inStockNum/index.jsx new file mode 100644 index 0000000..1c31eb0 --- /dev/null +++ b/rsf-admin/src/page/statistics/inStockNum/index.jsx @@ -0,0 +1,16 @@ +import React, { useState, useRef, useEffect, useMemo } from "react"; +import { + ListGuesser, + EditGuesser, + ShowGuesser, +} from "react-admin"; + +import InStockNumList from "./InStockNumList"; + +export default { + list: InStockNumList, + show: ShowGuesser, + recordRepresentation: (record) => { + return `${record.id}` + } +}; -- Gitblit v1.9.1