|  |  | 
 |  |  |   DatagridConfigurable, | 
 |  |  |   SearchInput, | 
 |  |  |   TopToolbar, | 
 |  |  |   Toolbar, | 
 |  |  |   SelectColumnsButton, | 
 |  |  |   EditButton, | 
 |  |  |   FilterButton, | 
 |  |  | 
 |  |  |   useRedirect, | 
 |  |  |   useUnselectAll, | 
 |  |  | } from 'react-admin'; | 
 |  |  | import { Box, Typography, Card, Stack } from '@mui/material'; | 
 |  |  | import { Box, Typography, Card, Stack, Drawer } from '@mui/material'; | 
 |  |  | import { styled } from '@mui/material/styles'; | 
 |  |  | import EmptyData from "../../components/EmptyData"; | 
 |  |  | import MyCreateButton from "../../components/MyCreateButton"; | 
 |  |  | import MyExportButton from '../../components/MyExportButton'; | 
 |  |  | import BillStatusField from '../../components/BillStatusField'; | 
 |  |  | import ConfirmButton from '../../components/ConfirmButton'; | 
 |  |  | import PageDrawer from "../../components/PageDrawer"; | 
 |  |  | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; | 
 |  |  | import EditIcon from '@mui/icons-material/Edit'; | 
 |  |  | import request from '@/utils/request'; | 
 |  |  | 
 |  |  | import ImportButton from "../../components/ImportButton"; | 
 |  |  | import DetailsIcon from '@mui/icons-material/Details'; | 
 |  |  | import CancelOutlinedIcon from '@mui/icons-material/CancelOutlined'; | 
 |  |  | import OutOrderCreate from "./OutOrderCreate"; | 
 |  |  | import AddIcon from '@mui/icons-material/Add'; | 
 |  |  | import OutOrderModal from "./OutOrderModal"; | 
 |  |  | import PublicIcon from '@mui/icons-material/Public'; | 
 |  |  | import SelectMatnrModal from "./SelectMatnrModal"; | 
 |  |  | import AddTaskIcon from '@mui/icons-material/AddTask'; | 
 |  |  | import PageEditDrawer from "../../components/PageEditDrawer"; | 
 |  |  | import OutStockPublic from "./OutStockPublic"; | 
 |  |  |  | 
 |  |  | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ | 
 |  |  |   '& .css-1vooibu-MuiSvgIcon-root': { | 
 |  |  | 
 |  |  |             theme.transitions.create(['all'], { | 
 |  |  |               duration: theme.transitions.duration.enteringScreen, | 
 |  |  |             }), | 
 |  |  |           marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, | 
 |  |  |         }} | 
 |  |  |         title={"menu.outStock"} | 
 |  |  |         empty={false} | 
 |  |  | 
 |  |  |             <CreateByOrderButton setCreateDialog={setCreateDialog} /> | 
 |  |  |             <MyCreateButton onClick={() => { setManualDialog(true); setmodalType(0) }} /> | 
 |  |  |             <SelectColumnsButton preferenceKey='outStock' /> | 
 |  |  |             <ImportButton value={'asnOrderItem'} /> | 
 |  |  |             <ImportButton value={'outStockItem'} /> | 
 |  |  |             {/* <MyExportButton /> */} | 
 |  |  |           </TopToolbar> | 
 |  |  |         )} | 
 |  |  | 
 |  |  |         <StyledDatagrid | 
 |  |  |           sx={{ width: '100%' }} | 
 |  |  |           preferenceKey='outStock' | 
 |  |  |           bulkActionButtons={ | 
 |  |  |             <PublicTaskButton />} | 
 |  |  |           bulkActionButtons={<PublicTaskButton />} | 
 |  |  |           rowClick={false} | 
 |  |  |           expandSingle={true} | 
 |  |  |           omit={['id', 'createTime', 'createBy', 'memo', 'poId', 'rleStatus$']} | 
 |  |  |           omit={['id', 'createTime', 'createBy', 'memo', 'rleStatus$']} | 
 |  |  |         > | 
 |  |  |           <NumberField source="id" /> | 
 |  |  |           <TextField source="code" label="table.field.outStock.code" /> | 
 |  |  |           <TextField source="poCode" label="table.field.outStock.poCode" /> | 
 |  |  |           <NumberField source="poId" label="table.field.outStock.poId" /> | 
 |  |  |           <TextField source="type$" label="table.field.outStock.type" /> | 
 |  |  |           <TextField cellClassName="wkType" source="wkType$" label="table.field.outStock.wkType" /> | 
 |  |  |           <NumberField source="anfme" label="table.field.outStock.anfme" /> | 
 |  |  | 
 |  |  |             <MyButton setCreateDialog={setManualDialog} setmodalType={setmodalType} /> | 
 |  |  |             <EditButton label="toolbar.detail" icon={(<DetailsIcon />)}></EditButton> | 
 |  |  |             <CancelButton /> | 
 |  |  |             <PublicButton setDrawerVal={setDrawerVal} drawerVal={drawerVal} setSelect={setSelect} /> | 
 |  |  |           </WrapperField> | 
 |  |  |         </StyledDatagrid> | 
 |  |  |       </List> | 
 |  |  | 
 |  |  |         open={createDialog} | 
 |  |  |         setOpen={setCreateDialog} | 
 |  |  |       /> | 
 |  |  |       <PageDrawer | 
 |  |  |         title='AsnOrder Detail' | 
 |  |  |       <PageEditDrawer | 
 |  |  |         title={"toolbar.publicWorking"} | 
 |  |  |         drawerVal={drawerVal} | 
 |  |  |         setDrawerVal={setDrawerVal} | 
 |  |  |       /> | 
 |  |  |       > | 
 |  |  |         <OutStockPublic record={select} open={drawerVal} setOpen={setDrawerVal}/> | 
 |  |  |       </PageEditDrawer> | 
 |  |  |     </Box > | 
 |  |  |   ) | 
 |  |  | } | 
 |  |  | 
 |  |  |   } | 
 |  |  |  | 
 |  |  |   return ( | 
 |  |  |     record?.exceStatus == 10 ? <ConfirmButton label={"toolbar.cancel"} startIcon={<CancelOutlinedIcon />} onConfirm={cancelOrder} /> : <></> | 
 |  |  |     record?.exceStatus == 10 ? <ConfirmButton label={"toolbar.cancel"} startIcon={<CancelOutlinedIcon />} onConfirm={cancelOrder} size={"small"} /> : <></> | 
 |  |  |   ) | 
 |  |  | } | 
 |  |  |  | 
 |  |  | //下发执行 | 
 |  |  | const PublicButton = ({ setDrawerVal, setSelect }) => { | 
 |  |  |   const record = useRecordContext(); | 
 |  |  |   const refresh = useRefresh(); | 
 |  |  |   const taskEvent = () => { | 
 |  |  |     setDrawerVal(true) | 
 |  |  |     setSelect(record) | 
 |  |  |     refresh(); | 
 |  |  |   } | 
 |  |  |  | 
 |  |  |   return ( | 
 |  |  |     record.workQty < record.anfme ? <ConfirmButton label={"toolbar.publicWorking"} startIcon={<AddTaskIcon />} onConfirm={taskEvent} size={"small"} /> : <></> | 
 |  |  |   ) | 
 |  |  | } |