regBaseChxxFormxg.jsp 33.6 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>测绘信息管理</title>
	<meta name="decorator" content="default"/>
    <script src="${ctxStatic}/gis/js/init.js" type="text/javascript"></script>
    <script src="${ctxStatic}/gis/lib/OpenLayers.js" type="text/javascript"></script>
    <script src="${ctxStatic}/gis/lib/zdclient.js" type="text/javascript"></script>
    <script src="${ctxStatic}/gis/lib/jquery.orbit-1.2.3.js" type="text/javascript"></script>    
    <script src="${ctxStatic}/gis/js/global.js" type="text/javascript"></script>
    <script src="${ctxStatic}/gis/js/config.js" type="text/javascript"></script>
	<script src="${ctxStatic}/select3/AreaData_min.js" type="text/javascript"></script>
	 <link href="${ctxStatic}/gis/lib/jqueryEasyui/easyui.css" rel="stylesheet" type="text/css" />
    <link href="${ctxStatic}/gis/lib/jqueryEasyui/icon.css" rel="stylesheet" type="text/css" />
    <script src="${ctxStatic}/gis/lib/jqueryEasyui/jquery.easyui.min.js" type="text/javascript"></script>
	<script type="text/javascript">
	  var mapreturnvale;
	  var mapreturnvaleList;
	  var DJQTotle,DJZQTotle;
	  var DJQName = new Array();
	  var DJZQName = new Array();
	  var regBaseZbinfoRowIdx = 0;
	  var tempdjq,tempdjzq,tempxzq;
	  var TempZBArray = new Array();
	  var TempZBYXArray = new Array();
	  var zblisttemp="";
	  var daoru="";
	  var minArea = 0, maxArea = 0;
	  var ychid = "";
	  var yts="";
		$(document).ready(function() {
			var zltext = '${zl}';
			document.getElementById("zltext").value=zltext;
			 regBaseZbinfoRowIdx = 0, regBaseZbinfoTpl = $("#regBaseZbinfoTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
			var data = ${fns:toJson(regBaseChxx.regBaseZbinfoList)};
			for (var i=0; i<data.length; i++){
				addRow('#regBaseZbinfoList', regBaseZbinfoRowIdx, regBaseZbinfoTpl, data[i]);
				regBaseZbinfoRowIdx = regBaseZbinfoRowIdx + 1;
			}			
			
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交,请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误,请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			}); 
						
			views();
		});
		
		function gobackchxxlist(){
			var url = "${ctx}/reg/base/regBaseChxx/xglist";
			window.location = url;
		}

		function views(){
			var viewid = "${VIEWS}";
			console.log(viewid);
			if(viewid == undefined || viewid == null || viewid ==""){
				return;
			}
			
		}

		
		//根据地区码查询地区名 
		function getAreaNamebyID(areaID){
			var areaName = "";
			if(areaID.length == 6){
				areaName = area_array[areaID];
			}else if(areaID.length == 9){
				var index1 = areaID.substring(0, 6);
				areaName = area_array[index1] + "" + sub_array[index1][areaID];
			}else if(areaID.length == 12){
				var index1 = areaID.substring(0, 6);
				var index2 = areaID.substring(0, 9);
				areaName = area_array[index1] + "" + sub_array[index1][index2] + "" + sub_arr[index2][areaID];
			}
			return areaName;
		}
		
		function addRow(list, idx, tpl, row){
			$(list).append(Mustache.render(tpl, {
				idx: idx, delBtn: true, row: row
			}));
			$(list+idx).find("select").each(function(){
				$(this).val($(this).attr("data-value"));
			});
			for(var i=0;i<150;i++){
				$("#regBaseZbinfoList"+i+"_sort").val(i+1);
				$("#regBaseZbinfoList"+i+"_zbdmc").val("J"+(i+1));
			}
			$(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
				var ss = $(this).attr("data-value").split(',');
				for (var i=0; i<ss.length; i++){
					if($(this).val() == ss[i]){
						$(this).attr("checked","checked");
					}
				}
			});
		}
		function delRow(obj, prefix){
			var id = $(prefix+"_id");
			var delFlag = $(prefix+"_delFlag");
			if (id.val() == ""){
				$(obj).parent().parent().remove();
			} else if(delFlag.val() == "0"){
				delFlag.val("1");
				$(obj).html("撤销删除").attr("title", "撤销删除");
				//$(obj).parent().parent().addClass("error"); 
			}else  if(delFlag.val() == "1") {
				delFlag.val("0");
				$(obj).html("删    除").attr("title", "删除");
				$(obj).parent().parent().removeClass("error");
			}
		}
		
		//打开人员基础信息维护
		function personOpen(){
			var iWidth=1100;
	       	var iHeight=600;
	       	var iTop = (window.screen.height - 30 - iHeight) / 2;
	       	var iLeft = (window.screen.width - 10 - iWidth) / 2;
			window.open("/ODM/a/reg/base/regBasePerson/list?WO=1&CHXXXZ=1","人员信息",
					"height="+ iHeight +",width="+ iWidth +",top="+ iTop +",left="+ iLeft +",toolbar=no,menubar=no,scrollbars=yes, resizable=no,location=no, status=no");		
		}
		
		//父页面证件类型赋值函数  
		function select2_zjlx(zjlxValue){
			$("#zjlxtext").data('select2').val([zjlxValue]);
		}
		
		
		/* function checkbitianxiang(){
			var trueOrfalse;
			trueOrfalse=false;
			$(".error").remove();
			if($("#seachcitytext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#seachcitytext");
				trueOrfalse=true;
			}
			if($("#seachdistricttext").val()== ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#seachdistricttext");
				trueOrfalse=true;
			}
			if($("#seachprovtext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#seachprovtext");
				trueOrfalse=true;
			}
			if(!(($("#seachprovtext").val() == "${XQCODE}"))){
				$("<label for='name' class='error'>县级行政区有误</label>").insertAfter("#seachprovtext");
				trueOrfalse=true;
			}
			if($("#zdtzmTxt").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#zdtzmTxt");
				trueOrfalse=true;
			}
			if($("#zltext").val()== ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#zltext");
				trueOrfalse=true;
			}
			if($("#zdmjtext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#zdmjtext");
				trueOrfalse=true;
			}
			if($("#adszdtext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#adszdtext");
				trueOrfalse=true;
			}
			if($("#zdszntext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#zdszntext");
				trueOrfalse=true;
			}
			if($("#zdszxtext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#zdszxtext");
				trueOrfalse=true;
			}
			if($("#zdszbtext").val() == ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#zdszbtext");
				trueOrfalse=true;
			}
			
			return trueOrfalse;
		} */
	
		 function selectTuCeng(ListTucengNO)
	        {
	        	var tucengValue="";
	        	switch(ListTucengNO)
	        	{
	        	  case "A":
	        		  tucengValue=actualSvrcfg.SYQZDGDBP;
	        		  break;
	        	  case "B":
	        		  tucengValue=actualSvrcfg.SHYQZD_DB;
	        		  break;
	        	  case "S":
	        		  tucengValue=actualSvrcfg.SHYQZD_DS;
	        		  break;
	        	  case "X":
	        		  tucengValue=actualSvrcfg.SHYQZD_DX;
	        		  break;
	        	  case "C":
	        		  tucengValue=actualSvrcfg.ZJDGDBP;
	        		  break;
	        	  case "D":
	        		  tucengValue=actualSvrcfg.CBJYQZD_GD;
	        		  break;
	        	  case "E":
	        		  tucengValue=actualSvrcfg.CBJYQZD_LD;
	        		  break;
	        	  case "F":
	        		  tucengValue=actualSvrcfg.CBJYQZD_CD;
	        		  break;
	        	  case "I":
	        		  break;
	        	  case "J":
	        		  break;
	        	  default:break;
	        	
	        	}
	        	return tucengValue;
	        }		
		
		 function AddquyaosutoTC()
		{	
			
	    	
			if(false==checkzb()){ $("#btnSubmit").attr("disabled",false);return;}
		    if(TempZBArray[0]!=TempZBArray[TempZBArray.length-1])
			{
		    	 TempZBArray[TempZBArray.length]=TempZBArray[0];
		    	 TempZBYXArray[TempZBYXArray.length]=TempZBYXArray[0];
		    	 
		    }
	        shujvfenxijianyan();
		}
		function shujvfenxijianyan()
		{
			var strTucengg;
			var pointObj = new Array(); 
			var qupointObj = new Array();
			var lengthzb;
			
		      qupointObj=TempZBYXArray;
			  var geomObj = new Zondy.Object.Polygon(qupointObj);    
			  geomObj.nearDis=0.001;
			  var queryStruct=new Zondy.Service.QueryFeatureStruct(
					  {
						  IncludeGeometry:true,
						  IncludeAttribute:true,
						  IncludeWebGraphic:false
						  });
			  var featureRule =Zondy.Service.QueryFeatureRule({
	                MustInside:true,
	                Intersect: true
	            });
			  strTucengg=selectTuCeng('${zdtzm}'); 
		  	 var queryParam=new Zondy.Service.QueryByLayerParameter(
		  			strTucengg,
		  			{ 
	                 geometry: geomObj,
	                 resultFormat: "json",
	                 isAsc: true,//排序 旧API文档没有
	                 rule: featureRule,
	                 struct:queryStruct
	                // where :  str
	                });
		 	queryParam.recordNumber=1000;
    		
    		var queryService=new Zondy.Service.QueryLayerFeature(queryParam,
    			{
    			ip: actualSvrcfg.ip,        //IP地址
    			port: actualSvrcfg.port ,   //端口号
    			requestType:"POST"
    			});
    		
    		 queryService.query(querryfenxiSuccess);
		}
		function querryfenxiSuccess(data){
			var a=0;
			if(data.TotalCount>0)
				{	
					a=1;
					$('#selectOkCancleButton').dialog('open');	
					$("#selectOkCancleButton").dialog("move",{top:$(document).scrollTop() + ($(window).height()-300) * 0.5});//带滚动条的div窗口居中显示
				}
			if(a==0)
			{
				 addzongdi();
			}
	   }
		function continueAddyaosu()
		{
			$('#selectOkCancleButton').dialog('close');
			addzongdi();
		}
		function cancelAdd()
		{
			$('#selectOkCancleButton').dialog('close');
			return;
		} 
		
	   
	   function checkzb(){
		   if($("#chrymctext").val()== ""){
				$("<label for='name' class='error'>必填信息</label>").insertAfter("#chrymctext");
				return false;
			}
			var tb = document.getElementById("contentTable");
			var tempx,tempy,indexNO=0,flag=0;
			console.log(TempZBArray);//清空数组
			console.log(TempZBYXArray);//清空数组
			 zblisttemp="";
			 console.log(tb.rows.length);
			 var indexNO = 0;
			for (var i=1;i<tb.rows.length-1;i++){
				tempx = tb.rows[i].cells[3].getElementsByTagName("INPUT")[0].value;
			    tempy = tb.rows[i].cells[4].getElementsByTagName("INPUT")[0].value;
			    var str=tb.rows[i].cells[5].innerText;
			    str=str.replace( /^\s+|\s+$/g, "" );
				if(str=="删 除"||str=="撤销删除")
				{	
					flag = 0;
					 //判断导入的数据格式,为文本则可导入
					  if((tempx.indexOf("E") != -1) || (tempy.indexOf("E") != -1)){
							 alert("导入的界址点格式为 非文本 格式,无法导入,请修改后重新导入");
							 gobackchxxlist();
							 flag = 1;
							 return false;
							}
					      var arr = tempx.split(".");
						 var arr1 = tempy.split(".");
						if((arr[0].length>=7)&&(arr1[0].length>=7))
					    {
							if($("#regBaseZbinfoList"+(i-1)+"_delFlag").val()=="0"){
								//坐标与GIS图XY坐标颠倒
							if((arr[0].length == 7)&&(arr1[0].length==8)){
							TempZBArray[indexNO]=tempy+","+tempx;
						    TempZBYXArray[indexNO]= new Zondy.Object.Point2D(parseFloat(tempy), parseFloat(tempx));	
							zblisttemp=zblisttemp+$("#regBaseZbinfoList"+(i-1)+"_zbdmc").val()+"["+$("#regBaseZbinfoList"+(i-1)+"_zby").val()+","+$("#regBaseZbinfoList"+(i-1)+"_zbx").val()+"] "+","+$("#regBaseZbinfoList"+(i-1)+"_id").val()+","+$("#regBaseZbinfoList"+(i-1)+"_delFlag").val()+","+$("#regBaseZbinfoList"+(i-1)+"_sort").val()+";";
							 indexNO=indexNO+1;
							}
							//坐标正常,XY一一对应
							else if((arr[0].length == 8)&&(arr1[0].length==7)){
							  TempZBArray[indexNO]=tempx+","+tempy;
						      TempZBYXArray[indexNO]= new Zondy.Object.Point2D(parseFloat(tempx), parseFloat(tempy));
							   zblisttemp=zblisttemp+$("#regBaseZbinfoList"+(i-1)+"_zbdmc").val()+"["+$("#regBaseZbinfoList"+(i-1)+"_zbx").val()+","+$("#regBaseZbinfoList"+(i-1)+"_zby").val()+"] "+","+$("#regBaseZbinfoList"+(i-1)+"_id").val()+","+$("#regBaseZbinfoList"+(i-1)+"_delFlag").val()+","+$("#regBaseZbinfoList"+(i-1)+"_sort").val()+";";
							 indexNO=indexNO+1;
							}else{
							  alert("第"+i+ "行坐标输入有误,请检查");
							  return false;	
							}
							}					
					        
					    }
						else
						{
							alert("第"+i+ "行坐标输入有误,请检查");
							return false;
						}
				 }					
			}
			if(flag == 0){
			if((TempZBArray.length<4)||(regBaseZbinfoRowIdx<4)) {alert("请输入至少4个坐标点!");return false;}
		      }
			return true;
	 }
		
		function addyaosu()
		{
			 
			var tempcheck;
			var zbtemp="";
          /*   tempcheck=checkbitianxiang();			
			if (tempcheck==true) {$("#btnSubmit").attr("disabled",false);return;}
 */			if(false==checkzb()){ $("#btnSubmit").attr("disabled",false);return;}
			//if(false==checkArea()){ $("#btnSubmit").attr("disabled",false);return;}
		    if(TempZBArray[0]!=TempZBArray[TempZBArray.length-1])
			{
		    	 TempZBArray[TempZBArray.length]=TempZBArray[0];
		    	 TempZBYXArray[TempZBYXArray.length]=TempZBYXArray[0];
		    }
			zbtemp="";
			for(j=0; j<TempZBArray.length; j++){
			   zbtemp=zbtemp+"J"+(j+1)+"["+TempZBArray[j]+"] ";
		    }	
			
			$.ajax({ 
	  			type:"POST", //请求方式 
	  			url:"${ctx}/reg/base/regBaseChxx/savexg", //请求路径 
	  			cache: false,   //(默认: true,dataType为script和jsonp时默认为false) jQuery 1.2 新功能,设置为 false 将不缓存此页面。 
	  			//data:"zddmvalue="+ss+"&bdcdyhvalue="+""+"&qlrvalue="+"",  //传参 
	  			data:"jzdzblist="+zblisttemp+"&jzdzb="+zbtemp+"&bdcdyh="+$("#bdcdyhtext").val()+"&chsj="+$("#chsjtext").val()+"&chrymc="+$("#chrymctext").val()+"&tfh="+$("#tfhtext").val()+"&zdt="+$("#zdt").val()+"&zdmj="+$("#zdmjtext").val()+"&bz="+$("#bztext").val(),//chrymctext
	  			async:false,
	  	        //dataType: "html",   //返回值类型 
	  			success:function(modelmap){
	  				if((modelmap.data)=="0") {alert("时间保存出错!");}
	  				   mapreturnvale =modelmap.regBaseChxxData;
	  				   mapreturnvaleList=modelmap.regBaseZbinfoListData;
	  				   mapreturnvale = eval('(' + mapreturnvale + ')');
	  				   mapreturnvaleList = eval('(' + mapreturnvaleList + ')');
	  				   ychid = modelmap.ychid;
	  				   yts = modelmap.yts;
	  				  //---------------------根据id查询到宗地 更新对应宗地信息 
		  				var queryStruct=new Zondy.Service.QueryFeatureStruct();
		  				queryStruct.IncludeGeometry=true;
		  				 var temptuceng=selectTuCeng(mapreturnvale.zdtzm);

		  				var str="CHID='"+ ychid +"'";
		  				
		  				var queryParam=new Zondy.Service.QueryByLayerParameter(temptuceng,{ 
		  	                   // geometry: line,
		  	                   resultFormat: "json",
		  	                   struct:queryStruct,
		  	                   where :  str
		  	                   });
		  				var queryService=new Zondy.Service.QueryLayerFeature(queryParam,
		  						{
		  					ip: actualSvrcfg.ip,        //IP地址
		  					port: actualSvrcfg.port ,   //端口号
		  					requestType:"POST"
		  					});
		  				queryService.query(queryUpdatedataSuccess);
		  				//------------------------------------	  				  	  				
	  			}
	  		});
		}
		function queryUpdatedataSuccess(data)
		{
			console.log(data);
			 var chaxunvalue=data;
			 var temptuceng=selectTuCeng(mapreturnvale.zdtzm);
			 if(chaxunvalue.TotalCount>0){
				 updatequyaosu(chaxunvalue.SFEleArray[0].FID,temptuceng);
				 }
			  if(chaxunvalue.TotalCount==0)
			 {
				 addzongdi();
			 } 
		}
		
		function addzongdi()
		{
			var pointObj = new Array(); 
			var qupointObj = new Array();
			/* var zbtemp="";
			for(var j=0; j<regBaseZbinfoRowIdx; j++){
				//pointObj[j]=$("#regBaseZbinfoList"+j+"_zbx").val()+","+$("#regBaseZbinfoList"+j+"_zby").val();
				if($("#regBaseZbinfoList"+j+"_id").val()=="0"){
				zbtemp=zbtemp+$("#regBaseZbinfoList"+j+"_zbdmc").val()+"["+$("#regBaseZbinfoList"+j+"_zbx").val()+","+$("#regBaseZbinfoList"+j+"_zby").val()+"] "+"zbid="+$("#regBaseZbinfoList"+j+"_id").val() +";";
				}
				}
			zbtemp="";
			for(j=0; j<TempZBArray.length; j++){
			   zbtemp=zbtemp+"J"+(j+1)+"["+TempZBArray[j]+"] ";
		    } */			
			 /*for(var i=0;i<pointObj.length;i++)
			  {
                lengthzb=pointObj[i].split(",");
		        if(lengthzb.length==2)
		        {
			       qupointObj[i] = new Zondy.Object.Point2D(parseFloat(lengthzb[1]), parseFloat(lengthzb[0]));
		        }
		        else
		        {alert("该宗地坐标有误!");return false;}
		      }*/
			  qupointObj=TempZBYXArray;
			  var gArc = new Zondy.Object.Arc(qupointObj);              //构成区要素的弧段
			  var gAnyLine = new Zondy.Object.AnyLine([gArc]);        //构成区要素折线
			  var gRegion = new Zondy.Object.GRegion([gAnyLine]);     //构成区要素
			  var fGeom = new Zondy.Object.FeatureGeometry({ RegGeom: [gRegion] }); //构成区要素的几何信息
    
			//设置区要素的图形参数信息
			  var cRegionInfo = new Zondy.Object.CRegionInfo({ EndColor: 136, FillColor:136, FillMode: 0, OutPenWidth: 1, OverMethod: 0, PatAngle: 1, PatColor: 1, PatHeight: 1, PatID: 0, PatWidth: 1 }); //区形状图形参数信息
			  var graphicInfo = new Zondy.Object.WebGraphicsInfo({ InfoType: 3, RegInfo: cRegionInfo }); //要素图形参数信
              //设置区要素的属性信息
              //var attValue = [0, , ,$("#qlrxmtext").val(),$("#zjlxtext").val(),$("#zjhmtext").val(),$("#seachprovtext").val(),$("#seachcitytext").val(),$("#seachdistricttext").val(),$("#zltext").val(),$("#zdmjtext").val(),$("#tfhtext").val(),$("#zdszdtext").val(),$("#zdszntext").val(),$("#zdszxtext").val(),$("#zdszbtext").val(),zbtemp,$("#zdt").val(),$("#chcode").val(),$("#chrymctext").val(),$("#chsjtext").val()];//$("#textnewyaosu").val()];
        	 var attValue = [0,,,,mapreturnvale.zddm,mapreturnvale.bdcdyh,mapreturnvale.ysdm,mapreturnvale.zdtzm,mapreturnvale.zl,mapreturnvale.zdmj,mapreturnvale.yt,mapreturnvale.mjdw,yts,mapreturnvale.dj,,mapreturnvale.qllx,mapreturnvale.qlxz,mapreturnvale.qlsdfs,mapreturnvale.rjl,mapreturnvale.jzmd,mapreturnvale.jzxg,mapreturnvale.zdszd,mapreturnvale.zdszn,mapreturnvale.zdszx,mapreturnvale.zdszb,mapreturnvale.zdt,mapreturnvale.tfh,mapreturnvale.djh,mapreturnvale.dah,mapreturnvale.zt,mapreturnvale.qlrxm,mapreturnvale.chid,mapreturnvale.islogout,mapreturnvale.bz,mapreturnvale.isls,"xg"];//tempselectdata.jg
             //创建一个新的区要素
             var newFeature = new Zondy.Object.Feature({ AttValue: attValue, fGeom: fGeom, GraphicInfo: graphicInfo });
             newFeature.setFType(3);

             //创建一个要素数据集
             var featureSet = new Zondy.Object.FeatureSet();
             var fldNumber = 36;
             var fldType = ["long",    "double", "double",   "long",  "string","string","string","string","string","double","string","string","string","string","double","string","string","string","string","float","float","string","string","string","string","string","string","string","string","string","string","string","string","string","string","string"];
             var fldName = ["mpLayer", "mpArea", "mpPerimeter","BSM", "ZDDM",  "BDCDYH","YSDM",  "ZDTZM","ZL",    "ZDMJ",  "YTMC", "MJDW", "YT",    "DJ",    "JG",    "QLLX"  ,"QLXZ",  "QLSDFS",  "RJL", "JZMD","JZXG", "ZDSZD", "ZDSZN", "ZDSZX", "ZDSZB",  "ZDT",    "TFH", "DJH","DAH","ZT","QLRXM","CHID","islogout","BZ","ISLS","BB"];
             var cAttValue = new Zondy.Object.CAttStruct({ FldNumber: fldNumber, FldType: fldType, FldName: fldName });
             featureSet.AttStruct = cAttValue;
             featureSet.addFeature(newFeature);

            //创建一个要素编辑服务对象
            // var editDocFeature = new Zondy.Service.EditDocFeature(SvrCfg.tileMapName, 0,0, { ip: SvrCfg.ip,  port: SvrCfg.port });
            var temptuceng=selectTuCeng('${zdtzm}');
            if(temptuceng!="")
            {
    	       var editDocFeature = new Zondy.Service.EditLayerFeature(temptuceng, { ip: actualSvrcfg.ip,  port: actualSvrcfg.port });
   
               editDocFeature.add(featureSet, chxxsuccess);	 

				  //--------------------------------
			}
		}

		function chxxsuccess(data)
		{
			if (data == true) {
				alert("添加要素成功!");
				var url ="${ctx}/reg/base/regBaseChxx/xglist";
    			 window.location = url;
				  				  	  				
			}
		   else {
		        alert("添加要素失败!");
		    }

		}


		//面积
		function dataSuccess(data){
	             var zdmj =parseFloat(data.SFEleArray[0].AttValue[1]);
	             var max = zdmj * (1.03);
	             var min = zdmj * (0.97);
	             var srmj = parseFloat($("#zdmjtext").val());
	             var mjdw = $("#mjdwTxt").val();
	             console.log(mjdw);
	             if(mjdw == "1"){
	                 zdmj = zdmj.toFixed(2);
	                if(min < srmj && srmj < max){
	            	 var url ="${ctx}/reg/base/regBaseChxx/?repage";
	    			 window.location = url;
	               }else{
	                alert("系统测的宗地面积为: "+zdmj+" 平方米,登记面积为: "+srmj+" 平方米,请确认坐标及登记面积!");
	                var url ="${ctx}/reg/base/regBaseChxx/?repage";
	   			     window.location = url;
	                   }
	             }
	             if(mjdw == "2"){
	                 zdmj = (zdmj*0.0015).toFixed(2);
	                 max = (max*0.0015).toFixed(2);
	                 min = (min*0.0015).toFixed(2);
	                 if(min < srmj && srmj < max){
	             	 var url ="${ctx}/reg/base/regBaseChxx/?repage";
	     			 window.location = url;
	                }else{
	                 alert("系统测的宗地面积为: "+zdmj+" 亩,登记面积为: "+srmj+" 亩,请确认坐标及登记面积!");
	                 var url ="${ctx}/reg/base/regBaseChxx/?repage";
	    			     window.location = url;
	                    }
	              }
	             if(mjdw == "3"){
	            	 zdmj = (zdmj*0.0001).toFixed(2);
	            	 max = (max*0.0001).toFixed(2);
	                 min = (min*0.0001).toFixed(2);
	                 if(min < srmj && srmj < max){
	             	 var url ="${ctx}/reg/base/regBaseChxx/?repage";
	     			 window.location = url;
	                }else{
	                 alert("系统测的宗地面积为: "+zdmj+" 公顷,登记面积为: "+srmj+" 公顷,请确认坐标及登记面积!");
	                 var url ="${ctx}/reg/base/regBaseChxx/?repage";
	    			     window.location = url;
	                    }
	              }
	        	
				}
		function updatequyaosu(fid,tuceng)
		{
			
			var editDocFeature = new Zondy.Service.EditLayerFeature(tuceng, { ip: actualSvrcfg.ip,  port: actualSvrcfg.port });			   
			editDocFeature.deletes(fid, deleteonSuccess);	
			
		}
		function deleteonSuccess(data) 
		{
			shujvfenxijianyan();
		}
		function updateSuccess(data)
		{ 
			if (data == true) {
	         alert("更新成功!");
	         var url ="${ctx}/reg/base/regBaseChxx/?repage";
 			 window.location = url;
	          }
	        else {
	         alert("更新失败,请检查参数是否填写完整!");
	        }		 
		}
		
	</script>

</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/reg/base/regBaseChxx/xgcxzd">测绘信息列表</a></li>
		<li class="active"><a href="#">宗地信息<shiro:hasPermission name="reg:base:regBaseChxx:edit">${not empty regBaseChxx.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="reg:base:regBaseChxx:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" name="form" modelAttribute="regBaseChxx" action="${ctx}/reg/base/regBaseChxx/savexg" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>
		<div class="control-group">
			
		<div class="control-group">
			<label class="control-label">不动产单元号:</label>
			<div class="controls">
				<form:input value="${bdcdyh}" id="bdcdyhtext" path="" htmlEscape="false" maxlength="30" readonly="true" class="input-xlarge"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">权利人:</label>
			<div class="controls">
				<form:input path="" value="${qlrxm}" id="qlrxmtext" readOnly="true" htmlEscape="false" maxlength="100" class="input-xlarge"/>
				
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">县级行政区:</label>
			<div class="controls">
			<%--
			 <form:input path="seachprov" id="seachprovtext" readOnly="true" htmlEscape="false" maxlength="50"  class="input-xlarge "/>
			--%>    
				<form:select path="seachprov" id="seachprovtext" class="input-xlarge required" onChange="changeComplexProvince(this.value, sub_array, 'seachcitytext', 'seachdistricttext');getAreaInfo();">
					<form:option value="${XQCODE}" label="${fns:getDictLabel(XQCODE, 'reg_bus_xq', '')}"/>
					<%--
					<form:options items="${fns:getDictList('reg_bus_xq')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				--%>  
				</form:select>
				 
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		
		
		<div class="control-group">
			<label class="control-label">宗地特征码:</label>
			<div class="controls">
				<form:select id="zdtzmTxt" path="zdtzm" disabled="true" class="input-large required">
						<form:option value="${zdtzm}" label="${fns:getDictLabel(zdtzm, 'reg_bus_zdtzm', '')}"/>
					</form:select>
					<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div> 
		<div class="control-group">
			<label class="control-label">坐落:</label>
			<div class="controls">
				<form:textarea path="zl" id="zltext" htmlEscape="false" disabled="true" rows="4" maxlength="200" class="input-xxlarge required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">宗地面积:</label>
			<div class="controls">
			<fmt:formatNumber value="${zdmj}"
                pattern="#0.##" 
                var="formattedNumber"/>
                
				<form:input path="" id="zdmjtext" htmlEscape="false" 
				value="${formattedNumber}" 
				 maxlength="15"  class="input-xlarge number required"/>
				     <form:select id="mjdwTxt" path="" class="input-small required">
					 	<form:options items="${fns:getDictList('reg_bus_mjdw')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				   </form:select>			            
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">测绘人员:</label>
			<div class="controls">
				<form:input path="" id="chrymctext" value="${chrymc}" htmlEscape="false" maxlength="100" class="input-xlarge"/>
				<span class="help-inline"><font color="red">*</font> </span>
				</div>
			
		</div>
		<div class="control-group">
			<label class="control-label">图幅号:</label>
			<div class="controls">
				<form:input path="" value="${tfh}" id="tfhtext" htmlEscape="false" maxlength="50" class="input-xlarge"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">宗地图:</label>
			<div class="controls">
				<form:hidden id="zdt" path="" value="${zdt}" htmlEscape="false" maxlength="4000" class="input-xlarge"/>
				<sys:ckfinder input="zdt" type="files" uploadPath="/reg/base/regBaseChxx" selectMultiple="true"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">测绘添加时间:</label>
			<div class="controls">
				<!-- 更新 -->
				<c:if test="${not empty regBaseChxx.id}">
					<input name="" id="chsjtext" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
						value="<fmt:formatDate value="${regBaseChxx.chsj}" pattern="yyyy-MM-dd"/>"
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd' });"/>
				</c:if>
				<!-- 新增 -->
				<c:if test="${empty regBaseChxx.id}">
					<input name="" id="chsjtext" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
						value="${fns:getDate('yyyy-MM-dd')}"
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd' });"/>
				</c:if>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">界址点坐标:</label>
			<div class="controls">
				<table id="contentTable" class="table table-striped table-bordered table-condensed">
					<thead>
						<tr>
							<th class="hide"></th>
							<th>序号</th>
							<th>坐标点名称</th>
							<th>X坐标值</th>
							<th>Y坐标值</th>
							<shiro:hasPermission name="reg:base:regBaseChxx:edit"><th width="100">&nbsp;操   作</th></shiro:hasPermission>
						</tr>
					</thead>
					<tbody id="regBaseZbinfoList">
					</tbody>
					<shiro:hasPermission name="reg:base:regBaseChxx:edit"><tfoot>
						<tr><td colspan="5"><a href="javascript:" onclick="addRow('#regBaseZbinfoList', regBaseZbinfoRowIdx, regBaseZbinfoTpl);regBaseZbinfoRowIdx = regBaseZbinfoRowIdx + 1;" class="btn" id="btnn">新增</a></td></tr>
					</tfoot></shiro:hasPermission>
				</table>
				<script type="text/template" id="regBaseZbinfoTpl">//<!--
						<tr id="regBaseZbinfoList{{idx}}">
							<td class="hide">
								<input id="regBaseZbinfoList{{idx}}_id" name="regBaseZbinfoList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
								<input id="regBaseZbinfoList{{idx}}_delFlag" name="regBaseZbinfoList[{{idx}}].delFlag" type="hidden" value="0"/>
							</td>
							<td>
								<input id="regBaseZbinfoList{{idx}}_sort" name="regBaseZbinfoList[{{idx}}].sort" type="text" value="{{row.sort}}" maxlength="100" class="input-small "/>
							</td>
							<td>
								<input id="regBaseZbinfoList{{idx}}_zbdmc" name="regBaseZbinfoList[{{idx}}].zbdmc" type="text" value="{{row.zbdmc}}" maxlength="100" class="input-small "/>
							</td>
							<td>
                              <c:if test="${not empty daoru}">
								 <input id="regBaseZbinfoList{{idx}}_zbx" name="regBaseZbinfoList[{{idx}}].zbx" type="text" value="{{row.zby}}" readonly="true" maxlength="50" class="input-small "/>
                              </c:if>	
                              <c:if test="${empty daoru}">
								<input id="regBaseZbinfoList{{idx}}_zbx" name="regBaseZbinfoList[{{idx}}].zbx" type="text" value="{{row.zby}}"  maxlength="50" class="input-small "/>
                              </c:if>							
                             </td>
							<td>
                              <c:if test="${not empty daoru}">
								 <input id="regBaseZbinfoList{{idx}}_zby" name="regBaseZbinfoList[{{idx}}].zby" type="text" value="{{row.zbx}}" readonly="true" maxlength="50" class="input-small "/>
						      </c:if>	
                              <c:if test="${empty daoru}">
							     <input id="regBaseZbinfoList{{idx}}_zby" name="regBaseZbinfoList[{{idx}}].zby" type="text" value="{{row.zbx}}" maxlength="50" class="input-small "/>
						      </c:if>	
							</td>
							<shiro:hasPermission name="reg:base:regBaseChxx:edit"><td class="text-center" width="100">
								{{#delBtn}}<a class="btn btn-primary" onclick="delRow(this, '#regBaseZbinfoList{{idx}}')" title="删除" id="btnn">    </a>{{/delBtn}}
							</td></shiro:hasPermission>
						</tr>//-->
					</script>
				<!-- <script type="text/javascript">
					 regBaseZbinfoRowIdx = 0, regBaseZbinfoTpl = $("#regBaseZbinfoTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
					$(document).ready(function() {
					
						var data = ${fns:toJson(regBaseChxx.regBaseZbinfoList)};
						for (var i=0; i<data.length; i++){
							addRow('#regBaseZbinfoList', regBaseZbinfoRowIdx, regBaseZbinfoTpl, data[i]);
							regBaseZbinfoRowIdx = regBaseZbinfoRowIdx + 1;
						}
					});
				     
	  				/*var regBaseZbinfoRowIdx = 0, regBaseZbinfoTpl = $("#regBaseZbinfoTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
					
					$(document).ready(function() {
						alert("ff");
						alert(mapreturnvaleList.length);
						for (var i=0; i<mapreturnvaleList.length; i++){
							addRow('#regBaseZbinfoList', regBaseZbinfoRowIdx, regBaseZbinfoTpl, mapreturnvaleList[i]);
						
							regBaseZbinfoRowIdx = regBaseZbinfoRowIdx + 1;
						}
					})*/
					 
				</script>-->
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">备注:</label>
			<div class="controls">
					<textarea id="bztext" htmlEscape="false" rows="2" maxlength="300" class="input-xxlarge ">${bz}</textarea>
			</div>
		</div>
		
		<div class="form-actions">
			<c:if test="${empty VIEWS}">
			<shiro:hasPermission name="reg:base:regBaseChxx:edit"><input id="btnSubmit" class="btn btn-primary" type="button" onclick="javascript:{this.disabled=true;addyaosu();}" value="保 存"/>&nbsp;</shiro:hasPermission>
			</c:if>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="gobackchxxlist()"/>
			
		</div>
			<div id="selectOkCancleButton"  class="easyui-dialog" title="提示信息!"  maximizable="false"  minimizable="false" collapsible="false"  border="false" resizable="false" closable="true" closed="true" style="color:#1E90FF;left:300px;top:200px; width:300px; height:200px;padding: 5px" resizable="false">	<form style="padding:10px 20px 10px 40px;">    
            <label class="control-label"><br/>&nbsp;&nbsp;&nbsp;&nbsp;添加的宗地与其他图层相交,是否继续。<br/><span><font color="red">选择‘是’,继续添加,选择‘否’,退出该操作!</font></span></label>
            <br/>
            <div>
			<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<input id="btnSubmit" class="btn btn-primary" type="button" onclick="javascript:{this.disabled=true;continueAddyaosu();}" value="是"/>&nbsp;
		     &nbsp;&nbsp;&nbsp;&nbsp;
		    
			<input id="btnCancel" class="btn" type="button" value="否" onclick="cancelAdd()"/>
			</div>
        </div>
	</form:form>
	
	
</body>

</html>