function pagenationForListreport($scope, $http,$Popupbox,date1time,date2time) {
    var date1=$("#date1").val();
    var date2=$("#date2").val();
    $http({
        method: 'post',
        url: '/icc-front/compass/list.do',
        params: {
            branchName: $scope.branchName1,
            policyNo: $scope.policyNumber1,
            channel: $scope.channel1,
            policyHolder: $scope.policyHolder1,
            claimNo: $scope.claimNo1,
            IdNnumber: $scope.IdNnumber1,
            score1:(($scope.score1==undefined||$scope.score1=="")?"0":$scope.score1),
            score2:(($scope.score2==undefined||$scope.score2=="")?"0":$scope.score2),
            date1:(date1==""?"":formatDate(date1time,1)),
            date2:(date2==""?"":formatDate(date2time,1)),
            beginpage:0,
            endpage:30
        }
    }).then(function successCallback(response) {
            if (response.data.records.length == 0) {
                $Popupbox.show("没有查询到相关数据！");
            }else{
                $scope.items=response.data.records;
                $scope.total=response.data.total;
                //初始化第一页数据
                $scope.pageSize = 30;
                $scope.pages = Math.ceil(response.data.total/ $scope.pageSize); //分页数
                //分页总数
                $scope.newPages = $scope.pages > 5 ? 5 : $scope.pages;
                $scope.pageList = [];
                $scope.selPage = 1;
                //分页要repeat的数组
                for (var i = 0; i < $scope.newPages; i++) {
                    $scope.pageList.push(i + 1);
                }
            }
        },
        function errorCallback(response) {
        });

//设置表格数据源(分页)
    $scope.setData = function () {
        $http({
            method: 'post',
            url: '/icc-front/compass/list.do',
            params: {
                branchName: $scope.branchName1,
                policyNo: $scope.policyNumber1,
                channel: $scope.channel1,
                policyHolder: $scope.policyHolder1,
                claimNo: $scope.claimNo1,
                IdNnumber: $scope.IdNnumber1,
                score1:(($scope.score1==undefined||$scope.score1=="")?"0":$scope.score1),
                score2:(($scope.score2==undefined||$scope.score2=="")?"0":$scope.score2),
                date1:(date1==""?"":formatDate(date1time,1)),
                date2:(date2==""?"":formatDate(date2time,1)), beginpage:$scope.pageSize * ($scope.selPage - 1),
                endpage:$scope.selPage * $scope.pageSize,
                /* total:$scope.total*/
            }
        }).then(function successCallback(response) {
                if (response.data.records.length == 0) {
                    $Popupbox.show("没有查询到相关数据！");
                }else {
                    $scope.filename = response.data.filename;
                    $scope.items = response.data.records;
                    /* $scope.pages = Math.ceil(response.data.total.length / $scope.pageSize); //分页数*/
                }
            },
            function errorCallback(response) {
            });
        // $scope.items = $scope.data.slice(($scope.pageSize * ($scope.selPage - 1)), ($scope.selPage * $scope.pageSize));//通过当前页数筛选出表格当前显示数据
    }
    /* $scope.items = $scope.data.slice(0, $scope.pageSize);*/

//打印当前选中页索引
    $scope.selectPage = function (page) {
//不能小于1大于最大
        if (page < 1 || page > $scope.pages) return;
//最多显示分页数5
        if (page > 2) {
//因为只显示5个页数，大于2页开始分页转换
            var newpageList = [];
            for (var i = (page - 3); i < ((page + 2) > $scope.pages ? $scope.pages : (page + 2)); i++) {
                newpageList.push(i + 1);
            }
            $scope.pageList = newpageList;
        }
        $scope.selPage = page;
        $scope.setData();
        $scope.isActivePage(page);
        console.log("选择的页：" + page);
    };
//设置当前选中页样式
    $scope.isActivePage = function (page) {
        return $scope.selPage == page;
    };
//上一页
    $scope.Previous = function () {
        $scope.selectPage($scope.selPage - 1);
    }
//下一页
    $scope.Next = function () {
        $scope.selectPage($scope.selPage + 1);
    };
}
