<extend name="Common/layui_list" />
<!-- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| 开单大师（专业的房产ERP管理系统）
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| © 2019 http://www.kaidandashi.com All rights reserved.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| 本系统由淮南市银泰软件科技有限公司提供技术支持
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| QQ号：984784483
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<block name="title">
	<title>{$title}</title>
</block>
<block name="css">
	<style type="text/css">
		a.layui-btn{
			margin-left: 10px;
		}
		#greetings{
			position: absolute;
			height: auto;
			border-left: 1px solid rgba(0, 0, 0, 0.11);
			border-right: 1px solid rgba(0, 0, 0, 0.11);
			left: 0px;
			z-index:5555;
		}
		#greetings ul{
			list-style: none;
			box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.44);
			-webkit-margin-before: 0em;
			-webkit-margin-after: 0em;
			-webkit-margin-start: 0px;
			-webkit-margin-end: 0px;
			-webkit-padding-start: 0px;
		}
		#greetings li{
			text-align: left;
			padding: 5px;
			font-family: inherit;
			border-bottom: 1px solid rgba(0, 0, 0, 0.16);
			height: 25px;
			width: 180px;
			line-height: 25px;
			background-color: rgba(255, 255, 255, 0.8);
			cursor: pointer;
		}
		#greetings li:hover{
			background-color: rgba(175, 42, 0, 0.52);
			color: white;
		}
		.lscxan:hover{
			{$lscxanbk}
		}
		{$lscxlist}
	</style>
</block>
<block name="content">
	<form class="layui-form">
		<blockquote class="layui-elem-quote">
			<!-- 排序所需要的两个字段 开始 -->
			<input type="hidden" name="field" value="id">
			<input type="hidden" name="order" value="desc">
			<!-- 排序所需要的两个字段 结束 -->
			<div class="layui-form-item">
				<div class="layui-inline">
					<div class="layui-input-inline" style="width: 180px;">
						<select name="bumen" lay-verify="">
							<option value="">部门</option>
							{$select_categorys}
						</select>
					</div>
					<div class="layui-input-inline" style="width: 180px;">
						<input type="text" name="shijian" placeholder="带看时间" class="layui-input" id="test1" readonly="readonly">
					</div>
					<div class="layui-input-inline" style="width: 240px;">
						<input type="text" name="sousuo" list="greetings" autocomplete="off" placeholder="请输入员工名、电话号码、房客源编号" class="layui-input" id="sousuo">
						<div id="greetings">
							<ul id="tcontent"></ul>
						</div>
					</div>
				</div>
				<button class="layui-btn k-search layui-btn-primary lscxan" lay-submit="" lay-filter="search" type="submit" id="submit_one">
					搜索
				</button>
				<button class="lscxan" style="display: none;" lay-submit="" lay-filter="search_hidden" type="button" id="submit_two">
					搜索
				</button>
				<button class="layui-btn layui-btn-primary lscxan" type="reset">
					重置
				</button>
				<a class="layui-btn pull-right layui-btn-primary lscxan" href="javascript:;" onClick="parent.removeIframe()">
					关闭
				</a>
				<a class="layui-btn pull-right layui-btn-primary lscxan" href="javascript:location.replace(location.href);" title="刷新">
					刷新
				</a>
			</div>
		</blockquote>
		<div class="more-search">
			<div class="layui-form-item"></div>
		</div>
	</form>
	<table id="table" lay-filter="table" class="layui-table" lay-data="{height:'full-100', url:'__ACTION__?is_ajax=1',limit:30,limits:[30,60,90],page:true, id:'table',request: {pageName: 'p'}}">
		<thead>
			<tr>
				<th lay-data="{field:'id',sort: 'true',hide: 'true'}">id</th>
				<th lay-data="{type:'numbers',align: 'center'}">序号</th>
				<th lay-data="{field:'kybh',align: 'center',templet: '#kybh',sort: 'true'}">客户编号</th>
				<th lay-data="{field:'kylx',align: 'center'}">客户类型</th>
				<th lay-data="{field:'kyxm',align: 'center'}">客户姓名</th>
				<th lay-data="{field:'ygmingcheng',align: 'center'}">带看人</th>
				<th lay-data="{field:'pkr',align: 'center'}">陪看人</th>
				<th lay-data="{field:'dkbm',align: 'center'}">带看部门</th>
				<th lay-data="{field:'fybh',align: 'center',templet: '#fybh',sort: 'true'}">带看房源</th>
				<th lay-data="{field:'kehupj',align: 'center'}">客户评价</th>
				<th lay-data="{field:'dkshijian',align: 'center',sort: 'true'}">带看时间</th>
			</tr>
		</thead>
	</table>
</block>
<block name="js">
	<script type="text/html" id="kybh">
		{{# if(d.rbacky == 1) { }}
			<a title="客源详情" data-href="{:U('Keyuan1/neirong1')}?xqbianhao={{d.xqbianhao}}" data-title="{{d.xqbianhao}}" href="javascript:;" onClick="parent.Hui_admin_tab(this)" style="text-decoration:none;color:red;">
		{{# } }}
		{{d.xqbianhao}}
		{{# if(d.rbacky == 1) { }}
			</a>
		{{# } }}
	</script>
	<script type="text/html" id="fybh">
		{{# if(d.rbacfy == 1) { }}
			<a title="房源详情" data-href="{{d.fyxqlj}}" data-title="{{d.bianhao}}" href="javascript:;" onClick="parent.Hui_admin_tab(this)" style="text-decoration:none;color:red;">
		{{# } }}
		{{d.bianhao}}
		{{# if(d.rbacfy == 1) { }}
			</a>
		{{# } }}
	</script>
	<script>
		var laydate = layui.laydate;
		laydate.render({
			elem: '#test1'
			,range: true
			,max: '{:date("Y-m-d",time())}'
		});
		$("#sousuo").keyup(function(){
			$("#greetings").show();
			var txt=$("#sousuo").val();
			if (txt!="") {
				$.ajax({
					url:'{:U('ajax/get_rsyonghu')}',
					type:"get",
					data:{'txt': txt,'node': 238},
					dataType:"json",
					success:function(data){
						var district = data.district;
						$("#tcontent li").remove();
						for(var i in district){
							var li=$("<li></li>");
							$(li).html(district[i]['ygmingcheng']);
							$("#tcontent").append(li);
						}
					}
				});
			}
		});
		$("#tcontent").on("click","li", function() {
			$("#greetings").show();
			var Uarry=$("#tcontent li");
			var count=$(this).index();//获取li的下标
			var Tresult=Uarry.eq(count).text();
			$("#sousuo").val(Tresult);
			$("#greetings").hide();
		})
		$("body").click(function(){
			$("#greetings").hide();
		});
	</script>
</block>