|  |  | 
 |  |  |     TextInput, | 
 |  |  |     DateTimeInput, | 
 |  |  |     DateInput, | 
 |  |  |     useRefresh, | 
 |  |  |     SelectInput, | 
 |  |  |     NumberInput, | 
 |  |  |     ReferenceInput, | 
 |  |  | 
 |  |  | import MyCreateButton from "@/page/components/MyCreateButton"; | 
 |  |  | import MyExportButton from '@/page/components/MyExportButton'; | 
 |  |  | import PageEditDrawer from "@/page/components/PageEditDrawer"; | 
 |  |  | import { Box, Typography, Card, Stack } from '@mui/material'; | 
 |  |  | import { Box, Typography, Card, Stack, Switch } from '@mui/material'; | 
 |  |  | import ConfirmButton from '../../components/ConfirmButton'; | 
 |  |  | import LocReviseCreate from "./LocReviseCreate"; | 
 |  |  | import TaskIcon from '@mui/icons-material/Task'; | 
 |  |  | import { styled } from '@mui/material/styles'; | 
 |  |  | import request from '@/utils/request'; | 
 |  |  |  | 
 |  |  | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ | 
 |  |  |     '& .css-1vooibu-MuiSvgIcon-root': { | 
 |  |  | 
 |  |  |     <SelectInput source="type" label="table.field.locRevise.type" | 
 |  |  |         choices={[ | 
 |  |  |             { id: 0, name: ' 库存调整' }, | 
 |  |  |             { id: 2, name: ' 盘点调整' }, | 
 |  |  |             { id: 1, name: ' 盘点调整' }, | 
 |  |  |             { id: 2, name: ' 其它调整' }, | 
 |  |  |         ]} | 
 |  |  |     />, | 
 |  |  |     <NumberInput source="anfme" label="table.field.locRevise.anfme" />, | 
 |  |  | 
 |  |  |                     rowClick={(id, resource, record) => false} | 
 |  |  |                     expand={false} | 
 |  |  |                     expandSingle={true} | 
 |  |  |                     omit={['id', 'createTime', 'createBy', 'orgAreaId', 'memo']} | 
 |  |  |                     omit={['id', 'createTime', 'createBy', 'areaId', 'memo']} | 
 |  |  |                 > | 
 |  |  |                     <NumberField source="id" /> | 
 |  |  |                     <TextField source="code" label="table.field.locRevise.code" /> | 
 |  |  |                     <TextField source="type$" label="table.field.locRevise.type" sortable={false} /> | 
 |  |  |                     <NumberField source="anfme" label="table.field.locRevise.anfme" /> | 
 |  |  |                     <NumberField source="reviseQty" label="table.field.locRevise.reviseQty" /> | 
 |  |  |                     {/* <NumberField source="anfme" label="table.field.locRevise.anfme" /> | 
 |  |  |                     <NumberField source="reviseQty" label="table.field.locRevise.reviseQty" /> */} | 
 |  |  |                     <NumberField source="areaId" label="table.field.locRevise.areaId" /> | 
 |  |  |                     <TextField source="areaName" label="table.field.locRevise.areaName" /> | 
 |  |  |                     <TextField source="exceStatus$" label="table.field.locRevise.exceStatus" sortable={false} /> | 
 |  |  |                     <NumberField source="orgAreaId" label="table.field.locRevise.areaId" /> | 
 |  |  |                     <TextField source="orgAreaName" label="table.field.locRevise.areaName" /> | 
 |  |  |                     <TextField source="updateBy$" label="common.field.updateBy" /> | 
 |  |  |                     <DateField source="updateTime" label="common.field.updateTime" showTime /> | 
 |  |  |                     <DateField source="createBy$" label="common.field.createBy" /> | 
 |  |  |                     <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} /> | 
 |  |  |                     <WrapperField cellClassName="opt" label="common.field.opt"> | 
 |  |  |                         <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> | 
 |  |  |                         <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> | 
 |  |  |                         <DelButton /> | 
 |  |  |                         <CompleteButton /> | 
 |  |  |                     </WrapperField> | 
 |  |  |                 </StyledDatagrid> | 
 |  |  |             </List> | 
 |  |  | 
 |  |  |     ) | 
 |  |  | } | 
 |  |  |  | 
 |  |  | const DelButton = () => { | 
 |  |  |     const record = useRecordContext(); | 
 |  |  |     return ( | 
 |  |  |         record?.exceStatus == 0 ? <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> : <></> | 
 |  |  |     ) | 
 |  |  | } | 
 |  |  |  | 
 |  |  | //完成单据 | 
 |  |  | const CompleteButton = () => { | 
 |  |  |     const record = useRecordContext(); | 
 |  |  |     const notify = useNotify(); | 
 |  |  |     const refresh = useRefresh(); | 
 |  |  |     const requestComplete = async () => { | 
 |  |  |         const { data: { code, data, msg } } = await request.post(`/reviseLog/complete/${record.id}`); | 
 |  |  |         if (code === 200) { | 
 |  |  |             notify(msg); | 
 |  |  |             refresh() | 
 |  |  |         } else { | 
 |  |  |             notify(msg); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     return ( | 
 |  |  |         record.exceStatus == 1 ? <ConfirmButton label={"toolbar.confirmTransfer"} color="secondary" startIcon={<TaskIcon />} onConfirm={requestComplete} size="small" /> : <></> | 
 |  |  |     ) | 
 |  |  |  | 
 |  |  | } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  | export default LocReviseList; |