<extend name="Common/layui_list" />
<!-- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| 房开源（综合房产ERP管理系统）
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| © 2019-2023 http://www.kaidandashi.com/ All rights reserved.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| 本系统由淮南市银泰软件科技有限公司提供技术支持
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| QQ号：984784483
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<block name="css">
	<style type="text/css">
		#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;
		}
	</style>
</block>
<block name="content">
	<form class="layui-form">
		<blockquote class="layui-elem-quote" style="padding: 5px;">
			<!-- 排序所需要的两个字段 开始 -->
			<input type="hidden" name="field">
			<input type="hidden" name="order">
			<!-- 排序所需要的两个字段 结束 -->
			<div class="layui-form-item" style="margin-top: 5px;">
				<div class="layui-inline" style="float: left;margin-left: 20px;">
					<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>
				<div class="layui-inline" style="width:120px;">
					<select name="kylx" lay-verify="">
						<option value="">客源类型</option>
						<option value="15">写字楼</option>
						<option value="16">商铺</option>
						<option value="2">住宅</option>
						<option value="17">新房</option>
						<option value="18">金融</option>
						<option value="19">装修</option>
						<option value="20">工商</option>
						<option value="21">会计</option>
						<option value="22">家具</option>
					</select>
				</div>
				<div class="layui-inline" style="width:150px;">
					<select name="bumen" id="bumen" lay-verify="">
						<option value="">部门</option>
						{$select_categorys}
					</select>
				</div>
				<div class="layui-inline" style="width: 150px;">
					<input type="text" name="shijian1" id="test1" autocomplete="off" class="layui-input" placeholder="开始日" readonly="">
				</div>
				<div class="layui-inline" style="width: 150px;">
					<input type="text" name="shijian2" id="test2" autocomplete="off" class="layui-input" placeholder="结束日" readonly="">
				</div>
				<button class="layui-btn k-search layui-btn-primary" lay-submit="" lay-filter="search" type="submit" id="submit_one">
					搜索
				</button>
				<button class="" style="display: none;" lay-submit="" lay-filter="search_hidden" type="button" id="submit_two">
					搜索
				</button>
				<button class="layui-btn layui-btn-primary" type="reset">
					重置
				</button>
				<a class="layui-btn pull-right layui-btn-primary" href="javascript:;" onClick="parent.removeIframe()" style="text-decoration:none">
					关闭
				</a>
				<a class="layui-btn pull-right layui-btn-primary" href="javascript:location.replace(location.href);" title="刷新" style="text-decoration:none">
					刷新
				</a>
			</div>
		</blockquote>
	</form>
	<table id="table" lay-filter="table" class="layui-table" lay-data="{height:'full-84', url:'__ACTION__?is_ajax=1',limit:30,limits:[30,60,90],page:true, id:'table',request: {pageName: 'p'}}" >
		<thead>
			<tr>
				<th lay-data="{type:'numbers',align: 'center'}">序号</th>
				<th lay-data="{field:'',align: 'center',templet: '#kybh'}">客户编号</th>
				<th lay-data="{field:'kylxmc',align: 'center'}">客户类型</th>
				<th lay-data="{field:'khxingming',align: 'center'}">客户姓名</th>
				<th lay-data="{field:'ygmingcheng',align: 'center'}">跟进人</th>
				<th lay-data="{field:'bumen',align: 'center'}">部门</th>
				<th lay-data="{field:'genjinfs',align: 'center'}">跟进方式</th>
				<th lay-data="{field:'gjneirong',align: 'center'}">跟进内容</th>
				<th lay-data="{field:'',align: 'center',templet: '#gjyy'}">跟进语音</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.rbacxq == 1) { }}
			<a title="客源详情" data-href="{{d.kyxqlj}}" data-title="{{d.kybh}}" href="javascript:;" onClick="parent.Hui_admin_tab(this)" style="text-decoration:none;color:red;">
		{{# } }}
		{{d.kybh}}
		{{# if(d.rbacxq == 1) { }}
			</a>
		{{# } }}
	</script>
	<script type="text/html" id="gjyy">
		{{# if(d.gjvoice == 1) { }}
			<audio id="audio{{d.id}}" src="/Upload/Genjin/10000/keyuan/{{d.kybh}}/gj{{d.id}}.mp3" controls style="width: 100px;">您的浏览器不支持audio标签</audio>
		{{# } else { }}
			暂无语音
		{{# } }}
	</script>
	<script>
		$(document).ready(function(){
			$(document).bind("contextmenu",function(e){
				return false;
			});
			var laydate = layui.laydate;
			laydate.render({
				elem: '#test1'
				,max: '{:date("Y-m-d",time())}'
			});
			laydate.render({
				elem: '#test2'
				,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>