{extend name="default/users/base" /}
{block name="title"}首页 - 用户中心 - {:WSTConf('CONF.shopName')}{__block__}{/block}
{block name="css"}
{/block}
{block name="content"}
<style>
.wst-addr{border:1px solid #eee;width:100%;margin-top:10px;}
.wst-addr tbody tr td{padding: 5px;}
.addr-title{width:80px;padding-left:5px;}
.invoices_box{margin:0px 48px;}
.edit{text-align: right;}
.edit a{border:1px solid #ccc;padding:6px 20px;}
.tips{margin-left:20px;}
</style>
<div class="wst-user-box">
  <div class="wst-user-info">
  <div class="wst-user-head">发票管理</div>
  </div>
  <input type="button" value="新增发票" class="wst-button wst-btn-default" style='margin-left:48px;' onclick="location.href=WST.U('home/invoices/toEdit')" /><span class='tips'>(最多新增20条发票记录)</span>
  <div id="invoices_box" class="invoices_box"></div>
</div>

        <script id="invoices" type="text/html">
            {{# for(var i = 0, len = d.length; i < len; i++){ }}
            <table class='wst-addr' >
               <tr>
                   <td class="addr-title">发票类型：</td>
                <td><p class="default" style="margin-left:0">{{d[i].invoiceType==0?'普票':'专票'}}</p></td>
              </tr>

               <tr><td class="addr-title">发票抬头：</td>
                 <td>{{d[i].invoiceHead}}</td>
               </tr>
               <tr><td class="addr-title">公司税号：</td>
                 <td>{{d[i].invoiceCode}}</td>
               </tr>
               {{#  if(d[i].invoiceType==1) { }}
               <tr><td class="addr-title">注册地址：</td>
                 <td>{{d[i].invoiceAddr}}</td>
               </tr>
               <tr><td class="addr-title">注册电话：</td>
                 <td>{{d[i].invoicePhoneNumber}}</td>
               </tr>
               <tr><td class="addr-title">开户银行：</td>
                 <td>{{d[i].invoiceBankName}}</td>
               </tr>
               <tr><td class="addr-title">银行账号：</td>
                 <td>{{d[i].invoiceBankNo}}</td>
               </tr>
               {{# }  }}

               <tr>
                 <td>&nbsp;</td>
                 <td class='edit' style='padding-bottom:10px;'>
                   <a href="javascript:delInvoice({{ d[i].id }},this)">删除</a>
                   <a href="javascript:editInvoice({{ d[i].id }})">编辑</a>
                   <div class="wst-clear"></div>
                 </td>
               </tr>
            </table>
            {{# } }}
           </script>
{/block}
{block name="js"}
<script type='text/javascript' src='__STYLE__/users/invoices/invoices.js?v={$v}'></script>
<script>
$(function(){
  listQuery();
});
</script>
{/block}
