You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							84 lines
						
					
					
						
							2.6 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							84 lines
						
					
					
						
							2.6 KiB
						
					
					
				
								function workorderNotice()
							 | 
						|
								{
							 | 
						|
									$('.product_badge').remove();
							 | 
						|
									$.ajax({
							 | 
						|
										url: '/'+window.location.pathname.split('/')[1]+'/product_audit',
							 | 
						|
										type: 'POST',
							 | 
						|
										data: {},
							 | 
						|
										dataType: 'json',
							 | 
						|
										success: function (res) {
							 | 
						|
								
							 | 
						|
											let total = res.total ? res.total : '';
							 | 
						|
											let cloud = res.cloud ? res.cloud : '';
							 | 
						|
											let industry = res.industry ? res.industry : '';
							 | 
						|
											let demand = res.demand ? res.demand : '';
							 | 
						|
											if (total > 0) {
							 | 
						|
												$('a[href*="product/audit"] p').parent().parent().parent().parent().parent().parent().children("a").append('<span class="product_badge" style="' +
							 | 
						|
													'display: inline-block; ' +
							 | 
						|
													'width: 20px; ' +
							 | 
						|
													'height: 20px; ' +
							 | 
						|
													'border-radius: 20px; ' +
							 | 
						|
													'line-height: 20px; ' +
							 | 
						|
													'text-align: center; ' +
							 | 
						|
													'font-size: 12px; ' +
							 | 
						|
													'background-color: red;' +
							 | 
						|
													'color: white;' +
							 | 
						|
													'">'+total+'</span>');
							 | 
						|
											}
							 | 
						|
								
							 | 
						|
								
							 | 
						|
											if (cloud > 0) {
							 | 
						|
												$('a[href*="product/audit"] p').parent().parent().parent().parent().parent().parent().children("ul").children(":first-child").children("ul").children("li:eq(1)").children(":first-child").append('<span class="product_badge" style="' +
							 | 
						|
													'display: inline-block; ' +
							 | 
						|
													'width: 20px; ' +
							 | 
						|
													'height: 20px; ' +
							 | 
						|
													'border-radius: 20px; ' +
							 | 
						|
													'line-height: 20px; ' +
							 | 
						|
													'text-align: center; ' +
							 | 
						|
													'font-size: 12px; ' +
							 | 
						|
													'background-color: red;' +
							 | 
						|
													'color: white;' +
							 | 
						|
													'">'+cloud+'</span>');
							 | 
						|
											}
							 | 
						|
								
							 | 
						|
											if (industry > 0) {
							 | 
						|
												$('a[href*="product/audit"] p').parent().parent().parent().parent().parent().parent().children("ul").children(":eq(1)").children("ul").children("li:eq(1)").children(":first-child").append('<span class="product_badge" style="' +
							 | 
						|
													'display: inline-block; ' +
							 | 
						|
													'width: 20px; ' +
							 | 
						|
													'height: 20px; ' +
							 | 
						|
													'border-radius: 20px; ' +
							 | 
						|
													'line-height: 20px; ' +
							 | 
						|
													'text-align: center; ' +
							 | 
						|
													'font-size: 12px; ' +
							 | 
						|
													'background-color: red;' +
							 | 
						|
													'color: white;' +
							 | 
						|
													'">'+industry+'</span>');
							 | 
						|
											}
							 | 
						|
								
							 | 
						|
											if (demand > 0) {
							 | 
						|
												$('a[href*="product/audit"] p').parent().parent().parent().parent().parent().parent().children("ul").children(":eq(2)").children(':first-child').append('<span class="product_badge" style="' +
							 | 
						|
													'display: inline-block; ' +
							 | 
						|
													'width: 20px; ' +
							 | 
						|
													'height: 20px; ' +
							 | 
						|
													'border-radius: 20px; ' +
							 | 
						|
													'line-height: 20px; ' +
							 | 
						|
													'text-align: center; ' +
							 | 
						|
													'font-size: 12px; ' +
							 | 
						|
													'background-color: red;' +
							 | 
						|
													'color: white;' +
							 | 
						|
													'">'+demand+'</span>');
							 | 
						|
											}
							 | 
						|
										},
							 | 
						|
										error: function (error) {
							 | 
						|
								
							 | 
						|
										}
							 | 
						|
									});
							 | 
						|
								}
							 | 
						|
								
							 | 
						|
								$(document).ready(function () {
							 | 
						|
									workorderNotice();
							 | 
						|
								});
							 | 
						|
								
							 | 
						|
								// const workordertimer = setInterval(function () {
							 | 
						|
								// 	workorderNotice()
							 | 
						|
								// }, 5000);
							 |