From a483b58e8d4782bb2359b849bf0905a612594e9a Mon Sep 17 00:00:00 2001 From: anna Date: Fri, 23 Feb 2024 12:16:51 +0800 Subject: [PATCH] re-submit add reason --- .../Details_GLD/StatusChangeDialog.js | 4 ++ src/pages/PublicNotice/Details_GLD/index.js | 43 ++++++++++++------- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/src/pages/PublicNotice/Details_GLD/StatusChangeDialog.js b/src/pages/PublicNotice/Details_GLD/StatusChangeDialog.js index 86222af..58a90ea 100644 --- a/src/pages/PublicNotice/Details_GLD/StatusChangeDialog.js +++ b/src/pages/PublicNotice/Details_GLD/StatusChangeDialog.js @@ -42,6 +42,10 @@ const StatusChangeDialog = (props) => { setDialogTitle("Not Accept Reason"); setPrositiveBtnText("Mark Not Accept"); return getNotAcceptedContent(); + }if (props.getStatus == "resubmit") { + setDialogTitle("Re-Submit Reason"); + setPrositiveBtnText("Mark Re-Submit"); + return getNotAcceptedContent(); } else { setDialogTitle("Action Confirm"); setPrositiveBtnText("Confirm"); diff --git a/src/pages/PublicNotice/Details_GLD/index.js b/src/pages/PublicNotice/Details_GLD/index.js index f9a297d..c516cd7 100644 --- a/src/pages/PublicNotice/Details_GLD/index.js +++ b/src/pages/PublicNotice/Details_GLD/index.js @@ -182,7 +182,7 @@ const PublicNoticeDetail_GLD = () => { } else if (getStatus == "notAccepted") { onNotAcceptClick(getReason); } else if (getStatus == "resubmit") { - onReSubmitClick(); + onReSubmitClick(getReason); } else if (getStatus == "publish") { onPublishClick(); } @@ -278,22 +278,33 @@ const PublicNoticeDetail_GLD = () => { } }; - const onReSubmitClick = () => { + const onReSubmitClick = (reason) => { if (params.id > 0) { - axios.get(`${SET_PUBLIC_NOTICE_STATUS_RESUBMIT}/${params.id}`) - .then((response) => { - if (response.status === 204) { - setOpen(false); - handleClose(); - // location.reload(); - loadApplicationDetail() - notifySaveSuccess() - } - }) - .catch(error => { - console.log(error); - return false; - }); + HttpUtils.post({ + url: `${SET_PUBLIC_NOTICE_STATUS_RESUBMIT}/${params.id}`, + params: reason, + onSuccess: function () { + setOpen(false); + handleClose(); + // location.reload(); + loadApplicationDetail() + notifySaveSuccess() + } + }); + // axios.post(`${SET_PUBLIC_NOTICE_STATUS_RESUBMIT}/${params.id}`) + // .then((response) => { + // if (response.status === 204) { + // setOpen(false); + // handleClose(); + // // location.reload(); + // loadApplicationDetail() + // notifySaveSuccess() + // } + // }) + // .catch(error => { + // console.log(error); + // return false; + // }); } };