<div class="layui-fluid">
	<div class="layui-card">
		<div class="layui-form layui-form-pane layui-card-header layuiadmin-card-header-auto" lay-filter="LAY-demand-demandlist-search">
			<div class="layui-form-item">
				<input type="hidden" name="id" value="{$id}">
				<div class="layui-inline">
					<label class="layui-form-label">姓名</label>
					<div class="layui-input-block">
						<input type="text" name="realname" placeholder="请输入姓名" autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">电话</label>
					<div class="layui-input-block">
						<input type="text" name="mobile" placeholder="请输入电话" autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">身份证号</label>
					<div class="layui-input-block">
						<input type="text" name="idcard" placeholder="请输入身份证号" autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<button class="layui-btn" lay-submit lay-filter="LAY-demand-demandlist-btn">
						<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
					</button>
				</div>
			</div>
		</div>

		<div class="layui-card-body">
			<table id="LAY-demand-demandlist-table" lay-filter="LAY-demand-demandlist-table"></table>
		</div>
	</div>
</div>

<script>
	layui.config({
		base: '/static/echoui/' //静态资源所在路径
	}).extend({
		index: 'lib/index' //主入口模块
	}).use(['index', 'form', 'set', 'table'], function() {
		var $ = layui.$,
			setter = layui.setter,
			admin = layui.admin,
			form = layui.form,
			table = layui.table;

		form.render();

		table.render({
			elem: '#LAY-demand-demandlist-table',
			height: 'full-20',
			url: setter.baseWorkerUrl + 'demand/reportlog?id={$id}',
			cols: [
				[
					{ field: 'id', width: 80, title: '表ID', sort: true },
					{ field: 'realname', title: '姓名', width: 100 },
					{ field: 'mobile', title: '手机号', width: 120 },
					{ field: 'idcard', title: '身份证号', width: 180 },
					{ field: 'arrivetime', title: '预计到达时间', width: 150 },
					{ field: 'remark', title: '备注信息', width: 200 },
					{ field: 'createtime', title: '报备时间', width: 150 },
					{ field: 'agentid', title: '门店', minWidth: 100, toolbar: '<div>{{d.agent ? d.agent.title : ""}}</div>' },
					{ field: 'brokerid', title: '经纪人', minWidth: 100, toolbar: '<div>{{d.broker ? d.broker.title : ""}}</div>' },
				]
			],
			page: true,
			limit: 50,
			toolbar: true,
			cellMinWidth: 150,
			text: '对不起，加载出现异常！'
		});

		form.on('submit(LAY-demand-demandlist-btn)', function(data) {
			table.reload('LAY-demand-demandlist-table', {
				where: data.field,
				page: {
					curr: 1
				}
			});
		});


	});
</script>
