|  |  | 
 |  |  | 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 MyField from "../components/MyField"; | 
 |  |  | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; | 
 |  |  | 
 |  |  | import FileDownloadIcon from '@mui/icons-material/FileDownload'; | 
 |  |  | import EditIcon from '@mui/icons-material/Edit'; | 
 |  |  | import TaskIcon from '@mui/icons-material/Task'; | 
 |  |  | import CloseIcon from '@mui/icons-material/Close'; | 
 |  |  | import request from '@/utils/request'; | 
 |  |  |  | 
 |  |  | import DictionarySelect from "../components/DictionarySelect"; | 
 |  |  |  | 
 |  |  | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ | 
 |  |  |   '& .css-1vooibu-MuiSvgIcon-root': { | 
 |  |  | 
 |  |  |   '& .column-name': { | 
 |  |  |   }, | 
 |  |  |   '& .opt': { | 
 |  |  |     width: 200 | 
 |  |  |     width: 320 | 
 |  |  |   }, | 
 |  |  |   '& .status': { | 
 |  |  |     width: 100 | 
 |  |  |   }, | 
 |  |  | })); | 
 |  |  |  | 
 |  |  | 
 |  |  |   />, | 
 |  |  |  | 
 |  |  |   <TextInput label="common.field.memo" source="memo" />, | 
 |  |  |   <SelectInput | 
 |  |  |     label="common.field.status" | 
 |  |  |     source="status" | 
 |  |  |     choices={[ | 
 |  |  |       { id: '1', name: 'common.enums.statusTrue' }, | 
 |  |  |       { id: '0', name: 'common.enums.statusFalse' }, | 
 |  |  |     ]} | 
 |  |  |     resettable | 
 |  |  |   <DictionarySelect | 
 |  |  |     label='common.field.status' | 
 |  |  |     name="exceStatus" | 
 |  |  |     dictTypeCode="sys_asn_exce_status" | 
 |  |  |   />, | 
 |  |  |  | 
 |  |  | ] | 
 |  |  |  | 
 |  |  | const AsnOrderList = () => { | 
 |  |  | 
 |  |  |   const [createDialog, setCreateDialog] = useState(false); | 
 |  |  |   const [drawerVal, setDrawerVal] = useState(false); | 
 |  |  |   const [modalType, setmodalType] = useState(0); | 
 |  |  |   const [billReload, setBillReload] = useState(null); | 
 |  |  |   const billReload = useRef(); | 
 |  |  |  | 
 |  |  |   const navigate = useNavigate(); | 
 |  |  |   const assign = (record) => { | 
 |  |  | 
 |  |  |           preferenceKey='asnOrder' | 
 |  |  |           bulkActionButtons={<> <InspectionsButton /><BulkDeleteButton mutationMode={OPERATE_MODE} /></>} | 
 |  |  |           rowClick={() => false} | 
 |  |  |           expand={<AsnOrderPanel setBillReload={setBillReload} />} | 
 |  |  |           expand={<AsnOrderPanel billReload={billReload} />} | 
 |  |  |           expandSingle={true} | 
 |  |  |           omit={['id', 'createTime', 'createBy', 'memo', 'poId']} | 
 |  |  |         > | 
 |  |  | 
 |  |  |             <TextField source="nickname" /> | 
 |  |  |           </ReferenceField> | 
 |  |  |           <DateField source="createTime" label="common.field.createTime" showTime /> | 
 |  |  |           <TextField source="exceStatus$" label="common.field.status" /> | 
 |  |  |           {/* <BooleanField source="statusBool" label="common.field.status" sortable={false} /> */} | 
 |  |  |           <BillStatusField cellClassName="status" source="exceStatus" label="common.field.status" /> | 
 |  |  |           <TextField source="memo" label="common.field.memo" sortable={false} /> | 
 |  |  |           <WrapperField cellClassName="opt" label="common.field.opt" > | 
 |  |  |           <WrapperField cellClassName="opt" label="common.field.opt" width={300} > | 
 |  |  |             {/* <Button label="toolbar.print" onClick={print}> | 
 |  |  |               <FileDownloadIcon /> | 
 |  |  |             </Button> */} | 
 |  |  | 
 |  |  |             </Button> */} | 
 |  |  |             <InspectionButton /> | 
 |  |  |             <CompleteButton /> | 
 |  |  |             <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> | 
 |  |  |             {/* <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> */} | 
 |  |  |             <CloseButton /> | 
 |  |  |           </WrapperField> | 
 |  |  |         </StyledDatagrid> | 
 |  |  |       </List> | 
 |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |   return ( | 
 |  |  |     <Button onClick={requestComplete} label={"toolbar.complete"} color="success"> | 
 |  |  |     record.exceStatus === 1 && (record.anfme === record.qty ? <Button onClick={requestComplete} label={"toolbar.complete"} color="success"> | 
 |  |  |       <TaskIcon /> | 
 |  |  |     </Button> | 
 |  |  |     </Button> : <ConfirmButton label={"toolbar.complete"} color="success" data={'当前收货数量小于计划数量,是否确认完成'} startIcon={<TaskIcon />} onConfirm={requestComplete} />) | 
 |  |  |  | 
 |  |  |   ) | 
 |  |  |  | 
 |  |  |  | 
 |  |  | } | 
 |  |  |  | 
 |  |  | const CloseButton = () => { | 
 |  |  |   const record = useRecordContext(); | 
 |  |  |   const notify = useNotify(); | 
 |  |  |   const refresh = useRefresh(); | 
 |  |  |   const requestClose = async () => { | 
 |  |  |     const { data: { code, data, msg } } = await request.post(`/asnOrder/close/${record.id}`); | 
 |  |  |  | 
 |  |  |     if (code === 200) { | 
 |  |  |       notify(msg); | 
 |  |  |       refresh() | 
 |  |  |     } else { | 
 |  |  |       notify(msg); | 
 |  |  |     } | 
 |  |  |   } | 
 |  |  |  | 
 |  |  |   return ( | 
 |  |  |     (<Button onClick={requestClose} label={"toolbar.close"} color="error"> | 
 |  |  |       <CloseIcon /> | 
 |  |  |     </Button>) | 
 |  |  |   ) | 
 |  |  | } |