chen.lin
9 天以前 98d88ac8caf7f0991d741079474c262f1e252927
rsf-admin/src/page/orders/outStock/OutStockPublic.jsx
@@ -238,7 +238,8 @@
                            siteNo: defaultSiteNo,
                            staNos: item.staNos || [],
                            sourceId: item.sourceId,
                            source: item.source
                            source: item.source,
                            pickingStatus: item.pickingStatus || null
                        };
                    }
                    // 如果数据已经是扁平结构,直接返回
@@ -399,9 +400,9 @@
        { field: 'unit', headerName: '单位', width: 60 },
        { field: 'outQty', headerName: '出库数量', width: 110, valueFormatter: (v) => formatQuantity(v) },
        {
            field: 'anfme', headerName: '库存数量', width: 110,
            field: 'anfme', headerName: '库存数量', width: 160,
            renderCell: (params) => (
                <OutStockAnfme value={params.value} />
                <OutStockAnfme value={params.value} row={params.row} />
            )
        },
        {
@@ -447,9 +448,18 @@
    }
    const OutStockAnfme = React.memo(function OutStockAnfme(props) {
        const { value } = props;
        const { value, row } = props;
        const pickingStatus = row?.pickingStatus;
        const num = Number(value);
        const hasStock = typeof num === 'number' && !Number.isNaN(num) && num > 1e-6;
        if (pickingStatus) {
            return (
                <Box sx={{ display: 'flex', flexDirection: 'column', alignItems: 'flex-start', justifyContent: 'center' }}>
                    <span style={{ color: '#1976d2' }}>{pickingStatus}</span>
                    {!hasStock && <span style={{ color: 'red', fontSize: '0.85em' }}>{translate('common.edit.title.insuffInventory')}</span>}
                </Box>
            );
        }
        return (
            hasStock ? (
                <Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>