diff --git a/src/pages/DemandNote/Create/SearchForm.js b/src/pages/DemandNote/Create/SearchForm.js index d8b40c3..c22bcc9 100644 --- a/src/pages/DemandNote/Create/SearchForm.js +++ b/src/pages/DemandNote/Create/SearchForm.js @@ -26,6 +26,9 @@ const SearchPublicNoticeForm = ({ applySearch, issueComboData, _paymentCount, _p const [isFailPopUp, setIsFailPopUp] = React.useState(false); const [failText, setFailText] = React.useState(""); + const [confirmPopUp, setConfirmPopUp] = React.useState(false); + const [dueDate, setDueDate] = React.useState(DateUtils.dateStr(new Date())); + const [isSuccessPopUp, setIsSuccessPopUp] = React.useState(false); const [resultCount, setResultCount] = React.useState(0); const [dnIdList, setDnIdList] = React.useState([]); @@ -68,18 +71,26 @@ const SearchPublicNoticeForm = ({ applySearch, issueComboData, _paymentCount, _p setIsFailPopUp(true); return; } else { - HttpUtils.post({ - url: UrlUtils.DEMAND_NOTE_CREATE + "/" + issueSelected.id, - onSuccess: function (responseData) { - setResultCount(responseData.count); - setDnIdList(responseData.idList); - setIsSuccessPopUp(true); - } - }); + setDueDate(DateUtils.dateStr(new Date())); + setConfirmPopUp(true); } - }; + const doDnCreate=()=>{ + setConfirmPopUp(false); + HttpUtils.post({ + url: UrlUtils.DEMAND_NOTE_CREATE + "/" + issueSelected.id, + params:{ + dueDate: dueDate + }, + onSuccess: function (responseData) { + setResultCount(responseData.count); + setDnIdList(responseData.idList); + setIsSuccessPopUp(true); + } + }); + } + const fileDownload = () => { HttpUtils.fileDownload({ method:'post', @@ -206,6 +217,47 @@ const SearchPublicNoticeForm = ({ applySearch, issueComboData, _paymentCount, _p +
+ setConfirmPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > + Create Confirm + + + + Due Date: + + + + { + setDueDate(DateUtils.dateStr(newValue)) + }} + InputLabelProps={{ + shrink: true + }} + /> + + + + + + + + +
{ - return (<> - {DateUtils.dateStr(params?.value)} - {params.row.sentDate ? <>
{DateUtils.datetimeStr(params.row.sentDate)} - {params.row.sentBy} : <> / To be sent} - ); + return ( + + + +
Issue:{DateUtils.dateStr(params?.row.issueDate)}
Due:{params?.value? DateUtils.dateStr(params?.value):"--"}
Sent:{params.row.sentDate ? <> {DateUtils.datetimeStr(params.row.sentDate)} - {params.row.sentBy} : <> To be sent}
); } }, { diff --git a/src/pages/DemandNote/Search/SearchForm.js b/src/pages/DemandNote/Search/SearchForm.js index 17b7c6e..89912ce 100644 --- a/src/pages/DemandNote/Search/SearchForm.js +++ b/src/pages/DemandNote/Search/SearchForm.js @@ -31,6 +31,9 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue const [minDate, setMinDate] = React.useState(searchCriteria.dateFrom); const [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo); + const [minDueDate, setMinDueDate] = React.useState(searchCriteria.dueDateFrom); + const [maxDueDate, setMaxDueDate] = React.useState(searchCriteria.dueDateTo); + const { reset, register, handleSubmit } = useForm() const onSubmit = (data) => { data.status = selectedLabelsString @@ -47,6 +50,8 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue dnNo: data.dnNo, dateFrom: data.dateFrom, dateTo: data.dateTo, + dueDateFrom: data.dueDateFrom, + dueDateTo: data.dueDateTo, status: (data.status === '' || data.status.includes("all")) ? "" : data.status, }; applySearch(temp); @@ -181,40 +186,92 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue /> - - { - setMinDate(DateUtils.dateStr(newValue)); - }} - InputLabelProps={{ - shrink: true - }} - /> + + + + { + setMinDate(DateUtils.dateStr(newValue)); + }} + InputLabelProps={{ + shrink: true + }} + /> + + + + To + + + + { + setMaxDate(DateUtils.dateStr(newValue)); + }} + id="dateTo" + type="date" + //label={"Submit Date(To)"} + defaultValue={searchCriteria.dateTo} + /> + + - - { - setMaxDate(DateUtils.dateStr(newValue)); - }} - id="dateTo" - type="date" - label={"Issue Date(To)"} - defaultValue={searchCriteria.dateTo} - /> + + + + { + setMinDueDate(DateUtils.dateStr(newValue)); + }} + InputLabelProps={{ + shrink: true + }} + /> + + + + To + + + + { + setMaxDueDate(DateUtils.dateStr(newValue)); + }} + id="dueDateTo" + type="date" + //label={"Submit Date(To)"} + defaultValue={searchCriteria.dueDateTo} + /> + + diff --git a/src/pages/DemandNote/Search/index.js b/src/pages/DemandNote/Search/index.js index a0355bd..dcd9ec9 100644 --- a/src/pages/DemandNote/Search/index.js +++ b/src/pages/DemandNote/Search/index.js @@ -38,6 +38,8 @@ const UserSearchPage_Individual = () => { const [searchCriteria, setSearchCriteria] = React.useState({ dateTo: DateUtils.dateStr(new Date()), dateFrom: DateUtils.dateStr(new Date().setDate(new Date().getDate() - 14)), + dueDateTo: DateUtils.dateStr(new Date()), + dueDateFrom: DateUtils.dateStr(new Date().setDate(new Date().getDate() - 14)), }); const [onReady, setOnReady] = React.useState(false);