| | |
| | | const SubmitButton = ({ selectedIds, setSelectedIds, rowSelectedIds, gridRef, record }) => { |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const translate = useTranslate(); |
| | | const redirect = useRedirect(); |
| | | const submit = async () => { |
| | | const items = gridRef.current?.getSortedRows(); |
| | | let selctRecord = items.filter(item => selectedIds.includes(item?.id)); |
| | | if (selctRecord == undefined || selctRecord.length < 1) { |
| | | notify(translate('common.msg.locEmpty'), { type: 'error' }); |
| | | return |
| | | } |
| | | |
| | | //过滤,将库位添加至盘点单明细中 |
| | | const records = rowSelectedIds.map(map =>{ |
| | | const records = rowSelectedIds.map(map => { |
| | | return { |
| | | ...map, |
| | | items: selctRecord.filter(item => item.matnrCode == map.matnrCode) |
| | | } |
| | | }) |
| | | |
| | | const { data: { code, data, msg } } = await request.post('/check/generate/tasks', records); |
| | | if (code == 200) { |
| | | refresh(); |
| | | redirect("/task") |
| | | } else { |
| | | notify(msg); |
| | | } |
| | | |
| | | console.log(records); |
| | | |
| | | |
| | | // const { data: { code, data, msg } } = await request.post('/check/generate/tasks', records); |
| | | // if (code == 200) { |
| | | // refresh(); |
| | | // redirect("/task") |
| | | // } else { |
| | | // notify(msg); |
| | | // } |
| | | } |
| | | return ( |
| | | <ConfirmButton |