|  |  | 
 |  |  |     TextInput, | 
 |  |  |     DateTimeInput, | 
 |  |  |     DateInput, | 
 |  |  |     useRefresh, | 
 |  |  |     SelectInput, | 
 |  |  |     NumberInput, | 
 |  |  |     ReferenceInput, | 
 |  |  | 
 |  |  | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; | 
 |  |  | 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 PageDrawer from "@/page/components/PageDrawer"; | 
 |  |  | import EmptyData from "@/page/components/EmptyData"; | 
 |  |  | import ConfirmButton from '../../components/ConfirmButton'; | 
 |  |  | import LocReviseCreate from "./LocReviseCreate"; | 
 |  |  | import MyField from "@/page/components/MyField"; | 
 |  |  | import TaskIcon from '@mui/icons-material/Task'; | 
 |  |  | import { styled } from '@mui/material/styles'; | 
 |  |  | import LocRevisePanel from "./LocRevisePanel"; | 
 |  |  | import * as Common from '@/utils/common'; | 
 |  |  | import request from '@/utils/request'; | 
 |  |  |  | 
 |  |  | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ | 
 |  |  |     '& .css-1vooibu-MuiSvgIcon-root': { | 
 |  |  | 
 |  |  |     <SearchInput source="condition" alwaysOn />, | 
 |  |  |     <DateInput label='common.time.after' source="timeStart" alwaysOn />, | 
 |  |  |     <DateInput label='common.time.before' source="timeEnd" alwaysOn />, | 
 |  |  |  | 
 |  |  |     <TextInput source="code" label="table.field.locRevise.code" />, | 
 |  |  |     <SelectInput source="type" label="table.field.locRevise.type" | 
 |  |  |         choices={[ | 
 |  |  |             { id: 0, name: ' 库存调整' }, | 
 |  |  |             { id:  2, name: ' 盘点调整' }, | 
 |  |  |             { id: 2, name: ' 盘点调整' }, | 
 |  |  |         ]} | 
 |  |  |     />, | 
 |  |  |     <NumberInput source="anfme" label="table.field.locRevise.anfme" />, | 
 |  |  | 
 |  |  |     <SelectInput source="exceStatus" label="table.field.locRevise.exceStatus" | 
 |  |  |         choices={[ | 
 |  |  |             { id: 0, name: '未执行' }, | 
 |  |  |             { id:  1, name: '执行中' }, | 
 |  |  |             { id:  2, name: '执行完成' }, | 
 |  |  |             { id: 1, name: '执行中' }, | 
 |  |  |             { id: 2, name: '执行完成' }, | 
 |  |  |         ]} | 
 |  |  |     />, | 
 |  |  |     <NumberInput source="orgAreaId" label="table.field.locRevise.orgAreaId" />, | 
 |  |  |     <TextInput source="orgAreaName" label="table.field.locRevise.orgAreaName" />, | 
 |  |  |  | 
 |  |  |     <TextInput label="common.field.memo" source="memo" />, | 
 |  |  |     <SelectInput | 
 |  |  |         label="common.field.status" | 
 |  |  | 
 |  |  | ] | 
 |  |  |  | 
 |  |  | const LocReviseList = () => { | 
 |  |  |     const translate = useTranslate(); | 
 |  |  |  | 
 |  |  |     const [createDialog, setCreateDialog] = useState(false); | 
 |  |  |     const [drawerVal, setDrawerVal] = useState(false); | 
 |  |  |     const translate = useTranslate(); | 
 |  |  |  | 
 |  |  |     return ( | 
 |  |  |         <Box display="flex"> | 
 |  |  | 
 |  |  |             > | 
 |  |  |                 <StyledDatagrid | 
 |  |  |                     preferenceKey='locRevise' | 
 |  |  |                     bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} | 
 |  |  |                     bulkActionButtons={false} | 
 |  |  |                     rowClick={(id, resource, record) => false} | 
 |  |  |                     expand={() => <LocRevisePanel />} | 
 |  |  |                     expand={false} | 
 |  |  |                     expandSingle={true} | 
 |  |  |                     omit={['id', 'createTime', 'createBy', 'memo']} | 
 |  |  |                     omit={['id', 'createTime', 'createBy', 'areaId', 'memo']} | 
 |  |  |                 > | 
 |  |  |                     <NumberField source="id" /> | 
 |  |  |                     <TextField source="code" label="table.field.locRevise.code" /> | 
 |  |  | 
 |  |  |                     <NumberField source="anfme" label="table.field.locRevise.anfme" /> | 
 |  |  |                     <NumberField source="reviseQty" label="table.field.locRevise.reviseQty" /> | 
 |  |  |                     <TextField source="exceStatus$" label="table.field.locRevise.exceStatus" sortable={false} /> | 
 |  |  |                     <NumberField source="orgAreaId" label="table.field.locRevise.orgAreaId" /> | 
 |  |  |                     <TextField source="orgAreaName" label="table.field.locRevise.orgAreaName" /> | 
 |  |  |  | 
 |  |  |                     <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> | 
 |  |  |                         <TextField source="nickname" /> | 
 |  |  |                     </ReferenceField> | 
 |  |  |                     <NumberField source="areaId" label="table.field.locRevise.areaId" /> | 
 |  |  |                     <TextField source="areaName" label="table.field.locRevise.areaName" /> | 
 |  |  |                     <TextField source="updateBy$" label="common.field.updateBy" /> | 
 |  |  |                     <DateField source="updateTime" label="common.field.updateTime" showTime /> | 
 |  |  |                     <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}> | 
 |  |  |                         <TextField source="nickname" /> | 
 |  |  |                     </ReferenceField> | 
 |  |  |                     <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} /> | 
 |  |  |                         <CompleteButton /> | 
 |  |  |                     </WrapperField> | 
 |  |  |                 </StyledDatagrid> | 
 |  |  |             </List> | 
 |  |  |             <LocReviseCreate | 
 |  |  |                 open={createDialog} | 
 |  |  |                 setOpen={setCreateDialog} | 
 |  |  |             /> | 
 |  |  |             <PageDrawer | 
 |  |  |                 title='LocRevise Detail' | 
 |  |  |                 drawerVal={drawerVal} | 
 |  |  |                 setDrawerVal={setDrawerVal} | 
 |  |  |             <PageEditDrawer | 
 |  |  |                 title={"toolbar.createLocRevise"} | 
 |  |  |                 drawerVal={createDialog} | 
 |  |  |                 setDrawerVal={setCreateDialog} | 
 |  |  |             > | 
 |  |  |             </PageDrawer> | 
 |  |  |                 <LocReviseCreate | 
 |  |  |                     open={createDialog} | 
 |  |  |                     setOpen={setCreateDialog} | 
 |  |  |                 /> | 
 |  |  |             </PageEditDrawer> | 
 |  |  |         </Box> | 
 |  |  |     ) | 
 |  |  | } | 
 |  |  |  | 
 |  |  |  | 
 |  |  | //完成单据 | 
 |  |  | 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.complete"} color="secondary" startIcon={<TaskIcon />} onConfirm={requestComplete} /> : <></> | 
 |  |  |     ) | 
 |  |  |  | 
 |  |  |  | 
 |  |  | } | 
 |  |  |  | 
 |  |  |  | 
 |  |  | export default LocReviseList; |