<%@ tag language="java" pageEncoding="UTF-8"%>
<%@ include file="/webpage/include/taglib.jsp"%>
<%@ attribute name="id" type="java.lang.String" required="true" description="编号"%>
<%@ attribute name="name" type="java.lang.String" required="false" description="隐藏域名称（ID）"%>
<%@ attribute name="value" type="java.lang.String" required="false" description="隐藏域值（ID）"%>
<%@ attribute name="labelName" type="java.lang.String" required="false" description="输入框名称（Name）"%>
<%@ attribute name="labelValue" type="java.lang.String" required="false" description="输入框值（Name）"%>
<%@ attribute name="fieldLabels" type="java.lang.String" required="true" description="表格Th里显示的名字"%>
<%@ attribute name="fieldKeys" type="java.lang.String" required="true" description="表格Td里显示的值"%>
<%@ attribute name="searchLabel" type="java.lang.String" required="true" description="表格Td里显示的值"%>
<%@ attribute name="searchKey" type="java.lang.String" required="true" description="表格Td里显示的值"%>
<%@ attribute name="floorLabel" type="java.lang.String" required="false" description="表格Td里显示的值"%>
<%@ attribute name="floorKey" type="java.lang.String" required="false" description="表格Td里显示的值"%>
<%@ attribute name="housenumberLabel" type="java.lang.String" required="false" description="表格Td里显示的值"%>
<%@ attribute name="housenumberKey" type="java.lang.String" required="false" description="表格Td里显示的值"%>
<%@ attribute name="title" type="java.lang.String" required="true" description="选择框标题"%>
<%@ attribute name="url" type="java.lang.String" required="true" description="数据地址"%>
<%@ attribute name="cssClass" type="java.lang.String" required="false" description="css样式"%>
<%@ attribute name="cssStyle" type="java.lang.String" required="false" description="css样式"%>
<%@ attribute name="disabled" type="java.lang.String" required="false" description="是否限制选择，如果限制，设置为disabled"%>
<script type="text/javascript">
function searchGrid${id}(clientId){
	var uri;
	if(clientId==null||clientId==''){
		// top.layer.msg("请先选择合同信息");
		// top.layer.msg('<span id="confirm" style="border:1px solid red;background:#fff;color:red;margin-left:-25px;padding: 14px 25px 15px 25px;overflow:hidden;position:relative;border-right:none;">请先选择合同信息<b style="position:absolute;top:-1px;width:24px;height:46px;right:-25px;border:1px solid red;border-left:none;background:#fff;"></b></span>')
		// return false;
		uri = "${ctx}/workclientinfo/workClientInfo/queryLinkManByCompany?clientId=null";
    }else{
		uri = "${url}?clientIds="+clientId;
	}
	top.layer.open({
	    type: 2,
	    area: ['90%','90%'],
	    title:"${title}",
		skin:"two-btns",
	    name:'friend',
	    content: encodeURI(uri+"&fieldLabels=${fieldLabels}&fieldKeys=${fieldKeys}&url="+uri+"&searchLabel=${searchLabel}&searchKey=${searchKey}&floorLabel=${floorLabel}&floorKey=${floorKey}&housenumberLabel=${housenumberLabel}&housenumberKey=${housenumberKey}") ,
	    btn: ['确定', '关闭'],
	    yes: function(index, layero){
	    	 var iframeWin = layero.find('iframe')[0].contentWindow; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
	    	 var item = iframeWin.getSelectedItem();

	    	 if(item == "-1"){
		    	 return;
	    	 }

			 top.layer.close(index);//关闭对话框。
           	 setValuee(item);
		  },
		  cancel: function(index){
	       }
	});

}
</script>

	<input id="${id}Id"  type="hidden" value="${value}"/>
	<div class="input-group" style="width: 100%">
		<%--<input id="${id}Name"  name="${labelName }" ${allowInput?'':'readonly="readonly"'}  type="text" value="${labelValue}" data-msg-required="${dataMsgRequired}"
		class="${cssClass}" style="${cssStyle}"/>--%>
       		 <span class="input-group-btn">
	       		 <a href=javascript:void(0); style="font-size:14px;" onclick="searchGridlinkman($('#linkmanId').val())" id="linkmanButton" class="nav-btn nav-btn-add"><i class="fa fa-search-plus"></i>
	              添加委托方联系人</a>
       		 </span>
       		
    </div>
	 <label id="${id}Name-error" class="error" for="${id}Name" style="display:none"></label>
