| 36645 |
vikas |
1 |
$(document).on('click', ".beat-report", function () {
|
|
|
2 |
doGetAjaxRequestHandler(context + "/beat-report",
|
|
|
3 |
function (response) {
|
|
|
4 |
$('#main-content').html(response);
|
|
|
5 |
});
|
|
|
6 |
});
|
|
|
7 |
|
|
|
8 |
$(document).on('click', '.beat-report-fetch', function () {
|
|
|
9 |
var selectedDate = $("#beat-report-date").val();
|
|
|
10 |
if (!selectedDate) {
|
|
|
11 |
alert("Please select a date!");
|
|
|
12 |
return;
|
|
|
13 |
}
|
| 36806 |
ranu |
14 |
var categoryId = $('#beat-report-category').val();
|
|
|
15 |
var level = $('#beat-report-level').val();
|
|
|
16 |
var url = context + "/beat-report/data?date=" + encodeURIComponent(selectedDate);
|
|
|
17 |
if (categoryId) url += '&categoryId=' + encodeURIComponent(categoryId);
|
|
|
18 |
if (level) url += '&escalationType=' + encodeURIComponent(level);
|
|
|
19 |
doGetAjaxRequestHandler(url,
|
| 36645 |
vikas |
20 |
function (response) {
|
|
|
21 |
$('.beat-report-container').html(response);
|
|
|
22 |
});
|
|
|
23 |
});
|
|
|
24 |
|
|
|
25 |
$(document).on('click', '.user-detail-refresh', function () {
|
| 36664 |
vikas |
26 |
var userId = $('#user-detail-user').val() || $(this).data('userid');
|
| 36645 |
vikas |
27 |
var selectedDate = $("#user-detail-date").val();
|
|
|
28 |
if (!selectedDate) {
|
|
|
29 |
alert("Please select a date!");
|
|
|
30 |
return;
|
|
|
31 |
}
|
|
|
32 |
doGetAjaxRequestHandler(context + "/beat-report/user-detail?userId=" + userId + "&date=" + selectedDate,
|
|
|
33 |
function (response) {
|
|
|
34 |
$('#main-content').html(response);
|
|
|
35 |
});
|
|
|
36 |
});
|
|
|
37 |
|
| 36664 |
vikas |
38 |
$(document).on('change', '#user-detail-level', function () {
|
|
|
39 |
var level = $(this).val();
|
|
|
40 |
var userSelect = $('#user-detail-user');
|
|
|
41 |
userSelect.html('<option value="">Select User</option>');
|
|
|
42 |
if (!level) return;
|
|
|
43 |
|
|
|
44 |
$.ajax({
|
|
|
45 |
url: context + "/beatPlan/getAuthUsers", type: "GET", dataType: "json",
|
|
|
46 |
data: { categoryId: 4, escalationType: level },
|
|
|
47 |
success: function (r) {
|
|
|
48 |
var data = r.response || r;
|
|
|
49 |
var html = '<option value="">Select User</option>';
|
|
|
50 |
data.forEach(function (u) {
|
|
|
51 |
html += '<option value="' + u.id + '">' + u.name + '</option>';
|
|
|
52 |
});
|
|
|
53 |
userSelect.html(html);
|
|
|
54 |
}
|
|
|
55 |
});
|
|
|
56 |
});
|
|
|
57 |
|
|
|
58 |
$(document).on('change', '#user-detail-user', function () {
|
|
|
59 |
var authUserId = $(this).val();
|
|
|
60 |
if (!authUserId) return;
|
|
|
61 |
var selectedDate = $("#user-detail-date").val();
|
|
|
62 |
if (!selectedDate) {
|
|
|
63 |
selectedDate = new Date().toISOString().split('T')[0];
|
|
|
64 |
}
|
|
|
65 |
doGetAjaxRequestHandler(context + "/beat-report/user-detail?authUserId=" + authUserId + "&date=" + selectedDate,
|
|
|
66 |
function (response) {
|
|
|
67 |
$('#main-content').html(response);
|
|
|
68 |
});
|
|
|
69 |
});
|
|
|
70 |
|
| 36645 |
vikas |
71 |
$(document).on('click', '.beat-user-detail-link', function () {
|
|
|
72 |
var userId = $(this).data('userid');
|
|
|
73 |
var selectedDate = $("#beat-report-date").val();
|
|
|
74 |
if (!selectedDate) {
|
|
|
75 |
selectedDate = new Date().toISOString().split('T')[0];
|
|
|
76 |
}
|
|
|
77 |
doGetAjaxRequestHandler(context + "/beat-report/user-detail?userId=" + userId + "&date=" + selectedDate,
|
|
|
78 |
function (response) {
|
|
|
79 |
$('#main-content').html(response);
|
|
|
80 |
});
|
|
|
81 |
});
|