{js:my97date}
<article class="module width_full">
	<header>
		<h3 class="tabs_involved">订单列表</h3>
		<ul class="tabs">
			<li><input type="button" class="alt_btn" onclick="filterResult();" value="检索" /></li>
			<li><input type="button" class="alt_btn" onclick="window.open('{url:/seller/order_report/?$searchParam}')" value="导出Excel" /></li>
		</ul>
	</header>

	<table class="tablesorter" cellspacing="0">
		<colgroup>
			<col width="145px" />
			<col width="85px" />
			<col width="115px" />
			<col width="105px" />
			<col width="105px" />
			<col width="105px" />
			<col width="155px" />
			<col width="75px" />
			<col />
		</colgroup>

		<thead>
			<tr>
				<th>订单号</th>
				<th>收货人</th>
				<th>联系电话</th>
				<th>配送状态</th>
				<th>支付状态</th>
				<th>订单状态</th>
				<th>下单时间</th>
				<th>打印</th>
				<th>操作</th>
			</tr>
		</thead>

		<tbody>
			{foreach:items = $this->orderHandle->find()}
			<tr>
				<td title="{$item['order_no']}" name="orderStatusColor{$item['status']}"><a href="{url:/seller/order_show/id/$item[id]}">{$item['order_no']}</a></td>
				<td title="{$item['accept_name']}">{$item['accept_name']}</td>
				<td title="{$item['mobile']}">{$item['mobile']}</td>
				<td name="disStatusColor{$item['distribution_status']}">{echo:Order_class::getOrderDistributionStatusText($item)}</span></td>
				<td name="payStatusColor{$item['pay_status']}">
					{if:$item['pay_type']==0}货到付款{/if}
					&nbsp;&nbsp;
					{echo:Order_class::getOrderPayStatusText($item)}
				</td>
				<td>{echo:order_class::orderStatusText(order_class::getOrderStatus($item))}</td>
				<td title="{$item['create_time']}">{$item['create_time']}</td>
				<td>
					<span class="prt" title="购物清单打印" onclick="window.open('{url:/order/shop_template/id/$item[id]/seller_id/$seller_id}');">购</span>
					<span class="prt" title="配货单打印" onclick="window.open('{url:/order/pick_template/id/$item[id]/seller_id/$seller_id}');">配</span>
					<span class="prt" title="联合打印" onclick="window.open('{url:/order/merge_template/id/$item[id]/seller_id/$seller_id}');">合</span>
					<span class="prt" title="快递单打印" onclick="window.open('{url:/order/expresswaybill_template/id/$item[id]/seller_id/$seller_id}');">递</span>
				</td>
				<td>
					<a href="{if:Order_class::isGoDelivery($item)}{url:/seller/order_deliver/id/$item[id]}{else:}javascript:alert('订单不满足发货条件，请检查订单状态');{/if}"><img class="operator" src="{skin:images/main/icn_jump_back.png}" title="立即发货" alt="立即发货" /></a>
					<a href="{url:/seller/order_show/id/$item[id]}"><img title="订单详情" alt="订单详情" src="{skin:images/main/icn_settings.png}" /></a>
				</td>
			</tr>
		   {/foreach}
		</tbody>
	</table>
	{$this->orderHandle->getPageBar()}
</article>

<script type="text/html" id="orderTemplate">
<form action="{url:/}" method="get" name="filterForm">
	<input type='hidden' name='controller' value='seller' />
	<input type='hidden' name='action' value='order_list' />
	<div class="module_content">
		<fieldset>
			<label>订单号</label>
			<input name="search[order_no]" value="" type="text" />

			<label>收货人</label>
			<input name="search[accept_name]" value="" type="text" />

			<label>选择支付状态</label>
			<select name="search[pay_status]">
				<option value="">全部</option>
				<option value="0">未支付</option>
				<option value="1">已支付</option>
			</select>

			<label>选择发货状态</label>
			<select name="search[distribution_status]">
				<option value="">全部</option>
				<option value="0">未发货</option>
				<option value="1">已发货</option>
				<option value="2">部分发货</option>
			</select>

			<label>订单状态</label>
			<select name="search[status]">
				<option value="">全部</option>
				<option value="1">新订单</option>
				<option value="2">确认订单</option>
				<option value="3">取消订单</option>
				<option value="4">作废订单</option>
				<option value="5">完成订单</option>
				<option value="6">退款</option>
				<option value="7">部分退款</option>
			</select>

			<label>订单总额</label>
			<div class="box">
				<input name="search[order_amount_start]" value="" type="text" class="small" /> ——
				<input name="search[order_amount_end]" value="" type="text" class="small" />
			</div>

			<label>下单时间</label>
			<div class="box">
				<input name="search[create_time_start]" value="" type="text" class="small" onfocus="WdatePicker()" /> ——
				<input name="search[create_time_end]" value="" type="text" class="small" onfocus="WdatePicker()" />
			</div>

			<label>发货时间</label>
			<div class="box">
				<input name="search[send_time_start]" value="" type="text" class="small" onfocus="WdatePicker()" /> ——
				<input name="search[send_time_end]" value="" type="text" class="small" onfocus="WdatePicker()" />
			</div>

			<label>完成时间</label>
			<div class="box">
				<input name="search[completion_time_start]" value="" type="text" class="small" onfocus="WdatePicker()" /> ——
				<input name="search[completion_time_end]" value="" type="text" class="small" onfocus="WdatePicker()" />
			</div>
		</fieldset>
    </div>
</form>
</script>
<script type='text/javascript'>

//检索商品
function filterResult()
{
	var ordersHeadHtml = template.render('orderTemplate');
	art.dialog(
	{
		"init":function()
		{
			var filterPost = {echo:JSON::encode(IReq::get('search'))};
			var formObj = new Form('filterForm');
			for(var index in filterPost)
			{
				formObj.setValue("search["+index+"]",filterPost[index]);
			}
		},
		"title":"检索条件",
		"content":ordersHeadHtml,
		"okVal":"立即检索",
		"ok":function(iframeWin, topWin)
		{
			iframeWin.document.forms[0].submit();
		}
	});
}

//DOM加载结束
$(function(){
	//高亮色彩
	$('[name="payStatusColor1"]').addClass('green');
	$('[name="disStatusColor1"]').addClass('green');
	$('[name="orderStatusColor3"]').addClass('red');
	$('[name="orderStatusColor4"]').addClass('red');
	$('[name="orderStatusColor5"]').addClass('green');
});
</script>