| | |
| | | useListContext, |
| | | useRefresh, |
| | | Edit, |
| | | useRedirect, |
| | | } from 'react-admin'; |
| | | import { |
| | | Dialog, |
| | |
| | | import { Delete } from '@mui/icons-material'; |
| | | import _, { set } from 'lodash'; |
| | | import StaSelect from "./StaSelect"; |
| | | import { redirect } from "react-router"; |
| | | import { number } from "prop-types"; |
| | | |
| | | const OutBoundList = () => { |
| | | |
| | |
| | | <SubmitButton |
| | | sta={sta} |
| | | data={tabelData} |
| | | setTableData={setTableData} |
| | | /> |
| | | </Stack> |
| | | </Box> |
| | |
| | | const SubmitButton = (props) =>{ |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | | const { sta, data } = props; |
| | | const redirect = useRedirect(); |
| | | const refresh = useRefresh(); |
| | | const { sta, data, setTableData } = props; |
| | | const check = ()=>{ |
| | | if(sta === "" || sta === undefined || sta === null){ |
| | | notify("请选择站点"); |
| | |
| | | return; |
| | | } |
| | | http(sta,data); |
| | | |
| | | } |
| | | const http = async (sta,data) => { |
| | | console.log("提交数据",sta,data); |
| | | 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 }); |
| | | if (code === 200) { |
| | | notify(msg); |
| | | refresh() |
| | | setTableData([]) |
| | | redirect("/task") |
| | | } else { |
| | | notify(msg); |
| | | } |
| | | } |
| | | return ( |
| | | <Button |
| | | <ConfirmButton |
| | | variant="contained" |
| | | color="primary" |
| | | onClick={check} |
| | | onConfirm={check} |
| | | label={"table.field.outBound.createTask"} |
| | | > |
| | | {translate('table.field.outBound.createTask')} |
| | | </Button> |
| | | </ConfirmButton> |
| | | ) |
| | | |
| | | } |
| | |
| | | field: 'outQty', |
| | | headerName: translate('table.field.outBound.outQty')+"*", |
| | | width: 100, |
| | | type: 'number', |
| | | editable: true, |
| | | headerClassName: "custom", |
| | | }, |
| | | { |
| | | field: 'anfme', |
| | | headerName: translate('table.field.locItem.anfme'), |
| | | type: 'number', |
| | | width: 100, |
| | | editable: false, |
| | | }, |
| | | { |
| | | field: 'workQty', |
| | | headerName: translate('table.field.locItem.workQty'), |
| | | width: 100, |
| | | type: 'number', |
| | | editable: false, |
| | | }, |
| | | { |
| | | field: 'matnrCode', |
| | | headerName: translate('table.field.locItem.matnrCode'), |
| | | width: 130, |