<extend name="Common/layui_list" />
<!-- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| 开单大师（专业的房产ERP管理系统）
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| © 2017-2022 淮南市银泰软件科技有限公司 All rights reserved
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| http://www.kaidandashi.com
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| 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;">
						<select name="genjinfs" >
							<option value="">跟进方式</option>
							<foreach name="genjinfs" item="pz">
								<option value="{$pz['lxid']}" >{$pz['lxming']}</option>
							</foreach>
						</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:'gjbm',align: 'center'}">部门</th>
				<th lay-data="{field:'gjfs',align: 'center'}">跟进方式</th>
				<th lay-data="{field:'gjneirong',align: 'center'}">跟进内容</th>
				<th lay-data="{field:'',align: 'center',templet: '#gjvoice'}">跟进语音</th>
				<th lay-data="{field:'gjshijian',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.bianhao}}" data-title="{{d.bianhao}}" href="javascript:;" onClick="parent.Hui_admin_tab(this)" style="text-decoration:none;color:red;">
		{{# } }}
		{{d.bianhao}}
		{{# if(d.rbacky == 1) { }}
			</a>
		{{# } }}
	</script>
	<script type="text/html" id="gjvoice">
		{{# if(d.gjvoice == 1) { }}
			<audio src="/Upload/Genjin/{{d.gongsiid}}/{{d.bianhao}}/{{d.id}}.mp3" controls>您的浏览器不支持audio标签</audio>
		{{# } else { }}
			暂无语音
		{{# } }}
	</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': 237},
					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>