$(function(){
    $("#temperinner").width(Math.ceil($("#score").val()/ 1000 * ($('#temper').width()))+ 'px');
});

var app = angular.module('myApp', ['myApp.services']);
app.controller('rulesController', function ($scope,$http){
    $scope.reportInfo=function () {

    };
    $scope.rulesQuery=function(){
        var num=0;
        if($scope.claimNo!=undefined&&$scope.claimNo!=null&&$scope.claimNo!=""){
            num=num+1;
        }
        if($scope.cappNo!=undefined&&$scope.cappNo!=null&&$scope.cappNo!=""){
            num=num+1;
        }
        if($scope.empNo!=undefined&&$scope.empNo!=null&&$scope.empNo!=""){
            num=num+1;
        }
        if(num<=0){
            layui.use('layer', function(){
                var layer = layui.layer;
                layer.open({
                    title: '信息'
                    ,content: '请填写至少一项查询条件！'
                });
            });
            return;
        }
        $http({
            method: 'post',
            url: '/icc-front/rulesreport/rules.do',
            params:{
                claimNo:$scope.claimNo,
                cappNo:$scope.cappNo,
                empNo:$scope.empNo
            }
        }).then(
            function successCallback(response) {
                if (response.data!=null) {
                    $scope.rulesList=response.data.list;
                    $scope.reportIndex=response.data.reportIndex;
                    if($scope.rulesList!=null&&$scope.rulesList.length>0){
                        $("#reportInfo").removeAttr("disabled");
                    }
                }
            }, function errorCallback(response) {
            }
        );
    };

    $scope.rulesReset=function(){
        $scope.claimNo="";
        $scope.cappNo="";
        $scope.empNo="";
    };


    $scope.reportInfoDetail=function(reportIndex){
        if(reportIndex==null&&reportIndex==undefined){
            layui.use('layer', function(){
                var layer = layui.layer;
                layer.open({
                    title: '异常信息'
                    ,content: '数据无对应的理赔分析报告！'
                });
            });
            return;
        }

        var uri = "/icc-front/LpReport/report.do?reportindex="+reportIndex;
        window.open(uri,"","");
    };


});




function hero()
{
    var herowidth=825;//改为你要的网页宽度
    var heroheight=2000;//改为你要的网页高度
    window.resizeTo(herowidth,heroheight);
}
$(window).resize(function() {
    $("#temperinner").width(Math.ceil($("#score").val()/ 1000 * ($('#temper').width()))+ 'px');
});