|
|
@@ -33,6 +33,8 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => { |
|
|
|
const [attachment, setAttachment] = React.useState({}); |
|
|
|
const intl = useIntl(); |
|
|
|
|
|
|
|
const [val, setVal] = React.useState({}); |
|
|
|
|
|
|
|
const [issueId, setIssueId] = React.useState(loadedData.issueId); |
|
|
|
const navigate = useNavigate(); |
|
|
|
|
|
|
@@ -80,33 +82,53 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => { |
|
|
|
setIsWarningPopUp(true); |
|
|
|
return; |
|
|
|
} |
|
|
|
HttpUtils.postWithFiles({ |
|
|
|
url: UrlUtils.POST_PUBLIC_NOTICE_APPLY, |
|
|
|
params: { |
|
|
|
id: 0, |
|
|
|
contactPerson: values.contactPerson, |
|
|
|
contactTelNo: { |
|
|
|
countryCode: values.tel_countryCode, |
|
|
|
phoneNumber: values.phoneNumber |
|
|
|
}, |
|
|
|
contactFaxNo: { |
|
|
|
countryCode: values.fax_countryCode, |
|
|
|
faxNumber: values.faxNumber |
|
|
|
}, |
|
|
|
issueId: issueId, |
|
|
|
careOf: values.careOf ? values.careOf: "", |
|
|
|
remarks: values.remarks ? values.remarks : "", |
|
|
|
}, |
|
|
|
files: [attachment], |
|
|
|
onSuccess: function () { |
|
|
|
notifyActionSuccess(intl.formatMessage({id: 'submissionSuccess'}) + '!') |
|
|
|
navigate("/publicNotice"); |
|
|
|
// location.reload(); |
|
|
|
} |
|
|
|
}); |
|
|
|
if(isORGLoggedIn()){ |
|
|
|
HttpUtils.get({ |
|
|
|
url: UrlUtils.CHECK_OVERDUE, |
|
|
|
onSuccess: (responData)=>{ |
|
|
|
if(responData.haveOverdue){ |
|
|
|
setVal(values); |
|
|
|
setWarningText(intl.formatMessage({id: 'dnOverdueWarning'})); |
|
|
|
setIsWarningPopUp(true); |
|
|
|
}else{ |
|
|
|
apply(values); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}else{ |
|
|
|
apply(values); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
const apply = (values)=>{ |
|
|
|
HttpUtils.postWithFiles({ |
|
|
|
url: UrlUtils.POST_PUBLIC_NOTICE_APPLY, |
|
|
|
params: { |
|
|
|
id: 0, |
|
|
|
contactPerson: values.contactPerson, |
|
|
|
contactTelNo: { |
|
|
|
countryCode: values.tel_countryCode, |
|
|
|
phoneNumber: values.phoneNumber |
|
|
|
}, |
|
|
|
contactFaxNo: { |
|
|
|
countryCode: values.fax_countryCode, |
|
|
|
faxNumber: values.faxNumber |
|
|
|
}, |
|
|
|
issueId: issueId, |
|
|
|
careOf: values.careOf ? values.careOf: "", |
|
|
|
remarks: values.remarks ? values.remarks : "", |
|
|
|
}, |
|
|
|
files: [attachment], |
|
|
|
onSuccess: function () { |
|
|
|
notifyActionSuccess(intl.formatMessage({id: 'submissionSuccess'}) + '!') |
|
|
|
navigate("/publicNotice"); |
|
|
|
// location.reload(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
const readFile = (event) => { |
|
|
|
let file = event.target.files[0]; |
|
|
|
if (file) { |
|
|
@@ -317,7 +339,14 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => { |
|
|
|
<DialogActions> |
|
|
|
<Button |
|
|
|
aria-label={intl.formatMessage({id: 'ok'})} |
|
|
|
onClick={() => setIsWarningPopUp(false)} |
|
|
|
onClick={() => { |
|
|
|
if(val.contactPerson){ |
|
|
|
apply(val); |
|
|
|
setIsWarningPopUp(false); |
|
|
|
}else{ |
|
|
|
setIsWarningPopUp(false); |
|
|
|
} |
|
|
|
}} |
|
|
|
> |
|
|
|
<FormattedMessage id="ok" /> |
|
|
|
</Button> |
|
|
|