<div ms-controller="PurchasePay">
    <table border="0" align="center" cellpadding="0" cellspacing="0" id="mian">
        <tbody>
            <tr>
                <td width="198" height="450" valign="top" id="tdleft">
                    <!--leftNav-->
                    <div id="left" ms-widget="leftMenu">
                    </div>
                    <!--End leftNav-->
                </td>
                <td valign="top" id="right">
                    <div class="top10">
                        <table border="0" align="center" cellpadding="0" cellspacing="0" class="seacrhTable" style="background: none; width: 100%;">
                            <tbody>
                                <tr>
                                    <td width="460" class="searchico">
                                        <div class="input-append" style="margin-bottom: 10px;">
                                            <input id="keyInput" type="text" class="span4" ms-duplex="queryData.keyword.val" placeholder="请输入供应商名称或采购单号" ms-keyup="onEnter">
                                            <button class="add-on ibtsearch" type="button" style="height: 28px; font-size: 12px; padding: 3px 12px;" ms-click="doSearch">搜索</button>
                                            <button class="add-on ibtsearch clearall" type="button" style="height: 28px; font-size: 12px; padding: 3px 12px;" ms-click="clearQuery">显示全部</button>
                                        </div>

                                    </td>
                                    <td class="fgray">{{lang.SearchHistory}}
                                   <span class="bindSearchHistory" ms-repeat-h='queryHistory'>
                                       <a href="javascript:void(0)" ms-click='addQuery(h.name,h.val,h.label)' ms-title='h.label'>{{h.label|truncate(10)}}</a>
                                   </span>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <table border="0" align="center" cellpadding="0" cellspacing="0" class="seacrhField" style="width: 100%;">
                            <tbody>
                                <tr class="quickword">
                                    <td colspan="2"><span>{{queryData.state.label}}</span>
                                        <div ms-each-r='queryData.state.items'>
                                            <a href="javascript:void(0)" ms-click='addQuery("state",r.val)' ms-class-1="selected:r.curr" ms-html='r.label'></a>
                                        </div>
                                    </td>
                                </tr>
                                <tr class="quickword">
                                    <td colspan="2"><span>{{queryData.dateTimes.label}}</span>
                                        <div ms-each-r='queryData.dateTimes.items'>
                                            <a href="javascript:void(0)" ms-click='addQuery("dateTimes",r.val)' ms-class-1="selected:r.curr" ms-html='r.label'></a>
                                        </div>
                                        <div ms-visible="queryData.dateTimes.val=='2'">
                                            <input type="text" style="width: 80px; height: 15px; margin-left: 10px;" ms-duplex="queryData.begindate.val" readonly="readonly" ms-widget="date,begindateid,begindateopts" id="txtbegindate" />
                                            <label style="margin-left: -15px;">至</label>
                                            <input type="text" style="width: 80px; height: 15px;" readonly="readonly" ms-duplex="queryData.enddate.val" ms-widget="date,enddateid,enddateopts" id="txtenddate" />

                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2" class="seabox">
                                        <span class="first" ms-html='lang.CurrSearchCondition'></span>
                                        <div style="display: inline; float: left;" ms-repeat="queryData">
                                            <span class="searchItem" ms-if-loop='$val.valLabel'>{{$val.valLabel}}
                                        <i><a href="javascript:void(0)" ms-click='removeQuery($key)'></a></i>
                                            </span>
                                        </div>
                                        <span class="last" ms-visible='hasQuery' ms-click='clearQuery'><a href="javascript:void(0)" ms-html='lang.ClearAll'></a></span>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tableList" id="tableList" style="margin-bottom: 10px;">
                        <tr class="head" style="background-color: rgba(0, 0, 0, 0);">
                            <td width="10%" align="center">采购单号</td>
                            <td width="10%" align="center">采购标题</td>
                            <td width="10%" align="center">采购日期</td>
                            <td width="10%" align="center">供应商</td>
                            <td width="10%" align="center">金额</td>
                            <td width="10%" align="center">已付金额</td>
                            <td width="10%" align="center">状态</td>
                            <td width="8%" align="center">操作</td>
                        </tr>
                        <tr ms-repeat-item="grid1.list" ms-class-old="$index % 2" ms-class-even="!($index % 2)" ms-hover="hover">
                            <td align="center"><a href="javascript:void(0);" ms-click="doFrom(item)">{{item.BillNo}}</a>
                            </td>
                            <td align="left"><a href="javascript:void(0);" ms-click="doFrom(item)">{{item.PurchaseOrderTag|truncate(30)}}</a>
                            </td>
                            <td align="center">{{item.ActionTime}}
                            </td>
                            <td align="left"><a href='javascript:void(0)' ms-live-click="doviews" ms-attr-path="'/Customer/DetailCustomer/'+item.SupplyId">{{item.SupplyName}}</a>
                            </td>
                            <td align="center">{{item.PayMoney}}
                            </td>
                            <td align="center">{{item.CurPayMoney}}
                            </td>
                            <td align="center">
                                <span ms-if="item.State==0">未付款</span>
                                <span ms-if="item.State==1">付款中</span>
                                <span ms-if="item.State==2">付款完毕</span>
                                <span ms-if="item.State==3">入库中</span>
                                <span ms-if="item.State==4">入库完毕</span>
                            </td>

                            <td align="center">
                                <a href="javascript:void(0);" class="doview" title="详细" ms-click="doview(item.Id)"></a>
                                <a href="javascript:void(0);" class="dopayment" title="付款" ms-click="doadd(item.Id)"></a>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="9" ms-widget='paging,PurchasePayPage,pagingops'></td>
                        </tr>
                    </table>
                </td>
            </tr>
        </tbody>
    </table>

    <!---支出单 查看--->
    <noscript id="receiptsViewTemplate2">
        <table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#D2D2D2" class="tablecInfo">
            <tr>
                <td>支出单号：</td>
                <td colspan="3">{{accounting.No}}
                </td>
            </tr>
            <tr>
                <td width="80">客户名称：</td>
                <td width="300">{{accounting.CustomerDisplay}}
                </td>
                <td width="80">客户电话：</td>
                <td>{{accounting.CustomerTel}}
                </td>
            </tr>
            <tr>
                <td>客户联系人：</td>
                <td>{{accounting.ContactsDisplay}}
                </td>
                <td>客户地址：</td>
                <td>{{accounting.CustomerAddr}}
                </td>
            </tr>
        </table>
        <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tableList hasOfferPanel">
            <tr class="minhead">
                <td align="center" width="20%">支出项目
                </td>
                <td align="center" width="8%">支出账户
                </td>
                <td align="center" width="5%">支出金额
                </td>
                <td align="center" width="40%">支出内容摘要
                </td>
            </tr>
            <tr ms-repeat-con="receiptDetailList" align="center" style="background-color: rgb(255, 255, 255);" ms-attr-index="$index">
                <td align="center">{{con.ProjectName}}
                </td>
                <td align="center">{{con.AccountDisplay}}
                </td>
                <td align="center">{{con.Amount}}
                </td>
                <td align="center">{{con.Remark}}
                </td>
            </tr>
            <tr ms-if="receiptDetailList.length == 0">
                <td colspan="4">抱歉！暂无支出明细数据。
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <table width="100%">
                        <tr>
                            <td>&nbsp;</td>
                            <td width="70">支出金额合计 </td>
                        </tr>
                    </table>
                </td>
                <td colspan="2">{{accounting.Amount}}元
                </td>
            </tr>
        </table>
        <table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#D2D2D2" class="tablecInfo">
            <tr>
                <td width="80">支出备注：</td>
                <td colspan="7">{{accounting.Remark}}
                </td>
            </tr>
            <tr>
                <td width="80">领款人：</td>
                <td>{{accounting.Receiptman}} 
                </td>
                <td width="80">领导审批：</td>
                <td>{{accounting.Examiner}} 
                </td>
                <td width="80">支出日期：</td>
                <td>{{accounting.Receiptdate}}
                </td>
                <td width="80">录入人：</td>
                <td>{{accounting.AddByName}}
                </td>
            </tr>
            <tr>
                <td>会计：</td>
                <td>{{accounting.Accounting}} 
                </td>
                <td>核准：</td>
                <td>{{accounting.Checker}} 
                </td>
                <td>出纳：</td>
                <td>{{accounting.Teller}}
                </td>
                <td>经手：</td>
                <td>{{accounting.Broker}}
                </td>
            </tr>
        </table>
    </noscript>
</div>


<!--查看-->
<noscript id="payviewTemplate">
    <table width="1000px" border="0" cellspacing="1" cellpadding="0" class="tableList">
        <tr class="minhead">
            <td align="center" width="10%">付款单号
            </td>
            <td align="center" width="10%">供应商
            </td>
            <td align="center" width="10%">付款日期
            </td>
            <td align="center" width="10%">付款金额
            </td>
            <td align="center" width="20%">备注
            </td>
            <td width="8%" align="center">操作</td>
        </tr>
        <tr ms-repeat-con="PurchasePayList" align="center" style="background-color: rgb(255, 255, 255);">
            <td align="center" style="font-weight: 100;">{{con.No}}
            </td>
            <td align="center" style="font-weight: 100;">{{con.CustomerDisplay}}
            </td>
            <td align="center" style="font-weight: 100;">{{con.Receiptdate}}
            </td>
            <td align="center" style="font-weight: 100;">{{con.Amount}}
            </td>
            <td align="center" style="font-weight: 100;">{{con.Remark}}
            </td>
            <td>
                <a href="javascript:void(0);" class="doview" title="详细" ms-click="view(con)"></a>
                <a href="javascript:void(0);" class="doedit" title="编辑" ms-click="doedit(con.Id)"></a>
                <a href="javascript:void(0);" class="dodel" ms-attr-index="$index" ms-click="dodel(con.Id)"></a>

            </td>
        </tr>
        <tr style="background-color: rgb(255, 255, 255);">
            <td colspan="3" align="right">合计&nbsp;
            </td>
            <td align="right" style="padding-right: 15px; font-weight: 100; color: red;">&nbsp;{{SumAmount}}(元)
            </td>
            <td align="right">&nbsp;
            </td>
            <td align="right">&nbsp;
            </td>
        </tr>
    </table>
</noscript>

