|
|
@ -887,7 +887,7 @@ |
|
|
|
|
|
|
|
|
let decisionHtml = ""; |
|
|
let decisionHtml = ""; |
|
|
|
|
|
|
|
|
// 🔹 Show decision buttons ONLY if pending |
|
|
|
|
|
|
|
|
// Show decision buttons ONLY if pending |
|
|
if (!record.final_status) { |
|
|
if (!record.final_status) { |
|
|
decisionHtml = ` |
|
|
decisionHtml = ` |
|
|
${documentsHtml} |
|
|
${documentsHtml} |
|
|
@ -1014,73 +1014,6 @@ |
|
|
$("#modalContent").html(html); |
|
|
$("#modalContent").html(html); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// function submitRdoDecision(status) { |
|
|
|
|
|
|
|
|
|
|
|
// let remarks = ($("#rdoRemarks").val() || "").trim(); |
|
|
|
|
|
// let refid = $("#detailsModal").data("refid"); |
|
|
|
|
|
// let gccUserId = $("#loginuserid").val(); // 🔥 ONLY THIS |
|
|
|
|
|
|
|
|
|
|
|
// //let approvedBy = $("#userName").val(); // 🔥 FROM HIDDEN INPUT |
|
|
|
|
|
|
|
|
|
|
|
// if (!remarks) { |
|
|
|
|
|
// Swal.fire({ |
|
|
|
|
|
// icon: 'warning', |
|
|
|
|
|
// title: 'Remarks Required', |
|
|
|
|
|
// text: 'Please enter remarks before submitting' |
|
|
|
|
|
// }); |
|
|
|
|
|
// return; |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
// Swal.fire({ |
|
|
|
|
|
// title: `Are you sure?`, |
|
|
|
|
|
// text: `You want to ${status.toLowerCase()} this request`, |
|
|
|
|
|
// icon: status === 'APPROVED' ? 'success' : 'error', |
|
|
|
|
|
// showCancelButton: true, |
|
|
|
|
|
// confirmButtonColor: status === 'APPROVED' ? '#28a745' : '#dc3545', |
|
|
|
|
|
// cancelButtonColor: '#6c757d', |
|
|
|
|
|
// confirmButtonText: `Yes, ${status}` |
|
|
|
|
|
// }).then((result) => { |
|
|
|
|
|
|
|
|
|
|
|
// if (!result.isConfirmed) return; |
|
|
|
|
|
|
|
|
|
|
|
// $.ajax({ |
|
|
|
|
|
// url: "/gcc/api/flagpoleregistration/rdo/updateDecision", |
|
|
|
|
|
// type: "POST", |
|
|
|
|
|
// data: { |
|
|
|
|
|
// refid: refid, |
|
|
|
|
|
// status: status, |
|
|
|
|
|
// remarks: remarks, |
|
|
|
|
|
// gccUserId: gccUserId |
|
|
|
|
|
// //approvedBy: approvedBy // 🔥 PASS TO BACKEND |
|
|
|
|
|
// }, |
|
|
|
|
|
// success: function (res) { |
|
|
|
|
|
|
|
|
|
|
|
// Swal.fire({ |
|
|
|
|
|
// icon: 'success', |
|
|
|
|
|
// title: status === 'APPROVED' ? 'Approved!' : 'Rejected!', |
|
|
|
|
|
// text: res.message || `Request has been ${status.toLowerCase()}`, |
|
|
|
|
|
// timer: 2000, |
|
|
|
|
|
// showConfirmButton: false |
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
|
|
// $("#detailsModal").modal("hide"); |
|
|
|
|
|
// $("#QaqcDatatable").DataTable().ajax.reload(null, false); |
|
|
|
|
|
// }, |
|
|
|
|
|
// error: function () { |
|
|
|
|
|
// Swal.fire({ |
|
|
|
|
|
// icon: 'error', |
|
|
|
|
|
// title: 'Error', |
|
|
|
|
|
// text: 'Failed to update decision' |
|
|
|
|
|
// }); |
|
|
|
|
|
// } |
|
|
|
|
|
// }); |
|
|
|
|
|
// }); |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function submitOfficerDecision(status) { |
|
|
function submitOfficerDecision(status) { |
|
|
|
|
|
|
|
|
let remarks = ($("#rdoRemarks").val() || "").trim(); |
|
|
let remarks = ($("#rdoRemarks").val() || "").trim(); |
|
|
@ -1089,7 +1022,7 @@ |
|
|
let gccUserId = $("#loginuserid").val(); // login user id |
|
|
let gccUserId = $("#loginuserid").val(); // login user id |
|
|
let username = $("#userName").val(); // display username |
|
|
let username = $("#userName").val(); // display username |
|
|
|
|
|
|
|
|
// 🔥 Collect verification answers |
|
|
|
|
|
|
|
|
// Collect verification answers |
|
|
let answers = []; |
|
|
let answers = []; |
|
|
|
|
|
|
|
|
$(".verification-item").each(function () { |
|
|
$(".verification-item").each(function () { |
|
|
@ -1172,68 +1105,6 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// function submitOfficerDecision(status) { |
|
|
|
|
|
|
|
|
|
|
|
// let remarks = ($("#rdoRemarks").val() || "").trim(); |
|
|
|
|
|
// let refid = $("#detailsModal").data("refid"); |
|
|
|
|
|
|
|
|
|
|
|
// let gccUserId = $("#loginuserid").val(); // login user id |
|
|
|
|
|
// let username = $("#userName").val(); // display username |
|
|
|
|
|
|
|
|
|
|
|
// if (!remarks) { |
|
|
|
|
|
// Swal.fire({ |
|
|
|
|
|
// icon: 'warning', |
|
|
|
|
|
// title: 'Remarks Required', |
|
|
|
|
|
// text: 'Please enter remarks before submitting' |
|
|
|
|
|
// }); |
|
|
|
|
|
// return; |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
// Swal.fire({ |
|
|
|
|
|
// title: `Are you sure?`, |
|
|
|
|
|
// text: `You want to ${status.toLowerCase()} this request`, |
|
|
|
|
|
// icon: status === 'APPROVED' ? 'success' : 'error', |
|
|
|
|
|
// showCancelButton: true, |
|
|
|
|
|
// confirmButtonColor: status === 'APPROVED' ? '#28a745' : '#dc3545', |
|
|
|
|
|
// cancelButtonColor: '#6c757d', |
|
|
|
|
|
// confirmButtonText: `Yes, ${status}` |
|
|
|
|
|
// }).then((result) => { |
|
|
|
|
|
|
|
|
|
|
|
// if (!result.isConfirmed) return; |
|
|
|
|
|
|
|
|
|
|
|
// $.ajax({ |
|
|
|
|
|
// url: "/flagpoles/api/flagpoleregistration/officer/updateDecision", |
|
|
|
|
|
// type: "POST", |
|
|
|
|
|
// data: { |
|
|
|
|
|
// refid: refid, |
|
|
|
|
|
// status: status, |
|
|
|
|
|
// remarks: remarks, |
|
|
|
|
|
// gccUserId: gccUserId, |
|
|
|
|
|
// username: username // ✅ NEW |
|
|
|
|
|
// }, |
|
|
|
|
|
// success: function (res) { |
|
|
|
|
|
|
|
|
|
|
|
// Swal.fire({ |
|
|
|
|
|
// icon: 'success', |
|
|
|
|
|
// title: status === 'APPROVED' ? 'Approved!' : 'Rejected!', |
|
|
|
|
|
// text: res.message || `Request has been ${status.toLowerCase()}`, |
|
|
|
|
|
// timer: 2000, |
|
|
|
|
|
// showConfirmButton: false |
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
|
|
// $("#detailsModal").modal("hide"); |
|
|
|
|
|
// $("#QaqcDatatable").DataTable().ajax.reload(null, false); |
|
|
|
|
|
// }, |
|
|
|
|
|
// error: function () { |
|
|
|
|
|
// Swal.fire({ |
|
|
|
|
|
// icon: 'error', |
|
|
|
|
|
// title: 'Error', |
|
|
|
|
|
// text: 'Failed to update decision' |
|
|
|
|
|
// }); |
|
|
|
|
|
// } |
|
|
|
|
|
// }); |
|
|
|
|
|
// }); |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script> |
|
|
</script> |
|
|
|