| 33507 |
tejus.loha |
1 |
$(document).on('click', ".onboarding-form1", function () {
|
|
|
2 |
doGetAjaxRequestHandler(`${context}/onboardingForm`,
|
|
|
3 |
function (response) {
|
|
|
4 |
$('#' + 'main-content').html(response);
|
|
|
5 |
});
|
|
|
6 |
});
|
|
|
7 |
|
|
|
8 |
$(document).on('click', ".submitOnboardingForm", function () {
|
|
|
9 |
if (confirm("Are you sure to submit form ?")) {
|
|
|
10 |
let formData = objectifyForm($("form[name='Loi_Form']").serializeArray());
|
|
|
11 |
for (var key in formData) {
|
|
|
12 |
if (formData.hasOwnProperty(key) && formData[key].trim() === '') {
|
|
|
13 |
alert("The (" + key + ") value is blank please fill this field !");
|
|
|
14 |
return false;
|
|
|
15 |
}
|
|
|
16 |
}
|
|
|
17 |
let jsonData = JSON.stringify(formData);
|
|
|
18 |
doPostAjaxRequestWithJsonHandler(`${context}/submitOnboardingForm`, jsonData, function (response) {
|
|
|
19 |
if (response) {
|
|
|
20 |
alert("Your LOI form Submitted successfully ");
|
|
|
21 |
pendingLoiForm("main-content");
|
|
|
22 |
|
|
|
23 |
} else {
|
|
|
24 |
alert("Your LOI form not Submitted , try again ");
|
|
|
25 |
doGetAjaxRequestHandler(`${context}/onboardingForm`,
|
|
|
26 |
function (response) {
|
|
|
27 |
$('#' + 'main-content').html(response);
|
|
|
28 |
});
|
|
|
29 |
}
|
|
|
30 |
});
|
|
|
31 |
} else {
|
|
|
32 |
//nothing to do now
|
|
|
33 |
}
|
|
|
34 |
|
|
|
35 |
});
|
|
|
36 |
$(document).on('click', ".updateOnboardingForm", function () {
|
|
|
37 |
let loiId = $(this).val();
|
|
|
38 |
console.log("form id - ", loiId);
|
|
|
39 |
doGetAjaxRequestHandler(context + "/updateOnboardingForm?loiId=" + loiId,
|
|
|
40 |
function (response) {
|
|
|
41 |
$('#' + 'main-content').html(response);
|
|
|
42 |
});
|
|
|
43 |
});
|
|
|
44 |
|
|
|
45 |
$(document).on('click', ".updateOnboardingFormData", function () {
|
|
|
46 |
let loiId = $(this).val();
|
|
|
47 |
let formData = {};
|
|
|
48 |
let jsonData = JSON.stringify(objectifyForm($("form[name='Loi_Form']").serializeArray())).trim();
|
|
|
49 |
doPostAjaxRequestWithJsonHandler(`${context}/updateOnboardingFormData?loiId=` + loiId, jsonData, function (response) {
|
|
|
50 |
if (response) {
|
|
|
51 |
alert("LOI Form Updated Successfully..");
|
|
|
52 |
}
|
|
|
53 |
pendingLoiForm("main-content");
|
|
|
54 |
});
|
|
|
55 |
|
|
|
56 |
});
|
|
|
57 |
|
|
|
58 |
$(document).on('click', ".pending-onboarding-form", function () {
|
|
|
59 |
doGetAjaxRequestHandler(`${context}/pendingOnboardingForm`,
|
|
|
60 |
function (response) {
|
|
|
61 |
$('#' + 'main-content').html(response);
|
|
|
62 |
});
|
|
|
63 |
});
|
|
|
64 |
$(document).on('click', "#addBrandFeePayment", function () {
|
|
|
65 |
let formData = objectifyForm($("form[name='brandFeeCollectionForm']").serializeArray());
|
|
|
66 |
let loiId = $(this).val();
|
|
|
67 |
console.log("form id -", loiId);
|
|
|
68 |
for (var key in formData) {
|
|
|
69 |
if (formData.hasOwnProperty(key) && formData[key].trim() === '') {
|
|
|
70 |
alert("The (" + key + ") value is blank please fill this field !");
|
|
|
71 |
return false;
|
|
|
72 |
}
|
|
|
73 |
}
|
|
|
74 |
let jsonData = JSON.stringify(formData);
|
|
|
75 |
doPostAjaxRequestWithJsonHandler(`${context}/brandfeeCollection?loiId=` + loiId, jsonData, function (response) {
|
|
|
76 |
console.log("brand collection...");
|
|
|
77 |
if (response) {
|
|
|
78 |
alert("Payment add successfully...");
|
|
|
79 |
pendingLoiForm("main-content");
|
|
|
80 |
|
|
|
81 |
} else {
|
|
|
82 |
//console
|
|
|
83 |
}
|
|
|
84 |
});
|
|
|
85 |
|
|
|
86 |
});
|
|
|
87 |
|
|
|
88 |
$(document).on('click', ".generateLoi", function () {
|
|
|
89 |
let loiId = $(this).val();
|
|
|
90 |
console.log("form id - ", loiId);
|
|
|
91 |
doGetAjaxRequestHandler(context + "/generateLoi?loiId=" + loiId,
|
|
|
92 |
function (response) {
|
|
|
93 |
$('#' + 'main-content').html(response);
|
|
|
94 |
});
|
|
|
95 |
});
|
|
|
96 |
|
|
|
97 |
$(document).on('click', "#LOI_otp", function () {
|
|
|
98 |
let loiId = $(this).val();
|
|
|
99 |
console.log("loiId-", loiId);
|
|
|
100 |
doPostAjaxRequestHandler(`${context}/loiAcceptanceOtp?loiId=` + loiId,
|
|
|
101 |
function (response) {
|
|
|
102 |
alert(response);
|
|
|
103 |
doGetAjaxRequestHandler(context + "/generateLoi?loiId=" + loiId,
|
|
|
104 |
function (response) {
|
|
|
105 |
$('#' + 'main-content').html(response);
|
|
|
106 |
});
|
|
|
107 |
});
|
|
|
108 |
});
|
|
|
109 |
|
|
|
110 |
|
|
|
111 |
$(document).on('click', ".onboardingFormDone", function () {
|
|
|
112 |
let loiId = $(this).val();
|
|
|
113 |
var loi = $(document).find(".upload-form-loi input[type=file]").val();
|
|
|
114 |
console.log("form id - ", loiId);
|
|
|
115 |
doPostAjaxRequestHandler(`${context}/uploadLoi?loiId=${loiId}&loi=${loi}`,
|
|
|
116 |
function (response) {
|
|
|
117 |
$('#' + 'main-content').html(response);
|
|
|
118 |
});
|
|
|
119 |
});
|
|
|
120 |
|
|
|
121 |
//confirmPayment
|
|
|
122 |
$(document).on('click', ".confirmPayment", function () {
|
|
|
123 |
let bfcId = $(this).val();
|
|
|
124 |
console.log('bfcId -', bfcId);
|
|
|
125 |
let approval = $(this).data('approval');
|
|
|
126 |
doPutAjaxRequestHandler(`${context}/feePaymentApproval?bfcId=${bfcId}&feePaymentStatus=${approval}`,
|
|
|
127 |
function (response) {
|
|
|
128 |
alert(response);
|
|
|
129 |
pendingLoiForm("main-content");
|
|
|
130 |
});
|
|
|
131 |
});
|
|
|
132 |
$(document).on('click', ".upload-document-form", function () {
|
|
|
133 |
let loiId = $(this).val();
|
|
|
134 |
doPutAjaxRequestHandler(`${context}/uploadDocumentForm?loiId=${loiId}`,
|
|
|
135 |
function (response) {
|
|
|
136 |
$('#' + 'main-content').html(response);
|
|
|
137 |
});
|
|
|
138 |
});
|
|
|
139 |
$(document).on('input', 'table#OnboardingDocumentTable input[type=file]', function () {
|
|
|
140 |
if (confirm('Confirm file upload ?')) {
|
|
|
141 |
var fileSelector = $(this)[0];
|
|
|
142 |
if (fileSelector != undefined
|
|
|
143 |
&& fileSelector.files[0] != undefined) {
|
|
|
144 |
var file = this.files[0];
|
|
|
145 |
console.log("file", file);
|
|
|
146 |
let fileInput = $(this);
|
|
|
147 |
console.log("fileInput", file);
|
|
|
148 |
uploadDocument(file, function (documentId) {
|
|
|
149 |
console.log("documentIdzzz : ", documentId);
|
|
|
150 |
fileInput.closest('td').find(".documentId").val(documentId);
|
|
|
151 |
});
|
|
|
152 |
}
|
|
|
153 |
}
|
|
|
154 |
});
|
|
|
155 |
$(document).on('click', ".mk_docApproval", function () {
|
|
|
156 |
let loiId = $(this).data('form_id');
|
|
|
157 |
let docMasterId = $(this).data('doc_master_id');
|
|
|
158 |
let flag = $(this).data('flag');
|
|
|
159 |
console.log("flag -", flag);
|
|
|
160 |
doPutAjaxRequestHandler(`${context}/documentVerify?loiId=${loiId}&docMasterId=${docMasterId}&flag=${flag}`,
|
|
|
161 |
function (response) {
|
|
|
162 |
alert(response);
|
|
|
163 |
doPutAjaxRequestHandler(`${context}/uploadDocumentForm?loiId=${loiId}`,
|
|
|
164 |
function (response) {
|
|
|
165 |
$('#' + 'main-content').html(response);
|
|
|
166 |
});
|
|
|
167 |
|
|
|
168 |
});
|
|
|
169 |
});
|
|
|
170 |
$(document).on('click', "#uploadDocumentbtn1", function () {
|
|
|
171 |
if (confirm("Are you sure to upload all documents ?")) {
|
|
|
172 |
var loiId = $(this).val();
|
|
|
173 |
var loiDocModels = [];
|
|
|
174 |
console.log("loiId -", loiId);
|
|
|
175 |
$("#OnboardingDocumentTable > tbody > tr").each(function (rowIndex) {
|
|
|
176 |
var marsterId = $(this).find(".masterId").val();
|
|
|
177 |
var docId = $(this).find(".documentId").val();
|
|
|
178 |
var docName = $(this).find(".documentName").val();
|
|
|
179 |
console.log("marsterId -", marsterId);
|
|
|
180 |
var loiDocModel = {
|
|
|
181 |
documentId: docId,
|
|
|
182 |
documentName: docName,
|
|
|
183 |
documentMasterId: marsterId
|
|
|
184 |
};
|
|
|
185 |
loiDocModels.push(loiDocModel);
|
|
|
186 |
});
|
|
|
187 |
console.log(loiDocModels);
|
|
|
188 |
var loiDocModelData = JSON.stringify(loiDocModels);
|
|
|
189 |
doPostAjaxRequestWithJsonHandler(`${context}/uploadOnboardingDocument?loiId=${loiId}`, loiDocModelData, function (response) {
|
|
|
190 |
console.log('response-', response);
|
|
|
191 |
pendingLoiForm("main-content");
|
|
|
192 |
});
|
|
|
193 |
} else {
|
|
|
194 |
//Nothing to do
|
|
|
195 |
}
|
|
|
196 |
|
|
|
197 |
|
|
|
198 |
});
|
|
|
199 |
$(document).on('click', ".documnet-verifed", function () {
|
|
|
200 |
let loiId = $(this).val();
|
|
|
201 |
if (confirm("Are you sure to verify All document ?")) {
|
|
|
202 |
doPutAjaxRequestHandler(`${context}/documentApproved?loiId=${loiId}`,
|
|
|
203 |
function (response) {
|
|
|
204 |
alert(response);
|
|
|
205 |
pendingLoiForm("main-content");
|
|
|
206 |
});
|
|
|
207 |
} else {
|
|
|
208 |
console.log(" All docs not verify");
|
|
|
209 |
//Nothing
|
|
|
210 |
}
|
|
|
211 |
});
|
|
|
212 |
$(document).on('click', ".loiFormComplete", function () {
|
|
|
213 |
let loiId = $(this).val();
|
|
|
214 |
if (confirm("Are you sure all things are done ?")) {
|
|
|
215 |
doPutAjaxRequestHandler(`${context}/loiFormComplete?loiId=${loiId}`,
|
|
|
216 |
function (response) {
|
|
|
217 |
alert(response);
|
|
|
218 |
});
|
|
|
219 |
pendingLoiForm("main-content");
|
|
|
220 |
|
|
|
221 |
} else {
|
|
|
222 |
console.log("Loi form not completed !");
|
|
|
223 |
//Nothing
|
|
|
224 |
}
|
|
|
225 |
});
|
|
|
226 |
$(document).on('click', ".deleteLoiForm", function () {
|
|
|
227 |
let loiId = $(this).val();
|
|
|
228 |
if (confirm("Are you sure to delete ?")) {
|
|
|
229 |
doPutAjaxRequestHandler(`${context}/deleteLoiForm?loiId=${loiId}`,
|
|
|
230 |
function (response) {
|
|
|
231 |
if (response) {
|
|
|
232 |
alert("Loi form deleted ");
|
|
|
233 |
} else {
|
|
|
234 |
//nothing to do
|
|
|
235 |
}
|
|
|
236 |
});
|
|
|
237 |
doGetAjaxRequestHandler(`${context}/pendingOnboardingForm`,
|
|
|
238 |
function (response) {
|
|
|
239 |
$('#' + 'main-content').html(response);
|
|
|
240 |
});
|
|
|
241 |
|
|
|
242 |
} else {
|
|
|
243 |
console.log("");
|
|
|
244 |
//Nothing
|
|
|
245 |
}
|
|
|
246 |
});
|
|
|
247 |
|
|
|
248 |
$(document).on('click', ".CompletedLoiForm", function () {
|
|
|
249 |
doPutAjaxRequestHandler(`${context}/completedLoiForms`,
|
|
|
250 |
function (response) {
|
|
|
251 |
$('#' + 'main-content').html(response);
|
|
|
252 |
});
|
|
|
253 |
});
|
|
|
254 |
|
|
|
255 |
$(document).on('click', "#createNewOnboardingPanel", function () {
|
|
|
256 |
let loiId = $(this).val();
|
|
|
257 |
let authId = $(this).closest('tr').find('.authId').val();
|
|
|
258 |
if (authId != " ") {
|
|
|
259 |
|
|
|
260 |
doPutAjaxRequestHandler(`${context}/createNewOnboardingPanel?loiId=${loiId}&authId=${authId}`,
|
|
|
261 |
function (response) {
|
|
|
262 |
if (response) {
|
|
|
263 |
doPutAjaxRequestHandler(`${context}/completedLoiForms`,
|
|
|
264 |
function (response) {
|
|
|
265 |
$('#' + 'main-content').html(response);
|
|
|
266 |
});
|
|
|
267 |
} else {
|
|
|
268 |
//nothing
|
|
|
269 |
}
|
|
|
270 |
|
|
|
271 |
});
|
|
|
272 |
} else {
|
|
|
273 |
alert("Please choose RBM ");
|
|
|
274 |
}
|
|
|
275 |
|
|
|
276 |
});
|
|
|
277 |
|
|
|
278 |
function pendingLoiForm(domId) {
|
|
|
279 |
doGetAjaxRequestHandler(`${context}/pendingOnboardingForm`,
|
|
|
280 |
function (response) {
|
|
|
281 |
$('#' + domId).html(response);
|
|
|
282 |
});
|
|
|
283 |
}
|