layui.use(['element','form'], function(){    
	var $ = layui.jquery;
	var element = layui.element;
	var form = layui.form;
	
	//一访问页面就调用
	$.ajax({
		url:"/quote_price/getCustomerTrainProTypes",
		type : "GET",
		dataType : "json",
		data:{
			type:$("#type").val()
		},
		success : function(result) {
			var data = result.list
			$.each(data,function(index,item){
				$('.proType').append(new Option(item.proType,item.proType));//往下拉菜单里添加元素
			});
			layui.form.render("select");
		}
	});
	form.on('select(proType)', function(data) {
		$('.kind').empty();
		$('.kind').append(new Option("",""));
	    form.render("select");
		$.ajax({
			url:"/quote_price/getCustomerTrainKindLabelsByProType",
			type : "GET",
			dataType : "json",
			data:{
				proType	:data.value,
				type	:$("#type").val(),
				needPage:"0"
			},
			success : function(result) {
				var data = result.list
				$.each(data,function(index,item){
					$('.kind').append(new Option(item.kindLabel,item.kindLabel));//往下拉菜单里添加元素
				});
				layui.form.render("select");
			}
		});
	});
});
