| 28848 |
manish |
1 |
$(function() {
|
|
|
2 |
|
|
|
3 |
$(document).on('click', ".partner_dealer_mapping", function() {
|
|
|
4 |
|
|
|
5 |
console.log("Hello");
|
|
|
6 |
partnerDealerMapping("main-content");
|
|
|
7 |
|
|
|
8 |
});
|
|
|
9 |
|
|
|
10 |
$(document).on('click', ".partner_onboarding_verification", function() {
|
|
|
11 |
|
|
|
12 |
partnerOnboardingVerification("main-content");
|
|
|
13 |
|
|
|
14 |
});
|
|
|
15 |
|
|
|
16 |
|
|
|
17 |
$(document).on('click', ".partner-dashboard-training", function() {
|
|
|
18 |
|
|
|
19 |
console.log("Hello");
|
|
|
20 |
partnerDashboardTraining("main-content");
|
|
|
21 |
|
|
|
22 |
});
|
|
|
23 |
|
|
|
24 |
$(document).on('click', ".partner-dealer-submit", function() {
|
|
|
25 |
|
|
|
26 |
var row = $(this).closest("tr");
|
|
|
27 |
console.log(row);
|
|
|
28 |
var brandlength = $(this).data("brandlength");
|
|
|
29 |
var onboardingId = $(row).find("td:eq(0)").text();
|
|
|
30 |
var partnerCode = $(row).find("td:eq(4)").text();
|
|
|
31 |
|
|
|
32 |
console.log("brandlength" + brandlength)
|
|
|
33 |
var brandCodes =[]
|
|
|
34 |
for (let i=5; i< 5+brandlength; i++){
|
|
|
35 |
|
|
|
36 |
brandCodes.push($(row).find("td:eq("+ i +") input[type='text']").val());
|
|
|
37 |
}
|
|
|
38 |
|
|
|
39 |
console.log("bands"+brandCodes);
|
|
|
40 |
|
|
|
41 |
dmsCode = {
|
|
|
42 |
"onboardingId" : onboardingId,
|
|
|
43 |
"partnerCode" : partnerCode,
|
|
|
44 |
|
|
|
45 |
"brands" : brandCodes,
|
|
|
46 |
}
|
|
|
47 |
|
|
|
48 |
var jsonObject = JSON.stringify(dmsCode)
|
|
|
49 |
|
|
|
50 |
console.log("jsonObject"+jsonObject);
|
|
|
51 |
|
|
|
52 |
|
|
|
53 |
doAjaxRequestWithJsonHandler(context + "/partnerDealerSubmit", "POST",jsonObject,
|
|
|
54 |
function(response) {
|
|
|
55 |
|
|
|
56 |
row.html(response);
|
|
|
57 |
|
|
|
58 |
});
|
|
|
59 |
|
|
|
60 |
});
|
|
|
61 |
|
|
|
62 |
$(document).on('click', ".partner-verification-submit", function() {
|
|
|
63 |
|
|
|
64 |
var row = $(this).closest("tr");
|
|
|
65 |
console.log(row);
|
|
|
66 |
|
|
|
67 |
var onboardingId = $(row).find("td:eq(0)").text();
|
|
|
68 |
var comment = $(row).find("td:eq(8) input[type='text']").val();
|
|
|
69 |
var nocGt = $("#nocGt").val();
|
|
|
70 |
var rbmReason = $("#rbmReason").val();
|
|
|
71 |
var approval =$("#approval").val();
|
|
|
72 |
|
|
|
73 |
console.log("onboardingId"+onboardingId);
|
|
|
74 |
console.log("rbmReason"+rbmReason);
|
|
|
75 |
console.log("approval"+approval);
|
|
|
76 |
console.log("nocGt"+nocGt);
|
|
|
77 |
console.log("comment"+comment);
|
|
|
78 |
|
|
|
79 |
|
|
|
80 |
var partnerVerficationObject = {};
|
|
|
81 |
partnerVerficationObject['onboardingId'] = onboardingId
|
|
|
82 |
partnerVerficationObject['comment'] = comment
|
|
|
83 |
partnerVerficationObject['nocGt'] = nocGt
|
|
|
84 |
partnerVerficationObject['rbmReason'] = rbmReason
|
|
|
85 |
|
|
|
86 |
partnerVerficationObject['approval'] = approval
|
|
|
87 |
|
|
|
88 |
|
|
|
89 |
var jsonObject = JSON.stringify(partnerVerficationObject);
|
|
|
90 |
|
|
|
91 |
console.log(jsonObject);
|
|
|
92 |
|
|
|
93 |
if (confirm("Are you sure you want to submit the request") == true) {
|
|
|
94 |
doAjaxRequestWithJsonHandler(context + "/partnerVerificationSubmit","POST",jsonObject,function(response) {
|
|
|
95 |
row.html(response);
|
|
|
96 |
row.css("background-color", "#F8F8FF");
|
|
|
97 |
|
|
|
98 |
});
|
|
|
99 |
}
|
|
|
100 |
|
|
|
101 |
});
|
|
|
102 |
|
|
|
103 |
$(document).on('click', ".partner-training-submit", function() {
|
|
|
104 |
|
|
|
105 |
var row = $(this).closest("tr");
|
|
|
106 |
console.log(row);
|
|
|
107 |
|
|
|
108 |
var onboardingId = $(row).find("td:eq(0)").text();
|
|
|
109 |
|
|
|
110 |
var dateCompleted = $(row).find("td:eq(8) input[type='date']").val();
|
|
|
111 |
if (dateCompleted != "") {
|
|
|
112 |
dateCompleted = dateCompleted + "T00:00:00";
|
|
|
113 |
}
|
|
|
114 |
|
|
|
115 |
var dashboardTraining = $("#dashboardTraining").val();
|
|
|
116 |
var appTraining = $("#appTraining").val();
|
|
|
117 |
|
|
|
118 |
console.log("onboardingId"+onboardingId);
|
|
|
119 |
console.log("dateCompleted"+dateCompleted);
|
|
|
120 |
console.log("dashboardTraining"+dashboardTraining);
|
|
|
121 |
console.log("appTraining"+appTraining);
|
|
|
122 |
|
|
|
123 |
|
|
|
124 |
var partnerDashboardTraining = {};
|
|
|
125 |
partnerDashboardTraining['onboardingId'] = onboardingId
|
|
|
126 |
partnerDashboardTraining['dateCompleted'] = dateCompleted
|
|
|
127 |
partnerDashboardTraining['dashboardTraining'] = dashboardTraining
|
|
|
128 |
partnerDashboardTraining['appTraining'] = appTraining
|
|
|
129 |
|
|
|
130 |
|
|
|
131 |
var jsonObject = JSON.stringify(partnerDashboardTraining);
|
|
|
132 |
|
|
|
133 |
console.log(jsonObject);
|
|
|
134 |
|
|
|
135 |
if (confirm("Are you sure you want to submit the request") == true) {
|
|
|
136 |
doAjaxRequestWithJsonHandler(context + "/partnerDashboardTrainingSubmit","POST",jsonObject,function(response) {
|
|
|
137 |
row.html(response);
|
|
|
138 |
row.css("background-color", "#F8F8FF");
|
|
|
139 |
|
|
|
140 |
});
|
|
|
141 |
}
|
|
|
142 |
|
|
|
143 |
});
|
|
|
144 |
|
|
|
145 |
var table = $('#partnerVerification').DataTable();
|
|
|
146 |
$(document).on('dblclick', '#partnerVerification tbody tr', function() {
|
|
|
147 |
console.log("dblclick");
|
|
|
148 |
var data = table.row(this).data();
|
|
|
149 |
|
|
|
150 |
$(this).find(":selected").attr('disabled', false).show();
|
|
|
151 |
$(this).find(":input").attr('disabled', false).show();
|
|
|
152 |
|
|
|
153 |
});
|
|
|
154 |
|
|
|
155 |
var table = $('#partnerDashboardTraining').DataTable();
|
|
|
156 |
$(document).on('dblclick', '#partnerDashboardTraining tbody tr', function() {
|
|
|
157 |
console.log("dblclick");
|
|
|
158 |
var data = table.row(this).data();
|
|
|
159 |
|
|
|
160 |
$(this).find(":selected").attr('disabled', false).show();
|
|
|
161 |
$(this).find(":input").attr('disabled', false).show();
|
|
|
162 |
|
|
|
163 |
});
|
|
|
164 |
|
|
|
165 |
|
|
|
166 |
|
|
|
167 |
|
|
|
168 |
var table = $('#partnerDealerMapping').DataTable();
|
|
|
169 |
$(document).on('dblclick', '#partnerDealerMapping tbody tr', function() {
|
|
|
170 |
console.log("dblclick");
|
|
|
171 |
var data = table.row(this).data();
|
|
|
172 |
|
|
|
173 |
$(this).find(":input").attr('disabled', false).show();
|
|
|
174 |
|
|
|
175 |
|
|
|
176 |
});
|
|
|
177 |
|
|
|
178 |
|
|
|
179 |
});
|
|
|
180 |
function partnerDealerMapping(domId) {
|
|
|
181 |
doAjaxRequestHandler(context + "/partnerDealerMapping", "GET",
|
|
|
182 |
function(response) {
|
|
|
183 |
$('#' + domId).html(response);
|
|
|
184 |
});
|
|
|
185 |
}
|
|
|
186 |
|
|
|
187 |
function partnerDashboardTraining(domId) {
|
|
|
188 |
doAjaxRequestHandler(context + "/partnerDashboardTraining", "GET",
|
|
|
189 |
function(response) {
|
|
|
190 |
$('#' + domId).html(response);
|
|
|
191 |
});
|
|
|
192 |
}
|
|
|
193 |
|
|
|
194 |
|
|
|
195 |
function partnerOnboardingVerification(domId) {
|
|
|
196 |
doAjaxRequestHandler(context + "/partnerOnboardingVerification", "GET",
|
|
|
197 |
function(response) {
|
|
|
198 |
$('#' + domId).html(response);
|
|
|
199 |
});
|
|
|
200 |
}
|
|
|
201 |
|
|
|
202 |
|