| 28071 |
tejbeer |
1 |
$(function() {
|
|
|
2 |
|
| 28381 |
tejbeer |
3 |
$(document).on('click', '.retail-block-brand-submit', function() {
|
| 28723 |
amit.gupta |
4 |
|
|
|
5 |
if(brandSelect == 1)
|
|
|
6 |
{
|
|
|
7 |
|
| 28381 |
tejbeer |
8 |
var brand = $('#block-brand').val();
|
|
|
9 |
var fofoIds = $('#selected-block-ids').val();
|
| 28723 |
amit.gupta |
10 |
console.log("fofoIds"+fofoIds);
|
| 37101 |
amit |
11 |
if (brand == null || $.trim(brand) === "" || $.trim(brand) === "0") {
|
|
|
12 |
alert("Please select a brand first");
|
|
|
13 |
return;
|
|
|
14 |
}
|
| 28381 |
tejbeer |
15 |
if (confirm("Are you sure you want to submit") == true) {
|
|
|
16 |
doPostAjaxRequestHandler(context + "/getRetailerBlockBrandMappping?brand=" + brand + "&fofoIds=" + fofoIds,
|
|
|
17 |
function(response) {
|
|
|
18 |
if (response = true) {
|
|
|
19 |
|
|
|
20 |
alert("Successfully Submitted");
|
|
|
21 |
$("button.block-brand-submit").click();
|
|
|
22 |
}
|
|
|
23 |
});
|
|
|
24 |
}
|
| 28723 |
amit.gupta |
25 |
}
|
|
|
26 |
|
|
|
27 |
else
|
|
|
28 |
{
|
|
|
29 |
|
|
|
30 |
alert("Please click submit button of selected brand");
|
|
|
31 |
}
|
| 28381 |
tejbeer |
32 |
});
|
|
|
33 |
|
| 28723 |
amit.gupta |
34 |
var brandSelect;
|
|
|
35 |
|
|
|
36 |
$(document).on('change', ".brand-select", function() {
|
|
|
37 |
brandSelect=0;
|
|
|
38 |
console.log(brandSelect);
|
|
|
39 |
|
|
|
40 |
|
|
|
41 |
});
|
|
|
42 |
|
| 28381 |
tejbeer |
43 |
|
|
|
44 |
$(document).on('click', '.block-brand-submit', function() {
|
|
|
45 |
|
|
|
46 |
var brand = $('#block-brand').val();
|
| 28723 |
amit.gupta |
47 |
brandSelect = 1;
|
|
|
48 |
console.log(brandSelect);
|
| 28381 |
tejbeer |
49 |
doGetAjaxRequestHandler(context + "/getBlockBrand?brand=" + brand,
|
| 28071 |
tejbeer |
50 |
function(response) {
|
| 28381 |
tejbeer |
51 |
$('.partnersbyblockbrands').html(response);
|
| 28071 |
tejbeer |
52 |
});
|
| 28381 |
tejbeer |
53 |
|
|
|
54 |
|
|
|
55 |
});
|
|
|
56 |
|
|
|
57 |
|
|
|
58 |
|
|
|
59 |
|
|
|
60 |
$(document).on('click', '.brands-limit-submit', function() {
|
|
|
61 |
|
|
|
62 |
var brand = $('#show-brands').val();
|
|
|
63 |
|
|
|
64 |
|
|
|
65 |
doGetAjaxRequestHandler(context + "/getRetailerBrandslimitMapping?brand=" + brand,
|
|
|
66 |
function(response) {
|
|
|
67 |
$('.partnerByBrandsLimit').html(response);
|
| 28071 |
tejbeer |
68 |
});
|
| 28381 |
tejbeer |
69 |
})
|
|
|
70 |
|
|
|
71 |
|
|
|
72 |
|
|
|
73 |
|
|
|
74 |
$(document).on('click', '.pincode-submit', function() {
|
|
|
75 |
|
|
|
76 |
var fofoId = partnerId;
|
|
|
77 |
var pincode = $('#partnerPincode').val();
|
|
|
78 |
|
|
|
79 |
console.log("pin" + pincode);
|
|
|
80 |
|
|
|
81 |
|
|
|
82 |
doPostAjaxRequestHandler(context + "/setPartnerPincode?pincode=" + pincode + "&fofoId=" + fofoId,
|
| 28071 |
tejbeer |
83 |
function(response) {
|
| 28381 |
tejbeer |
84 |
$('.partner-pincode-container').html(response);
|
|
|
85 |
|
| 28071 |
tejbeer |
86 |
});
|
|
|
87 |
|
| 28381 |
tejbeer |
88 |
});
|
|
|
89 |
|
|
|
90 |
$(document).on('click', '.pincode-serach-submit', function() {
|
|
|
91 |
|
|
|
92 |
var pincode = $('#searchPincode').val();
|
|
|
93 |
|
|
|
94 |
console.log("pin" + pincode);
|
|
|
95 |
doGetAjaxRequestHandler(context + "/searchPincodePartner?pincode=" + pincode,
|
|
|
96 |
function(response) {
|
|
|
97 |
$('.pincode-container').html(response);
|
|
|
98 |
|
|
|
99 |
});
|
|
|
100 |
|
|
|
101 |
});
|
|
|
102 |
|
|
|
103 |
$(document).on('click', '.remove-pincode', function() {
|
|
|
104 |
var pin = $(this).data('pin');
|
|
|
105 |
var id = $(this).data('id');
|
|
|
106 |
var fofoId = $(this).data('fofoid');
|
|
|
107 |
console.log(pin);
|
|
|
108 |
console.log(fofoId);
|
|
|
109 |
if (confirm("Are you sure you want to remove this pincode") == true) {
|
|
|
110 |
doPostAjaxRequestHandler(context + "/removeSearchPincode?id=" + id + "&fofoId=" + fofoId + "&pin=" + pin,
|
|
|
111 |
function(response) {
|
|
|
112 |
|
|
|
113 |
$('.pincode-container').html(response);
|
|
|
114 |
|
|
|
115 |
});
|
|
|
116 |
}
|
|
|
117 |
});
|
|
|
118 |
|
|
|
119 |
|
|
|
120 |
|
|
|
121 |
|
|
|
122 |
$(document).on('click', ".pincode-delete", function() {
|
|
|
123 |
|
|
|
124 |
|
|
|
125 |
var id = $(this).data('id');
|
|
|
126 |
var fofoId = $(this).data('fofoid');
|
|
|
127 |
console.log(fofoId);
|
|
|
128 |
if (confirm("Are you sure you want to remove this pincode") == true) {
|
|
|
129 |
doPostAjaxRequestHandler(context + "/removePartnerPincode?id=" + id + "&fofoId=" + fofoId,
|
|
|
130 |
function(response) {
|
|
|
131 |
|
|
|
132 |
$('.partner-pincode-container').html(response);
|
|
|
133 |
|
|
|
134 |
});
|
|
|
135 |
}
|
|
|
136 |
|
|
|
137 |
});
|
|
|
138 |
|
| 28071 |
tejbeer |
139 |
});
|