verou
2025-03-25 7a33c97d5741a5d8813035ccde1fa801ec30a179
rsf-admin/src/page/asnOrder/AsnWareModal.jsx
@@ -50,15 +50,25 @@
    };
    const handleSubmit = () => {
        setOpen(false);
        refresh();
        const selectedData = selectedRows.map(id => tableData.find(row => row.id === id));
        setData(selectedData);
        const value = selectedData.map((el => {
            return {
                matnrId: el.id,
                maktx: el.name,
                stockUnit: el.stockUnit || '',
                purUnit: el.purchaseUnit || '',
            }
        }))
        setData(value);
        setOpen(false);
        // refresh();
    };
    const getData = async () => {
        const res = await request.post(`/matnr/page`, {
            pageSize: 99
            ...formData,
            pageSize: 199
        });
        if (res?.data?.code === 200) {
            setTableData(res.data.data.records);
@@ -72,7 +82,7 @@
    }, []);
    const handleSearch = () => {
        // 这里可以添加搜索逻辑
        getData()
    };
    return (
@@ -118,6 +128,16 @@
                                size="small"
                            />
                        </Grid>
                        <Grid item xs={4}>
                            <TextField
                                label={translate('table.field.matnr.groupId')}
                                name="groupId"
                                value={formData.groupId}
                                onChange={handleChange}
                                variant="outlined"
                                size="small"
                            />
                        </Grid>
                    </Grid>
                </Box>
                <Box sx={{ mt: 2 }}>
@@ -134,7 +154,7 @@
            <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}>
                <Box sx={{ width: '100%', display: 'flex', justifyContent: 'space-between' }}>
                    <Button onClick={handleSubmit} variant="contained" startIcon={<SaveIcon />}>
                        确认
                        {translate('toolbar.confirm')}
                    </Button>
                </Box>
            </DialogActions>
@@ -165,10 +185,8 @@
    ];
    const handleSelectionChange = (ids) => {
        const selectedData = ids.map((id) => tableData.find((row) => row.id === id));
        // setSelectedRows(selectedData);
        // setSelectedRows(ids);
        console.log(selectedData)
        setSelectedRows(ids)
    };
    return (
@@ -183,7 +201,7 @@
                disableColumnMenu={true}
                disableColumnSorting
                disableMultipleColumnsSorting
                autoPageSize
                columnBufferPx={100}
            />
        </div>
    );