123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- // 路径配置
- ;$(function(){
- searchUnit();
-
- $(".triangle").on('click',function(){
- $("#searchByTime").fadeIn(500);
- $("#triangleOut").removeClass("triangle");
- $("#triangleOut").addClass("noneTri");
- });
- $(".triangleIn").on('click',function(){
- $("#searchByTime").fadeOut(500);
- setTimeout(function addClassTri(){
- $("#triangleOut").removeClass("noneTri");
- $("#triangleOut").addClass("triangle");
- },500);
- });
-
- $("#search").on("click",function(){
- var params = verify();
- if(params){
- search_btn(params);
- }
- });
-
- });
-
-
- function verify(){
- var beginTime = $("#beginTime").attr("value") ;
- var endTime = $("#endTime").attr("value") ;
- var unitID = $("#unitId").attr("relValue") ;
- if(beginTime != "" && endTime == "") endTime = getNowFormatDate(allGetServerTime()) ;
- if(beginTime == "" && endTime != "") beginTime = getThreeMonthsAgo(endTime);
- if(beginTime == "" && endTime == ""){
- var date = allGetServerTime() ;
- beginTime = getThreeMonthsAgo(getNowFormatDate(date)) ;
- endTime = getNowFormatDate(allGetServerTime()) ;
- } ;
-
- if(unitID == ""){
- alert("请选择单位!");
- return false;
- }else{
- return {beginTime:beginTime,endTime:endTime,ID:unitID};
- }
- };
-
- /* 初始化单位 */
- function searchUnit(){
- var userInfo=resolveUrl();
- var deptUrl= $.pathname() + "/ws/orgInDeptService/OrgInDeptService/getDeptRootById";
- $.post(deptUrl, {"deptId" : userInfo["dept_id"]}, function(data) {
- $("#unitId").data("data", data);
- $("#unitId").render();
- }, "json");
- };
-
- /**
- * 得到当前登录用户信息
- * @returns {___anonymous6112_6113}
- */
- function resolveUrl(){
- var encondeCondition=window.location.search;
- var condition= decodeURI(decodeURI(encondeCondition.substring(1,encondeCondition.length)));
- var conditionArr=condition.split("&");
- var condJson={};
- for(var item in conditionArr){
- var temArr=conditionArr[item].split("=");
- condJson[temArr[0]]=temArr[1];
- }
- userInfo = condJson;
- return condJson;
- };
- /**
- * 得到json格式请求
- */
- function getJsonData(url,params){
- var result={} ;
- $.ajax({
- async:false,
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data) {
- result = data ;
- return data ;
- },
- error : function(e) {
- $.messager.alert('系统提示信息error', '访问服务失败!', 'error');
- }
- });
- return result ;
- };
- // 路径配置
- ;$(function(){
- searchUnit();
-
- $(".triangle").on('click',function(){
- $("#searchByTime").fadeIn(500);
- $("#triangleOut").removeClass("triangle");
- $("#triangleOut").addClass("noneTri");
- });
- $(".triangleIn").on('click',function(){
- $("#searchByTime").fadeOut(500);
- setTimeout(function addClassTri(){
- $("#triangleOut").removeClass("noneTri");
- $("#triangleOut").addClass("triangle");
- },500);
- });
-
- $("#search").on("click",function(){
- var params = verify();
- if(params){
- search_btn(params);
- }
- });
-
- });
-
-
- function verify(){
- var beginTime = $("#beginTime").attr("value") ;
- var endTime = $("#endTime").attr("value") ;
- var unitID = $("#unitId").attr("relValue") ;
- if(beginTime != "" && endTime == "") endTime = getNowFormatDate(allGetServerTime()) ;
- if(beginTime == "" && endTime != "") beginTime = getThreeMonthsAgo(endTime);
- if(beginTime == "" && endTime == ""){
- var date = allGetServerTime() ;
- beginTime = getThreeMonthsAgo(getNowFormatDate(date)) ;
- endTime = getNowFormatDate(allGetServerTime()) ;
- } ;
-
- if(unitID == ""){
- alert("请选择单位!");
- return false;
- }else{
- return {beginTime:beginTime,endTime:endTime,ID:unitID};
- }
- };
-
- /* 初始化单位 */
- function searchUnit(){
- var userInfo=resolveUrl();
- var deptUrl= $.pathname() + "/ws/orgInDeptService/OrgInDeptService/getDeptRootById";
- $.post(deptUrl, {"deptId" : userInfo["dept_id"]}, function(data) {
- $("#unitId").data("data", data);
- $("#unitId").render();
- }, "json");
- };
-
- /**
- * 得到当前登录用户信息
- * @returns {___anonymous6112_6113}
- */
- function resolveUrl(){
- var encondeCondition=window.location.search;
- var condition= decodeURI(decodeURI(encondeCondition.substring(1,encondeCondition.length)));
- var conditionArr=condition.split("&");
- var condJson={};
- for(var item in conditionArr){
- var temArr=conditionArr[item].split("=");
- condJson[temArr[0]]=temArr[1];
- }
- userInfo = condJson;
- return condJson;
- };
- /**
- * 得到json格式请求
- */
- function getJsonData(url,params){
- var result={} ;
- $.ajax({
- async:false,
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data) {
- result = data ;
- return data ;
- },
- error : function(e) {
- $.messager.alert('系统提示信息error', '访问服务失败!', 'error');
- }
- });
- return result ;
- };
|