| | |
| | | const [disabled, setDisabled] = useState(false); |
| | | const [selectedRows, setSelectedRows] = useState([]); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [formData, setFormData] = useState({}); |
| | | const [formData, setFormData] = useState({ type: '1', orgAreaId: null, tarAreaId: null }); |
| | | const [list, setList] = useState([]); |
| | | |
| | | const handleClose = (event, reason) => { |
| | |
| | | } |
| | | } |
| | | |
| | | const newAddClick = () => { |
| | | if (formData.orgAreaId == null || formData.orgAreaId == undefined) { |
| | | notify("原库区不能为空!!", { type: 'error' }) |
| | | return |
| | | } |
| | | if (formData.tarAreaId == null || formData.tarAreaId == undefined) { |
| | | notify("目标库区不能为空!!", { type: 'error' }) |
| | | return |
| | | } |
| | | setCreateDialog(true) |
| | | } |
| | | |
| | | |
| | | const handleChange = (value, name) => { |
| | | setFormData((prevData) => ({ |
| | |
| | | variant="filled" |
| | | onChange={(e) => handleChange(e.target.value, 'type')} |
| | | dictTypeCode="sys_transfer_type" |
| | | required |
| | | /> |
| | | </Grid> |
| | | <Grid item md={2}> |
| | |
| | | value={formData.orgAreaId} |
| | | variant="filled" |
| | | dictTypeCode="warehouse" |
| | | required |
| | | onChange={(e) => handleChange(e.target.value, 'orgAreaId')} |
| | | label={translate("table.field.transfer.orgAreaName")} /> |
| | | </Grid> |
| | |
| | | value={formData.tarAreaId} |
| | | dictTypeCode="warehouse" |
| | | variant="filled" |
| | | required |
| | | onChange={(e) => handleChange(e.target.value, 'tarAreaId')} |
| | | /> |
| | | </Grid> |
| | |
| | | </SimpleForm> |
| | | <Box sx={{ mt: 2 }}> |
| | | <Stack direction="row" spacing={2} sx={{ justifyContent: "flex-end" }}> |
| | | <Button variant="contained" onClick={() => setCreateDialog(true)} > |
| | | <Button variant="contained" onClick={newAddClick} > |
| | | {translate('common.action.newAddMats')} |
| | | </Button> |
| | | <ConfirmButton label={"toolbar.delete"} variant="outlined" color="error" onConfirm={handleDeleteItem} /> |
| | |
| | | <TransferTableView |
| | | tabelData={tabelData} |
| | | setTableData={setTableData} |
| | | asnId={orderId} |
| | | orderId={orderId} |
| | | selectedRows={selectedRows} |
| | | setSelectedRows={setSelectedRows} |
| | | tableRef={tableRef}> |
| | |
| | | <CreateBySelectMats |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | selectedRows={selectedRows} |
| | | setSelectedRows={setSelectedRows} |
| | | data={tabelData} |
| | | setData={setTableData} |
| | | /> |
| | |
| | | |
| | | tableRef.current = useGridApiRef(); |
| | | |
| | | const tableIds = tabelData.map(map => map.id); |
| | | // setSelectedRows(tableIds); |
| | | // // console.log(selectedRows); |
| | | |
| | | |
| | | return ( |
| | | <Box> |
| | | <DataGrid |
| | |
| | | rows={tabelData} |
| | | columns={columns} |
| | | disableRowSelectionOnClick |
| | | getRowId={(row) => row.matnrId ? row.matnrId : row.id} |
| | | disableColumnFilter |
| | | disableColumnSelector |
| | | disableColumnSorting |
| | | disableMultipleColumnsSorting |
| | | processRowUpdate={processRowUpdate} |
| | | initialState={{ |
| | | pagination: { |
| | | paginationModel: { |
| | |
| | | pageSizeOptions={[15, 25, 50, 100]} |
| | | editMode="row" |
| | | checkboxSelection |
| | | rowSelectionModel={tableIds} |
| | | onRowSelectionModelChange={handleSelectionChange} |
| | | selectionModel={selectedRows} |
| | | sx={{ |
| | | height: 580, |
| | | '& .MuiDataGrid-cell input': { |
| | |
| | | }, |
| | | }} |
| | | /> |
| | | {/* <Box sx={{ |
| | | padding: 2, |
| | | position: 'absolute', |
| | | right: 1 |
| | | }}> |
| | | <Button variant="contained" onClick={() => handleSubmit()} startIcon={<SaveIcon/>} > |
| | | {translate('toolbar.confirm')} |
| | | </Button> |
| | | </Box> */} |
| | | </Box> |
| | | ); |
| | | }; |