<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<!DOCTYPE html>
<html>
<head lang="en">
	<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
 	<%@include file="../../../frame/assets/header-all.jsp"%>
 	<script type="text/javascript" src="../js/jquery.form.js"></script>
	<style>
			* { font-size:13px}
			.form-line .text-content{
				width:120px;
			}
			body { margin:0}
			
			.line { position:relative; float:left; padding: 8px 0px 8px 50px;   border-left: 0 !important;}
			
			.line span { float:left}
			
			input { border:1px solid #888; vertical-align:middle}
			
			.file { position:absolute; left:90px; top:8px; display:none;filter:alpha(opacity=0);opacity:0}
			
			.file1 { padding:6px 13px; display:block; float:left; background:#67c23a; color:#fff; z-index:1; margin-left:5px; vertical-align:middle; cursor: pointer}
			
			.inputstyle {     width: 180px;height: 26px;border:1px solid #888; z-index:99}
			.fail{padding:0 5px;}
			.datagrid-body{
				height:85px !important;
			}
	</style>
</head>
<body class="easyui-layout">
<form id="childform" class="easyui-form" data-options="novalidate:true">
	<input id="xh" type="hidden" />
	<div class="form-line clearfix" >
		<div class="fl">
			<span class="text-content"><em class="must">*</em>标志名称：</span> 
			<input id="bzmc" class="easyui-textbox" data-options="required:true,validType:'length[0,128]'" missingMessage="标志名称必填项" > 
		</div> 
		<div class="fl">
			<span class="text-content"><em class="must"></em>标志编号：</span> 
			<input id="bzbh" class="easyui-textbox" data-options="required:false,validType:'length[0,40]'" missingMessage="标志编号必填项" > 
		</div> 
	</div>
	<div class="form-line clearfix">
		<div class="fl">
			<span class="text-content"><em class="must"></em>标志类型：</span> 
			<input id="bzlx" class="easyui-textbox" data-options="required:false,validType:'length[0,40]'" missingMessage="标志类型必填项" > 
		</div> 
		<div class="fl">
			<span class="text-content"><em class="must"></em>标志品牌：</span> 
			<input id="bzpp" class="easyui-textbox" data-options="required:false,validType:'length[0,40]'" missingMessage="标志品牌必填项" > 
		</div> 
	</div>
	<div class="form-line clearfix">
		<div class="fl">
			<span class="text-content"><em class="must"></em>规格型号：</span> 
			<input id="ggxh" class="easyui-textbox" data-options="required:false,validType:'length[0,40]'" missingMessage="规格型号必填项" > 
		</div> 
		<div class="fl">
			<span class="text-content"><em class="must"></em>供应商名称：</span> 
			<input id="gysbh" class="easyui-combobox" data-options="valueField:'id', textField:'text',panelHeight:'auto'" missingMessage="供应商名称必填项" > 
		</div> 
		
	</div>
	<div class="form-line clearfix">
		<div class="fl">
			<span class="text-content"><em class="must"></em>安装单位：</span> 
			<input id="azdw" class="easyui-textbox" data-options="required:false,validType:'length[0,40]'" missingMessage="安装单位必填项" > 
		</div> 
		<div class="fl">
			<span class="text-content"><em class="must"></em>安装时间：</span> 
			<input id="azsj" class="easyui-datebox" missingMessage="安装时间必填项" > 
		</div> 
	</div>
	<div class="form-line clearfix">
		<div class="fl">
			<span class="text-content"><em class="must"></em>安装方式：</span> 
			<input id="azfs" class="easyui-textbox" data-options="required:false,validType:'length[0,40]'" missingMessage="安装方式必填项" > 
		</div> 
		<div class="fl">
			<span class="text-content"><em class="must"></em>杆件类型：</span> 
			<input id="gjlx" class="easyui-textbox" data-options="required:false,validType:'length[0,40]'" missingMessage="杆件类型必填项" > 
		</div> 
	</div>
	<div class="form-line clearfix">
		<div class="fl">
			<span class="text-content"><em class="must"></em>数量：</span> 
			<input id="sl" class="easyui-textbox" data-options="required:false,validType:'length[0,10]'" missingMessage="数量必填项" > 
		</div> 
		<div class="fl">
			<span class="text-content"><em class="must"></em>管辖单位：</span> 
			<input id="gxdwbm" class="easyui-combotree" data-options="valueField:'id', textField:'text',panelHeight:'auto'" missingMessage="管辖单位名称必填项" > 
		</div> 
	</div>
	<div class="form-line clearfix">
		<div class="fl">
			<span class="text-content"><em class="must"></em>管辖联系人：</span> 
			<input id="lxr" class="easyui-textbox" data-options="required:false,validType:'length[0,40]'" missingMessage="联系人必填项" > 
		</div> 
		<div class="fl">
			<span class="text-content"><em class="must"></em>管辖联系电话：</span> 
			<input id="lxdh" class="easyui-textbox" data-options="required:false,validType:'length[0,40]'" missingMessage="联系电话必填项" > 
		</div> 
	</div>
	<div class="form-line clearfix">
		<div class="fl">
			<div class="line"> 
				<span>
					<label  style="padding: 6px 0;">实景照片：</label>
					<input name="" type="text" id="viewfile"  readonly onmouseout="document.getElementById('myfile').style.display='none';" class="inputstyle" />
				</span>
				<label for="unload" onmouseover="document.getElementById('myfile').style.display='block';" class="file1">浏览...</label>
				<input type="file" onchange="document.getElementById('viewfile').value=this.value;this.style.display='none';" class="file"   id='myfile' name='file' />
			</div>
			<!-- 
			<span class="text-content"><em class="must"></em>实景照片：</span> 
			<input id="sjzp" class="easyui-textbox" data-options="required:false,validType:'length[0,256]'" missingMessage="实景照片必填项" >  -->
		</div> 
	</div>
	<div class="form-line clearfix">
		<div class="fl">
			<span class="text-content"><em class="must"></em>经度：</span> 
			<input id="jd" class="easyui-textbox" data-options="required:false,validType:'length[0,40]'" missingMessage="经度必填项" > 
		</div> 
		<div class="fl">
			<span class="text-content"><em class="must"></em>维度：</span> 
			<input id="wd" class="easyui-textbox" data-options="required:false,validType:'length[0,40]'" missingMessage="维度必填项" > 
		</div> 
	</div>
	<div class="form-line clearfix">
		<div class="fl">
			<span class="text-content"><em class="must"></em>简介：</span> 
			<input id="bzjj" class="easyui-textbox" data-options="multiline:true" style="width:300px;height:100px" missingMessage="备注必填项" > 
		</div> 
	</div>
	
	<div class="form-line hidden">
		 
	</div>
</form>
</body>
</html>
<script type="text/javascript">
var winId	= $.getUrlParam("winId");
var records = top.$("#"+winId).panel("options").data;
$(function(){
	//加载下拉选项
	$('#gysbh').combobox({
		url:'nhywgysxxAction!query_NhywgysxxList.do',
		textField:"gysmc",
		valueField:"xh",
		panelWidth:148,
		value:""
	});
	/*
	$('#bzlx').combobox({
		 url:'xtclAction!query_Xtcl.do?csdl=nhywBzlx',
		 textField:"csmc",  
		 valueField:"csdm",
		 panelWidth:148,
		 value:"1" 
	});
	$('#gjlx').combobox({
		 url:'xtclAction!query_Xtcl.do?csdl=nhywGjlx',
		 textField:"csmc",  
		 valueField:"csdm",
		 panelWidth:148,
		 value:"1" 
	});
*/

	//初始化行政树
		$.ajax({
			 type:'post',
//			 async:false,
			 dataType : 'json',
			 url:'menuConfigAction!query_Ptxzs.do',//dac 行政树
//			 url:'ptxzsAction!query_Ptxzs.do' ,//本地 行政树
//			 data:{
//				 order : " order by jdpx asc "
//			 },
		 }).done(function(data){
			if(data!=null && data.length>0) {
				$.each(data, function (i, o) {
					o.state = 'closed';
					o.treeId = o.xzbh;
					o.name = o.xzmc;
					o.treeType = "xz";
					o.id = o.xzbh;
					o.pid = o.sjxzbh;
					o.start = 0; //iconCls
				})
			}
				var xzfz = {};
			 	xzfz.treeType 	= "xz";
				xzfz.id		= "-1";
				xzfz.pid		= "xzTree";
				xzfz.start 	= 0; //iconCls
			 	xzfz.xzbh = "-1";
			 	xzfz.xzmc = "行政分组";
			 	xzfz.state = "closed";
			 	xzfz.treeId = "-1";
			 	xzfz.sjxzbh = "xzTree";
			 	xzfz.name = "行政分组";
				data.push(xzfz);
				$('#gxdwbm').combotree({
					checkbox:false,
					border:false,
					parentField:"pid",
					textFiled:"name",
					idFiled:"id",
					panelWidth:148,
					data:data,
					onLoadSuccess:function(node,data){
						if(records){
							var tree = $('#gxdwbm').combotree('tree');
							for (var i=0;i<data.length ;i++ ){
								node= tree.tree("find",data[i].id);
								tree.tree('expandAll',node.target);
							}
							node = tree.tree('find', records.gxdwbm);
							tree.tree('select', node.target);
							//tree.tree('expandAll',node.target);
							$('#gxdwbm').combotree("setValue",node.id)
						}
					},
					onClick: function(node){
						
					},
					data   : data
				});
		});

	$('#azsj').datebox({ editable:false });

	setTimeout(loadValue,500);
});
function loadValue(){
	if(records){
		$("#xh").val(records.xh);
		$("#bzmc").textbox("setValue",records.bzmc);
		$("#bzbh").textbox("setValue",records.bzbh);
		$("#bzlx").textbox("setValue",records.bzlx);
		$("#bzpp").textbox("setValue",records.bzpp);
		$("#ggxh").textbox("setValue",records.ggxh);
		$("#gysbh").combobox("setValue",records.gysbh);
		//$("#gysmc").textbox("setValue",records.gysmc);
		$("#azdw").textbox("setValue",records.azdw);
		$("#azsj").textbox("setValue",records.azsj);
		$("#azfs").textbox("setValue",records.azfs);
		$("#gjlx").textbox("setValue",records.gjlx);
		$("#sl").textbox("setValue",records.sl);
		//$("#gxdwbm").combotree("setValue",records.gxdwbm);
		
		$("#lxr").textbox("setValue",records.lxr);
		$("#lxdh").textbox("setValue",records.lxdh);
		$("#jd").textbox("setValue",records.jd);
		$("#wd").textbox("setValue",records.wd);
		$("#bzjj").textbox("setValue",records.bzjj);

//		$("#sszbx").textbox("setValue",records.sszbx);// 所属坐标系
//		$("#sjzp").textbox("setValue",records.sjzp);// 实景照片 文件上传 填写ftp链接
//		$("#gxdwmc").textbox("setValue",records.gxdwbm); //管辖单位名称gxdwmc
//		$("#gysbh").textbox("setValue",records.gysbh);// 供应商编号
//		$("#bzjj").textbox("setValue",records.bzjj); // 标志简介
		
		/*$("#cjry").textbox("setValue",records.cjry);
		$("#cjrq").textbox("setValue",records.cjrq);
		$("#xgry").textbox("setValue",records.xgry);
		$("#xgrq").textbox("setValue",records.xgrq);
		$("#kz1").textbox("setValue",records.kz1);
		$("#kz2").textbox("setValue",records.kz2);
		$("#kz3").textbox("setValue",records.kz3);
		$("#kz4").textbox("setValue",records.kz4);*/

	}else{
		
	}
}
/*
var xx1 = $("#xx1").textbox("getValue");//文本
var xx2 = $("#xx2").combobox("getValue");//下拉
var xx3 = $("#xx3").datetimebox("getValue");//日期
var xx4 = $("#xx4").numberbox("getValue");//数字
$('#xx5').combobox({  
	url:'xtclAction!select_Xtcl.do?csdl=xx5&page=1&rows=1000', 
	textField:"csmc",  
	valueField:"csdm",
	panelWidth:148,
	loadFilter:function(data){
		//data.unshift({"csmc":"选择","csdm":""});
		return data;
	}
});
$("#xx6").textbox("setValue",records.xx6);
$("#xx7").combobox("setValue",records.xx7);
$("#xx8").combobox("setValue",records.xx8);
$("#xx9").datetimebox("setValue",$.getNowTime());
$("#xx10").datetimebox("setValue",$.getTodayStart('00:00:00',-3));//往前推3天  +'00:00:00'
$("#xx11").datetimebox("setValue",$.getTodayEnd());//当天 +'23:59:59'	
$("#xx12").datetimebox("setValue",$.getDateNumToStr(records.xx12));
$("#xx13").numberbox("setValue",records.xx13);
*/
</script>
