| | |
| | | |
| | | |
| | | const OutOrderPreview = (props) => { |
| | | const { open, setOpen, record, selectedIds } = props; |
| | | const { open, setOpen, record, selectedIds, setCloseParent } = props; |
| | | const translate = useTranslate(); |
| | | const gridRef = useGridApiRef(); |
| | | const [rows, setRows] = useState([]); |
| | |
| | | if (reason !== "backdropClick") { |
| | | // const res = await request.get(`/outStock/items/cancel/` + selectedIds); |
| | | setOpen(false); |
| | | setCloseParent(false) |
| | | } |
| | | }; |
| | | |
| | |
| | | </Grid> |
| | | </Grid> |
| | | <Toolbar sx={{ justifyContent: 'end' }}> |
| | | <ConfirmButton label="toolbar.confirm" variant="contained" size="large" gridRef={gridRef} setOpen={setOpen} /> |
| | | <ConfirmButton label="toolbar.confirm" variant="contained" size="large" gridRef={gridRef} setOpen={setOpen} setCloseParent={setCloseParent} /> |
| | | </Toolbar> |
| | | </DialogContent> |
| | | </Dialog> |
| | |
| | | |
| | | export default OutOrderPreview; |
| | | |
| | | const ConfirmButton = ({ gridRef, setOpen }) => { |
| | | const ConfirmButton = ({ gridRef, setOpen, setCloseParent }) => { |
| | | const refresh = useRefresh(); |
| | | const notify = useNotify(); |
| | | const confirm = async () => { |
| | |
| | | notify(msg); |
| | | refresh() |
| | | setOpen(false) |
| | | setCloseParent(false) |
| | | } else { |
| | | notify(msg); |
| | | } |
| | |
| | | valueGetter: (value, row) => { |
| | | return row.anfme - row.workQty - row.qty; |
| | | }, |
| | | preProcessEditCellProps: (params) => { |
| | | const hasError = !params.props.value || params.props.value.trim() === ''; |
| | | return { |
| | | ...params.props, |
| | | error: hasError, |
| | | message: hasError ? '计划数量不能为空!!' : '', |
| | | }; |
| | | }, |
| | | }, |
| | | { |
| | | field: 'workQty', headerName: '剩余数量', width: 110, type: 'number', |