| 23343 |
ashik.ali |
1 |
$(function() {
|
| 27754 |
amit.gupta |
2 |
$(document).on('click', ".create-scheme", function() {
|
| 23343 |
ashik.ali |
3 |
loadScheme("main-content");
|
|
|
4 |
});
|
| 23752 |
govind |
5 |
|
| 27755 |
amit.gupta |
6 |
$(document).on('click', "#schemes-paginated .next",
|
| 28134 |
tejbeer |
7 |
function() {
|
|
|
8 |
var category = $('#partner-category').val();
|
|
|
9 |
var searchText = $("#scheme-item-search-text").val();
|
| 26802 |
tejbeer |
10 |
|
| 28134 |
tejbeer |
11 |
var category = $('#partner-category').val();
|
|
|
12 |
if (typeof (searchText) == "undefined" || !searchText) {
|
|
|
13 |
searchText = "";
|
|
|
14 |
}
|
|
|
15 |
if (typeof (category) == "undefined" || !category) {
|
|
|
16 |
category = "";
|
|
|
17 |
}
|
| 23752 |
govind |
18 |
|
| 28134 |
tejbeer |
19 |
if ((searchText) && (category)) {
|
| 26802 |
tejbeer |
20 |
|
| 28134 |
tejbeer |
21 |
var params = {};
|
|
|
22 |
params['searchItem'] = currentItem.itemId;
|
|
|
23 |
params['partnerType'] = category
|
|
|
24 |
loadPaginatedNextItems('/getPaginatedSchemes', params,
|
|
|
25 |
'schemes-paginated', 'schemes-table',
|
|
|
26 |
'scheme-details-container');
|
| 26763 |
tejbeer |
27 |
|
| 28134 |
tejbeer |
28 |
} else if ((searchText)) {
|
|
|
29 |
var params = {};
|
|
|
30 |
params['searchItem'] = currentItem.itemId;
|
|
|
31 |
loadPaginatedNextItems('/getPaginatedSchemes', params,
|
|
|
32 |
'schemes-paginated', 'schemes-table',
|
|
|
33 |
'scheme-details-container');
|
| 26802 |
tejbeer |
34 |
|
| 28134 |
tejbeer |
35 |
} else {
|
|
|
36 |
var params = {};
|
|
|
37 |
params['partnerType'] = category
|
|
|
38 |
loadPaginatedNextItems('/getPaginatedSchemes', params,
|
|
|
39 |
'schemes-paginated', 'schemes-table',
|
|
|
40 |
'scheme-details-container');
|
|
|
41 |
}
|
|
|
42 |
$(this).blur();
|
|
|
43 |
});
|
| 23752 |
govind |
44 |
|
| 27755 |
amit.gupta |
45 |
$(document).on('click', "#schemes-paginated .previous",
|
| 28134 |
tejbeer |
46 |
function() {
|
|
|
47 |
var searchText = $("#scheme-item-search-text").val();
|
|
|
48 |
var category = $('#partner-category').val();
|
|
|
49 |
// var searchTxt=$("#scheme-search-text").val();
|
|
|
50 |
console.log(searchText);
|
|
|
51 |
if (typeof (searchText) == "undefined" || !searchText) {
|
|
|
52 |
searchText = "";
|
|
|
53 |
}
|
|
|
54 |
if (typeof (category) == "undefined" || !category) {
|
|
|
55 |
category = "";
|
|
|
56 |
}
|
| 23752 |
govind |
57 |
|
| 28134 |
tejbeer |
58 |
console.log(searchText)
|
| 26802 |
tejbeer |
59 |
|
| 28134 |
tejbeer |
60 |
if ((searchText) && (category)) {
|
| 26802 |
tejbeer |
61 |
|
| 28134 |
tejbeer |
62 |
var params = {};
|
|
|
63 |
params['searchItem'] = currentItem.itemId;
|
|
|
64 |
params['partnerType'] = category
|
|
|
65 |
loadPaginatedPreviousItems('/getPaginatedSchemes', params,
|
|
|
66 |
'schemes-paginated', 'schemes-table',
|
|
|
67 |
'scheme-details-container');
|
| 26763 |
tejbeer |
68 |
|
| 28134 |
tejbeer |
69 |
} else if ((searchText)) {
|
|
|
70 |
var params = {};
|
|
|
71 |
params['searchItem'] = currentItem.itemId;
|
|
|
72 |
loadPaginatedPreviousItems('/getPaginatedSchemes', params,
|
|
|
73 |
'schemes-paginated', 'schemes-table',
|
|
|
74 |
'scheme-details-container');
|
| 26763 |
tejbeer |
75 |
|
| 28134 |
tejbeer |
76 |
} else {
|
|
|
77 |
var params = {};
|
|
|
78 |
params['partnerType'] = category
|
|
|
79 |
loadPaginatedPreviousItems('/getPaginatedSchemes', params,
|
|
|
80 |
'schemes-paginated', 'schemes-table',
|
|
|
81 |
'scheme-details-container');
|
|
|
82 |
}
|
|
|
83 |
$(this).blur();
|
|
|
84 |
});
|
| 23752 |
govind |
85 |
|
| 27754 |
amit.gupta |
86 |
$(document).on('click', ".scheme-details", function() {
|
| 23343 |
ashik.ali |
87 |
var schemeId = $(this).attr('data');
|
| 23752 |
govind |
88 |
console.log("schemeId = " + schemeId);
|
| 23343 |
ashik.ali |
89 |
loadSchemeDetails(schemeId, "scheme-details-container");
|
|
|
90 |
});
|
| 23752 |
govind |
91 |
|
| 27754 |
amit.gupta |
92 |
$(document).on('click', ".active-scheme", function() {
|
| 23343 |
ashik.ali |
93 |
var schemeId = $(this).attr('data');
|
| 23752 |
govind |
94 |
console.log("active-scheme id : " + schemeId);
|
|
|
95 |
var start = $("#schemes-paginated .start").text();
|
|
|
96 |
// var end = $( "#schemes-paginated .end" ).text();
|
| 23343 |
ashik.ali |
97 |
var offset = start - 1;
|
| 23752 |
govind |
98 |
if (confirm("Are you sure you want to Active Scheme!") == true) {
|
| 23343 |
ashik.ali |
99 |
activeScheme(schemeId, offset, "schemes-table");
|
|
|
100 |
}
|
|
|
101 |
});
|
| 23752 |
govind |
102 |
|
| 27754 |
amit.gupta |
103 |
$(document).on('click', ".expire-scheme", function() {
|
| 23343 |
ashik.ali |
104 |
var schemeId = $(this).attr('data');
|
| 25069 |
amit.gupta |
105 |
var expireDate = startDate;
|
| 23752 |
govind |
106 |
var start = $("#schemes-paginated .start").text();
|
|
|
107 |
// var end = $( "#schemes-paginated .end" ).text();
|
| 23343 |
ashik.ali |
108 |
var offset = start - 1;
|
| 23752 |
govind |
109 |
if (confirm("Are you sure you want to Expire Scheme!") == true) {
|
| 25069 |
amit.gupta |
110 |
expireScheme(schemeId, expireDate, offset, "schemes-table");
|
| 23343 |
ashik.ali |
111 |
}
|
|
|
112 |
});
|
| 27755 |
amit.gupta |
113 |
$(document).on('click', "#extendDatetime-button",
|
| 28134 |
tejbeer |
114 |
function() {
|
|
|
115 |
console.log("extendAll button click");
|
|
|
116 |
var extendDatetime = $('input[name="extendDatetime"]')
|
|
|
117 |
.val();
|
|
|
118 |
console.log("extendDatetime : " + extendDatetime);
|
|
|
119 |
if (extendDatetime) {
|
|
|
120 |
if (confirm("Are you sure you want to Extend expireDateTime for All Scheme!") == true) {
|
|
|
121 |
extendAllScheme(extendDatetime, "schemes-table")
|
|
|
122 |
}
|
|
|
123 |
} else {
|
|
|
124 |
alert("feild can't be blank");
|
|
|
125 |
}
|
|
|
126 |
});
|
| 27755 |
amit.gupta |
127 |
$(document).on('click', "#extendScheme-button",
|
| 28134 |
tejbeer |
128 |
function() {
|
|
|
129 |
console.log("extend button click");
|
|
|
130 |
var extendDatetime = $('input[name="extendScheme"]')
|
|
|
131 |
.val();
|
|
|
132 |
var schemeId = $('#schemeId').val()
|
|
|
133 |
console.log("extendDatetime : " + extendDatetime);
|
|
|
134 |
console.log(schemeId);
|
|
|
135 |
if (extendDatetime) {
|
|
|
136 |
if (confirm("Are you sure you want to Extend expireDateTime for Scheme!") == true) {
|
|
|
137 |
extendSchemeById(schemeId)
|
|
|
138 |
}
|
|
|
139 |
} else {
|
|
|
140 |
alert("feild can't be blank");
|
|
|
141 |
}
|
|
|
142 |
});
|
| 23752 |
govind |
143 |
|
| 27754 |
amit.gupta |
144 |
$(document).on('click', ".schemes", function() {
|
| 23347 |
ashik.ali |
145 |
console.log("Active Schemes Button Clicked...")
|
| 28134 |
tejbeer |
146 |
|
|
|
147 |
bootbox.confirm({
|
|
|
148 |
message: "<div class = 'disclosurehindata'> <img src='resources/images/disclosure.png' style='width:100%'> </div>"
|
|
|
149 |
,
|
|
|
150 |
buttons: {
|
|
|
151 |
confirm: {
|
|
|
152 |
label: 'I agree',
|
|
|
153 |
className: 'btn-success'
|
|
|
154 |
},
|
|
|
155 |
cancel: {
|
|
|
156 |
label: 'I disagree',
|
|
|
157 |
className: 'btn-danger'
|
|
|
158 |
}
|
|
|
159 |
},
|
|
|
160 |
callback: function(result) {
|
|
|
161 |
if (result == true) {
|
|
|
162 |
schemes("main-content");
|
|
|
163 |
}
|
|
|
164 |
}
|
|
|
165 |
});
|
|
|
166 |
|
| 23347 |
ashik.ali |
167 |
});
|
| 23752 |
govind |
168 |
|
| 28134 |
tejbeer |
169 |
$(document).on('click', ".margin-calculator", function() {
|
| 27648 |
tejbeer |
170 |
console.log("Active Schemes Button Clicked...")
|
| 28134 |
tejbeer |
171 |
marginCalculator("main-content");
|
| 27648 |
tejbeer |
172 |
});
|
|
|
173 |
|
| 27754 |
amit.gupta |
174 |
$(document).on('click', ".schemes-download-page", function() {
|
| 23347 |
ashik.ali |
175 |
console.log("Schemes Download Clicked...")
|
|
|
176 |
loadSchemesDownloadPage("main-content");
|
| 22860 |
ashik.ali |
177 |
});
|
| 23752 |
govind |
178 |
|
| 27754 |
amit.gupta |
179 |
$(document).on('click', ".schemes-update", function() {
|
| 23556 |
amit.gupta |
180 |
loadSchemeUpdatePage("main-content");
|
|
|
181 |
});
|
| 23557 |
amit.gupta |
182 |
|
| 27754 |
amit.gupta |
183 |
$(document).on('click', ".add-item", function() {
|
| 23928 |
govind |
184 |
|
|
|
185 |
schemeIds = $("#schemeids").val();
|
|
|
186 |
itemIds = $("#itemids").val();
|
|
|
187 |
console.log(schemeIds);
|
|
|
188 |
console.log(itemIds);
|
|
|
189 |
if (confirm("Are you sure you want to Add Item to Scheme!") == true) {
|
| 26763 |
tejbeer |
190 |
if (itemIds.trim().length === 0 || schemeIds.trim().length === 0) {
|
|
|
191 |
alert("fields shouldn't be blank");
|
|
|
192 |
return;
|
|
|
193 |
}
|
|
|
194 |
updateSingleScheme(schemeIds, itemIds);
|
| 23928 |
govind |
195 |
}
|
|
|
196 |
});
|
| 27754 |
amit.gupta |
197 |
$(document).on('click', ".add-schemes", function() {
|
| 23752 |
govind |
198 |
|
| 23557 |
amit.gupta |
199 |
schemeIds = $("#schemeids").val();
|
|
|
200 |
itemIds = $("#itemids").val();
|
| 23914 |
govind |
201 |
console.log(schemeIds);
|
|
|
202 |
console.log(itemIds);
|
|
|
203 |
if (confirm("Are you sure you want to Add Item to Scheme!") == true) {
|
| 26763 |
tejbeer |
204 |
if (itemIds.trim().length === 0 || schemeIds.trim().length === 0) {
|
|
|
205 |
alert("fields shouldn't be blank");
|
|
|
206 |
return;
|
|
|
207 |
}
|
|
|
208 |
updateSchemes(schemeIds, itemIds);
|
| 23557 |
amit.gupta |
209 |
}
|
|
|
210 |
});
|
| 27754 |
amit.gupta |
211 |
$(document).on('click', ".delete-schemes", function() {
|
| 23819 |
govind |
212 |
if (confirm("Are you sure you want to delete Scheme!") == true) {
|
| 23914 |
govind |
213 |
schemeId = $(this).data('schemeid');
|
|
|
214 |
itemId = $(this).data('itemid');
|
|
|
215 |
console.log(schemeId);
|
|
|
216 |
console.log(itemId);
|
|
|
217 |
deleteScheme(schemeId, itemId);
|
| 23715 |
govind |
218 |
}
|
| 23752 |
govind |
219 |
});
|
|
|
220 |
|
| 27755 |
amit.gupta |
221 |
$(document).on('click', "#scheme-search-button",
|
| 28134 |
tejbeer |
222 |
function() {
|
|
|
223 |
var searchText = $("#scheme-search-text").val();
|
|
|
224 |
if (typeof (searchText) == "undefined" || !searchText) {
|
|
|
225 |
searchText = "";
|
|
|
226 |
}
|
|
|
227 |
doGetAjaxRequestHandler(context + "/getSchemes?searchTerm="
|
|
|
228 |
+ searchText, function(response) {
|
| 26802 |
tejbeer |
229 |
$('#' + "main-content").html(response);
|
|
|
230 |
});
|
| 28134 |
tejbeer |
231 |
});
|
| 26802 |
tejbeer |
232 |
|
| 27754 |
amit.gupta |
233 |
$(document).on("keyup", "#scheme-search-text", function(e) {
|
| 23752 |
govind |
234 |
var keyCode = e.keyCode || e.which;
|
|
|
235 |
if (keyCode == 13) {
|
|
|
236 |
$("#scheme-search-button").click();
|
|
|
237 |
}
|
|
|
238 |
});
|
| 27754 |
amit.gupta |
239 |
$(document).on('click', "#scheme-item-search-button", function() {
|
| 23752 |
govind |
240 |
var searchText = $("#scheme-item-search-text").val();
|
| 27875 |
amit.gupta |
241 |
var date = $(".schemes-date").val();
|
| 23752 |
govind |
242 |
if (typeof (searchText) == "undefined" || !searchText) {
|
|
|
243 |
searchText = "";
|
| 26497 |
amit.gupta |
244 |
alert("please select item");
|
|
|
245 |
return;
|
| 23752 |
govind |
246 |
}
|
| 27094 |
tejbeer |
247 |
if (typeof currentItem != "undefined") {
|
|
|
248 |
console.log(currentItem);
|
| 27875 |
amit.gupta |
249 |
loadSchemeItemSearchInfo(currentItem, date);
|
| 27094 |
tejbeer |
250 |
} else {
|
|
|
251 |
console.log("reeffff")
|
|
|
252 |
alert("Data No Found")
|
|
|
253 |
}
|
| 23752 |
govind |
254 |
});
|
|
|
255 |
|
| 28795 |
tejbeer |
256 |
|
|
|
257 |
$(document).on('click', "#scheme-imei-search-button", function() {
|
|
|
258 |
var searchText = $("#scheme-imei-search-text").val();
|
|
|
259 |
var date = $(".schemes-date").val();
|
|
|
260 |
if (typeof (searchText) == "undefined" || !searchText) {
|
|
|
261 |
searchText = "";
|
|
|
262 |
alert("please select imei");
|
|
|
263 |
return;
|
|
|
264 |
}
|
|
|
265 |
if (typeof imei != "undefined") {
|
|
|
266 |
console.log(imei);
|
|
|
267 |
loadSchemeImeiSearchInfo(imei, date);
|
|
|
268 |
} else {
|
|
|
269 |
console.log("reeffff")
|
|
|
270 |
alert("Data No Found")
|
|
|
271 |
}
|
|
|
272 |
});
|
| 27755 |
amit.gupta |
273 |
$(document).on('click', ".categoryWiseSchemeHistory",
|
| 28134 |
tejbeer |
274 |
function() {
|
|
|
275 |
var category = $('#partner-category').val();
|
|
|
276 |
console.log(category);
|
| 26763 |
tejbeer |
277 |
|
| 28134 |
tejbeer |
278 |
doGetAjaxRequestHandler(context + "/getSchemes?partnerType="
|
|
|
279 |
+ category, function(response) {
|
| 26802 |
tejbeer |
280 |
$('#' + "main-content").html(response);
|
|
|
281 |
$('#partner-category').val(category);
|
|
|
282 |
window.dispatchEvent(new Event('resize'));
|
|
|
283 |
});
|
| 26763 |
tejbeer |
284 |
|
| 28134 |
tejbeer |
285 |
});
|
| 26763 |
tejbeer |
286 |
|
| 27754 |
amit.gupta |
287 |
$(document).on("keyup", "#scheme-item-search-text", function(e) {
|
| 23752 |
govind |
288 |
var keyCode = e.keyCode || e.which;
|
|
|
289 |
if (keyCode == 13) {
|
|
|
290 |
$("#scheme-item-search-button").click();
|
|
|
291 |
}
|
|
|
292 |
});
|
| 22860 |
ashik.ali |
293 |
});
|
|
|
294 |
|
| 23752 |
govind |
295 |
function configureTagListingItemsDescriptionDropDown() {
|
| 28134 |
tejbeer |
296 |
$('.tagListingItemsDescription').multiselect({
|
|
|
297 |
includeSelectAllOption: true,
|
|
|
298 |
maxHeight: 200,
|
|
|
299 |
buttonWidth: '180px',
|
|
|
300 |
numberDisplayed: 1,
|
|
|
301 |
nonSelectedText: 'Items',
|
|
|
302 |
nSelectedText: ' - Items Selected',
|
|
|
303 |
allSelectedText: 'All Items Selected',
|
|
|
304 |
enableFiltering: true,
|
|
|
305 |
enableCaseInsensitiveFiltering: true
|
| 23752 |
govind |
306 |
});
|
| 23343 |
ashik.ali |
307 |
}
|
|
|
308 |
|
| 23752 |
govind |
309 |
function schemesDownload() {
|
| 23343 |
ashik.ali |
310 |
console.log("downloadItemLedgerReport Button clicked")
|
| 23914 |
govind |
311 |
var startDateTime = $('input[name="startDateTime"]').val();
|
|
|
312 |
console.log("startDateTime : " + startDateTime);
|
|
|
313 |
var endDateTime = $('input[name="endDateTime"]').val();
|
|
|
314 |
console.log("endDateTime : " + endDateTime);
|
| 23752 |
govind |
315 |
doAjaxGetDownload(context + "/schemes/download?startDateTime="
|
| 28134 |
tejbeer |
316 |
+ startDateTime + "&endDateTime=" + endDateTime,
|
|
|
317 |
"SchemesReport.xlsx");
|
| 23343 |
ashik.ali |
318 |
}
|
| 23914 |
govind |
319 |
function selectedbrand() {
|
|
|
320 |
var brands = $('#tag-listing-brands').val();
|
|
|
321 |
console.log(brands);
|
|
|
322 |
if (brands) {
|
|
|
323 |
loadTagListingItemsDescriptionByBrand(
|
| 28134 |
tejbeer |
324 |
"tag-listing-items-description-container", brands);
|
| 23914 |
govind |
325 |
}
|
|
|
326 |
}
|
| 23752 |
govind |
327 |
function loadSchemeDetails(schemeId, domId) {
|
|
|
328 |
doGetAjaxRequestHandler(context + "/getSchemeById?schemeId=" + schemeId,
|
| 28134 |
tejbeer |
329 |
function(response) {
|
|
|
330 |
$('#' + domId).html(response);
|
|
|
331 |
window.dispatchEvent(new Event('resize'));
|
|
|
332 |
});
|
| 23343 |
ashik.ali |
333 |
}
|
|
|
334 |
|
| 23752 |
govind |
335 |
function activeScheme(schemeId, offset, domId) {
|
|
|
336 |
doPutAjaxRequestHandler(context + "/activeSchemeById?schemeId=" + schemeId
|
| 28134 |
tejbeer |
337 |
+ "&offset=" + offset, function(response) {
|
|
|
338 |
$('#' + domId).html(response);
|
|
|
339 |
$('#scheme-details-container').html('');
|
|
|
340 |
});
|
| 23752 |
govind |
341 |
|
| 23343 |
ashik.ali |
342 |
}
|
|
|
343 |
|
| 25069 |
amit.gupta |
344 |
function expireScheme(schemeId, expireDate, offset, domId) {
|
| 23752 |
govind |
345 |
doPutAjaxRequestHandler(context + "/expireSchemeById?schemeId=" + schemeId
|
| 28134 |
tejbeer |
346 |
+ "&offset=" + offset + "&expireTimestamp=" + expireDate, function(
|
| 26763 |
tejbeer |
347 |
response) {
|
|
|
348 |
alert("Scheme - " + schemeId + " marked for expiry successfully!");
|
| 23343 |
ashik.ali |
349 |
$('#' + domId).html(response);
|
|
|
350 |
$('#scheme-details-container').html('');
|
|
|
351 |
});
|
|
|
352 |
}
|
| 23914 |
govind |
353 |
function extendAllScheme(domId) {
|
| 26763 |
tejbeer |
354 |
doPostAjaxRequestWithJsonHandler(context + "/extendAllSchemes", JSON
|
| 28134 |
tejbeer |
355 |
.stringify(startDate), function(response) {
|
|
|
356 |
if (response == 'true') {
|
|
|
357 |
alert("Scheme All Extended successfully");
|
|
|
358 |
schemes("main-content");
|
|
|
359 |
} else {
|
|
|
360 |
alert("No scheme Activated Currently");
|
|
|
361 |
schemes("main-content");
|
|
|
362 |
}
|
|
|
363 |
});
|
| 23343 |
ashik.ali |
364 |
|
| 23914 |
govind |
365 |
}
|
|
|
366 |
function extendSchemeById(schemeId) {
|
| 26763 |
tejbeer |
367 |
doPostAjaxRequestWithJsonHandler(context + "/extendSchemeById?schemeId="
|
| 28134 |
tejbeer |
368 |
+ schemeId, JSON.stringify(startDate), function(response) {
|
|
|
369 |
if (response == 'true') {
|
|
|
370 |
alert("Scheme extended successfully");
|
|
|
371 |
schemes("main-content");
|
|
|
372 |
} else {
|
|
|
373 |
alert("Scheme already Expired");
|
|
|
374 |
schemes("main-content");
|
|
|
375 |
}
|
|
|
376 |
});
|
| 23914 |
govind |
377 |
|
|
|
378 |
}
|
|
|
379 |
|
| 23752 |
govind |
380 |
function loadScheme(domId) {
|
|
|
381 |
doGetAjaxRequestHandler(context + "/createScheme", function(response) {
|
| 23343 |
ashik.ali |
382 |
$('#' + domId).html(response);
|
|
|
383 |
});
|
| 23752 |
govind |
384 |
|
| 23343 |
ashik.ali |
385 |
}
|
|
|
386 |
|
| 23914 |
govind |
387 |
function loadTagListingItemsDescriptionByBrand(domId, brands) {
|
|
|
388 |
doPostAjaxRequestWithJsonHandler(context + '/getTagListingItemsByBrand',
|
| 28134 |
tejbeer |
389 |
JSON.stringify(brands), function(response) {
|
|
|
390 |
$('#' + domId).html(response);
|
|
|
391 |
debugger;
|
|
|
392 |
configureTagListingItemsDescriptionDropDown();
|
|
|
393 |
});
|
| 23752 |
govind |
394 |
|
| 23343 |
ashik.ali |
395 |
}
|
|
|
396 |
|
| 23752 |
govind |
397 |
function schemes(domId) {
|
|
|
398 |
doGetAjaxRequestHandler(context + "/getSchemes", function(response) {
|
| 23343 |
ashik.ali |
399 |
$('#' + domId).html(response);
|
|
|
400 |
});
|
|
|
401 |
}
|
| 27648 |
tejbeer |
402 |
function marginCalculator(domId) {
|
|
|
403 |
doGetAjaxRequestHandler(context + "/getMarginCalculator", function(response) {
|
|
|
404 |
$('#' + domId).html(response);
|
|
|
405 |
});
|
|
|
406 |
}
|
| 23343 |
ashik.ali |
407 |
|
| 23752 |
govind |
408 |
function loadSchemesDownloadPage(domId) {
|
|
|
409 |
doGetAjaxRequestHandler(context + "/schemes/downloadPage", function(
|
| 28134 |
tejbeer |
410 |
response) {
|
| 23343 |
ashik.ali |
411 |
$('#' + domId).html(response);
|
|
|
412 |
});
|
| 23556 |
amit.gupta |
413 |
}
|
|
|
414 |
|
| 23752 |
govind |
415 |
function loadSchemeUpdatePage(domId) {
|
|
|
416 |
doGetAjaxRequestHandler(context + "/schemes/update-schemes-page", function(
|
| 28134 |
tejbeer |
417 |
response) {
|
| 23556 |
amit.gupta |
418 |
$('#' + domId).html(response);
|
|
|
419 |
});
|
| 23557 |
amit.gupta |
420 |
}
|
|
|
421 |
|
| 23928 |
govind |
422 |
function updateSingleScheme(shcemeIds, itemIds) {
|
|
|
423 |
doPostAjaxRequestWithJsonHandler(context + '/addItemToScheme', JSON
|
| 28134 |
tejbeer |
424 |
.stringify({
|
|
|
425 |
"itemIds": itemIds.split(",").map(Number),
|
|
|
426 |
"schemeIds": schemeIds.split(",").map(Number)
|
|
|
427 |
}), function(response) {
|
|
|
428 |
if (response == 'true') {
|
|
|
429 |
alert("Item Added to scheme successfully");
|
|
|
430 |
// $('#newItemToSchemeModal').modal('hide');
|
|
|
431 |
loadSchemeDetails(shcemeIds, "scheme-details-container");
|
|
|
432 |
} else {
|
|
|
433 |
alert("Item already present");
|
|
|
434 |
loadSchemeDetails(shcemeIds, "scheme-details-container");
|
|
|
435 |
}
|
|
|
436 |
});
|
| 23715 |
govind |
437 |
}
|
| 23928 |
govind |
438 |
function updateSchemes(shcemeIds, itemIds) {
|
|
|
439 |
doPostAjaxRequestWithJsonHandler(context + '/schemes/update', JSON
|
| 28134 |
tejbeer |
440 |
.stringify({
|
|
|
441 |
"itemIds": itemIds.split(",").map(Number),
|
|
|
442 |
"schemeIds": schemeIds.split(",").map(Number)
|
|
|
443 |
}), function(response) {
|
|
|
444 |
if (response == 'true') {
|
|
|
445 |
alert("Item Added to scheme successfully");
|
|
|
446 |
// $('#newItemToSchemeModal').modal('hide');
|
|
|
447 |
loadSchemeUpdatePage("main-content");
|
|
|
448 |
}
|
|
|
449 |
});
|
| 23928 |
govind |
450 |
}
|
| 23914 |
govind |
451 |
function deleteScheme(shcemeId, itemId) {
|
|
|
452 |
doDeleteAjaxRequestHandler(context + "/schemes/delete?schemeId=" + shcemeId
|
| 28134 |
tejbeer |
453 |
+ "&itemId=" + itemId, function(response) {
|
|
|
454 |
if (response == 'true') {
|
|
|
455 |
alert("ItemId Deleted successfully from Scheme");
|
|
|
456 |
loadSchemeDetails(shcemeId, "scheme-details-container");
|
|
|
457 |
}
|
|
|
458 |
});
|
| 23752 |
govind |
459 |
}
|
|
|
460 |
function loadSearchScheme(domId, search_text) {
|
| 27875 |
amit.gupta |
461 |
doGetAjaxRequestHandler(context + "/searchScheme?searchTerm="
|
| 28134 |
tejbeer |
462 |
+ search_text, function(response) {
|
|
|
463 |
$('#' + domId).html(response);
|
|
|
464 |
});
|
| 23752 |
govind |
465 |
}
|
| 27875 |
amit.gupta |
466 |
function loadSearchItemScheme(domId, selected_item, date) {
|
| 26802 |
tejbeer |
467 |
var category = $('#partner-category').val();
|
|
|
468 |
var searchText = $("#scheme-item-search-text").val();
|
| 26763 |
tejbeer |
469 |
|
| 26802 |
tejbeer |
470 |
var category = $('#partner-category').val();
|
| 26912 |
tejbeer |
471 |
|
|
|
472 |
console.log(category)
|
|
|
473 |
|
| 26802 |
tejbeer |
474 |
if (typeof (searchText) == "undefined" || !searchText) {
|
|
|
475 |
searchText = "";
|
|
|
476 |
}
|
|
|
477 |
if (typeof (category) == "undefined" || !category) {
|
|
|
478 |
category = "";
|
|
|
479 |
}
|
|
|
480 |
if ((searchText) && (category)) {
|
| 27875 |
amit.gupta |
481 |
doGetAjaxRequestHandler(context + "/getSchemes?searchItem="
|
| 28134 |
tejbeer |
482 |
+ selected_item.itemId + "&partnerType=" + category, function(
|
| 26802 |
tejbeer |
483 |
response) {
|
|
|
484 |
$('#' + domId).html(response);
|
|
|
485 |
$('#partner-category').val(category);
|
|
|
486 |
$('#scheme-item-search-text').val(selected_item.itemDescription);
|
|
|
487 |
|
|
|
488 |
});
|
| 26912 |
tejbeer |
489 |
} else if ((searchText)) {
|
| 27875 |
amit.gupta |
490 |
doGetAjaxRequestHandler(`${context}/getSchemes?searchItem=${selected_item.itemId}&date=${date}`, function(response) {
|
| 26802 |
tejbeer |
491 |
$('#' + domId).html(response);
|
|
|
492 |
$('#scheme-item-search-text').val(selected_item.itemDescription);
|
|
|
493 |
|
|
|
494 |
});
|
| 26912 |
tejbeer |
495 |
|
|
|
496 |
}
|
|
|
497 |
|
| 23752 |
govind |
498 |
}
|
| 28795 |
tejbeer |
499 |
|
|
|
500 |
function loadSearchImeiScheme(domId, selected_imei, date) {
|
|
|
501 |
var category = $('#partner-category').val();
|
|
|
502 |
var searchText = $("#scheme-imei-search-text").val();
|
|
|
503 |
|
|
|
504 |
var category = $('#partner-category').val();
|
|
|
505 |
|
|
|
506 |
console.log(category)
|
|
|
507 |
|
|
|
508 |
if (typeof (searchText) == "undefined" || !searchText) {
|
|
|
509 |
searchText = "";
|
|
|
510 |
}
|
|
|
511 |
if (typeof (category) == "undefined" || !category) {
|
|
|
512 |
category = "";
|
|
|
513 |
}
|
|
|
514 |
if ((searchText) && (category)) {
|
|
|
515 |
doGetAjaxRequestHandler(context + "/getSchemes?searchImei="
|
|
|
516 |
+ selected_imei + "&partnerType=" + category, function(
|
|
|
517 |
response) {
|
|
|
518 |
$('#' + domId).html(response);
|
|
|
519 |
|
|
|
520 |
$('#partner-category').val(category);
|
|
|
521 |
$('#scheme-imei-search-text').val(selected_imei);
|
|
|
522 |
});
|
|
|
523 |
} else if ((searchText)) {
|
|
|
524 |
doGetAjaxRequestHandler(`${context}/getSchemes?searchImei=${selected_imei}&date=${date}`, function(response) {
|
|
|
525 |
$('#' + domId).html(response);
|
|
|
526 |
$('#scheme-imei-search-text').val(selected_imei);
|
|
|
527 |
|
|
|
528 |
});
|
|
|
529 |
|
|
|
530 |
}
|
|
|
531 |
|
|
|
532 |
}
|
| 23752 |
govind |
533 |
function loadSchemeSearchInfo(search_text) {
|
|
|
534 |
loadSearchScheme("main-content", search_text);
|
|
|
535 |
}
|
| 27875 |
amit.gupta |
536 |
function loadSchemeItemSearchInfo(selectedItem, date) {
|
|
|
537 |
loadSearchItemScheme("main-content", selectedItem, date);
|
| 23914 |
govind |
538 |
}
|
| 28795 |
tejbeer |
539 |
|
|
|
540 |
function loadSchemeImeiSearchInfo(selectedImei, date) {
|
|
|
541 |
|
|
|
542 |
loadSearchImeiScheme("main-content", selectedImei, date);
|
|
|
543 |
}
|
|
|
544 |
|