|  |  |  | 
|---|
|  |  |  | AutocompleteInput, | 
|---|
|  |  |  | DeleteButton, | 
|---|
|  |  |  | useGetRecordId, | 
|---|
|  |  |  | Button, | 
|---|
|  |  |  | useRefresh, | 
|---|
|  |  |  | } from 'react-admin'; | 
|---|
|  |  |  | import { Box, Typography, Card, Stack } from '@mui/material'; | 
|---|
|  |  |  | import { styled } from '@mui/material/styles'; | 
|---|
|  |  |  | import CheckDiffItemCreate from "./CheckDiffItemCreate"; | 
|---|
|  |  |  | import CheckDiffItemPanel from "./CheckDiffItemPanel"; | 
|---|
|  |  |  | import EmptyData from "../../../components/EmptyData"; | 
|---|
|  |  |  | import MyCreateButton from "../../../components/MyCreateButton"; | 
|---|
|  |  |  | import MyExportButton from '../../../components/MyExportButton'; | 
|---|
|  |  |  | import PageDrawer from "../../../components/PageDrawer"; | 
|---|
|  |  |  | import MyField from "../../../components/MyField"; | 
|---|
|  |  |  | import BillStatusField from '../../../components/BillStatusField'; | 
|---|
|  |  |  | import ApiOutlinedIcon from '@mui/icons-material/ApiOutlined'; | 
|---|
|  |  |  | import ConfirmButton from '../../../components/ConfirmButton'; | 
|---|
|  |  |  | 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"> | 
|---|
|  |  |  | 
|---|
|  |  |  | rowClick={(id, resource, record) => false} | 
|---|
|  |  |  | expand={false} | 
|---|
|  |  |  | expandSingle={true} | 
|---|
|  |  |  | omit={['id', 'checkId','createTime', 'createBy', 'memo']} | 
|---|
|  |  |  | omit={['id', 'checkId', 'createTime$', 'createBy$', 'memo']} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <NumberField source="id" /> | 
|---|
|  |  |  | <NumberField source="checkId" label="table.field.checkDiffItem.checkId" /> | 
|---|
|  |  |  | 
|---|
|  |  |  | <TextField source="batch" label="table.field.checkDiffItem.batch" /> | 
|---|
|  |  |  | <NumberField source="anfme" label="table.field.checkDiffItem.anfme" /> | 
|---|
|  |  |  | <NumberField source="checkQty" label="table.field.checkDiffItem.checkQty" /> | 
|---|
|  |  |  | <CheckDiffField source="diffQty" label="table.field.checkDiffItem.diffQty" /> | 
|---|
|  |  |  | <TextField source="reason" label="table.field.checkDiffItem.reason" /> | 
|---|
|  |  |  | <TextField source="updateBy$" label="common.field.updateBy" /> | 
|---|
|  |  |  | <DateField source="updateTime" label="common.field.updateTime" showTime /> | 
|---|
|  |  |  | <TextField source="createBy$" label="common.field.createBy" /> | 
|---|
|  |  |  | <DateField source="createTime" label="common.field.createTime" showTime /> | 
|---|
|  |  |  | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> | 
|---|
|  |  |  | <TextField source="memo" label="common.field.memo" sortable={false} /> | 
|---|
|  |  |  | <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 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 ( | 
|---|
|  |  |  | record?.exceStatus != 2 ? <><ConfirmButton label={"ra.action.approved"} startIcon={<ApiOutlinedIcon />} onConfirm={handleEditClick} size={"small"} /></> : <></> | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | export default CheckDiffItemList; | 
|---|