<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">
<title>{echo admin_title()}</title>
<!--header-->
{template _:header}
</head>
<body>
<div class="layui-layout layui-layout-admin">
<!--top-->
{template _main_top}
<!--nav-->
{template _main_nav}
	<div class="position"><h1>门店列表</h1></div>
	<div class="layui-body admin-body">
		<div class="admin-content">
			<div class="searcher">
				<div class="right"><button type="button" class="layui-btn layui-add">添加门店</button></div>
				<form name="sch_form" id="sch_form" method="get" action="{echo \befen\get_url()}">
					<div class="layui-input-inline">
						<input type="text" name="store_name" id="store_name" class="layui-input" value="{echo input('param.store_name')}" placeholder="门店名称">
					</div>
					<div class="layui-input-inline layui-left-margin"><button type="submit" id="search" class="layui-btn">查询</button></div>
				</form>
				<div class="clear"></div>
			</div>
			<form name="theform" id="theform" method="post" action="{echo \befen\get_url()}">
			<table class="layui-table">
				<thead>
					<tr>
						<th>门店ID</th>
						<th>门店名称</th>
						<th>负责人姓名</th>
						<th>负责人电话</th>
						<th>状态</th>
						<th>管理操作</th>
					</tr>
				</thead>
				<tbody>
					<!--{loop $list $key $val}-->
					<tr id="">
						<td>{$val[store_id]}</td>
						<td>{$val[store_name]}</td>
						<td>{$val[per_name]}</td>
						<td>{$val[per_phone]}</td>
						<td class="op"><span class="layui-badge layui-bg-status-{$val[store_status]}">{echo model('Store')->getStatus()[$val[store_status]]}</span></td>
						<td class="op">
							<a op="detail" val="{$val[store_id]}" lay-url="{echo url('store/detail', ['store_id' => $val['store_id']])}" class="layui-btn layui-btn-xs layui-btn-normal">门店详情</a>
							<a op="person" href="{echo url('person/index', ['store_id' => $val['store_id']])}" class="layui-btn layui-btn-xs layui-btn-normal">店员列表</a>
							<a op="device" href="{echo url('device/index', ['store_id' => $val['store_id']])}" class="layui-btn layui-btn-xs layui-btn-normal">终端设备</a>
						</td>
					</tr>
					<!--{/loop}-->
				</tbody>
			</table>
			</form>
			<div class="listpages">{$pagenav}</div>
		</div>
	</div>
</div>
<!--footer-->
{template _:footer}
<script type="text/javascript">
$(".layui-add").click(function(){
	showWindow('添加门店', "{echo url('store/add')}", '550px');
});
$("a[op=detail]").click(function(){
	showWindow('门店详情', $(this).attr('lay-url'), '550px');
});
$("a[op=device]").click(function(){
	gotourl($(this).attr('lay-url'));
});
</script>
</body>
</html>