| | |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | useGetRecordId, |
| | | Button, |
| | | useRefresh, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | |
| | | import BillStatusField from '../../../components/BillStatusField'; |
| | | import ApiOutlinedIcon from '@mui/icons-material/ApiOutlined'; |
| | | import ConfirmButton from '../../../components/ConfirmButton'; |
| | | import PageDrawer from "../../../components/PageDrawer"; |
| | | import MyField from "../../../components/MyField"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | import CheckDiffField from "../../../components/CheckDiffField"; |
| | | import CheckDiffResonDialog from "./CheckDiffResonDialog"; |
| | | import request from '@/utils/request'; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | const orderId = useGetRecordId(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [waveRule, setWaveRule] = useState(false); |
| | | |
| | | //获取波次规则 |
| | | const closeDialog = async (value) => { |
| | | setWaveRule(false) |
| | | |
| | | } |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <BillStatusField cellClassName="status" source="exceStatus" label="table.field.checkOrder.exceStatus" /> |
| | | <BillStatusField cellClassName="status" source="exceStatus$" label="table.field.checkOrder.exceStatus" /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <CheckButton /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | {/* <CheckDiffResonDialog open={waveRule} setOpen={setWaveRule} onClose={closeDialog} /> */} |
| | | </Box> |
| | | ) |
| | | } |
| | |
| | | |
| | | const CheckButton = () => { |
| | | const record = useRecordContext(); |
| | | const handleEditClick = (btn) => { |
| | | btn.stopPropagation() |
| | | |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const handleEditClick = async () => { |
| | | record.exceStatus = 2; |
| | | const { data: { code, data, msg } } = await request.post(`/checkDiffItem/update`, record); |
| | | if (code === 200) { |
| | | notify(msg); |
| | | refresh() |
| | | } else { |
| | | notify(msg); |
| | | } |
| | | } |
| | | |
| | | return ( |
| | | <ConfirmButton label={"ra.action.approved"} startIcon={<ApiOutlinedIcon />} onConfirm={handleEditClick} size={"small"} /> |
| | | record?.exceStatus != 2 ? <><ConfirmButton label={"ra.action.approved"} startIcon={<ApiOutlinedIcon />} onConfirm={handleEditClick} size={"small"} /></> : <></> |
| | | ) |
| | | } |
| | | |