| | |
| | | TableCell, |
| | | Tooltip, |
| | | IconButton, |
| | | styled |
| | | styled, |
| | | Select, |
| | | MenuItem |
| | | |
| | | |
| | | } from '@mui/material'; |
| | |
| | | |
| | | export default AsnOrderModal; |
| | | |
| | | const SelectInputSplrNameEditCell = (params) => { |
| | | const [formData, setFormData] = useState([{}]) |
| | | useEffect(() => { |
| | | getOptions(); |
| | | }, []); |
| | | const getOptions = async () => { |
| | | const parmas = { |
| | | } |
| | | const { |
| | | data: { code, data, msg }, |
| | | } = await request.post("companys/page",parmas); |
| | | if (code === 200) { |
| | | setFormData(data.records) |
| | | console.log(data.records) |
| | | } else { |
| | | notify(msg); |
| | | } |
| | | } |
| | | |
| | | return ( |
| | | <Select |
| | | value={params.value} |
| | | onChange={(e) => |
| | | params.api.setEditCellValue({ |
| | | id: params.id, |
| | | field: params.field, |
| | | value: e.target.value, |
| | | }) |
| | | } |
| | | fullWidth |
| | | autoFocus |
| | | > |
| | | {formData.map(e => { |
| | | return( |
| | | <MenuItem value={e.name} children={e.name} /> |
| | | ); |
| | | |
| | | })} |
| | | |
| | | </Select> |
| | | ); |
| | | }; |
| | | |
| | | const SelectInputSplrCodeEditCell = (params) => { |
| | | const [formData, setFormData] = useState([{}]) |
| | | useEffect(() => { |
| | | getOptions(); |
| | | }, []); |
| | | const getOptions = async () => { |
| | | const parmas = { |
| | | } |
| | | const { |
| | | data: { code, data, msg }, |
| | | } = await request.post("companys/page",parmas); |
| | | if (code === 200) { |
| | | setFormData(data.records) |
| | | console.log(data.records) |
| | | } else { |
| | | notify(msg); |
| | | } |
| | | } |
| | | |
| | | return ( |
| | | <Select |
| | | value={params.value} |
| | | onChange={(e) => |
| | | params.api.setEditCellValue({ |
| | | id: params.id, |
| | | field: params.field, |
| | | value: e.target.value, |
| | | }) |
| | | } |
| | | fullWidth |
| | | autoFocus |
| | | > |
| | | {formData.map(e => { |
| | | return( |
| | | <MenuItem value={e.id} children={e.name} /> |
| | | ); |
| | | |
| | | })} |
| | | |
| | | </Select> |
| | | ); |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | const AsnOrderModalTable = ({ tabelData, setTableData, asnId, selectedRows, setSelectedRows, tableRef }) => { |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | |
| | | minWidth: 100, |
| | | flex: 1, |
| | | editable: true, |
| | | renderEditCell: (params) => ( |
| | | <SelectInputSplrCodeEditCell {...params} /> |
| | | ), |
| | | }, |
| | | { |
| | | field: 'splrName', |
| | |
| | | minWidth: 100, |
| | | flex: 1, |
| | | editable: true, |
| | | renderEditCell: (params) => ( |
| | | <SelectInputSplrNameEditCell {...params} /> |
| | | ), |
| | | |
| | | }, |
| | | // { |
| | | // field: 'packName', |