<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <%@ include file="../../common/head.jsp"%>
    <link rel="stylesheet" type="text/css" href="../res/js//plugins/webuploader/webuploader.css">
    <link rel="stylesheet" type="text/css" href="../res/css/demo/webuploader-demo.css">
    <script type="text/javascript" src="../res/js/plugins/webuploader/webuploader.js"></script>
    <script type="text/javascript" src="../res/js/plugins/webuploader/uploader.js"></script>
    <script type="text/javascript" charset="utf-8" src="<%=basePath %>res/js/plugins/UEditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="<%=basePath %>res/js/plugins/UEditor/ueditor.all.min.js"> </script>
	<cs:initFile/>
    <script type="text/javascript">
        $(function () {
            $("#airportDiv").hide();
            $("#airwaysDiv").hide();
        });

        function dotype(type){
            if(type == 0){
                $("#airportDiv").hide();
                $("#airwaysDiv").hide();
            }else if(type == 1){
                $("#airportDiv").show();
                $("#airwaysDiv").hide();
            }else if(type ==2){
                $("#airportDiv").show();
                $("#airwaysDiv").show();
            }
        }
        function doItem(id) {
            $('#airwaysId').empty();
            $('#airwaysId').html('<option value="">--无--</option>');

            $.getJSON('../machine/getAirways.cs', {
                'airportId': $('#airportId').val()
            }, function (data) {
                $.each(data, function (i, obj) {
                    $("#airwaysId").append('<option value="' + obj.id+'">' + obj.name + '</option>');
                });
            });
        }
    </script>
    <script>
		function initUe(){
			var productImg = $("input[name='productImg']");
			var productGroupImg = $("input[name='productGroupImg']");
			if(productImg.length > 2){
				layer.msg("主图只能有1个");
				return false;
			}
			if(productImg.length <=1){
				layer.msg("请上传您的主图");
				return false;
			}
			if(productGroupImg.length > 6){
				layer.msg("组图最多5个");
				return false;
			}
			if(productGroupImg.length <=1){
				layer.msg("请上传您的组图");
				return false;
			}
			
			$("#productAttr").val(ue1.getContent());
			$("#productBody").val(ue2.getContent());
			$("#policy").val(ue4.getContent());
			
			$("#addUserForm").submit();
			return true;
		}
		
	</script>
</head>

<body>
    <div class="wrapper wrapper-content">
        <div class="row">
            <div class="col-sm-12">
            	 <cs:form_validate formId="addUserForm"/>
                  <form class="form-horizontal" action="add.cs" id="addUserForm" method="POST" onsubmit="return false;">
                     <div class="form-group col-sm-12">
                     	<div class="form-group col-sm-6">
                          <label class="col-sm-4 control-label">产品名称：</label>
                          <div class="col-sm-8">
                              <input id="productName" name="productName" class="form-control" validate="{required:true,maxlength:50}" validateMessage="{required:'请输入名称',maxlength:'输入的名称超出长度限制'}" >
                          </div>
                        </div>
                        <div class="form-group col-sm-6">
                          <label class="col-sm-4 control-label">产品型号：</label>
                          <div class="col-sm-8">
                              <input id="productModel" name="productModel" class="form-control" validate="{required:true,maxlength: 25}" validateMessage="{required:'请输入型号',maxlength:'输入的型号超出长度限制'}" >
                          </div>
                        </div>
                      </div>
                      
                      <div class="form-group col-sm-12">
                      <div class="form-group col-sm-6">
                          <label class="col-sm-4 control-label">产品标识：</label>
                          <div class="col-sm-8">
                              <input id="productRemark" name="productRemark" placeholder="地产项目请填写城市区域，其他产品请填写产品特色" class="form-control" validate="{required:true,maxlength: 150}" validateMessage="{required:'请输入型号',maxlength:'输入的标识超出长度限制'}" >
                          </div>
                      </div>
                      
                      <div class="form-group col-sm-6">
                          <label class="col-sm-4 control-label">佣金比率（%）：</label>
                          <div class="col-sm-8">
                              <input id="commissionRate" name="commissionRate" class="form-control" validate="{required:true,min:0,maxlength:100}" validateMessage="{required:'请输入佣金比率',min:'请输入大于等于0的值',maxlength:'输入的佣金比率超出长度限制'}" >
                          </div>
                      </div>
                      </div>
                      
                      
                       <div class="form-group col-sm-12">
                      <div class="form-group col-sm-6">
                          <label class="col-sm-4 control-label">联系电话：</label>
                          <div class="col-sm-8">
                              <input id="hotline" name="hotline" class="form-control" validate="{required:true,maxlength:30}" validateMessage="{required:'请输入联系电话',maxlength:'输入的电话超出长度限制'}" >
                          </div>
                      </div>
                      
                       <div class="form-group col-sm-6">
                          <label class="col-sm-4 control-label">产品价格：</label>
                          <div class="col-sm-8">
                              <input id="productPrice" name="productPrice" class="form-control" validate="{required:true,maxlength:50}" validateMessage="{required:'请输入产品价格',maxlength:'输入的产品价格超出长度限制'}" >
                          </div>
                      </div>
                      </div>
                      
                      <div class="form-group col-sm-12">
                      
                       <div class="form-group col-sm-6">
                          <label class="col-sm-4 control-label">单位：</label>
                          <div class="col-sm-8">
                              <input id="unit" name="unit" class="form-control" validate="{required:true,maxlength:5}" validateMessage="{required:'请输入单位',maxlength:'输入的单位超出长度限制'}" >
                          </div>
                      </div>
                      
                      <div class="form-group col-sm-6">
                          <label class="col-sm-4 control-label">权重：</label>
                          <div class="col-sm-8">
                              <input id="weight" name="weight" oninput='this.value=this.value.replace(/^[0]+[0-9]*$/gi,"")' onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')" placeholder="请输入数字，从小到大排序" class="form-control" validate="{required:true,min:0,maxlength:8}" validateMessage="{required:'请输入权重，内容为数字',maxlength:'输入的权重超出长度限制'}" >
                          </div>
                      </div>
                      </div>
                      
                      
                       <div class="form-group col-sm-12">
	                       <div class="form-group col-sm-6">
	                          <label class="col-sm-4 control-label">是否推荐：</label>
	                          <div class="col-sm-8">
	                          <div class="radio i-checks">
                                     <label><input type="radio" name ="isHome" value="1" > <i></i> 是</label>
                                     <label><input type="radio" name="isHome" value="0"  checked="checked"> <i></i> 否</label>
                               </div>
	                          </div>
	                      </div>
	                      
	                      <div class="form-group col-sm-6">
	                          <label class="col-sm-4 control-label">是否公开：</label>
	                          <div class="col-sm-8">
	                          <select id="openFlag" name="openFlag" class="form-control">
									<option value="1" selected>公开</option>
									<option value="0">内部</option>
								</select>
	                          </div>
	                      </div>
                      </div>
                      
                      <div class="form-group col-sm-12">
                      
                      <div class="form-group col-sm-6">
                          <label class="col-sm-4 control-label">上级分类：</label>
                          <div class="col-sm-8">
                              <select <c:if test="${role.ONE_CATEGORY_Id != null && role.ONE_CATEGORY_Id != '' && role.ONE_CATEGORY_Id!= '0'}">disabled="disabled"</c:if> class="form-control m-b" id="gcId" name="gcId" onchange="menuChange(this)" validate="{required:true}" validateMessage="{required:'请选择分类'}">
                              		<option value="">请选择</option>
                              		<c:forEach items="${firstCategory }" var="superMenu">
                              			<option value="${superMenu.id }" <c:if test="${role.ONE_CATEGORY_ID == superMenu.id }">selected</c:if>>${superMenu.gcName}</option>
                              		</c:forEach>
                              </select>
                              <c:if test="${role.ONE_CATEGORY_Id != null && role.ONE_CATEGORY_Id != '' && role.ONE_CATEGORY_Id!= '0'}"><input type="hidden" value="${role.ONE_CATEGORY_ID }" name="id1"></c:if>
                          </div>
                      </div>
                     <script type="text/javascript">
                     function menuChange(obj){
                    	 var ss = $(obj).children('option:selected').val();  
                    	 $("#tlb").css("display","none");
                    	 $('#tlb select').find("option:selected").prop('selected',false);
                    	 $("#thlb").css("display","none");
                    	 $('#thlb select').find("option:selected").prop('selected',false);
                    	 $("#folb").css("display","none");
                    	 $('#folb select').find("option:selected").prop('selected',false);
                    	 $('#dcfllb select').find("option:selected").prop('selected',false);
                    	 $('#dcfllb').css("display","none");
                    	 $("#gcParentId").empty();
                    	 $("#gcThreeId").empty();
                    	 $("#gcFourId").empty();
                         $.ajax({
                             type: "get",
                             url: "<%=basePath%>mgmProductCategoryCtl/nextCategory.cs",
                             data: {id:ss},
                             dataType: "json",
                             success: function(data){
                                   	if(data.mlist.length > 0){
                                   	$("#tlb").css("display","block");
                                   	$("#gcParentId").empty();
                                   	$("#gcParentId").append("<option value='0'>请选择</option>");
                                   	data.mlist.forEach(function(val,index,arr){
                                   		  $("#gcParentId").append("<option value='"+val.id+"'>"+ val.gcName+"</option>");            
                                   		});
                                   	}
                                   	if(data.type == "1"){
                                   		$('#dcfllb').css("display","block");
                                   	}
                                 }
                         });
                         
                     }
                     
                     function twoMenuChange(obj){
                    	 var ss = $(obj).children('option:selected').val();  
                    	 $("#thlb").css("display","none");
                    	 $('#thlb select').find("option:selected").prop('selected',false);
                    	 $("#folb").css("display","none");
                    	 $('#folb select').find("option:selected").prop('selected',false);
                    	 $("#gcThreeId").empty();
                    	 $("#gcFourId").empty();
                         $.ajax({
                             type: "get",
                             url: "<%=basePath%>mgmProductCategoryCtl/nextCategory.cs",
                             data: {id:ss},
                             dataType: "json",
                             success: function(data){
                         			if(data.mlist.length > 0){
                         			 $("#thlb").css("display","block");
                         			$("#gcThreeId").empty();
                                   	$("#gcThreeId").append("<option value='0'>请选择</option>");
                                  	data.mlist.forEach(function(val,index,arr){
                                  		  $("#gcThreeId").append("<option value='"+val.id+"'>"+ val.gcName+"</option>");            
                                  		});
                         			}
                                 }
                         });
                         
                     }
                     function threeMenuChange(obj){
                    	 var ss = $(obj).children('option:selected').val();  
                    	 $("#folb").css("display","none");
                    	 $('#folb select').find("option:selected").prop('selected',false);
                    	 $("#gcFourId").empty();
                         $.ajax({
                             type: "get",
                             url: "<%=basePath%>mgmProductCategoryCtl/nextCategory.cs",
                             data: {id:ss},
                             dataType: "json",
                             success: function(data){
                        			 if(data.mlist.length > 0){
                        			 $("#folb").css("display","block");
                        			 $("#gcFourId").empty();
                                    	$("#gcFourId").append("<option value='0'>请选择</option>");
                                 	data.mlist.forEach(function(val,index,arr){
                                 		  $("#gcFourId").append("<option value='"+val.id+"'>"+ val.gcName+"</option>");            
                                 		});
                        			 }
                                 }
                         });
                         
                     }
                     </script>
                     
                     <div id="tlb" class="form-group col-sm-6" <c:if test="${role.TWO_CATEGORY_Id == null }">style="display:none;"</c:if> >
                          <label class="col-sm-4 control-label">二级分类：</label>
                          <div class="col-sm-8">
                              <select <c:if test="${role.TWO_CATEGORY_Id != null && role.TWO_CATEGORY_Id != '' && role.TWO_CATEGORY_Id!= '0'}">disabled="disabled"</c:if> class="form-control m-b" id="gcParentId" name="gcParentId" onchange="twoMenuChange(this)" validate="{required:true}" validateMessage="{required:'请选择分类'}">
                              		<option value="">请选择</option>
                              		<c:forEach items="${twoCategory }" var="superMenu">
                              		<option value="${superMenu.id }" <c:if test="${role.TWO_CATEGORY_Id == superMenu.id }">selected</c:if> >${superMenu.gcName}</option>
                              		</c:forEach>
                              </select>
                              <c:if test="${role.TWO_CATEGORY_Id != null && role.TWO_CATEGORY_Id != '' && role.TWO_CATEGORY_Id!= '0'}">
                              <input type="hidden" value="${role.TWO_CATEGORY_Id }" name="id2">
                              </c:if>
                          </div>
                      </div>
                      </div>
                      <div class="form-group col-sm-12">
                      
                      <div id="thlb" class="form-group col-sm-6"  <c:if test="${role.THREE_CATEGORY_ID == null }">style="display:none;"</c:if>> 
                          <label class="col-sm-4 control-label">三级分类：</label>
                          <div class="col-sm-8">
                              <select <c:if test="${role.THREE_CATEGORY_Id != null && role.THREE_CATEGORY_Id != '' && role.THREE_CATEGORY_Id!= '0'}">disabled="disabled"</c:if> class="form-control m-b" id="gcThreeId" name="gcThreeId" onchange="threeMenuChange(this)" validate="{required:true}" validateMessage="{required:'请选择分类'}">
                              		<option value="">请选择</option>
                              		<c:forEach items="${threeCategory }" var="superMenu">
                              		<option value="${superMenu.id }" <c:if test="${role.THREE_CATEGORY_ID == superMenu.id }">selected</c:if> >${superMenu.gcName}</option>
                              		</c:forEach>
                              </select>
                              <c:if test="${role.THREE_CATEGORY_Id != null && role.THREE_CATEGORY_Id != '' && role.THREE_CATEGORY_Id!= '0'}"><input type="hidden" value="${role.THREE_CATEGORY_ID }" name="id3"></c:if>
                          </div>
                      </div>
                      
                      <div id="folb" class="form-group col-sm-6" <c:if test="${role.FOUR_CATEGORY_ID == null }">style="display:none;"</c:if>> 
                          <label class="col-sm-4 control-label">四级分类：</label>
                          <div class="col-sm-8">
                              <select <c:if test="${role.FOUR_CATEGORY_Id != null  && role.FOUR_CATEGORY_Id != '' && role.FOUR_CATEGORY_Id!= '0'}">disabled="disabled"</c:if> class="form-control m-b" id="gcFourId" name="gcFourId" validate="{required:true}" validateMessage="{required:'请选择分类'}">
                              		<option value="">请选择</option>
                              		<c:forEach items="${fourCategory }" var="superMenu">
                              		<option value="${superMenu.id }" <c:if test="${role.FOUR_CATEGORY_ID == superMenu.id }">selected</c:if> >${superMenu.gcName}</option>
                              		</c:forEach>
                              </select>
                              <c:if test="${role.FOUR_CATEGORY_Id != null  && role.FOUR_CATEGORY_Id != '' && role.FOUR_CATEGORY_Id!= '0'}"><input type="hidden" value="${role.FOUR_CATEGORY_ID }" name="id4"></c:if>
                          </div>
                      </div>
                      
                      <!-- //地产项目分类 -->
                      <div id="dcfllb" class="form-group col-sm-6" style="display:none;"> 
                          <label class="col-sm-4 control-label">地产项目分类：</label>
                          <div class="col-sm-8">
                              <select class="form-control m-b" id="xmCode" name="xmCode" validate="{required:true}" validateMessage="{required:'请输入地产项目分类'}">
                              		<option value="">请选择</option>
                              		<c:forEach items="${diclist }" var="superMenu">
                              			<option value="${superMenu.code }" >${superMenu.name}</option>
                              		</c:forEach>
                              </select>
                          </div>
                      </div>
                      </div>
                      
                      
                     
                      
                      
                      <div class="form-group col-sm-12">
                            <label class="col-sm-2 control-label">商品主图：</label>
                            <div class="col-sm-10">
                                <cs:file name="productImg" type="100" num="1"></cs:file>
                            </div>
                      </div>
                      
                      <div class="form-group col-sm-12">
                            <label class="col-sm-2 control-label">商品组图：</label>
                            <div class="col-sm-10">
                                <cs:file  name="productGroupImg" type="100" num="5"></cs:file>
                            </div>
                      </div>
                      
                      <!-- <div class="form-group"> 
                          <label class="col-sm-3 control-label">产品说明：</label>
                          <div class="col-sm-6">
		                      <div class="content">
					             <script id="editor" type="text/plain" style="width:100%;height:500px;"></script>
					            <script type="text/javascript">
					
								    //实例化编辑器
								    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
								    var ue = UE.getEditor('editor');
								    ue.addListener('selectionchange',function(){
								   		$("#productMsg").val(ue.getContent());
								        console.log("选区已经变化！");
								   })
								</script>
								<textarea rows="" cols="" id="productMsg" style="display:none;" name="productMsg"></textarea>
				               </div>
                          </div>
                      </div> -->
                      
                      <div class="form-group col-sm-12" > 
                          <label class="col-sm-2 control-label">产品参数：</label>
                          <div class="col-sm-10">
		                      <div class="content">
					             <script id="editor1" type="text/plain" style="width:100%;height:500px;"></script>
					            <script type="text/javascript">
					
								    //实例化编辑器
								    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
								    var ue1 = UE.getEditor('editor1');
								    /* ue1.addListener('selectionchange',function(){
								   		$("#productAttr").val(ue1.getContent());
								        console.log("选区已经变化！");
								   }) */
								</script>
								<textarea rows="" cols="" id="productAttr" style="display:none;" name="productAttr"></textarea>
				               </div>
                          </div>
                      </div>
                      
                      <div class="form-group col-sm-12"> 
                          <label class="col-sm-2 control-label">产品详情：</label>
                          <div class="col-sm-10">
		                      <div class="content">
					             <script id="editor2" type="text/plain" style="width:100%;height:500px;"></script>
					            <script type="text/javascript">
					
								    //实例化编辑器
								    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
								    var ue2 = UE.getEditor('editor2');
								   /*  ue2.addListener('selectionchange',function(){
								   		$("#productBody").val(ue2.getContent());
								        console.log("选区已经变化！");
								   }) */
								</script>
								<textarea rows="" cols="" id="productBody" style="display:none;" name="productBody"></textarea>
				               </div>
                          </div>
                      </div>
                      
                      <!-- <div class="form-group"> 
                          <label class="col-sm-3 control-label">佣金说明：</label>
                          <div class="col-sm-6">
		                      <div class="content">
					             <script id="editor3" type="text/plain" style="width:100%;height:500px;"></script>
					            <script type="text/javascript">
					
								    //实例化编辑器
								    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
								    var ue3 = UE.getEditor('editor3');
								    ue3.addListener('selectionchange',function(){
								   		$("#commissionRemark").val(ue3.getContent());
								        console.log("选区已经变化！");
								   })
								</script>
								<textarea rows="" cols="" id="commissionRemark" style="display:none;" name="commissionRemark"></textarea>
				               </div>
                          </div>
                      </div> -->
                      
                      <div class="form-group col-sm-12" > 
                          <label class="col-sm-2 control-label">优惠政策：</label>
                          <div class="col-sm-10">
		                      <div class="content">
					             <script id="editor4" type="text/plain" style="width:100%;height:500px;"></script>
					            <script type="text/javascript">
					
								    //实例化编辑器
								    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
								    var ue4 = UE.getEditor('editor4');
								   /*  ue4.addListener('selectionchange',function(){
								   		$("#policy").val(ue4.getContent());
								        console.log("选区已经变化！");
								   }) */
								</script>
								<textarea rows="" cols="" id="policy" name=policy style="display:none;"></textarea>
				               </div>
                          </div>
                      </div>
                      
                      <!-- <div class="form-group">
                          <label class="col-sm-3 control-label">省：</label>
                          <div class="col-sm-6">
                      		<select id="provinceCode" name="provinceCode" class="form-control" validate="{required:true}" validateMessage="{required:'请输入名称'}">
                                <option value="" disabled selected hidden>省</option>
                            </select>
                            
                            <input type="hidden" id="province" name="province"/>
                          </div>
                      </div>
                      
                      <div class="form-group">
                          <label class="col-sm-3 control-label">市：</label>
                          <div class="col-sm-6">
                            <select id="cityCode" name="cityCode" class="form-control" validate="{required:true}" validateMessage="{required:'请输入名称'}">
                                <option value="" disabled selected hidden>市</option>                                
                            </select>
                            <input type="hidden" id="city" name="city"/>
                          </div>
                      </div>
                            
                      <div class="form-group">
                          <label class="col-sm-3 control-label">区 / 县：</label>
                          <div class="col-sm-6">
                            <select id="countyCode" name="countyCode" class="form-control" validate="{required:true}" validateMessage="{required:'请输入名称'}">
                                <option value="" disabled selected hidden>区 / 县</option>                               
                            </select>
                            <input type="hidden" id="county" name="county"/>
                          </div>
                      </div> -->
                            
                      
                      <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-3 pull-left">
                                    <button class="btn btn-default btn-dlg-close">取消</button>
                                    <button class="btn btn-primary" type="button" onclick="initUe();">提交</button>
                                </div>
                       </div>
                      
                  </form>
            </div>
        </div>

    </div>

<script type="text/javascript">
<%-- $.get('<%=basePath%>area/getProvice.cs',function(data){
	for(var i in data){
		var _option = '';
		if(curProvinceCode ==data[i].code ){
			 _option = '<option value="' + data[i].code + '" selected>' + data[i].name + '</option>';
			 $('#province').val(data[i].name);
		}else{
		 	_option = '<option value="' + data[i].code + '" >' + data[i].name + '</option>';
		}
		$('#provinceCode').append(_option);
	}
});  

if(curProvinceCode != ''){
	$.get('<%=basePath%>area/getByParentCode.cs',{'param': curProvinceCode}, function(data){
		for(var i in data){
		    var _option = '<option value="' + data[i].code + '" >' + data[i].name + '</option>';
			$('#cityCode').append(_option);
		}
	}); 
}

///省
$("#provinceCode").change(function(){
	var self = $(this);
	
	$('#cityCode').empty();
	    var _option = '<option>请选择</option>';
	$('#cityCode').append(_option);
	$('#city').val("");
	
	$('#countyCode').empty();
	    var _option = '<option>请选择</option>';
	$('#countyCode').append(_option);
	$('#county').val("");
	
	$('#townshipCode').empty();
	    var _option = '<option>请选择</option>';
	$('#townshipCode').append(_option);
	$('#township').val("");
	
	
	
	$.get('<%=basePath%>area/getByParentCode.cs',{'param': self.val()}, function(data){
		for(var i in data){
				var _option = '<option value="' + data[i].code + '" >' + data[i].name + '</option>';
				$('#cityCode').append(_option);
			}
	}); 
	$('#province').val(self.find("option:selected").text());
});

///城市
$("#cityCode").change(function(){
	var self = $(this);
	$('#countyCode').empty();
	    var _option = '<option>请选择</option>';
	$('#countyCode').append(_option);
	$('#county').val("");
	
	$('#townshipCode').empty();
	    var _option = '<option>请选择</option>';
	$('#townshipCode').append(_option);
	$('#township').val("");
	
	
	$.get('<%=basePath%>area/getByParentCode.cs',{'param': self.val()}, function(data){
		for(var i in data){
				var _option = '<option value="' + data[i].code + '" >' + data[i].name + '</option>';
				//if(num == 1){
				    $('#countyCode').append(_option);
			   // }
			}
	}); 
	
	$('#city').val(self.find("option:selected").text());
});

///县、区
$("#countyCode").change(function(){
	var self = $(this);
	$('#townshipCode').empty();
	    var _option = '<option>请选择</option>';
	$('#townshipCode').append(_option);
	$('#township').val("");
	
	
	$.get('<%=basePath%>area/getByParentCode.cs',{'param': self.val()}, function(data){
		for(var i in data){
				var _option = '<option value="' + data[i].code + '" >' + data[i].name + '</option>';
				//if(num == 1){
				    $('#townshipCode').append(_option);
			   // }
			}
	}); 
	
	$('#county').val(self.find("option:selected").text());
}); --%>
</script>
</body>

</html>

