Subversion Repositories SmartDukaan

Rev

Rev 29951 | Rev 31170 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
29951 amit.gupta 1
$(function () {
30252 amit.gupta 2
	$(document).on('click', ".price-circular", function () {
3
		loadPriceCircular("main-content");
4
	});
28102 tejbeer 5
 
30252 amit.gupta 6
	$(document).on('click', ".partner-price-circular", function () {
28134 tejbeer 7
 
30252 amit.gupta 8
		bootbox.confirm({
9
			message: "<div class = 'disclosurehindata'> <img src='resources/images/disclosure.png' style='width:100%'> </div>"
10
			,
11
			buttons: {
12
				confirm: {
13
					label: 'I agree',
14
					className: 'btn-success'
15
				},
16
				cancel: {
17
					label: 'I disagree',
18
					className: 'btn-danger'
19
				}
20
			},
21
			callback: function (result) {
22
				if (result == true) {
23
					loadPartnerPriceCircular("main-content");
24
				}
25
			}
26
		});
28134 tejbeer 27
 
30252 amit.gupta 28
	});
28102 tejbeer 29
 
28142 tejbeer 30
 
30252 amit.gupta 31
	$(document).on('click', ".circular-request", function () {
32
		var brand = $(".criteria-item-brands").val();
33
		var partnerType = $("#partnerType").val();
34
		doGetAjaxRequestHandler(context + "/priceCircularByBrandAndPartnerType?brands=" + brand + "&partnerType=" +
35
			partnerType,
36
			function (response) {
37
				console.log(response)
38
				$('.circular-container').html(response);
39
			});
40
	});
28102 tejbeer 41
 
30252 amit.gupta 42
	$(document).on('click', ".submit-circular-request", function () {
43
		let brand = $("#brands").val();
44
		let priceCircularUrl = `${context}/priceCircularByBrand?brand=${brand}`;
45
		if (typeof partnerId == "number") {
46
			priceCircularUrl = `${priceCircularUrl}&fofoId=${partnerId}`;
47
		}
48
		doGetAjaxRequestHandler(priceCircularUrl,
49
			function (response) {
50
				console.log(response)
51
				$('.price-circular-container').html(response);
52
			});
53
	});
28102 tejbeer 54
 
30252 amit.gupta 55
	$(document).on('click', ".download-nlc", function () {
56
		let brand = $("#brands").val();
57
		let downloadNlcUrl = `${context}/downloadNlcByBrand?brand=${brand}`;
58
		if (typeof partnerId == "number") {
59
			downloadNlcUrl = `${downloadNlcUrl}&fofoId=${partnerId}`;
60
		}
61
		doAjaxGetDownload(downloadNlcUrl, `${brand}-nlc.csv`);
62
	});
28102 tejbeer 63
 
30252 amit.gupta 64
 
28102 tejbeer 65
});
66
 
67
function loadPriceCircular(domId) {
30252 amit.gupta 68
	doGetAjaxRequestHandler(context + "/priceCircular",
69
		function (response) {
70
			$('#' + domId).html(response);
71
		});
28102 tejbeer 72
}
73
 
74
function loadPartnerPriceCircular(domId) {
30252 amit.gupta 75
	doGetAjaxRequestHandler(context + "/partnerPriceCircular",
76
		function (response) {
77
			$('#' + domId).html(response);
78
		});
28102 tejbeer 79
}