<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html ng-app="app">
<head>
    <title>历史委托查询-上海</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <link rel="stylesheet" href="../lib/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/bondrepurchase.css">
    <script src="../lib/jquery-1.11.3.min.js"></script>
    <script src="../lib/bootstrap/js/bootstrap.min.js"></script>
    <script src="../lib/My97DatePicker/WdatePicker.js"></script>
    <script src="../lib/angular/angular.js"></script>
    <script src="../lib/angular/angular-sanitize.js"></script>
    <script src="../lib/angular/angular-ui-router.js"></script>
    <!-- angularjs modules -->
    <script src="../_common/service_fcfg.js"></script>
    <script src="../_common/fy_client.js"></script>
    <script src="../_common/service_fql.js"></script>
    <script src="../_common/service_fql_exports.js"></script>
    <style type="text/css" media="print">
        .noprint{
            display: none;
        }
        @media print {
            html, body {
                height: inherit;
            }
            #query-table {
                height: inherit;
            }
            #queryTable {
                height: inherit !important;
            }
        }
    </style>
</head>

<body style="overflow:hidden" ng-cloak ng-controller="historyEntrust_sh.ctrl" ng-class="{'default': isDefault, 'white': isWhite}" oncontextmenu="return false" onselectstart="return false" ondragstart="return false" onbeforecopy="return false" oncopy=document.selection.empty() onselect=document.selection.empty()>
<!-- <body style="overflow:hidden" ng-cloak ng-controller="historyEntrust_sh.ctrl"> -->
    <div ng-show="isAsk" class="maskBox" ng-class="{'default-maskBox': isDefault, 'white-maskBox': isWhite}" id="maskBox">
        <div class="proBox"></div>
    </div>
    <!--表格上面条件行-->
    <div class="condition-box noprint">
        <!--按条件、输入查询-->
        <div class="table-top type-widthdraw-query">
            <div class="type">
                <span>买卖类别：</span>
                <div class="select">
                    <p class="select-con" ng-class="{'default-select-con': isDefault, 'white-select-con': isWhite}"></p>
                    <div class="can-select" ng-class="{'default-can-select': isDefault, 'white-can-select': isWhite}">
                        <p>全部</p>
                        <p>初始成交</p>
                        <p>到期续作</p>
                        <p>换券</p>
                        <p>提前终止(正)</p>
                        <p>提前终止(逆)</p>
                        <p>解除质押(正)</p>
                        <p>解除质押(逆)</p>
                    </div>
                </div>
            </div>
            <div class="query-date-section" ng-class="{'default-query-date': isDefault, 'white-query-date': isWhite}">
                <span>起始日期：</span>
                <input type="text" value="" class="Wdate datepicker startDate" id="startDate" onclick="WdatePicker({lang:'zh-cn',skin:'twoer',minDate:'#F{$dp.$D(\'endDate\',{M:-12,d:1})}',maxDate:'#F{$dp.$D(\'endDate\')}'})" />
                <span>结束日期：</span>
                <input type="text" class="Wdate datepicker endDate" id="endDate" onclick="WdatePicker({lang:'zh-cn',skin:'twoer',minDate:'#F{$dp.$D(\'startDate\')}',maxDate:'#F{$dp.$D(\'startDate\',{M:12,d:-1})}'})" value="" />
            </div>
            <div class="history-query-btn" ng-click="historyQuery()">查询</div>
        </div>
        <!--导出、打印-->
        <div class="export-print" ng-class="{'default-export-print': isDefault, 'white-export-print': isWhite}">
            <a id="dlink" style="display:none;"></a>
            <p class="export" data-title="导出" ng-click="tableToExcel('printTable', 'name', '历史委托查询')">
                <img src="img/export.png" alt="">
            </p>
            <p class="print" data-title="打印" onclick="window.print()">
                <img src="img/print.png" alt="">
            </p>
        </div>
    </div>
    <!--查询数据表格-->
    <div class="container query-table" id="query-table">
        <div class="table-responsive tableResponsive" ng-class="{'default-table-scroll': isDefault, 'white-table-scroll': isWhite}" id="queryTable" style="overflow: scroll;height: 100%;">
            <!--startprint-->
            <table class="table text-center" ng-class="{'default-table': isDefault, 'white-table': isWhite}" id="printTable" style="border-left: none;">
                <thead class="tableHeader">
                    <tr>
                        <th class="opera" ng-click="order('stkcode')">质押券代码</th>
                        <th ng-click="chineseOrder('stkname')">质押券简称</th>
                        <th ng-click="order('orderdate')">委托日期</th>
                        <th ng-click="order('ordersno')">委托序号</th>
                        <th ng-click="order('orderprice')">回购利率(%)</th>
                        <th ng-click="order('orderqty')">委托数量(张)</th>
                        <!--<th ng-click="order('reportqty')">申报数量(手)</th>-->
                        <th ng-click="order('matchqty')">成交数量(张)</th>
                        <th ng-click="order('cancelqty')">撤单数量(张)</th>
                        <th ng-click="order('tradefee')">交易费用(元)</th>
                        <th ng-click="order('orderfrzamt')">委托冻结金额(元)</th>
                        <th ng-click="order('clearamt')">清算金额(元)</th>
                        <th ng-click="chineseOrder('bsflagName')">买卖类别</th>
                        <th ng-click="order('lastqty')">券面总额(元)</th>
                        <th ng-click="order('pledgerate')">折算率(%)</th>
                        <th ng-click="order('matchamt')">成交金额(元)</th>
                        <th ng-click="order('ghintr')">购回利息(元)</th>
                        <th ng-click="order('endamt')">到期购回金额(元)</th>
                        <th ng-click="order('bb_matchdate')">回购成交日期</th>
                        <th ng-click="order('bb_matchid')">回购成交号</th>
                        <th ng-click="chineseOrder('cancelflagName')">撤单标识</th>
                        <th ng-click="chineseOrder('orderstatusName')">委托状态</th>
                        <th ng-click="chineseOrder('errmsg')">废单原因</th>
                    </tr>
                </thead>
                <tbody class="tableBody">
                    <tr ng-repeat="item in entrustList">
                        <td class="opera">{{item.stkcode}}</td>
                        <td>{{item.stkname}}</td>
                        <td>{{item.orderdate}}</td>
                        <td>{{item.ordersno}}</td>
                        <td>{{item.orderprice | number:4}}</td>
                        <td>{{item.orderqty}}</td>
                        <!--<td>{{item.reportqty}}</td>-->
                        <td>{{item.matchqty}}</td>
                        <td>{{item.cancelqty}}</td>
                        <td>{{item.tradefee | number:2}}</td>
                        <td>{{item.orderfrzamt | number:2}}</td>
                        <td>{{item.clearamt | number:2}}</td>
                        <td>{{item.bsflagName}}</td>
                        <td>{{item.lastqty}}</td>
                        <td>{{item.pledgerate | number:2}}</td>
                        <td>{{item.matchamt | number:2}}</td>
                        <td>{{item.ghintr | number:2}}</td>
                        <td>{{item.endamt | number:2}}</td>
                        <td>{{item.bb_matchdate}}</td>
                        <td>{{item.bb_matchid}}</td>
                        <td>{{item.cancelflag | withdrawFilter}}</td>
                        <td>{{item.orderstatus | entrustStatus}}</td>
                        <td>{{item.errmsg}}</td>
                    </tr>
                </tbody>
            </table>
            <!--endprint-->
        </div>
    </div>
    <!--查询数据条数-->
    <div class="table-bottom noprint">
        查询结果: 共[<span class="query-num">0</span>]笔记录
    </div>

    <date-picker></date-picker>

<script src="./controllers/bondrepurchase.js"></script>
<script src="./directives/directive.js"></script>
    <script>
        $(document).on("click",".start-time" ,function(e){
            var rowid = $(e.target).parents("tr").attr("rowid");;
            WdatePicker({
                el: e.target,
                autoPickDate: true,
                dateFmt:"yyyy-MM-dd HH:mm:ss",
                maxDate:'#F{$dp.$D(\'noticeendtime' + rowid + '\')}'
            });
        });
        //结束日期的点击事件
        $(document).on("click",".end-time" ,function(e){
            var rowid = $(e.target).parents("tr").attr("rowid");;
            WdatePicker({
                el: e.target,
                autoPickDate: true,
                dateFmt:"yyyy-MM-dd HH:mm:ss",
                minDate:'#F{$dp.$D(\'startTime' + rowid + '\')}'
            });
        });
        $(function () {
            //点击切换导出 打印
            var ep = $('.export-print p');
            ep.each(function(index){
                $(this).click(function(){
                    ep.eq(index).css({'background': '#1c85d0', 'color': '#fff'}).siblings().css({'background': '#178fe1', 'color': '#fff'});
                });
            });

            var tableCont = document.querySelector('#queryTable');
            function scrollHandle (){
                var scrollTop = this.scrollTop;
                this.querySelector('thead').style.transform = 'translateY(' + scrollTop + 'px)';
            }
            tableCont.addEventListener('scroll',scrollHandle);

            //下拉菜单
            // $('.select-con').text('全部');
            // var pTag = $('.can-select p');
            // pTag.each(function () {
            //     $(this).click(function () {
            //         $(this).css({'background':'#289df5', 'color': '#fff'}).siblings().css({'background':'#fff', 'color': '#000'});
            //         $('.select-con').text($(this).text());
            //         $('.can-select').slideUp(200);
            //     });
            // })
            // $('.can-select').hide();
            // $('.select-con').on('click', function() {
            //     var display = $('.can-select').css('display');
            //     if (display == 'none') {
            //         $('.can-select').slideDown(200);
            //     } else {
            //         $('.can-select').slideUp(200);
            //     }
            // });
            $("body").bind("click",function(evt){
                if ($('.can-select').css('display') == 'block' && evt.target != $('.select-con').get(0) && evt.target != $('.can-select').get(0)) {
                    $('.can-select').slideUp(200);
                }
            });
        });
    </script>

</body>
</html>
