<div class="row rt-margin-bottom-before-box">
    <div class="col-sm-8">
        <div class="btn-group">
            <button class="btn btn-link" ng-disabled="false" ng-show="vm.privilege.IsWrite" ng-click='vm.actions.import({
                        Title:"应收数据",
                        ModuleName:"ArVoucherImport",
                        EntityName:"ar_voucher",
                        Columns:[
                            {ColumnName:"voucher_code",DisplayName:"应收单号*",IsRequired:true,IsKey:true},
                            {ColumnName:"voucher_date",DisplayName:"单据日期*",IsRequired:true,IsKey:false},
                            {ColumnName:"payment_date",DisplayName:"应收日期*",IsRequired:true,IsKey:false},
                            {ColumnName:"accountnumber",DisplayName:"客户编码*",IsRequired:true,IsKey:false},
                            {ColumnName:"accountid",DisplayName:"客户名称",IsRequired:false,IsKey:false},
                            {ColumnName:"product_code",DisplayName:"药品编码*",IsRequired:true,IsKey:true},
                            {ColumnName:"productid",DisplayName:"药品名称",IsRequired:false,IsKey:false},
                            {ColumnName:"ar_qty",DisplayName:"应收数量*",IsRequired:true,IsKey:false},
                            {ColumnName:"ar_amount",DisplayName:"应收金额*",IsRequired:true,IsKey:false},
                            {ColumnName:"OwnerId",DisplayName:"负责人*",IsRequired:true,IsKey:false},
                            {ColumnName:"ar_status",DisplayName:"应收状态*",IsRequired:true,IsKey:false},
                        ]
                    })'>
                <i class="fa fa-upload"></i> 导入
            </button>
            <button class="btn btn-link" ng-show="vm.privilege.IsExport" ng-click='vm.actions.export({
                    "voucher_code":"应收单号",
                    "voucherDate":"单据日期",
                    "paymentDate":"应收日期",
                    "accountnumber":"客户编码",
                    "accountidName":"客户名称",
                    "product_code":"药品编码",
                    "productidName":"药品名称",
                    "ar_qty":"应收数量",
                    "ar_amount":"应收金额",
                    "OwnerIdName":"负责人",
                    "ar_statusName":"应收状态"
                    },"ArVoucherExport","所有应收数据")'>
                <i class="fa fa-download"></i> 导出
            </button>
        </div>
    </div>
    <div class="col-sm-4">
        <form class="input-group">
            <input type="search" placeholder="输入单号或客户编码或名称快速搜索..." class="form-control" ng-model="vm.view.searchText" />
            <span class="input-group-btn" ng-click="vm.view.search(1)">
                <button type="submit" class="btn btn-default">
                    <i class="fa fa-search"></i>
                </button>
            </span>
        </form>
    </div>
</div>

<div class="box box-primary">
    <div class="box-header" style="cursor: move;">
        <div class="pull-left">
            <div class="btn-group">
                <button class="btn btn-default dropdown-toggle" id="dropdownMenuViewSelect" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    {{vm.view.selectedView.ViewName}}
                    <span class="caret"></span>
                </button>
                <ul class="dropdown-menu" aria-labelledby="dropdownMenuViewSelect">
                    <li ng-repeat="view in vm.view.list track by view.Id" ng-click="vm.view.select(view)">
                        <a href="javascript:void(0)">{{view.ViewName}}</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <div class="nav-tabs-custom">
        <div class="tab-content">
            <rt-data-grid rt-page-record-count="vm.page.recordCount"  rt-page-index="vm.page.index" rt-page-size="vm.page.size" rt-get-data="vm.view.search()" rt-sort-field="vm.view.sortField"
                rt-rows="vm.data" rt-selected-ids="vm.view.selectedIds" rt-auto-height="{{vm.view.autoHeight}}">
                <table class="table table-hover">
                    <thead>
                        <tr>
                            <th>
                                <rt-header-checkbox></rt-header-checkbox>
                            </th>
                            <!-- @@ 视图表头 -->
                            <th rt-field-code="voucher_code">应收单号</th>
                            <th rt-field-code="voucher_date">单据日期</th>
                            <th rt-field-code="payment_date">应收日期</th>
                            <th rt-field-code="accountnumber">客户编码</th>
                            <th rt-field-code="accountidName">客户名称</th>
                            <th rt-field-code="product_code">药品编码</th>
                            <th rt-field-code="productidName">药品名称</th>
                            <th rt-field-code="ar_qty">应收数量</th>
                            <th rt-field-code="ar_amount">应收金额</th>
                            <th rt-field-code="OwnerIdName">负责人</th>
                            <th rt-field-code="ar_statusName">应收状态</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr ng-repeat="row in vm.data track by row.Id">
                            <td>
                                <rt-data-checkbox value="{{row.Id}}" />
                            </td>
                            <!-- @@ 视图列表值 -->
                            <!--<td ng-if="vm.view.type=='default'">
                        <a id="{{row.Id}}" data-toggle="sidebar" data-target=".sidebar-right" ui-sref=".edit({id:row.Id})" ui-sref-opts="{location:true}">{{row.voucher_code}}</a>
                    </td>
                    <td ng-if="vm.view.type=='grid'">
                        <a href="javascript:;" ng-click="vm.actions.showForm(row.Id)"> </a>
                    </td>-->
                            <td>{{row.voucher_code}}</td>
                            <td>
                                {{row.voucher_date | date:'yyyy-MM-dd'}}
                            </td>
                            <td>
                                {{row.payment_date | date:'yyyy-MM-dd'}}
                            </td>
                            <td>
                                {{row.accountnumber}}
                            </td>
                            <td>
                                {{ row.accountid.Name}}
                            </td>
                            <td>
                                {{row.product_code}}
                            </td>
                            <td>
                                {{row.productid.Name}}
                            </td>
                            <td>
                                {{row.ar_qty}}
                            </td>
                            <td>
                                {{row.ar_amount | toFixNumber: 2}}
                            </td>
                            <td>
                                {{row.OwnerId.Name}}
                            </td>
                            <td>
                                {{row.ar_status.Name}}
                            </td>
                        </tr>
                    </tbody>
                </table>
            </rt-data-grid>
            <!-- rt-data-grid  -->
        </div>
    </div>
</div>

<div class="sidebar sidebar-right sidebar-animate rt-shadow-border-left content-wrapper" ng-if="vm.view.type=='default'">
    <div ui-view class="content"></div>
</div>
<!-- div[.editview] -->