| | |
| | | const redirect = useRedirect(); |
| | | const refresh = useRefresh(); |
| | | const { orgLoc, tarLoc } = props; |
| | | const check = () => { |
| | | const move = () => { |
| | | console.log(orgLoc, tarLoc); |
| | | if (orgLoc === "" || orgLoc === undefined || orgLoc === null) { |
| | | notify("请选择站点"); |
| | |
| | | notify("请选择站点"); |
| | | return; |
| | | } |
| | | |
| | | http(orgLoc, tarLoc?.id) |
| | | } |
| | | const http = async (sta, items) => { |
| | | console.log(items); |
| | | |
| | | const filter = items.filter(item => (item.outQty + item.workQty) > item.anfme); |
| | | if (filter.length > 0) { |
| | | notify(translate('toolbar.request.error.out_stock_qty')) |
| | | return |
| | | } |
| | | const { data: { code, data, msg } } = await request.post(`/locItem/generate/task`, { siteNo: sta, items: items }); |
| | | const http = async (orgLoc, tarLoc) => { |
| | | const { data: { code, data, msg } } = await request.post(`/locItem/move/task`, { orgLoc, tarLoc }); |
| | | if (code === 200) { |
| | | notify(msg); |
| | | refresh() |
| | | setTableData([]) |
| | | redirect("/task") |
| | | } else { |
| | | notify(msg); |
| | |
| | | <ConfirmButton |
| | | variant="contained" |
| | | color="primary" |
| | | onConfirm={check} |
| | | onConfirm={move} |
| | | label={"table.field.outBound.createTask"} |
| | | > |
| | | </ConfirmButton> |