Subversion Repositories SmartDukaan

Rev

Rev 33660 | Rev 34216 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 33660 Rev 34210
Line 187... Line 187...
187
    });
187
    });
188
    newTargetSlab.find("select.criteria-brands").chosen({no_results_text: "Oops, nothing found!"});
188
    newTargetSlab.find("select.criteria-brands").chosen({no_results_text: "Oops, nothing found!"});
189
    //createSlabFrom(currentHtml);
189
    //createSlabFrom(currentHtml);
190
});
190
});
191
 
191
 
-
 
192
$(document).on('click', '.scheme_block_imeis_panel', function () {
-
 
193
    reloadBlockImeiPanel();
-
 
194
    $('div.modal-backdrop.fade').remove();
-
 
195
 
-
 
196
 
-
 
197
});
-
 
198
 
-
 
199
$(document).on('click', '.eligible_offer_imeis_panel', function () {
-
 
200
    doGetAjaxRequestHandler(`${context}/blockImeisForOffer/panel`, function (response) {
-
 
201
        $('#main-content').html(response);
-
 
202
    });
-
 
203
    $('div.modal-backdrop.fade').remove();
-
 
204
 
-
 
205
 
-
 
206
});
-
 
207
 
-
 
208
 
-
 
209
$(document).on('click', '#submit_scheme_block_imeis', function () {
-
 
210
    let blockImei = $('#block_imei_scheme').val();
-
 
211
    console.log("blockImei - ", blockImei);
-
 
212
    if (!blockImei) {
-
 
213
        alert("Please enter Imei");
-
 
214
        return;
-
 
215
    }
-
 
216
 
-
 
217
    let url = `${context}/createBlockImei?imeiNumbers=${blockImei}`;
-
 
218
    if (confirm('Are you sure to block all enter Imei numbers')) {
-
 
219
        doPostAjaxRequestHandler(url, function (response) {
-
 
220
            if (response) {
-
 
221
                alert("Imei blocked successfully");
-
 
222
                reloadBlockImeiList();
-
 
223
            }
-
 
224
        });
-
 
225
    } else {
-
 
226
        return;
-
 
227
    }
-
 
228
 
-
 
229
});
-
 
230
$(document).on('click', '#submit_offer_eligible_imeis', function () {
-
 
231
    let blockImei = $('#offer_eligible_imeis').val();
-
 
232
    let offerId = $('#offerId').val();
-
 
233
    console.log("blockImei - ", blockImei);
-
 
234
    console.log("offer id - ", offerId);
-
 
235
    if (!blockImei) {
-
 
236
        alert("Please enter Imei");
-
 
237
        return;
-
 
238
    }
-
 
239
    if (!offerId) {
-
 
240
        alert("Please enter Offer Id");
-
 
241
        return;
-
 
242
    }
-
 
243
    let url = `${context}/blockImeisForOffer/create?imeis=${blockImei}&offerId=${offerId}`;
-
 
244
    if (confirm('Are you sure to block all enter Imei numbers')) {
-
 
245
        doPostAjaxRequestHandler(url, function (response) {
-
 
246
            if (response) {
-
 
247
                reloadOfferEligibleImeisList();
-
 
248
                alert("submited successfully");
-
 
249
            }
-
 
250
        });
-
 
251
    } else {
-
 
252
        return;
-
 
253
    }
-
 
254
 
-
 
255
});
-
 
256
 
-
 
257
 
-
 
258
$(document).on('click', '.scheme_imei_block_unblock_button', function () {
-
 
259
    let blockedImeiId = $(this).val();
-
 
260
    if (confirm("Are you sure to change status")) {
-
 
261
        doPutAjaxRequestHandler(`${context}/blockUnblockImei?id=${blockedImeiId}`, function (response) {
-
 
262
            reloadBlockImeiList();
-
 
263
        });
-
 
264
    } else {
-
 
265
        return;
-
 
266
    }
-
 
267
});
-
 
268
 
-
 
269
$(document).on('click', '.offer_eligible_imeis_EligibilityChange_button', function () {
-
 
270
    let blockedImeiId = $(this).val();
-
 
271
    if (confirm("Are you sure to change status")) {
-
 
272
        doPutAjaxRequestHandler(`${context}/blockImeisForOffer/changeStatus?id=${blockedImeiId}`, function (response) {
-
 
273
            reloadOfferEligibleImeisList();
-
 
274
            alert("Status changed successfully");
-
 
275
        });
-
 
276
    } else {
-
 
277
        return;
-
 
278
    }
-
 
279
});
-
 
280
 
-
 
281
$(document).on('click', '.scheme_blocked_imei_remove_button', function () {
-
 
282
    let blockedImeiId = $(this).val();
-
 
283
    if (confirm("Are you sure to remove")) {
-
 
284
        doDeleteAjaxRequestHandler(`${context}/removeBlockedImei?id=${blockedImeiId}`, function (response) {
-
 
285
            if (response) {
-
 
286
                reloadBlockImeiList();
-
 
287
            }
-
 
288
        });
-
 
289
    } else {
-
 
290
        return;
-
 
291
    }
-
 
292
 
-
 
293
 
-
 
294
});
-
 
295
$(document).on('click', '.offer_eligible_imei_remove_button', function () {
-
 
296
    let offerId = $(this).val();
-
 
297
    if (confirm("Are you sure to remove")) {
-
 
298
        doDeleteAjaxRequestHandler(`${context}/blockImeisForOffer/deleteByOfferId?offerId=${offerId}`, function (response) {
-
 
299
            if (response) {
-
 
300
                reloadOfferEligibleImeisList();
-
 
301
                alert("Removed successfully");
-
 
302
            }
-
 
303
        });
-
 
304
    } else {
-
 
305
        return;
-
 
306
    }
-
 
307
});
-
 
308
 
-
 
309
function reloadBlockImeiPanel() {
-
 
310
    doGetAjaxRequestHandler(`${context}/blockImeiPanel`, function (response) {
-
 
311
        $('#main-content').html(response);
-
 
312
    });
-
 
313
    // $('div.modal-backdrop.fade').remove();
-
 
314
}
-
 
315
function reloadBlockImeiOfferPanel() {
-
 
316
    doGetAjaxRequestHandler(`${context}/blockImeiOfferPanel`, function (response) {
-
 
317
        $('#main-content').html(response);
-
 
318
    });
-
 
319
    $('div.modal-backdrop.fade').remove();
-
 
320
}
-
 
321
 
-
 
322
function reloadBlockImeiList() {
-
 
323
    doGetAjaxRequestHandler(`${context}/blockImeiList`, function (response) {
-
 
324
        $('#scheme_blocked_imeis_div').empty();
-
 
325
        $('#scheme_blocked_imeis_div').html(response);
-
 
326
    });
-
 
327
}
-
 
328
 
-
 
329
function reloadOfferEligibleImeisList() {
-
 
330
    doGetAjaxRequestHandler(`${context}/blockImeisForOffer/allList`, function (response) {
-
 
331
        $('#offer_eligible_imeis_div').empty();
-
 
332
        $('#offer_eligible_imeis_div').html(response);
-
 
333
 
-
 
334
    });
-
 
335
}
-
 
336
 
192
$(document).on('click', 'select.criteria-catalogids+div > button', function () {
337
$(document).on('click', 'select.criteria-catalogids+div > button', function () {
193
    if (changed) {
338
    if (changed) {
194
        let brands = $(this).closest('.item-criteria').find('select').val();
339
        let brands = $(this).closest('.item-criteria').find('select').val();
195
        let led = $(this).closest('.item-criteria').find('input[name=led]').is(":checked");
340
        let led = $(this).closest('.item-criteria').find('input[name=led]').is(":checked");
196
        let tablet = $(this).closest('.item-criteria').find('input[name=tablet]').is(":checked");
341
        let tablet = $(this).closest('.item-criteria').find('input[name=tablet]').is(":checked");