From c458dd9c84a66ba50cb83adaa3967823ea9effd8 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期三, 11 六月 2025 11:26:23 +0800 Subject: [PATCH] 出库单明细搜索报错问题修复 --- rsf-admin/src/page/orders/outStock/OutStockPublic.jsx | 34 ++++++++++++++++++++++++++++++---- 1 files changed, 30 insertions(+), 4 deletions(-) diff --git a/rsf-admin/src/page/orders/outStock/OutStockPublic.jsx b/rsf-admin/src/page/orders/outStock/OutStockPublic.jsx index 40e4607..3a9f70b 100644 --- a/rsf-admin/src/page/orders/outStock/OutStockPublic.jsx +++ b/rsf-admin/src/page/orders/outStock/OutStockPublic.jsx @@ -47,6 +47,7 @@ import ConfirmButton from '../../components/ConfirmButton'; import { Delete, Edit, Add } from '@mui/icons-material'; import OutStockSiteDialog from "./OutStockSiteDialog"; +import { color } from "framer-motion"; const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ '& .css-1vooibu-MuiSvgIcon-root': { @@ -210,14 +211,22 @@ const PreviewTable = ({ rows, gridRef, setRows, record, selectedIds, setSelectedIds, setDialog }) => { gridRef.current = useGridApiRef(); + const translate = useTranslate(); const columns = [ - { field: 'id', headerName: 'ID', width: 40 }, + // { field: 'id', headerName: 'ID', width: 40 }, { field: 'locCode', headerName: '搴撲綅', width: 110 }, { field: 'barcode', headerName: '瀹瑰櫒', width: 120 }, + { field: 'matnrCode', headerName: '鐗╂枡缂栫爜', width: 120 }, { field: 'batch', headerName: '鎵规', width: 90 }, - { field: 'unit', headerName: '鍗曚綅', width: 90 }, - { field: 'outQty', headerName: '鏈鍑哄簱鏁伴噺', width: 110 }, + { field: 'unit', headerName: '鍗曚綅', width: 60 }, + { field: 'outQty', headerName: '鍑哄簱鏁伴噺', width: 110, }, + { + field: 'anfme', headerName: '搴撳瓨鏁伴噺', width: 110, + renderCell: (params) => ( + <OutStockAnfme value={params.value} /> + ) + }, { field: 'siteNo', headerName: '鍑哄簱鍙�', @@ -256,6 +265,23 @@ }) setRows(outRows) } + + const OutStockAnfme = React.memo(function OutStockAnfme(props) { + const { value } = props; + return ( + value > 0 ? + <Box + sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }} + > + <span>{value}</span> + </Box> : + <Box + sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }} + > + <span style={{color: 'red'}}>{translate('common.edit.title.insuffInventory')}</span> + </Box> + ); + }); const OutStockSiteNo = React.memo(function OutStockSiteNo(props) { const { value } = props; @@ -357,6 +383,7 @@ }, }} checkboxSelection + disableRowSelectionOnClick pageSizeOptions={[15, 25, 35, 45]} onRowSelectionModelChange={(ids) => { setSelectedIds(ids) @@ -373,7 +400,6 @@ const refresh = useRefresh(); const redirect = useRedirect(); const submit = async () => { - console.log(record); const items = gridRef.current?.getSortedRows(); const { data: { code, data, msg } } = await request.post('/outStock/generate/tasks', { items, outId: record?.id }); if (code == 200) { -- Gitblit v1.9.1