View Daily call reporting (Neb Mitra)
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m43s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m43s
Details
This commit is contained in:
parent
44bb2e709b
commit
a58dd6ea49
|
|
@ -579,6 +579,52 @@
|
|||
// Load initial 50 rows
|
||||
let lastkey = '{{ $lastkey }}';
|
||||
|
||||
function reloadListWithCurrentFilters() {
|
||||
currentFilterParams = buildFilterParams();
|
||||
lastkey = 1;
|
||||
loadRows(lastkey, false, currentFilterParams);
|
||||
}
|
||||
|
||||
let currentAction = '';
|
||||
let currentSubmission = '';
|
||||
|
||||
$(document).on('click', '.btn-approve, .btn-reject', function() {
|
||||
currentAction = $(this).hasClass('btn-approve') ? 'approve' : 'reject';
|
||||
currentSubmission = $(this).attr('data-submission');
|
||||
|
||||
$('#reasonBox').show();
|
||||
$('#btnSubmitReason').show();
|
||||
});
|
||||
|
||||
$(document).on('click', '#btnSubmitReason', function() {
|
||||
let reason = $('#approval_reason').val().trim();
|
||||
if (!reason) {
|
||||
alert("Enter reason");
|
||||
return;
|
||||
}
|
||||
$("#pageloader").fadeIn();
|
||||
$('#reasonModal').modal('hide');
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: '/form/approvereject?action=' + currentAction +
|
||||
'&id=' + currentSubmission +
|
||||
'&form_id={{ $form_id }}' +
|
||||
'&user_id={{ $formdata->user_id ?? '' }}' +
|
||||
'&partition={{ $formdata->partition ?? '' }}' +
|
||||
'&reason=' + encodeURIComponent(reason),
|
||||
success: function(res) {
|
||||
$("#pageloader").fadeOut();
|
||||
$('#approval_reason').val('');
|
||||
reloadListWithCurrentFilters();
|
||||
},
|
||||
error: function(e) {
|
||||
$("#pageloader").fadeOut();
|
||||
console.log("ERROR", e);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function loadRows(lastkeyVal, append = true, extraParams = {}) {
|
||||
$("#pageloader").fadeIn();
|
||||
|
||||
|
|
@ -679,107 +725,6 @@
|
|||
|
||||
})
|
||||
|
||||
let currentAction = '';
|
||||
let currentSubmission = '';
|
||||
let currentThat = null;
|
||||
|
||||
$(document).on('click', '.btn-approve, .btn-reject', function() {
|
||||
currentAction = $(this).hasClass('btn-approve') ? 'approve' : 'reject';
|
||||
currentSubmission = $(this).attr('data-submission');
|
||||
currentThat = $(this);
|
||||
|
||||
$('#reasonBox').show(); // ✅ SHOW TEXTAREA
|
||||
$('#btnSubmitReason').show(); // ✅ SHOW SUBMIT BUTTON
|
||||
});
|
||||
|
||||
$(document).on('click', '#btnSubmitReason', function() {
|
||||
let reason = $('#approval_reason').val().trim();
|
||||
if (!reason) {
|
||||
alert("Enter reason");
|
||||
return;
|
||||
}
|
||||
$("#pageloader").fadeIn();
|
||||
$('#reasonModal').modal('hide');
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: '/form/approvereject?action=' + currentAction +
|
||||
'&id=' + currentSubmission +
|
||||
'&form_id={{ $form_id }}' +
|
||||
'&user_id={{ $formdata->user_id ?? '' }}' +
|
||||
'&partition={{ $formdata->partition ?? '' }}' +
|
||||
'&reason=' + encodeURIComponent(reason),
|
||||
success: function(res) {
|
||||
$("#pageloader").fadeOut();
|
||||
location.reload();
|
||||
},
|
||||
error: function(e) {
|
||||
console.log("ERROR", e);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// $('.btn-approve').unbind().click(function() {
|
||||
// currentAction = 'approve';
|
||||
// currentSubmission = $(this).data('submission');
|
||||
// currentThat = $(this);
|
||||
|
||||
// $('#reasonTitle').text('Enter Approval Reason');
|
||||
// $('#approval_reason').val('');
|
||||
// $('#reasonModal').modal('show');
|
||||
// });
|
||||
|
||||
// $('.btn-approve').click(function() {
|
||||
// $("#pageloader").fadeIn();
|
||||
// let that = $(this)
|
||||
// $.ajax({
|
||||
// type: "GET",
|
||||
// url: '/form/approvereject?action=approve&id=' + $(this).attr(
|
||||
// 'submission') + '&form_id=' + '{{ $form_id }}' +
|
||||
// '&user_id=' + '{{ $formdata->user_id }}',
|
||||
// //data: new FormData($('#report-form')[0]),
|
||||
// processData: false,
|
||||
// contentType: false,
|
||||
// success: function(data) {
|
||||
// $("#pageloader").fadeOut();
|
||||
// console.log(data)
|
||||
// that.parent().html('')
|
||||
// },
|
||||
// });
|
||||
// })
|
||||
|
||||
// $('.btn-reject').unbind().click(function() {
|
||||
// currentAction = 'reject';
|
||||
// currentSubmission = $(this).data('submission');
|
||||
// currentThat = $(this);
|
||||
|
||||
// $('#reasonTitle').text('Enter Rejection Reason');
|
||||
// $('#approval_reason').val('');
|
||||
// $('#reasonModal').modal('show');
|
||||
// });
|
||||
|
||||
|
||||
// $('.btn-reject').click(function() {
|
||||
// $("#pageloader").fadeIn();
|
||||
// let that = $(this)
|
||||
// $.ajax({
|
||||
// type: "GET",
|
||||
// url: '/form/approvereject?action=reject&id=' + $(this).attr(
|
||||
// 'submission') + '&form_id=' + '{{ $form_id }}',
|
||||
// //data: new FormData($('#report-form')[0]),
|
||||
// processData: false,
|
||||
// contentType: false,
|
||||
// success: function(data) {
|
||||
// $("#pageloader").fadeOut();
|
||||
// console.log(data)
|
||||
// that.parent().html('')
|
||||
// },
|
||||
// });
|
||||
// })
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue