|
|
@@ -2,7 +2,9 @@ |
|
|
|
import { |
|
|
|
Grid, |
|
|
|
Typography, |
|
|
|
Stack |
|
|
|
Stack, |
|
|
|
Button, |
|
|
|
Dialog, DialogTitle, DialogContent, DialogActions, |
|
|
|
} from '@mui/material'; |
|
|
|
import MainCard from "components/MainCard"; |
|
|
|
|
|
|
@@ -31,6 +33,8 @@ const BackgroundHead = { |
|
|
|
|
|
|
|
const UserSearchPage_Individual = () => { |
|
|
|
|
|
|
|
const [isErrorPopUp, setIsErrorPopUp] = React.useState(false); |
|
|
|
|
|
|
|
const [record, setRecord] = React.useState([]); |
|
|
|
const [orgCombo, setOrgCombo] = React.useState([]); |
|
|
|
const [issueCombo, setIssueCombo] = React.useState([]); |
|
|
@@ -64,6 +68,19 @@ const UserSearchPage_Individual = () => { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
function exportXml() { |
|
|
|
if (record.length >= 100) { |
|
|
|
setIsErrorPopUp(true); |
|
|
|
return; |
|
|
|
} |
|
|
|
HttpUtils.fileDownload({ |
|
|
|
url: UrlUtils.DEMAND_NOTE_EXPORT, |
|
|
|
params: searchCriteria, |
|
|
|
onSuccess: function () { |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
function getOrgCombo() { |
|
|
|
HttpUtils.get({ |
|
|
|
url: UrlUtils.GET_ORG_COMBO, |
|
|
@@ -108,6 +125,7 @@ const UserSearchPage_Individual = () => { |
|
|
|
orgComboData={orgCombo} |
|
|
|
issueComboData={issueCombo} |
|
|
|
searchCriteria={searchCriteria} |
|
|
|
|
|
|
|
/> |
|
|
|
</Grid> |
|
|
|
{/*row 2*/} |
|
|
@@ -120,9 +138,21 @@ const UserSearchPage_Individual = () => { |
|
|
|
<EventTable |
|
|
|
recordList={record} |
|
|
|
reloadFun={getUserList} |
|
|
|
exportXmlFun={exportXml} |
|
|
|
/> |
|
|
|
</MainCard> |
|
|
|
</Grid> |
|
|
|
<div> |
|
|
|
<Dialog open={isErrorPopUp} onClose={() => setIsErrorPopUp(false)} > |
|
|
|
<DialogTitle><Typography variant="h3">Action Fail</Typography></DialogTitle> |
|
|
|
<DialogContent style={{ display: 'flex', }}> |
|
|
|
<Typography variant="h4" style={{ padding: '16px' }}>Number of DN record must less than 100.<br/>Please edit search form.</Typography> |
|
|
|
</DialogContent> |
|
|
|
<DialogActions> |
|
|
|
<Button onClick={() => setIsErrorPopUp(false)}><Typography variant="h5">OK</Typography></Button> |
|
|
|
</DialogActions> |
|
|
|
</Dialog> |
|
|
|
</div> |
|
|
|
</Grid> |
|
|
|
); |
|
|
|
} |
|
|
|