{js:my97date}
<div class="breadcrumbs" id="breadcrumbs">
	<ul class="breadcrumb">
		<li>
			<i class="home-icon fa fa-home"></i>
			<a href="#">统计</a>
		</li>
		<li>
			<a href="#">商户数据统计</a>
		</li>
		<li class="active">已结算货款</li>
	</ul>
</div>

<div class="content">
	<table class="table list-table">
		<colgroup>
			<col width="120px" />
			<col />
			<col width="150px" />
			<col width="120px" />
			<col width="120px" />
			<col width="100px" />
			<col width="110px" />
		</colgroup>

		<caption>
			<form name="searchBill" action="{url:/}" method="get" class="form-inline">
				<input type='hidden' name='controller' value='market' />
				<input type='hidden' name='action' value='bill_list' />

				<div class="input-group">
					<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
		        	<input type="text" name='search[pay_time>=]' value='' class="form-control" pattern='date' onFocus="WdatePicker()" empty placeholder='起始时间' />
				</div>

				<div class="input-group">
					<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
		        	<input type="text" name='search[pay_time<=]' value='' class="form-control" pattern='date' onFocus="WdatePicker()" empty placeholder='终止时间' />
				</div>

				<select class="form-control" name="search[seller_id=]">
					<option value="">选择商家</option>
					{query:name=seller where=is_del eq 0}
					<option value="{$item['id']}">{$item['true_name']}</option>
					{/query}
				</select>

				<button class="btn btn-default" type="button" onclick="submitForm('bill_list');">
                    <i class="fa fa-search"></i> 搜索
                </button>
			</form>
		</caption>

		<thead>
			<tr>
				<th>付款单号</th>
				<th>商户</th>
				<th>结算时间</th>
				<th>结算金额</th>
				<th>结算方式</th>
				<th>操作人</th>
				<th>操作</th>
			</tr>
		</thead>

		<tbody>
            {foreach:items=$this->query->find()}
			<tr>
				<td>{$item['bill_no']}</td>
				<td>{$item['true_name']}</td>
				<td>{$item['pay_time']}</td>
				<td>{$item['amount']}</td>
				<td>{echo:payment::transferWay($item['way'])}</td>
				<td>{$item['admin_name']}</td>
				<td>
					<a href="{url:/market/order_goods_list/bill_id/$item['id']}" title="订单明细">
						<i class='operator fa fa-list'></i>
					</a>

					<a href="javascript:delModel({link:'{url:/market/bill_del/id/$item['id']}'})">
						<i class='operator fa fa-close'></i>
					</a>

					<a href="{url:/market/bill_report/id/$item['id']}" title="导出报表">
						<i class="operator fa fa-file-excel-o"></i>
					</a>
				</td>
			</tr>
			{/foreach}
		</tbody>
	</table>
</div>
{$this->query->getPageBar()}

<script type="text/javascript">
//表单回填
var searchData = {echo:JSON::encode(IReq::get('search'))};
for(var index in searchData)
{
	$('[name="search['+index+']"]').val(searchData[index]);
}

//修改表单提交内容
function submitForm(action)
{
	$('[name="action"]').val(action);
	formSubmit("searchBill");
}
</script>