{if $full_page}
{include file="pageheader.htm"}
{insert_scripts files="../js/utils.js,listtable.js"}
<!-- 订单搜索 -->
<div class="form-div">
  <form action="javascript:searchOrder()" name="searchForm">
    <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />    
    {$lang.order_sn}<input name="order_sn" type="text" id="order_sn" size="15">
    {$lang.consignee|escape}<input name="consignee" type="text" id="consignee" size="15">
	{if $supp_list}
	<select name="suppid" id="suppid">
      <option value="-1">{$lang.select_please}</option>
      {foreach from=$supp_list item=supp}
	  <option value='{$supp.supplier_id}' {if $supp.supplier_id == $smarty.request.suppid} checked {/if}>{$supp.supplier_name}</option>
	  {/foreach}
    </select>
	{/if}
    状态<select name="order_type" id="order_type"><option value="0"></option><option value="3">已完成</option><option value="2">未完成</option></select>
    <input type="submit" value="{$lang.button_search}" class="button" />
  </form>
</div>

<!-- 订单列表 -->
<form method="post" action="back.php?act=remove_back" name="listForm" onsubmit="return check()">
  <div class="list-div" id="listDiv">
{/if}

<table class="table table-bordered">  <tr>
  <th align=left><input onclick='listTable.selectAll(this, "back_id")' type="checkbox"/>{$lang.back_id}</th>
    <th><a href="javascript:listTable.sort('order_sn', 'DESC'); ">{$lang.order_sn}</a>{$sort_order_sn}</th>
	{if $supp_list}
	<th><a href="javascript:listTable.sort('supplier_name', 'DESC'); ">供货商家</a>{$sort_supplier_name}</th>
	{/if}
	<th >{$lang.back_goods_name}</th>
    <th><a href="javascript:listTable.sort('add_time', 'DESC'); ">{$lang.label_add_time}</a>{$sort_add_time}</th>
	<th>{$lang.back_money_1}</th>
	<th>{$lang.back_money_2}</th>
    <th><a href="javascript:listTable.sort('consignee', 'DESC'); ">{$lang.consignee}</a>{$sort_consignee}</th>
    <!--<th><a href="javascript:listTable.sort('update_time', 'DESC'); ">签收时间</a>{$sort_update_time}</th>-->
    <th>退换状态</th>
    <th>{$lang.back_username}</th>
    <th>{$lang.handler}</th>
  <tr>
  {foreach from=$back_list item=back key=dkey}
  <tr>
  <td><input type="checkbox" name="back_id[]" value="{$back.back_id}" />{$back.back_id}</td>
    <td>{$back.order_sn}</td>
	{if $supp_list}
	<td>{$back.supplier_name|escape:html}</td>
	{/if}
	<td >ID：{$back.goods_id}
	<br><a href="{$back.goods_url}" target="_blank">{$back.goods_name}</a>
	</td>
    <td align="center"  nowrap="nowrap">{$back.add_time}</td>
	<td>{$back.refund_money_1}</td>
	<td>{$back.refund_money_2}</td>
    <td align="right" > {$back.consignee|escape} {if $back.mobile}(手机：{$back.mobile}){elseif $back.tel}(电话：{$back.tel}){/if}<br>{$back.address}</td>
    <!--<td align="center" valign="top" nowrap="nowrap">{$back.update_time}</td>	-->
    <td align="center"  nowrap="nowrap">{$back.status_back_val}</td>
    <td align="center"  nowrap="nowrap">{$back.consignee}</td>
    <td align="center"   nowrap="nowrap">
     <a href="back.php?act=back_info&back_id={$back.back_id}">{$lang.detail}</a>
     <a onclick="{if(confirm('{$lang.confirm_delete}')){return true;}return false;}" href="back.php?act=remove_back&back_id={$back.back_id}">{$lang.remove}</a>
    </td>
  </tr>
  {/foreach}
</table>

<!-- 分页 -->
<table id="page-table" cellspacing="0">
  <tr>
    <td align="right" nowrap="true">
    {include file="page.htm"}
    </td>
  </tr>
</table>

{if $full_page}
  </div>
  <div>
    <input name="remove_back" type="submit" id="btnSubmit3" value="{$lang.remove}" class="button" disabled="true" onclick="{if(confirm('{$lang.confirm_delete}')){return true;}return false;}" />
  </div>
</form>
<script language="JavaScript">
listTable.recordCount = {$record_count};
listTable.pageCount = {$page_count};

{foreach from=$filter item=item key=key}
listTable.filter.{$key} = '{$item}';
{/foreach}
{literal}

    onload = function()
    {
        // 开始检查订单
        startCheckOrder();
                
        //
        listTable.query = "back_query";
    }

    /**
     * 搜索订单
     */
    function searchOrder()
    {
        listTable.filter['order_sn'] = Utils.trim(document.forms['searchForm'].elements['order_sn'].value);
        listTable.filter['consignee'] = Utils.trim(document.forms['searchForm'].elements['consignee'].value);
        //listTable.filter['delivery_sn'] = document.forms['searchForm'].elements['delivery_sn'].value;
		{if $supp_list}
		listTable.filter['suppid'] = document.forms['searchForm'].elements['suppid'].value;
		{/if}
		listTable.filter['order_type'] = document.forms['searchForm'].elements['order_type'].value;
		
		
        listTable.filter['page'] = 1;
        listTable.query = "back_query";
        listTable.loadList();
    }

    function check()
    {
      var snArray = new Array();
      var eles = document.forms['listForm'].elements;
      for (var i=0; i<eles.length; i++)
      {
        if (eles[i].tagName == 'INPUT' && eles[i].type == 'checkbox' && eles[i].checked && eles[i].value != 'on')
        {
          snArray.push(eles[i].value);
        }
      }
      if (snArray.length == 0)
      {
        return false;
      }
      else
      {
        eles['order_id'].value = snArray.toString();
        return true;
      }
    }
</script>
{/literal}

{include file="pagefooter.htm"}
{/if}