|  |  |  | 
|---|
|  |  |  | const setFinally = () => { | 
|---|
|  |  |  | const rows = tableRef.current.state.editRows; | 
|---|
|  |  |  | for (const key in rows) { | 
|---|
|  |  |  | const find = tabelData.find(item => item.matnrId === +key); | 
|---|
|  |  |  | const find = tabelData.find(item => item.id === +key); | 
|---|
|  |  |  | find.anfme = rows[key].anfme.value; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | setTableData([...tabelData]); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const handleDeleteItem = () => { | 
|---|
|  |  |  | const newTableData = _.filter(tabelData, (item) => !selectedRows.includes(item.matnrId)); | 
|---|
|  |  |  | const newTableData = _.filter(tabelData, (item) => !selectedRows.includes(item.id)); | 
|---|
|  |  |  | setTableData(newTableData); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | value: selectedSupplier.id, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | ), | 
|---|
|  |  |  | headerClassName: "custom", | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // { | 
|---|
|  |  |  | //     field: 'packName', | 
|---|
|  |  |  | //     headerName: translate('table.field.asnOrderItem.packName'), | 
|---|
|  |  |  | //     minWidth: 100, | 
|---|
|  |  |  | //     flex: 1, | 
|---|
|  |  |  | //     editable: true, | 
|---|
|  |  |  | // }, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | { | 
|---|
|  |  |  | field: 'platItemId', | 
|---|
|  |  |  | headerName: translate('table.field.asnOrderItem.platItemId') + "*", | 
|---|
|  |  |  | 
|---|
|  |  |  | flex: 1, | 
|---|
|  |  |  | editable: true, | 
|---|
|  |  |  | headerClassName: "custom", | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | field: 'splrBatch', | 
|---|
|  |  |  | headerName: translate('table.field.asnOrderItem.splrBatch'), | 
|---|
|  |  |  | minWidth: 100, | 
|---|
|  |  |  | flex: 1, | 
|---|
|  |  |  | editable: true, | 
|---|
|  |  |  | headerClassName: "custom", | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // { | 
|---|
|  |  |  | 
|---|
|  |  |  | //     flex: 1, | 
|---|
|  |  |  | //     editable: true, | 
|---|
|  |  |  | // }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | field: 'purUnit', | 
|---|
|  |  |  | headerName: translate('table.field.asnOrderItem.purUnit'), | 
|---|
|  |  |  | minWidth: 100, | 
|---|
|  |  |  | flex: 1, | 
|---|
|  |  |  | editable: false, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // { | 
|---|
|  |  |  | //     field: 'purUnit', | 
|---|
|  |  |  | //     headerName: translate('table.field.asnOrderItem.purUnit'), | 
|---|
|  |  |  | //     minWidth: 100, | 
|---|
|  |  |  | //     flex: 1, | 
|---|
|  |  |  | //     editable: false, | 
|---|
|  |  |  | // }, | 
|---|
|  |  |  | ]) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const action = { | 
|---|
|  |  |  | 
|---|
|  |  |  | </IconButton> | 
|---|
|  |  |  | </Tooltip> | 
|---|
|  |  |  | ), | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | let cdata = useRef([]); | 
|---|
|  |  |  | 
|---|
|  |  |  | } = await request.get("/fields/enable/list"); | 
|---|
|  |  |  | if (code === 200) { | 
|---|
|  |  |  | const cols = data.map(el => ({ | 
|---|
|  |  |  | field: el.fields, | 
|---|
|  |  |  | field:  el.fields, | 
|---|
|  |  |  | valueGetter: (value, row) => { | 
|---|
|  |  |  | if (value != null && value != undefined) { | 
|---|
|  |  |  | return value; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (row.extendFields == null  ||row.extendFields[el.fields] == null) { | 
|---|
|  |  |  | return '' | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | return `${row.extendFields[el.fields] == null ? '' : row.extendFields[el.fields]}`; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | headerName: el.fieldsAlise, | 
|---|
|  |  |  | minWidth: 100, | 
|---|
|  |  |  | flex: 1, | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const handleDelete = (row) => { | 
|---|
|  |  |  | const newData = _.filter(cdata.current, (item) => item.matnrId !== row.matnrId); | 
|---|
|  |  |  | const newData = _.filter(cdata.current, (item) => item.id !== row.id); | 
|---|
|  |  |  | setTableData(newData); | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const processRowUpdate = (newRow, oldRow) => { | 
|---|
|  |  |  | const rows = tabelData.map((r) => | 
|---|
|  |  |  | r.matnrId === newRow.matnrId ? { ...newRow } : r | 
|---|
|  |  |  | r.id === newRow.id ? { ...newRow } : r | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | setTableData(rows) | 
|---|
|  |  |  | // setTableData((prevData) => | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const handleSelectionChange = (ids) => { | 
|---|
|  |  |  | console.log(ids); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | setSelectedRows(ids) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | 
|---|
|  |  |  | rows={tabelData} | 
|---|
|  |  |  | columns={columns} | 
|---|
|  |  |  | disableRowSelectionOnClick | 
|---|
|  |  |  | getRowId={(row) => row.matnrId} | 
|---|
|  |  |  | getRowId={(row) => row.id} | 
|---|
|  |  |  | disableColumnFilter | 
|---|
|  |  |  | disableColumnSelector | 
|---|
|  |  |  | disableColumnSorting | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | pageSizeOptions={[10, 25, 50, 100]} | 
|---|
|  |  |  | pageSizeOptions={[15, 25, 50, 100]} | 
|---|
|  |  |  | editMode="row" | 
|---|
|  |  |  | checkboxSelection | 
|---|
|  |  |  | onRowSelectionModelChange={handleSelectionChange} | 
|---|