<extend name="Common/layui_list" />
<!-- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| 开单大师（专业的房产ERP管理系统）
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| © 2017-2022 淮南市银泰软件科技有限公司 All rights reserved
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| http://www.kaidandashi.com
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| 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;
		}
		.lscxan:hover{
			{$lscxanbk}
		}
		{$lscxlist}
	</style>
</block>
<block name="content">
	<form class="layui-form">
		<blockquote class="layui-elem-quote">
			<!-- 排序所需要的两个字段 开始 -->
			<input type="hidden" name="field">
			<input type="hidden" name="order">
			<!-- 排序所需要的两个字段 结束 -->
			<div class="layui-form-item">
				<div class="layui-inline">
					<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="type">
						<option value="">请选择</option>
						<option value="3" selected="">待审核</option>
						<option value="1">已通过</option>
						<option value="2">已驳回</option>
					</select>
				</div>
				<div class="layui-inline" style="width: 120px;">
					<select name="kplx">
						<option value="">请选择</option>
						<option value="1">开电话</option>
						<option value="2">开地址</option>
						<option value="3">开底价</option>
						<option value="4">开调取</option>
						<option value="5">开查看</option>
					</select>
				</div>
				<div class="layui-inline" style="width: 210px;">
					<input type="text" name="shijian" id="test1" autocomplete="off" class="layui-input" placeholder="申请时间" readonly="">
				</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()" style="text-decoration:none">
					关闭
				</a>
				<a class="layui-btn pull-right layui-btn-primary lscxan" href="javascript:location.replace(location.href);" title="刷新" style="text-decoration:none">
					刷新
				</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&type=3',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:'shzt',align: 'center'}">审核状态</th>
				<th lay-data="{field:'',align: 'center',templet: '#fybh'}">房源编号</th>
				<th lay-data="{field:'kprxx',align: 'center'}">开盘人</th>
				<th lay-data="{field:'kpcz',align: 'center'}">开盘类型</th>
				<th lay-data="{field:'yuanyin',align: 'center'}">开盘原因</th>
				<th lay-data="{field:'tjrxx',align: 'center'}">申请人</th>
				<th lay-data="{field:'addtime',align: 'center',sort: 'true'}">申请时间</th>
				<th lay-data="{field:'',align: 'center',fixed: 'right',width: 120,templet: '#btn',unresize: true}">操作</th>
			</tr>
		</thead>
	</table>
</block>
<block name="js">
	<script type="text/html" id="btn">
		{{# if(d.rbacsh == 1) { }}
			<a class="layui-btn layui-btn-xs layui-btn-primary" lay-event="kpsh">审核</a>
		{{# } }}
		{{# if(d.rbacrz == 1) { }}
			<a class="layui-btn layui-btn-xs layui-btn-primary" lay-event="kprz">日志</a>
		{{# } }}
	</script>
	<script type="text/html" id="fybh">
		{{# if(d.rbacfy == 1) { }}
			<a title="房源详情" data-href="{{d.fyxqlj}}" data-title="{{d.zybh}}" href="javascript:;" onClick="parent.Hui_admin_tab(this)" style="text-decoration:none;color:red;">
		{{# } }}
		{{d.zybh}}
		{{# if(d.rbacfy == 1) { }}
			</a>
		{{# } }}
	</script>
	<script>
		$(document).ready(function(){
			//监听工具条
			table.on('tool(table)', function(obj){ //注：tool是工具条事件名，test是table原始容器的属性 lay-filter="对应的值"
				var data = obj.data; //获得当前行数据
				var layEvent = obj.event; //获得 lay-event 对应的值（也可以是表头的 event 参数对应的值）
				var tr = obj.tr; //获得当前行 tr 的DOM对象
				if(layEvent === 'kpsh'){
					var id = data.id;
					k_open_leyer('开盘审核','{:U('kpshenhe')}?id='+id,'700','400')
				} else if(layEvent === 'kprz'){
					var id = data.id;
					k_open_leyer('开盘日志','{:U('kprizhi')}?id='+id+'&rzlx=2','700','300')
				}
			});
			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': 847},
						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>