<extend name="Common/index" />
<!-- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| 房佳（专业的新房分销ERP管理系统）
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| © 2019 http://fj.ytsofts.cn/ All rights reserved.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| 本系统由淮南市银泰软件科技有限公司提供技术支持
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| QQ号：984784483
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<block name="css">
	<style type="text/css">
		.pagination {
			margin: 20px 0;
		}
		.pagination ul {
			display: inline-block;
			list-style:none;
			*display: inline;
			/* IE7 inline-block hack */
			*zoom: 1;
			margin-left: 0;
			margin-bottom: 0;
			-webkit-border-radius: 4px;
			-moz-border-radius: 4px;
			border-radius: 4px;
			-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
			-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
			box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
		}
		.pagination ul > li {
			display: inline;
		}
		.pagination ul > li > a,
		.pagination ul > li > span,
		.pagination #lastspan {
			float: left;
			padding: 4px 12px;
			line-height: 20px;
			text-decoration: none;
			background-color: #ffffff;
			border: 1px solid #dddddd;
			border-left-width: 0;
		}
		.pagination ul > li > a:hover,
		.pagination ul > li > a:focus,
		.pagination ul > .active > a,
		.pagination ul > .active > span {
			background-color: #f5f5f5;
		}
		.pagination ul > .active > a,
		.pagination ul > .active > span {
				color: #999999;
				cursor: default;
		}
		.pagination ul > .disabled > span,
		.pagination ul > .disabled > a,
		.pagination ul > .disabled > a:hover,
		.pagination ul > .disabled > a:focus {
			color: #999999;
			background-color: transparent;
			cursor: default;
		}
		.pagination ul > li:first-child > a,
		.pagination ul > li:first-child > span {
			border-left-width: 1px;
			-webkit-border-top-left-radius: 4px;
			-moz-border-radius-topleft: 4px;
			border-top-left-radius: 4px;
			-webkit-border-bottom-left-radius: 4px;
			-moz-border-radius-bottomleft: 4px;
			border-bottom-left-radius: 4px;
		}
		.pagination ul > li:last-child > a,
		.pagination ul > li:last-child > span,
		.pagination #lastspan {
			-webkit-border-top-right-radius: 4px;
			-moz-border-radius-topright: 4px;
			border-top-right-radius: 4px;
			-webkit-border-bottom-right-radius: 4px;
			-moz-border-radius-bottomright: 4px;
			border-bottom-right-radius: 4px;
		}
		.pagination-centered {
			text-align: center;
		}
		.pagination-right {
			text-align: right;
		}
		.pagination-large ul > li > a,
		.pagination-large ul > li > span,
		.pagination-large #lastspan{
			padding: 11px 19px;
			font-size: 17.5px;
		}
		.pagination-large ul > li:first-child > a,
		.pagination-large ul > li:first-child > span {
			-webkit-border-top-left-radius: 6px;
			-moz-border-radius-topleft: 6px;
			border-top-left-radius: 6px;
			-webkit-border-bottom-left-radius: 6px;
			-moz-border-radius-bottomleft: 6px;
			border-bottom-left-radius: 6px;
		}
		.pagination-large ul > li:last-child > a,
		.pagination-large ul > li:last-child > span,
		.pagination-large #lastspan {
			-webkit-border-top-right-radius: 6px;
			-moz-border-radius-topright: 6px;
			border-top-right-radius: 6px;
			-webkit-border-bottom-right-radius: 6px;
			-moz-border-radius-bottomright: 6px;
			border-bottom-right-radius: 6px;
		}
		.pagination-mini ul > li:first-child > a,
		.pagination-small ul > li:first-child > a,
		.pagination-mini ul > li:first-child > span,
		.pagination-small ul > li:first-child > span {
			-webkit-border-top-left-radius: 3px;
			-moz-border-radius-topleft: 3px;
			border-top-left-radius: 3px;
			-webkit-border-bottom-left-radius: 3px;
			-moz-border-radius-bottomleft: 3px;
			border-bottom-left-radius: 3px;
		}
		.pagination-mini ul > li:last-child > a,
		.pagination-small ul > li:last-child > a,
		.pagination-mini ul > li:last-child > span,
		.pagination-small ul > li:last-child > span {
			-webkit-border-top-right-radius: 3px;
			-moz-border-radius-topright: 3px;
			border-top-right-radius: 3px;
			-webkit-border-bottom-right-radius: 3px;
			-moz-border-radius-bottomright: 3px;
			border-bottom-right-radius: 3px;
		}
		.pagination-small ul > li > a,
		.pagination-small ul > li > span {
			padding: 2px 10px;
			font-size: 11.9px;
		}
		.pagination-mini ul > li > a,
		.pagination-mini ul > li > span {
			padding: 0 6px;
			font-size: 10.5px;
		}
		.layui-form-item{
			margin-bottom: 0;
		}
		#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>
	<link rel="stylesheet" href="__PUBLIC__/lib/layui1/css/layui.css" media="all">
</block>
<block name="content">
	<div class="page-container">
		<table id="table" class="table table-border table-bordered table-hover table-bg">
			<thead>
				<tr>
					<th scope="col" colspan="12">
						<form class="layui-form" action="{:U('keyuan1/kygenjin')}" method="get" id="form">
							<div class="layui-form-item" style="margin: 0px;">
								<div class="layui-input-inline" style="width: 180px;">
									<select name="bumen" id="bumen" lay-verify="">
										<option value="">部门</option>
										{$select_categorys}
									</select>
								</div>
								<div class="layui-input-inline" style="width: 150px;">
									<input type="text" name="shijian1" id="test1" autocomplete="off" class="layui-input" placeholder="开始日">
								</div>
								<div class="layui-input-inline" style="width: 150px;">
									<input type="text" name="shijian2" id="test2" autocomplete="off" class="layui-input" placeholder="结束日">
								</div>
								<div class="layui-input-inline" style="width: 240px;">
									<input type="text" name="sousuo" list="greetings" autocomplete="off" placeholder="请输入员工名、电话号码、客户编号" class="layui-input" id="sousuo" value="{$_GET['sousuo']}">
									<div id="greetings">
										<ul id="tcontent"></ul>
									</div>
								</div>
								<button class="layui-btn layui-btn-radius" lay-submit="" lay-filter="demo1" style="background: darkslateblue;">
									<i class="Hui-iconfont">&#xe665;</i> 查找
								</button>
								<button type="reset" class="layui-btn layui-btn-radius layui-btn-primary">
									<i class="Hui-iconfont">&#xe72a;</i> 重置
								</button>
								<span style="float: right;">
									<a class="layui-btn layui-btn-radius layui-btn-primary" href="{:U('keyuan1/kygenjin')}" title="刷新" style="text-decoration:none">
										<i class="Hui-iconfont">&#xe68f;</i> 刷新
									</a>
									<a class="layui-btn layui-btn-radius layui-btn-primary" href="javascript:;" onclick="parent.removeIframe()" style="text-decoration:none">
										<i class="Hui-iconfont">&#xe706;</i> 关闭
									</a>
								</span>
							</div>
						</form>
					</th>
				</tr>
				<tr class="text-c">
					<th>序号</th>
					<th>客户编号</th>
					<th>客户姓名</th>
					<th>回访人</th>
					<th>部门</th>
					<th>回访方式</th>
					<th>回访内容</th>
					<th>回访时间</th>
					<th>录入时间</th>
					<th>查看图片</th>
				</tr>
			</thead>
			<tbody id="tbody">
				<volist name="genjin" id="gj">
					<tr class="text-c">
						<td>{$i+$firstRow}</td>
						<td>
							<?php
								$kys=M('fzky')->where(array('kyid'=>$gj['kyid']))->field('weihurenid')->select();
								foreach ($kys as $key => $value) {
									$is_rbac1 = _rbac_btn_show(75,0,$value['weihurenid']);
									if ($is_rbac1) {
										$kyxq=1;
										$kywhr=$value['weihurenid'];
									}
								}
								if (!$kyxq) {
									$whrid=M('keyuan')->where(array('xqbianhao'=>$gj['kybh']))->getField('weihurenid');
									$is_rbac2 = _rbac_btn_show(75,0,$whrid);
									if ($is_rbac2) {
										$kyxq=1;
									}
								}
							?>
							<if condition="$kyxq eq 1">
								<a title="客源详情" data-href="{:U('Keyuan1/neirong1',array('id'=>$gj['kyid'],'kywhr'=>$kywhr))}" data-title="<if condition='$gj.kybh'>{$gj.kybh}</if>" href="javascript:;" style="text-decoration:none;color:red;" onclick="Hui_admin_tab(this);">
									{$gj['kybh']}
								</a>
								<else/>
								{$gj['kybh']}
							</if>
						</td>
						<td>
							{$gj['khxingming']}
						</td>
						<td>
							{$gj['ygmingcheng']}
						</td>
						<td>
							{:bumen($gj['bumen'])}
						</td>
						<td>
							<?php echo get_peizhi("genjinfs",$gj['genjinfs']); ?>
						</td>
						<td>
							{$gj['gjneirong']}
						</td>
						<td>
							{$gj['gjshijian']|date='Y-m-d H:i',###}
						</td>
						<td>
							{$gj['time']|date='Y-m-d H:i',###}
						</td>
						<td>
							<if condition="_rbac_node_show(852)">
								<a class="layui-btn layui-btn-xs" title="客户回访图片" href="javascript:;" onclick="layer_show('客户回访图片','{:U('ajax/ckkhhftp',array('kyhf'=>$gj['id']))}','960','480')" style="text-decoration:none;background: yellowgreen;">
									<i class="Hui-iconfont">&#xe720;</i> 图片
								</a>
							</if>
						</td>
					</tr>
				</volist>
			</tbody>
		</table>
		<div style="line-height:50PX;">&nbsp;</div>
		<div class="pagination" style="width:100%;height:30px;margin:0 auto;background:#fff;position:fixed;bottom:0;text-align:center;">
			{$page}
		</div>
	</div>
</block>
<block name="js">
	<script src="__PUBLIC__/lib/layui1/layui.js" charset="utf-8"></script>
	<script type="text/javascript">
		layui.use(['form', 'layedit', 'laydate'], function(){
			var form = layui.form
			,layer = layui.layer
			,layedit = layui.layedit
			,laydate = layui.laydate;
			laydate.render({
				elem: '#test1'
				,value: '{$_GET["shijian1"]}'
			});
			laydate.render({
				elem: '#test2'
				,value: '{$_GET["shijian2"]}'
			});
			$("#sousuo").keyup(function(){
				$("#greetings").show();
				var txt=$("#sousuo").val();
				if (txt!="") {
					$.ajax({
						url:'{:U('ajax/get_rsyonghu')}',
						type:"get",
						data:"txt="+txt,
						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>