Subversion Repositories SmartDukaan

Rev

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

Rev 29064 Rev 29764
Line 43... Line 43...
43
		
43
		
44
			});
44
			});
45
		
45
		
46
 
46
 
47
	});
47
	});
48
	$(document).on('click', ".notApplicableService",
-
 
49
			function() {
-
 
50
				
-
 
51
		
48
	
52
		
-
 
53
 
-
 
54
			});
-
 
55
$(document).on('click', ".submit-brand-not-available", function() {
49
$(document).on('click', ".submit-brand-not-available", function() {
56
		
50
		
57
	console.log("submit-brand-not-available");
51
	console.log("submit-brand-not-available");
58
	serviceId = $(this).data('serviceid');
52
	serviceId = $(this).data('serviceid');
59
	   fofoId = $("#partnerName").val();
53
	   fofoId = $("#partnerName").val();
Line 88... Line 82...
88
		console.log(serviceBrandId);
82
		console.log(serviceBrandId);
89
		console.log(serviceBrandComment);
83
		console.log(serviceBrandComment);
90
		reasonPartnerbrandServiceNotActivate(fofoId, serviceId, serviceBrandId,serviceBrandComment);
84
		reasonPartnerbrandServiceNotActivate(fofoId, serviceId, serviceBrandId,serviceBrandComment);
91
	
85
	
92
	});
86
	});
-
 
87
   
-
 
88
   
-
 
89
   
-
 
90
   $(document).on('click', ".service-comment", function() {
-
 
91
		serviceId = $(this).data('serviceid');
-
 
92
		fofoId =  $(this).data('fofoid');
-
 
93
		var row = $(this).closest("tr");
-
 
94
		
-
 
95
		bootbox.dialog({
-
 
96
			title : "Comment!",
-
 
97
			message : "<div class=form-inline'>"
-
 
98
					+ "<label for='code'>comment :</label>"
-
 
99
					+ "<input class='form-control' type='text' id='naTextComment'/>"
-
 
100
					+ "</div>",
-
 
101
			buttons : {
-
 
102
				cancel : {
-
 
103
					label : "CANCEL",
-
 
104
					className : 'btn-danger',
-
 
105
					callback : function() {
-
 
106
						return;
-
 
107
					}
-
 
108
				},
-
 
109
				ok : {
-
 
110
					label : "OK",
-
 
111
					className : 'btn-info',
-
 
112
					callback : function() {
-
 
113
						naText = $('#naTextComment').val();
-
 
114
						if(naText==""||naText==undefined||naText==null){
-
 
115
								alert("Comment text can't be empty");
-
 
116
								return;
-
 
117
							}
-
 
118
						var params = {
-
 
119
								"serviceId" : serviceId,
-
 
120
								"fofoId" : fofoId,
-
 
121
								"naText":naText
-
 
122
							}
-
 
123
							doPostAjaxRequestWithJsonHandler(context + "/addPartnerServiceGenComment",
-
 
124
									JSON.stringify(params), function(response) {
-
 
125
										alert("Successfully Submitted");
-
 
126
										row.html(response);
-
 
127
										
-
 
128
									});
-
 
129
					}
-
 
130
				}
-
 
131
			}
-
 
132
		});
-
 
133
	});
-
 
134
	
-
 
135
   $(document).on('click', ".service-mark-not-active", function() {
-
 
136
		serviceId = $(this).data('serviceid');
-
 
137
		fofoId =  $(this).data('fofoid');
-
 
138
		var row = $(this).closest("tr");
-
 
139
		
-
 
140
		bootbox.dialog({
-
 
141
			title : "Mark Not Applicable!",
-
 
142
			message : "<div class=form-inline'>"
-
 
143
					+ "<label for='code'>Not Applicable Reason:</label>"
-
 
144
					+ "<input class='form-control' type='text' id='naText'/>"
-
 
145
					+ "</div>",
-
 
146
			buttons : {
-
 
147
				cancel : {
-
 
148
					label : "CANCEL",
-
 
149
					className : 'btn-danger',
-
 
150
					callback : function() {
-
 
151
						return;
-
 
152
					}
-
 
153
				},
-
 
154
				ok : {
-
 
155
					label : "OK",
-
 
156
					className : 'btn-info',
-
 
157
					callback : function() {
-
 
158
						naText = $('#naText').val();
-
 
159
						if(naText==""||naText==undefined||naText==null){
-
 
160
								alert("NA text can't be empty");
-
 
161
								return;
-
 
162
							}
-
 
163
						var params = {
-
 
164
								"serviceId" : serviceId,
-
 
165
								"fofoId" : fofoId,
-
 
166
								"naText":naText
-
 
167
							}
-
 
168
							doPostAjaxRequestWithJsonHandler(context + "/addPartnerServiceNotavailable",
-
 
169
									JSON.stringify(params), function(response) {
-
 
170
										alert("Successfully Marked NA");
-
 
171
										row.html(response);
-
 
172
										
-
 
173
									});b  
-
 
174
					}
-
 
175
				}
-
 
176
			}
-
 
177
		});
-
 
178
	});
93
	
179
	
94
	$(document).on('click', ".markNA", function() {
180
	$(document).on('click', ".markNA", function() {
95
		let fofoId = $('#partnerName').val();
181
		let fofoId = $('#partnerName').val();
96
		let serviceId = $(this).data("serviceid");
182
		let serviceId = $(this).data("serviceid");
97
		bootbox.dialog({
183
		bootbox.dialog({
Line 257... Line 343...
257
		loadaddPartnerServiceDetails("main-content");
343
		loadaddPartnerServiceDetails("main-content");
258
	});
344
	});
259
	$(document).on('click', ".add-partner-brand-service-details", function() {
345
	$(document).on('click', ".add-partner-brand-service-details", function() {
260
		loadaddPartnerBrandServiceDetails("main-content");
346
		loadaddPartnerBrandServiceDetails("main-content");
261
	});
347
	});
-
 
348
	$(document).on('click', ".service-mark-active", function() {
-
 
349
		serviceId = $(this).data('serviceid');
-
 
350
		fofoId =  $(this).data('fofoid');
-
 
351
		var row = $(this).closest("tr");
-
 
352
		console.log(fofoId);
-
 
353
		console.log(serviceId);
-
 
354
		console.log(row);
-
 
355
		activateFinanceServices(fofoId, serviceId,row);
-
 
356
	});
-
 
357
	
-
 
358
	
262
	$(document).on('click', ".activate-service", function() {
359
	$(document).on('click', ".activate-service", function() {
263
		serviceId = $(this).data('serviceid');
360
		serviceId = $(this).data('serviceid');
264
		fofoId = $("#partnerName").val();
361
		fofoId = $("#partnerName").val();
265
		console.log(fofoId);
362
		console.log(fofoId);
266
		console.log(serviceId);
363
		console.log(serviceId);
Line 315... Line 412...
315
		
412
		
316
		deActivatePartnerServiceByPartner(fofoId, serviceId,partnerNotInterestedComment);
413
		deActivatePartnerServiceByPartner(fofoId, serviceId,partnerNotInterestedComment);
317
 
414
 
318
	});
415
	});
319
	
416
	
-
 
417
	
-
 
418
	
-
 
419
$(document).on('click', ".service-mark-pni", function() {
-
 
420
		
-
 
421
		serviceId = $(this).data('serviceid');
-
 
422
		fofoId = $(this).data('fofoid');
-
 
423
		 var partnerNotInterestedComment = "Partner Not Interested"
-
 
424
			 var row = $(this).closest("tr");
-
 
425
		console.log(fofoId);
-
 
426
		console.log(serviceId);
-
 
427
		console.log(row);
-
 
428
		
-
 
429
		
-
 
430
		
-
 
431
		deActivateFinanceServicePartnerNotInterested(fofoId, serviceId,partnerNotInterestedComment,row);
-
 
432
 
-
 
433
	});
-
 
434
	
-
 
435
$(document).on('click', ".action-on-brand", function() {
-
 
436
	serviceId = $(this).data('serviceid');
-
 
437
	fofoId = $(this).data('fofoid');
-
 
438
	brandid = $(this).data('brandid');
-
 
439
	 var row = $(this).closest("tr");
-
 
440
	
-
 
441
	console.log(fofoId);
-
 
442
	console.log(serviceId);
-
 
443
	console.log(brandid);
-
 
444
	actionFinanceBrandService(fofoId, serviceId, brandid,row);
-
 
445
 
-
 
446
});
-
 
447
	
-
 
448
	
-
 
449
	
320
	$(document).on('click', ".deactivate-brand-service-modal", function() {
450
	$(document).on('click', ".deactivate-brand-service-modal", function() {
321
		console.log("activate-brand-service clicked");
451
		console.log("activate-brand-service clicked");
322
		serviceId = $(this).data('serviceid');
452
		serviceId = $(this).data('serviceid');
323
		fofoId = $("#partnerName").val();
453
		fofoId = $("#partnerName").val();
324
		serviceBrandId = $(this).data('servicebrandid');
454
		serviceBrandId = $(this).data('servicebrandid');
Line 808... Line 938...
808
			}
938
			}
809
		}
939
		}
810
	});
940
	});
811
}
941
}
812
 
942
 
-
 
943
function activateFinanceServices(fofoId, serviceId,row) {
-
 
944
	console.log(fofoId);
-
 
945
	
-
 
946
	console.log(row);
-
 
947
	bootbox.dialog({
-
 
948
		title : "Are you sure you want to activate services!",
-
 
949
		message : "<div class=form-inline'>"
-
 
950
				+ "<label for='code'>Code:</label>"
-
 
951
				+ "<input class='form-control' type='text' id='code'/>"
-
 
952
				+ "</div>",
-
 
953
		buttons : {
-
 
954
			cancel : {
-
 
955
				label : "cancel",
-
 
956
				className : 'btn-danger',
-
 
957
				callback : function() {
-
 
958
					return;
-
 
959
				}
-
 
960
			},
-
 
961
			ok : {
-
 
962
				label : "ok",
-
 
963
				className : 'btn-info',
-
 
964
				callback : function() {
-
 
965
					code = $('#code').val();
-
 
966
					//console.log(partnerStatusComment);
-
 
967
					if(code==""||code==undefined||code==null)
-
 
968
						{
-
 
969
							alert("code can't be empty");
-
 
970
							activatePartnerService(fofoId, serviceId);
-
 
971
							return;
-
 
972
						}
-
 
973
					var params = {
-
 
974
							"serviceId" : serviceId,
-
 
975
							"fofoId" : fofoId,
-
 
976
							"code":code
-
 
977
						}
-
 
978
						doPostAjaxRequestWithParamsHandler(context + "/activateFinanceServices",
-
 
979
								params, function(response) {
-
 
980
						
-
 
981
										row.html(response);
-
 
982
										alert("successfully submit");
-
 
983
 
-
 
984
								});
-
 
985
				}
-
 
986
			}
-
 
987
		}
-
 
988
	});
-
 
989
}
813
function deActivatePartnerService(fofoId, serviceId) {
990
function deActivatePartnerService(fofoId, serviceId) {
814
	if (confirm("Are you sure you want to deactivate services!") == true) {
991
	if (confirm("Are you sure you want to deactivate services!") == true) {
815
		var params = {
992
		var params = {
816
			"serviceId" : serviceId,
993
			"serviceId" : serviceId,
817
			"fofoId" : fofoId
994
			"fofoId" : fofoId
Line 843... Line 1020...
843
				loadAdminPartnerService("main-content", fofoId);
1020
				loadAdminPartnerService("main-content", fofoId);
844
			}
1021
			}
845
		});
1022
		});
846
	}
1023
	}
847
}
1024
}
-
 
1025
 
-
 
1026
function actionFinanceBrandService(fofoId, serviceId, brandId,row) {
-
 
1027
	if (confirm("Are you sure you want to activate or deactivate brand service!") == true) {
-
 
1028
		var params = {
-
 
1029
			"serviceId" : serviceId,
-
 
1030
			"fofoId" : fofoId,
-
 
1031
			"serviceBrandId" : brandId
-
 
1032
 
-
 
1033
		}
-
 
1034
		doPostAjaxRequestWithParamsHandler(context
-
 
1035
				+ "/actionFinanceBrandService", params, function(response) {
-
 
1036
			
-
 
1037
				alert("successfully activate");
-
 
1038
				row.html(response);
-
 
1039
		});
848
	
1040
	}
-
 
1041
}
-
 
1042
 
-
 
1043
 
-
 
1044
function deActivateFinanceServicePartnerNotInterested(fofoId, serviceId, partnerNotInterestedComment,row) {
-
 
1045
	console.log(row);
-
 
1046
	if (confirm("Are you sure you want to Deactivate service!") == true) {
-
 
1047
		var params = {
-
 
1048
			"serviceId" : serviceId,
-
 
1049
			"fofoId" : fofoId,
-
 
1050
			"partnerNotInterestedComment" : partnerNotInterestedComment
-
 
1051
 
-
 
1052
		}
-
 
1053
		doPostAjaxRequestWithParamsHandler(context
-
 
1054
				+ "/deActivateFinanceServicePartnerNotInterested", params, function(response) {
-
 
1055
		
-
 
1056
				console.log(row);
-
 
1057
				alert("successfully submit");
-
 
1058
				row.html(response);
-
 
1059
			
-
 
1060
		});
-
 
1061
   }
-
 
1062
}
849
	function deActivatePartnerServiceByPartner(fofoId, serviceId, partnerNotInterestedComment) {
1063
	function deActivatePartnerServiceByPartner(fofoId, serviceId, partnerNotInterestedComment) {
850
		if (confirm("Are you sure you want to Deactivate service!") == true) {
1064
		if (confirm("Are you sure you want to Deactivate service!") == true) {
851
			var params = {
1065
			var params = {
852
				"serviceId" : serviceId,
1066
				"serviceId" : serviceId,
853
				"fofoId" : fofoId,
1067
				"fofoId" : fofoId,