skyouc
2025-06-11 5193d463bbf96467d93c73a6399cdcc957babd8b
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,6 +211,7 @@
const PreviewTable = ({ rows, gridRef, setRows, record, selectedIds, setSelectedIds, setDialog }) => {
    gridRef.current = useGridApiRef();
    const translate = useTranslate();
    const columns = [
        // { field: 'id', headerName: 'ID', width: 40 },
@@ -218,7 +220,13 @@
        { field: 'matnrCode', headerName: '物料编码', width: 120 },
        { field: 'batch', headerName: '批次', width: 90 },
        { field: 'unit', headerName: '单位', width: 60 },
        { field: 'outQty', headerName: '出库数量', width: 110 ,valueFormatter: (val) => val <= 0 ? '库存不足' : val,},
        { field: 'outQty', headerName: '出库数量', width: 110, },
        {
            field: 'anfme', headerName: '库存数量', width: 110,
            renderCell: (params) => (
                <OutStockAnfme value={params.value} />
            )
        },
        {
            field: 'siteNo',
            headerName: '出库口',
@@ -257,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;
@@ -375,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) {