|  |  |  | 
|---|
|  |  |  | '& .column-maktx': { | 
|---|
|  |  |  | width: 200 | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | '& .RaBulkActionsToolbar-toolbar': { | 
|---|
|  |  |  | display: 'none' | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | mt: '60px' | 
|---|
|  |  |  | // '& .RaBulkActionsToolbar-toolbar': { | 
|---|
|  |  |  | //     display: 'none' | 
|---|
|  |  |  | // } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | })); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const OutStockPublic = (props) => { | 
|---|
|  |  |  | const { record, open, setOpen } = props; | 
|---|
|  |  |  | const { record, open, setOpen, setManualDialog } = props; | 
|---|
|  |  |  | const notify = useNotify(); | 
|---|
|  |  |  | const gridRef = useGridApiRef(); | 
|---|
|  |  |  | const [rows, setRows] = useState([]); | 
|---|
|  |  |  | 
|---|
|  |  |  | }, [selectedMatnr]) | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const handleRowClick = (id, resource, record) => { | 
|---|
|  |  |  | setRowSelectedIds(prev => | 
|---|
|  |  |  | prev.includes(id) | 
|---|
|  |  |  | ? prev.filter(item => item !== id)  // 取消选择 | 
|---|
|  |  |  | : [...prev, id]                     // 添加选择 | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | const ComfirmButton = () => { | 
|---|
|  |  |  | const { selectedIds, data } = useListContext(); | 
|---|
|  |  |  | const handleRowClick = () => { | 
|---|
|  |  |  | const ids = data.filter(item => selectedIds.includes(item.id)).map(item => item.id); | 
|---|
|  |  |  | setRowSelectedIds(ids); | 
|---|
|  |  |  | const mas = data.filter(item => selectedIds.includes(item.id)).map(item => item.matnrCode); | 
|---|
|  |  |  | //设置库位信息筛选条件 | 
|---|
|  |  |  | setSelectedMatnr(mas); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //设置库位信息筛选条件 | 
|---|
|  |  |  | setSelectedMatnr(prev => | 
|---|
|  |  |  | prev.includes(record?.matnrCode) | 
|---|
|  |  |  | ? prev.filter(item => item !== record?.matnrCode)  // 取消选择 | 
|---|
|  |  |  | : [...prev, record?.matnrCode]                     // 添加选择 | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | <Button label="toolbar.confirm" size="medium" onClick={handleRowClick} /> | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const handleClickOpen = () => { | 
|---|
|  |  |  | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | useEffect(() => { | 
|---|
|  |  |  | if (open) { | 
|---|
|  |  |  | getWaveRule() | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, [open, formData]) | 
|---|
|  |  |  | getWaveRule() | 
|---|
|  |  |  | }, [open]) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const getWaveRule = async () => { | 
|---|
|  |  |  | if (formData.waveId == null && formData.waveId == undefined) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | const { data: { code, data, msg } } = await request.post('/outStock/order/getOutTaskItems', { ...formData }); | 
|---|
|  |  |  | if (code === 200) { | 
|---|
|  |  |  | setRows(data) | 
|---|
|  |  |  | // setRows(data) | 
|---|
|  |  |  | setFetchRows(data) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | notify(msg); | 
|---|
|  |  |  | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | title={"menu.outStockItem"} | 
|---|
|  |  |  | empty={false} | 
|---|
|  |  |  | filter={{ asnId: record?.id, deleted: 0 }} | 
|---|
|  |  |  | filter={{ orderId: record?.id, deleted: 0 }} | 
|---|
|  |  |  | sort={{ field: "create_time", order: "desc" }} | 
|---|
|  |  |  | actions={false} | 
|---|
|  |  |  | pagination={false} | 
|---|
|  |  |  | perPage={DEFAULT_ITEM_PAGE_SIZE} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <LinearProgress | 
|---|
|  |  |  | 
|---|
|  |  |  | <StyledDatagrid | 
|---|
|  |  |  | storeKey={"outStockPublic"} | 
|---|
|  |  |  | preferenceKey='outStockItem' | 
|---|
|  |  |  | bulkActionButtons={<></>} | 
|---|
|  |  |  | rowClick={handleRowClick} | 
|---|
|  |  |  | selectedIds={rowSelectedIds} | 
|---|
|  |  |  | bulkActionButtons={<> | 
|---|
|  |  |  | <ComfirmButton /> | 
|---|
|  |  |  | </>} | 
|---|
|  |  |  | omit={['id', 'splrName', 'qty', 'poCode',]} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <NumberField source="id" /> | 
|---|
|  |  |  | <TextField source="asnCode" label="table.field.outStockItem.asnCode" /> | 
|---|
|  |  |  | <TextField source="asnCode" label="table.field.outStockItem.orderCode" /> | 
|---|
|  |  |  | <TextField source="poCode" label="table.field.outStockItem.poCode" /> | 
|---|
|  |  |  | <TextField source="matnrCode" label="table.field.outStockItem.matnrCode" /> | 
|---|
|  |  |  | <TextField source="maktx" label="table.field.outStockItem.maktx" /> | 
|---|
|  |  |  | 
|---|
|  |  |  | { field: 'batch', headerName: '批次', width: 90 }, | 
|---|
|  |  |  | { field: 'unit', headerName: '单位', width: 60 }, | 
|---|
|  |  |  | { field: 'outQty', headerName: '出库数量', width: 110, }, | 
|---|
|  |  |  | { field: 'anfme', headerName: '库存数量', width: 110, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | field: 'anfme', headerName: '库存数量', width: 110, | 
|---|
|  |  |  | renderCell: (params) => ( | 
|---|
|  |  |  | <OutStockAnfme value={params.value} /> | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | <ConfirmButton | 
|---|
|  |  |  | label="toolbar.confirm" | 
|---|
|  |  |  | label="toolbar.allComfirm" | 
|---|
|  |  |  | variant="contained" | 
|---|
|  |  |  | size="medium" | 
|---|
|  |  |  | onConfirm={submit} | 
|---|
|  |  |  | startIcon={<ConfirmationNumberOutlinedIcon />} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | } | 
|---|