| | |
| | | import DictSelect from "../components/DictSelect"; |
| | | |
| | | const AsnOrderModal = (props) => { |
| | | const { open, setOpen, asnId } = props; |
| | | const { open, setOpen, asnId, billReload } = props; |
| | | |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const [disabled, setDisabled] = useState(false) |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | |
| | |
| | | }; |
| | | |
| | | const handleSubmit = async () => { |
| | | setDisabled(true) |
| | | if (asnId === 0) { |
| | | const parmas = { |
| | | "orders": formData, |
| | |
| | | const res = await request.post(`/asnOrder/items/save`, parmas); |
| | | if (res?.data?.code === 200) { |
| | | setOpen(false); |
| | | billReload() |
| | | refresh(); |
| | | } else { |
| | | notify(res.data.msg); |
| | |
| | | if (res?.data?.code === 200) { |
| | | setOpen(false); |
| | | refresh(); |
| | | |
| | | } else { |
| | | notify(res.data.msg); |
| | | } |
| | | } |
| | | |
| | | setDisabled(false) |
| | | |
| | | }; |
| | | |
| | |
| | | </DialogContent> |
| | | <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}> |
| | | <Toolbar sx={{ width: '100%', justifyContent: 'space-between' }} > |
| | | <Button onClick={handleSubmit} variant="contained" startIcon={<SaveIcon />}> |
| | | <Button disabled={disabled} onClick={handleSubmit} variant="contained" startIcon={<SaveIcon />}> |
| | | {translate('toolbar.confirm')} |
| | | </Button> |
| | | </Toolbar> |
| | |
| | | { |
| | | field: 'maktx', |
| | | headerName: translate('table.field.asnOrderItem.maktx'), |
| | | minWidth: 100, |
| | | flex: 1, |
| | | width: 250, |
| | | editable: false, |
| | | }, |
| | | { |
| | | field: 'maktxCode', |
| | | headerName: translate('table.field.asnOrderItem.maktxCode'), |
| | | minWidth: 100, |
| | | flex: 1, |
| | | field: 'matnrCode', |
| | | headerName: translate('table.field.asnOrderItem.matnrCode'), |
| | | width: 130, |
| | | editable: false, |
| | | }, |
| | | { |
| | |
| | | // flex: 1, |
| | | // }, |
| | | { |
| | | field: 'poDetlCode', |
| | | headerName: translate('table.field.asnOrderItem.poDetlCode'), |
| | | field: 'platItemId', |
| | | headerName: translate('table.field.asnOrderItem.platItemId'), |
| | | minWidth: 100, |
| | | flex: 1, |
| | | }, |