'use strict';
// 担保对照
var a = 0;
var page = 0;
var gro = "";
define([ 'app', 'appModule' ],function(app){
// 弹出层自适应居中
$(function() {
$(".modal-body").height($(window).height() - 360);
// 当文档窗口发生改变时 触发
$(window).resize(function() {
$(".modal-body").height($(window).height() - 360);
});
$(this).on('show.bs.modal', function() {
$('body').addClass('modal-open');
});
$(this).on('hide.bs.modal', function() {
$('body').removeClass('modal-open');
});
});
app.register.controller('focuscollCtrl',['$rootScope','$scope','$cookies','coreUrl','lodinDataService','lodinDatadService','$http',function($rootScope,$scope, $cookies, coreUrl,lodinDataService, lodinDatadService,$http) {
if (lodinDatadService.getObject('lodinDatad') == 0) {
$scope.LoginList = lodinDataService.getObject('lodinData');
}
if (lodinDataService.getObject('lodinData') == 0) {
$scope.LoginList = lodinDatadService.getObject('lodinDatad');
}
$rootScope.parentCru = lodinDataService.get('parentCru');
$rootScope.childCru = lodinDataService.get('childCru');
$rootScope.userId = $scope.LoginList.userId;
$rootScope.branchId = $scope.LoginList.branchId;
$scope.data = lodinDatadService.getObject('branchData');
//新增机构-弹出框显示隐藏
$scope.get_tree = function(){
if($scope.data){
$scope.tree($scope.data.row);
}
};
$scope.tree = function(data){
$('#trees').on("changed.jstree", function(e, data) {
if(data.selected.length) {
$scope.id = data.instance.get_node(data.selected[0]).id;
$scope.text = data.instance.get_node(data.selected[0]).text;
} //输出点击的内容
}).jstree({
'core': {
'data': data
}
}); //动态生成tree菜单
};
$scope.getBranchName = function(){
if($scope.text == undefined || $scope.text == ""){
alert("温馨提示!", '请选择机构!', function () {
}, {type: 'warning',showConfirmButton:true});
}else{
$scope.branchId_collection = $scope.id;
$scope.branchName_collection = $scope.text;
}
};
//查询--选择机构--取消
$scope.getBranchName_dismiss = function(){
$('#myModal_add4').modal('hide');
};
//获取报表种类
var CoreUrl = new coreUrl({
"transCode" : "B000704",
"bizTypeCode" : "LOAN_PRESS_TYPE"
});
CoreUrl.$save(function(objc){
$scope.actualChannelList = objc.rows;
});
//查询
$scope.QueryMessagePress= function(){
var href_Base = "jasperreport/reportFocusCollHtml?";
$scope.startDate = document.getElementById('LAY_demorange_s').value;
$scope.endDate = document.getElementById('LAY_demorange_e').value;
if($scope.branchName_collection != undefined && $scope.startDate.length>0 && $scope.endDate.length>0){
href_Base += "groupId=";
href_Base += $scope.branchId_collection;
href_Base += "&groupName=";
href_Base += $scope.branchName_collection;
href_Base += "&startDate=";
var sDate = $scope.startDate;
sDate = sDate.replace(/-/, "年");
sDate = sDate.replace(/-/, "月");
sDate += "日";
href_Base += sDate;
href_Base += "&endDate=";
var eDate = $scope.endDate;
eDate = eDate.replace(/-/, "年");
eDate = eDate.replace(/-/, "月");
eDate += "日";
href_Base += eDate;
$scope.href_Base = href_Base;
window.subFrame.location.href = $scope.href_Base;
}else{
alert("温馨提示!", '请输入查询条件', function () {}, {type: 'warning',showConfirmButton:true});
}
};
//导出
$scope.QueryMessageXls= function(){
var href_Base = "jasperreport/reportFocusCollXls?";
$scope.startDate = document.getElementById('LAY_demorange_s').value;
$scope.endDate = document.getElementById('LAY_demorange_e').value;
if($scope.branchName_collection != undefined && $scope.startDate.length>0 && $scope.endDate.length>0){
href_Base += "groupId=";
href_Base += $scope.branchId_collection;
href_Base += "&groupName=";
href_Base += $scope.branchName_collection;
href_Base += "&startDate=";
var sDate = $scope.startDate;
sDate = sDate.replace(/-/, "年");
sDate = sDate.replace(/-/, "月");
sDate += "日";
href_Base += sDate;
href_Base += "&endDate=";
var eDate = $scope.endDate;
eDate = eDate.replace(/-/, "年");
eDate = eDate.replace(/-/, "月");
eDate += "日";
href_Base += eDate;
$scope.href_Base = href_Base;
window.subFrame.location.href = $scope.href_Base;
}else{
alert("温馨提示!", '请输入导出条件', function () {}, {type: 'warning',showConfirmButton:true});
}
};
//输入框屏蔽特殊字符
/*var pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]") ;
$('input').bind('input propertychange', function() {
$('input').val($('input').val().replace(pattern,""));
});*/
//------end--------
//转列日期--时间控件
layui.use('laydate', function(){
var laydate = layui.laydate;
var start = {
// min:
// laydate.now()
max : laydate.now(),
istoday : false,
choose : function(datas) {
$scope.startDate = datas;
end.min = datas; //开始日选好后,重置结束日的最小日期
end.start = datas //将结束日的初始值设定为开始日
}
};
var end = {
//min: laydate.now()
max : laydate.now(),
istoday: false,
choose: function(datas){
$scope.endDate = datas;
start.max = datas; //结束日选好后,重置开始日的最大日期
}
};
document.getElementById('LAY_demorange_s').onclick = function(){
start.elem = this;
laydate(start);
};
document.getElementById('LAY_demorange_e').onclick = function(){
end.elem = this;
laydate(end);
};
});
//转列日期-时间控件end
}]);
});
本文题目:requireJS+angularJS+java+ireport统计报表
分享路径:
http://cxhlcq.com/article/piecji.html