|  |  |  | 
|---|
|  |  |  | import debounce from 'lodash/debounce'; | 
|---|
|  |  |  | import { DataGrid } from '@mui/x-data-grid'; | 
|---|
|  |  |  | import PrintModal from './PrintModal'; | 
|---|
|  |  |  | import { width } from "@mui/system"; | 
|---|
|  |  |  | const AsnOrderPanel = () => { | 
|---|
|  |  |  | import PrintIcon from '@mui/icons-material/Print'; | 
|---|
|  |  |  | const AsnOrderPanel = ({ billReload }) => { | 
|---|
|  |  |  | const record = useRecordContext(); | 
|---|
|  |  |  | if (!record) return null; | 
|---|
|  |  |  | const translate = useTranslate(); | 
|---|
|  |  |  | 
|---|
|  |  |  | debouncedHttp({ maktx }); | 
|---|
|  |  |  | }, [asnId, maktx]); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const http = async (parmas) => { | 
|---|
|  |  |  | const res = await request.post('/asnOrderItem/page', { ...parmas, asnId }); | 
|---|
|  |  |  | if (res?.data?.code === 200) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | useEffect(() => { | 
|---|
|  |  |  | billReload.current = http | 
|---|
|  |  |  | }, []); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const debouncedHttp = useMemo(() => debounce(http, 300), []); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const columns = [ | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | field: 'asnCode', | 
|---|
|  |  |  | headerName: translate('table.field.asnOrderItem.asnCode') | 
|---|
|  |  |  | headerName: translate('table.field.asnOrderItem.asnCode'), | 
|---|
|  |  |  | width: 150, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // { | 
|---|
|  |  |  | //     field: 'poDetlId', | 
|---|
|  |  |  | //     headerName: translate('table.field.asnOrderItem.poDetlId') | 
|---|
|  |  |  | // }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | field: 'poDetlId', | 
|---|
|  |  |  | headerName: translate('table.field.asnOrderItem.poDetlId') | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | field: 'poDetlCode', | 
|---|
|  |  |  | field: 'poCode', | 
|---|
|  |  |  | headerName: translate('table.field.asnOrderItem.poDetlCode') | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | field: 'matnrCode', | 
|---|
|  |  |  | headerName: translate('table.field.asnOrderItem.matnrCode') | 
|---|
|  |  |  | headerName: translate('table.field.asnOrderItem.matnrCode'), | 
|---|
|  |  |  | width: 150, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | field: 'maktx', | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | field: 'trackCode', | 
|---|
|  |  |  | headerName: translate('table.field.asnOrderItem.barcode') | 
|---|
|  |  |  | headerName: translate('table.field.asnOrderItem.barcode'), | 
|---|
|  |  |  | width: 150 | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | field: 'prodTime', | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | <Box sx={{ | 
|---|
|  |  |  | position: 'relative', | 
|---|
|  |  |  | padding: '5px 10px' | 
|---|
|  |  |  | }}> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '4px', alignItems: 'center' }}> | 
|---|
|  |  |  | <TextField value={maktx} onChange={(e) => maktxChange(e.target.value)} label="搜索物料" variant="outlined" sx={{ width: '300px' }} /> | 
|---|
|  |  |  | <TextField value={maktx} onChange={(e) => maktxChange(e.target.value)} label="搜索物料" sx={{ width: '300px' }} size="small" /> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <div style={{ display: 'flex', gap: '10px' }}> | 
|---|
|  |  |  | <PrintsButton rows={selectedRows} /> | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <DataGrid | 
|---|
|  |  |  | sx={{ width: 'calc(100vw - 280px)' }} | 
|---|
|  |  |  | size="small" | 
|---|
|  |  |  | rows={rows} | 
|---|
|  |  |  | columns={columns} | 
|---|
|  |  |  | 
|---|
|  |  |  | disableColumnMenu={true} | 
|---|
|  |  |  | disableColumnSorting | 
|---|
|  |  |  | disableMultipleColumnsSorting | 
|---|
|  |  |  | columnHeaderHeight={40} | 
|---|
|  |  |  | rowHeight={42} | 
|---|
|  |  |  | initialState={{ | 
|---|
|  |  |  | pagination: { | 
|---|
|  |  |  | paginationModel: { | 
|---|
|  |  |  | pageSize: 10, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | pageSizeOptions={[10, 25, 50]} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Box > | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | <> | 
|---|
|  |  |  | <Button size="small" variant="contained" color="secondary" onClick={modalChange}>{translate("toolbar.batchPrint")}</Button> | 
|---|
|  |  |  | <Button size="small" color="secondary" onClick={modalChange} startIcon={<PrintIcon />}>{translate("toolbar.batchPrint")}</Button> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <PrintModal | 
|---|
|  |  |  | open={createDialog} | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | <> | 
|---|
|  |  |  | <Button size="small" variant="contained" color="secondary" onClick={() => setCreateDialog(true)}>{translate("toolbar.print")}</Button> | 
|---|
|  |  |  | <Button size="small" color="secondary" onClick={() => setCreateDialog(true)} startIcon={<PrintIcon />}>{translate("toolbar.print")}</Button> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <PrintModal | 
|---|
|  |  |  | open={createDialog} | 
|---|