|  |  | 
 |  |  | import AddIcon from '@mui/icons-material/Add'; | 
 |  |  | import request from '@/utils/request'; | 
 |  |  | import AsnSelModal from "./AsnSelModal"; | 
 |  |  | import InspectModal from "./InspectModal"; | 
 |  |  |  | 
 |  |  | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ | 
 |  |  |     '& .css-1vooibu-MuiSvgIcon-root': { | 
 |  |  | 
 |  |  |                     marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, | 
 |  |  |                 }} | 
 |  |  |                 title={"menu.qlyInspect"} | 
 |  |  |                 empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} | 
 |  |  |                 empty={<EmptyData | 
 |  |  |                     children={ | 
 |  |  |                         <Box sx={{ gap: 2, display: 'flex' }}> | 
 |  |  |                             <AsnCreatButton isInit={true} /> | 
 |  |  |                         </Box> | 
 |  |  |                     } | 
 |  |  |                     onClick={() => { }} />} | 
 |  |  |                 filters={filters} | 
 |  |  |                 sort={{ field: "create_time", order: "desc" }} | 
 |  |  |                 actions={( | 
 |  |  | 
 |  |  |                     omit={['id', 'createTime', 'createBy', 'memo', 'asnId', 'statusBool']} | 
 |  |  |                 > | 
 |  |  |                     <NumberField source="id" /> | 
 |  |  |                     <NumberField source="asnId" label="table.field.qlyInspect.asnId" /> | 
 |  |  |                     <NumberField source="asnCode" label="table.field.qlyInspect.asnCode" /> | 
 |  |  |                     <TextField source="code" label="table.field.qlyInspect.code" /> | 
 |  |  |                     <TextField source="isptStatus$" label="table.field.qlyInspect.isptStatus" /> | 
 |  |  |                     <TextField source="wkType" label="table.field.qlyInspect.wkType" /> | 
 |  |  |                     <TextField source="wkType$" label="table.field.qlyInspect.wkType" /> | 
 |  |  |                     <NumberField source="asnId" label="table.field.qlyInspect.asnId" /> | 
 |  |  |                     <NumberField source="asnCode" label="table.field.qlyInspect.asnCode" /> | 
 |  |  |                     <NumberField source="safeQty" label="table.field.qlyInspect.safeQty" /> | 
 |  |  |                     <NumberField source="dlyQty" label="table.field.qlyInspect.dlyQty" /> | 
 |  |  |                     <NumberField source="rcptQty" label="table.field.qlyInspect.rcptQty" /> | 
 |  |  | 
 |  |  |     const record = useRecordContext(); | 
 |  |  |     const notify = useNotify(); | 
 |  |  |     const refresh = useRefresh(); | 
 |  |  |     const inspection = () => { | 
 |  |  |         //   requestInspect([record]) | 
 |  |  |     }; | 
 |  |  |  | 
 |  |  |     // const requestInspect = async (rows) => { | 
 |  |  |     //   const { data: { code, data, msg } } = await request.post(`/asnOrder/inspect`, rows); | 
 |  |  |  | 
 |  |  |     //   if (code === 200) { | 
 |  |  |     //     notify(msg); | 
 |  |  |     //     refresh() | 
 |  |  |     //   } else { | 
 |  |  |     //     notify(msg); | 
 |  |  |     //   } | 
 |  |  |     // } | 
 |  |  |     const [createDialog, setCreateDialog] = useState(false); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     return ( | 
 |  |  |         <Button onClick={inspection} label={"toolbar.quality"}> | 
 |  |  |             <ConstructionIcon /> | 
 |  |  |         </Button> | 
 |  |  |         <> | 
 |  |  |             <Button onClick={() => setCreateDialog(true)} label={"toolbar.quality"}> | 
 |  |  |                 <ConstructionIcon /> | 
 |  |  |             </Button> | 
 |  |  |  | 
 |  |  |             <InspectModal | 
 |  |  |                 open={createDialog} | 
 |  |  |                 setOpen={setCreateDialog} | 
 |  |  |                 ispectId={record.id} | 
 |  |  |             /> | 
 |  |  |         </> | 
 |  |  |     ) | 
 |  |  | } | 
 |  |  |  | 
 |  |  | 
 |  |  |     ) | 
 |  |  | } | 
 |  |  |  | 
 |  |  | const AsnCreatButton = () => { | 
 |  |  | const AsnCreatButton = ({ isInit }) => { | 
 |  |  |     const record = useRecordContext(); | 
 |  |  |     const notify = useNotify(); | 
 |  |  |     const refresh = useRefresh(); | 
 |  |  |     const [createDialog, setCreateDialog] = useState(false); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     return ( | 
 |  |  |         <> | 
 |  |  |             <Button onClick={() => setCreateDialog(true)} label={"toolbar.asnCreate"}> | 
 |  |  |                 <AddIcon /> | 
 |  |  |             </Button> | 
 |  |  |             { | 
 |  |  |                 isInit ? <Button onClick={() => setCreateDialog(true)} label={"toolbar.asnCreate"} variant="contained" | 
 |  |  |                     color="primary"> | 
 |  |  |                     <AddIcon /> | 
 |  |  |                 </Button> : <Button onClick={() => setCreateDialog(true)} label={"toolbar.asnCreate"} > | 
 |  |  |                     <AddIcon /> | 
 |  |  |                 </Button> | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |             <AsnSelModal | 
 |  |  |                 open={createDialog} |