|
|
@@ -0,0 +1,617 @@
|
|
|
+shr.defineClass("shr.ats.atteExeMsgStatusList", shr.framework.List, {
|
|
|
+ self : null,
|
|
|
+ editViewDisable: true,
|
|
|
+ initalizeDOM : function () {
|
|
|
+ shr.ats.atteExeMsgStatusList.superClass.initalizeDOM.call(this);
|
|
|
+ _self = this;
|
|
|
+ _self.reportConstantsUtils = new shr.report.reportConstantsUtils;
|
|
|
+ $(".template_list").find(".text-tag").live("click", function () {
|
|
|
+ if (!$(this).hasClass("template_pressed")) {
|
|
|
+ $(".template_list .text-tag").removeClass("template_pressed");
|
|
|
+ $(".template_list .text-label").removeClass("text_label_pressed");
|
|
|
+ $(this).addClass("template_pressed");
|
|
|
+ $(this).find(".text-label").addClass("text_label_pressed");
|
|
|
+ } else {
|
|
|
+ $(".template_list .text-tag").removeClass("template_pressed");
|
|
|
+ $(".template_list .text-label").removeClass("text_label_pressed");
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+ setTimeout(function(){
|
|
|
+ $('#grid tr').hover(function(){
|
|
|
+ this.style.cursor = 'pointer';
|
|
|
+ })
|
|
|
+ }, 500);
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ initQueryDataParamRealValue:function(queryData, allParam){
|
|
|
+ for (var i = 0; i < queryData.length; i++) {
|
|
|
+ if (queryData[i].inputState != 2) {
|
|
|
+ if (queryData[i].inputType && queryData[i].inputType == 4) {
|
|
|
+ var _obj = $("input[id='"+queryData[i].name+"']").shrPromptBox("getValue");
|
|
|
+ if(queryData[i].name == 'hrOrg'){
|
|
|
+ if(!_obj){
|
|
|
+ queryData[i].curentValue = null;
|
|
|
+ queryData[i].curentValueAlias = null;
|
|
|
+ }else{
|
|
|
+ queryData[i].curentValue = _obj['id'];
|
|
|
+ queryData[i].curentValueAlias = _obj['name'];
|
|
|
+ }
|
|
|
+ }else if(queryData[i].name == 'adminOrg'){
|
|
|
+ if(!_obj){
|
|
|
+ queryData[i].curentValue = null;
|
|
|
+ queryData[i].curentValueAlias = null;
|
|
|
+ }else{
|
|
|
+ queryData[i].curentValue = _obj['longNumber'];
|
|
|
+ queryData[i].curentValueAlias = _obj['name'];
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ queryData[i].curentValue = $("input[id='"+queryData[i].name+"']").prev().val() == "null"?"":$("input[id='"+queryData[i].name+"']").prev().val()||$("input[id='"+queryData[i].name+"']").shrPromptBox("getValue").number;
|
|
|
+ queryData[i].curentValueAlias = $("input[id='"+queryData[i].name+"']").val() == "null"?"":$("input[id='"+queryData[i].name+"']").val();
|
|
|
+ }
|
|
|
+ }else if(queryData[i].inputType && queryData[i].inputType == 1) {
|
|
|
+ var _obj = $("input[id='"+queryData[i].name+"']").shrSelect("getValue");
|
|
|
+ if(_obj){
|
|
|
+ queryData[i].curentValue = _obj['value'];
|
|
|
+ queryData[i].curentValueAlias = _obj["alias"];
|
|
|
+ }else{
|
|
|
+ queryData[i].curentValue = '';
|
|
|
+ queryData[i].curentValueAlias = null;
|
|
|
+ }
|
|
|
+ }else if (queryData[i].inputType && queryData[i].inputType == 2){
|
|
|
+ //queryData[i].curentValue = $("input[id='"+queryData[i].name+"']").val().replace(/\//g,"-");
|
|
|
+ queryData[i].curentValue = $("input[id='"+queryData[i].name+"']").shrDateTimePicker("getValue");
|
|
|
+ queryData[i].curentValueAlias = null;
|
|
|
+ } else {
|
|
|
+ queryData[i].curentValue = $("input[id='"+queryData[i].name+"']").val();
|
|
|
+ queryData[i].curentValueAlias = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var alias = {
|
|
|
+ alias : queryData[i].properties.alias_zh_CN
|
|
|
+ };
|
|
|
+ allParam[i] = {
|
|
|
+ curentValue : queryData[i].curentValue,
|
|
|
+ curentValueAlias : queryData[i].curentValueAlias,
|
|
|
+ dataType : queryData[i].dataType,
|
|
|
+ defaultValue : queryData[i].defaultValue,
|
|
|
+ designDataType : queryData[i].designDataType,
|
|
|
+ inputState : queryData[i].inputState,
|
|
|
+ inputType : queryData[i].inputType,
|
|
|
+ isAllowNull : queryData[i].isAllowNull,
|
|
|
+ properties : JSON.stringify(alias),
|
|
|
+ name : queryData[i].name
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ openPlugView : function(){
|
|
|
+ window.open(shr.getContextPath() + "/weboffice7/plugView.html");
|
|
|
+ },
|
|
|
+
|
|
|
+ checkNullValue : function (queryData, isAdminOrgRequired) {
|
|
|
+ var currentValue;
|
|
|
+ for (var i = 0; i < queryData.length; i++) {
|
|
|
+ if (queryData[i].inputState != 2) {
|
|
|
+ //F7
|
|
|
+ if (queryData[i].inputType && queryData[i].inputType == 4) {
|
|
|
+ var _obj = $("input[id='"+queryData[i].name+"']").shrPromptBox("getValue");
|
|
|
+ if(queryData[i].name == 'hrOrg'){
|
|
|
+ if(_obj){
|
|
|
+ currentValue = _obj['id'];
|
|
|
+ }
|
|
|
+ }else if(queryData[i].name == 'adminOrg'){
|
|
|
+ if(_obj && _obj['longNumber']){
|
|
|
+ currentValue = _obj['longNumber'];
|
|
|
+ }else{
|
|
|
+ if(isAdminOrgRequired){
|
|
|
+ shr.showError({message : jsBizMultLan.shrreport_reportquery_i18n_1});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ currentValue = $("input[id^='"+queryData[i].name+"']").prev().val()||$("input[id='"+queryData[i].name+"']").shrPromptBox("getValue").number;
|
|
|
+ }
|
|
|
+
|
|
|
+ }else if(queryData[i].inputType && queryData[i].inputType == 1){
|
|
|
+ var _obj = $("input[id='"+queryData[i].name+"']").shrSelect("getValue");
|
|
|
+ if(_obj){
|
|
|
+ currentValue = _obj['value'];
|
|
|
+ }else{
|
|
|
+ currentValue = '';
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ currentValue = $("input[id^='"+queryData[i].name+"']").val();
|
|
|
+ }
|
|
|
+ if(!queryData[i].isAllowNull && (currentValue == null || currentValue == undefined || currentValue == "null" || currentValue == "")){
|
|
|
+ shr.showError({message : jsBizMultLan.shrreport_reportquery_i18n_7+queryData[i].properties.alias_zh_CN});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 日期型控件要保证输入的日期合法
|
|
|
+ if((queryData[i].designDataType == 2 || queryData[i].designDataType == "2") && !queryData[i].isAllowNull){
|
|
|
+ currentValue = $("input[id^='"+queryData[i].name+"']").shrDateTimePicker("getValue");
|
|
|
+ var date = new Date(currentValue);
|
|
|
+ if(!date.getFullYear() || date.getFullYear() > 9999){
|
|
|
+ shr.showError({message : queryData[i].properties.alias_zh_CN + jsBizMultLan.shrreport_reportquery_i18n_0});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(date.getMonth() >11 || date.getMonth() < 0){
|
|
|
+ shr.showError({message : queryData[i].properties.alias_zh_CN + jsBizMultLan.shrreport_reportquery_i18n_0});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(date.getDate() > 31 || date.getDate() < 1){
|
|
|
+ shr.showError({message : queryData[i].properties.alias_zh_CN + jsBizMultLan.shrreport_reportquery_i18n_0});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ },
|
|
|
+
|
|
|
+ CheckSelectedIds : function () {
|
|
|
+ var selectedIds = $("#tempTab").jqGrid("getSelectedRows")
|
|
|
+ if (selectedIds.length > 0) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ CheckTabSelectedIds : function () {
|
|
|
+ var selectedIds = $("#tempTab").jqGrid("getSelectedRows");
|
|
|
+ if (selectedIds.length > 0) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ addFilterComponent : function (data) {
|
|
|
+ var _self = this;
|
|
|
+ var router = 0;
|
|
|
+ var xml;
|
|
|
+ /////////////////////////////////////////////////////////////////
|
|
|
+
|
|
|
+ $(".report_filter").empty();
|
|
|
+ /*
|
|
|
+ $(".report_filter").append('<div class="row-fluid row-block " id=""><div data-ctrlrole="labelContainer" ><div class="span2">'
|
|
|
+ +'<div class="field_label" title="'+"模板"+'">'+"模板"+'</div></div><div class="span3 field-ctrl">'
|
|
|
+ +'<input class="block-father input-height" id="selectTemplate" name="selectTemplate" validate="" placeholder="" type="text" dataExtenal="" />'
|
|
|
+ +'</div><div class="span1 field-desc"></div></div></div>');
|
|
|
+ */
|
|
|
+
|
|
|
+ if (data.length == 0) {
|
|
|
+ $(".report_filter").append('<div id="no"><span id="ui-id-1" class="ui-dialog-title" style="color:#FA0610;margin-left: 40px;">'
|
|
|
+ + jsBizMultLan.shrreport_reportquery_i18n_12
|
|
|
+ + '</span></div>');
|
|
|
+ }
|
|
|
+
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
+ if (data[i].inputState != 2) {
|
|
|
+ router++;
|
|
|
+ var isneed = 'false';
|
|
|
+ if (!data[i].isAllowNull) {
|
|
|
+ isneed = 'true';
|
|
|
+ }
|
|
|
+ if (data[i].designDataType == 0 && data[i].inputType == 4) {
|
|
|
+ if (router % 2 == 1) {
|
|
|
+ xml = '<div class="row-fluid row-block " id=""><div data-ctrlrole="labelContainer" ><div class="span2" style="margin-left: 20px;">'
|
|
|
+ + '<div class="field_label" title="' + data[i].ins + '">' + data[i].properties.alias_zh_CN + '</div></div><div class="span3 field-ctrl" style="margin-right: 0;">'
|
|
|
+ + '<input id="' + data[i].name + '" name="' + data[i].name + '" class="block-father input-height" type="text" validate="{required:' + isneed + '}" />'
|
|
|
+ + '</div><div class="span1 field-desc"></div></div>';
|
|
|
+ } else {
|
|
|
+ $(".report_filter").append(xml + '<div data-ctrlrole="labelContainer" ><div class="span2">'
|
|
|
+ + '<div class="field_label" title="' + data[i].ins + '">' + data[i].properties.alias_zh_CN + '</div></div><div class="span3 field-ctrl" style="margin-right: 0;">'
|
|
|
+ + '<input id="' + data[i].name + '" name="' + data[i].name + '" class="block-father input-height" type="text" validate="{required:' + isneed + '}" />'
|
|
|
+ + '</div><div class="span1 field-desc"></div></div></div>');
|
|
|
+ }
|
|
|
+ } else if (data[i].designDataType == 0) {
|
|
|
+ if (router % 2 == 1) {
|
|
|
+ xml = '<div class="row-fluid row-block " id=""><div data-ctrlrole="labelContainer" ><div class="span2" style="margin-left: 20px;">'
|
|
|
+ + '<div class="field_label" title="' + data[i].ins + '">' + data[i].properties.alias_zh_CN + '</div></div><div class="span3 field-ctrl" style="margin-right: 0;">'
|
|
|
+ + '<input id="' + data[i].name + '" class="block-father input-height" type="text" name="' + data[i].name + '" validate="{maxlength:255,required:' + isneed + '}" value="" placeholder="" dataExtenal="" style="width:180px !important"/>'
|
|
|
+ + '</div><div class="span1 field-desc"></div></div>';
|
|
|
+ } else {
|
|
|
+ $(".report_filter").append(xml + '<div data-ctrlrole="labelContainer" ><div class="span2">'
|
|
|
+ + '<div class="field_label" title="' + data[i].ins + '">' + data[i].properties.alias_zh_CN + '</div></div><div class="span3 field-ctrl" style="margin-right: 0;">'
|
|
|
+ + '<input id="' + data[i].name + '" class="block-father input-height" type="text" name="' + data[i].name + '" validate="{maxlength:255,required:' + isneed + '}" value="" placeholder="" dataExtenal="" style="width:180px !important"/>'
|
|
|
+ + '</div><div class="span1 field-desc"></div></div></div>');
|
|
|
+ }
|
|
|
+ } else if (data[i].designDataType == 1) {
|
|
|
+ if (router % 2 == 1) {
|
|
|
+ xml = '<div class="row-fluid row-block " id=""><div data-ctrlrole="labelContainer" ><div class="span2" style="margin-left: 20px;">'
|
|
|
+ + '<div class="field_label" title="' + data[i].ins + '">' + data[i].properties.alias_zh_CN + '</div></div><div class="span3 field-ctrl" style="margin-right: 0;">'
|
|
|
+ + '<input id="' + data[i].name + '" class="block-father input-height" type="text" name="' + data[i].name + '" validate="{maxlength:9,digits:true,required:' + isneed + '}" value="0" placeholder="" dataExtenal=""/>'
|
|
|
+ + '</div><div class="span1 field-desc"></div></div>';
|
|
|
+ } else {
|
|
|
+ $(".report_filter").append(xml + '<div data-ctrlrole="labelContainer" ><div class="span2">'
|
|
|
+ + '<div class="field_label" title="' + data[i].ins + '">' + data[i].properties.alias_zh_CN + '</div></div><div class="span3 field-ctrl" style="margin-right: 0;">'
|
|
|
+ + '<input id="' + data[i].name + '" class="block-father input-height" type="text" name="' + data[i].name + '" validate="{maxlength:9,digits:true,required:' + isneed + '}" value="0" placeholder="" dataExtenal=""/>'
|
|
|
+ + '</div><div class="span1 field-desc"></div></div></div>');
|
|
|
+ }
|
|
|
+ } else if (data[i].designDataType == 2) {
|
|
|
+ if (router % 2 == 1) {
|
|
|
+ xml = '<div class="row-fluid row-block " id=""><div data-ctrlrole="labelContainer" ><div class="span2" style="margin-left: 20px;">'
|
|
|
+ + '<div class="field_label" title="' + data[i].ins + '">' + data[i].properties.alias_zh_CN + '</div></div><div class="span3 field-ctrl" style="margin-right: 0;">'
|
|
|
+ + '<input id="' + data[i].name + '" name="' + data[i].name + '" value="" validate="{dateISO:true,required:' + isneed + '}" placeholder="" type="text" dataExtenal="">'
|
|
|
+ + '</div><div class="span1 field-desc"></div></div>';
|
|
|
+ } else {
|
|
|
+ $(".report_filter").append(xml + '<div data-ctrlrole="labelContainer" ><div class="span2">'
|
|
|
+ + '<div class="field_label" title="' + data[i].ins + '">' + data[i].properties.alias_zh_CN + '</div></div><div class="span3 field-ctrl" style="margin-right: 0;">'
|
|
|
+ + '<input id="' + data[i].name + '" name="' + data[i].name + '" value="" validate="{dateISO:true,required:' + isneed + '}" placeholder="" type="text" dataExtenal="">'
|
|
|
+ + '</div><div class="span1 field-desc"></div></div></div>');
|
|
|
+ }
|
|
|
+ } else if (data[i].designDataType == 3) {
|
|
|
+ if (router % 2 == 1) {
|
|
|
+ xml = '<div class="row-fluid row-block " id=""><div data-ctrlrole="labelContainer" ><div class="span2" style="margin-left: 20px;">'
|
|
|
+ + '<div class="field_label" title="' + data[i].ins + '">' + data[i].properties.alias_zh_CN + '</div></div><div class="span3 field-ctrl" style="margin-right: 0;">'
|
|
|
+ + '<input id="' + data[i].name + '" name="' + data[i].name + '" class="block-father input-height" type="text" validate="{required:' + isneed + '}" />'
|
|
|
+ + '</div><div class="span1 field-desc"></div></div>';
|
|
|
+ } else {
|
|
|
+ $(".report_filter").append(xml + '<div data-ctrlrole="labelContainer" ><div class="span2">'
|
|
|
+ + '<div class="field_label" title="' + data[i].ins + '">' + data[i].properties.alias_zh_CN + '</div></div><div class="span3 field-ctrl" style="margin-right: 0;">'
|
|
|
+ + '<input id="' + data[i].name + '" name="' + data[i].name + '" class="block-father input-height" type="text" validate="{required:' + isneed + '}" />'
|
|
|
+ + '</div><div class="span1 field-desc"></div></div></div>');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (router % 2 == 1 && xml != null) {
|
|
|
+ $(".report_filter").append(xml + '</div>');
|
|
|
+ }
|
|
|
+ _self.reportConstantsUtils.addTips('adminOrg', _self.reportConstantsUtils.REPORT_TIPS_DESC.ADMINORG);
|
|
|
+ _self.reportConstantsUtils.addTips('hrOrg', _self.reportConstantsUtils.REPORT_TIPS_DESC.HRORG);
|
|
|
+ _self.reportConstantsUtils.addPlaceholder('adminOrg', _self.reportConstantsUtils.REPORT_PLACEHOLDER_DESC.ADMINORG);
|
|
|
+ _self.reportConstantsUtils.addPlaceholder('hrOrg', _self.reportConstantsUtils.REPORT_PLACEHOLDER_DESC.HRORG);
|
|
|
+ ///////////////////////////////////////////////
|
|
|
+ },
|
|
|
+ getdate : function (date) {
|
|
|
+ var now = new Date(); //当前日期
|
|
|
+ var nowYear = now.getFullYear(); //当前年
|
|
|
+ switch(date){
|
|
|
+ case "today" :
|
|
|
+ return now.format("yyyy-MM-dd");
|
|
|
+ break;
|
|
|
+ case "current_month_star" :
|
|
|
+ return this.getMonthStartDate();
|
|
|
+ break;
|
|
|
+ case "current_month_end" :
|
|
|
+ return this.getMonthEndDate();
|
|
|
+ break;
|
|
|
+ case "current_quarter_star" :
|
|
|
+ return this.getQuarterStartDate();
|
|
|
+ break;
|
|
|
+ case "current_quarter_end" :
|
|
|
+ return this.getQuarterEndDate();
|
|
|
+ break;
|
|
|
+ case "current_annual_star" :
|
|
|
+ return this.getAnnualStartDate();
|
|
|
+ break;
|
|
|
+ case "current_annual_end" :
|
|
|
+ return this.getAnnualEndDate();
|
|
|
+ break;
|
|
|
+ case "last_month_star" :
|
|
|
+ return this.getLastMonthStartDate();
|
|
|
+ break;
|
|
|
+ case "last_month_end" :
|
|
|
+ return this.getLastMonthEndDate();
|
|
|
+ break;
|
|
|
+ case "last_quarter_star" :
|
|
|
+ var t_date = new Date(this.getQuarterStartDate());
|
|
|
+ return this.getPriorSeasonFirstDay(nowYear,t_date.getMonth());
|
|
|
+ break;
|
|
|
+ case "last_quarter_end" :
|
|
|
+ var t_date = new Date(this.getQuarterStartDate());
|
|
|
+ return this.getPriorSeasonEndDay(nowYear,t_date.getMonth());
|
|
|
+ break;
|
|
|
+ case "last_annual_star" :
|
|
|
+ return this.getLastAnnualStartDate();
|
|
|
+ break;
|
|
|
+ case "last_annual_end" :
|
|
|
+ return this.getLastAnnualEndDate();
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ return date;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ formatDate :function (date) {
|
|
|
+ var myyear = date.getFullYear();
|
|
|
+ var mymonth = date.getMonth()+1;
|
|
|
+ var myweekday = date.getDate();
|
|
|
+
|
|
|
+ if(mymonth < 10){
|
|
|
+ mymonth = "0" + mymonth;
|
|
|
+ }
|
|
|
+ if(myweekday < 10){
|
|
|
+ myweekday = "0" + myweekday;
|
|
|
+ }
|
|
|
+ return (myyear+"-"+mymonth + "-" + myweekday);
|
|
|
+ },
|
|
|
+
|
|
|
+ //获得某月的天数
|
|
|
+ getMonthDays :function (myMonth){
|
|
|
+ var now = new Date(); //当前日期
|
|
|
+ var nowDayOfWeek = now.getDay(); //今天本周的第几天
|
|
|
+ var nowDay = now.getDate(); //当前日
|
|
|
+ var nowMonth = now.getMonth(); //当前月
|
|
|
+ var nowYear = now.getFullYear(); //当前年
|
|
|
+
|
|
|
+ var lastMonthDate = new Date(); //上月日期
|
|
|
+ lastMonthDate.setDate(1);
|
|
|
+ lastMonthDate.setMonth(lastMonthDate.getMonth()-1);
|
|
|
+ var lastYear = lastMonthDate.getYear();
|
|
|
+ var lastMonth = lastMonthDate.getMonth();
|
|
|
+
|
|
|
+ var monthStartDate = new Date(nowYear, myMonth, 1);
|
|
|
+ var monthEndDate = new Date(nowYear, myMonth + 1, 1);
|
|
|
+ var days = (monthEndDate - monthStartDate)/(1000 * 60 * 60 * 24);
|
|
|
+ return days;
|
|
|
+ },
|
|
|
+
|
|
|
+ //获得本季度的开端月份
|
|
|
+ getQuarterStartMonth :function (){
|
|
|
+ var now = new Date(); //当前日期
|
|
|
+ var nowDayOfWeek = now.getDay(); //今天本周的第几天
|
|
|
+ var nowDay = now.getDate(); //当前日
|
|
|
+ var nowMonth = now.getMonth(); //当前月
|
|
|
+ var nowYear = now.getFullYear(); //当前年
|
|
|
+
|
|
|
+ var lastMonthDate = new Date(); //上月日期
|
|
|
+ lastMonthDate.setDate(1);
|
|
|
+ lastMonthDate.setMonth(lastMonthDate.getMonth()-1);
|
|
|
+ var lastYear = lastMonthDate.getYear();
|
|
|
+ var lastMonth = lastMonthDate.getMonth();
|
|
|
+ var quarterStartMonth = 0;
|
|
|
+ if(nowMonth<3){
|
|
|
+ quarterStartMonth = 0;
|
|
|
+ }
|
|
|
+ if(2<nowMonth && nowMonth<6){
|
|
|
+ quarterStartMonth = 3;
|
|
|
+ }
|
|
|
+ if(5<nowMonth && nowMonth<9){
|
|
|
+ quarterStartMonth = 6;
|
|
|
+ }
|
|
|
+ if(nowMonth>8){
|
|
|
+ quarterStartMonth = 9;
|
|
|
+ }
|
|
|
+ return quarterStartMonth;
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ //获得本月的开端日期
|
|
|
+ getMonthStartDate :function (){
|
|
|
+ var now = new Date(); //当前日期
|
|
|
+ var nowDayOfWeek = now.getDay(); //今天本周的第几天
|
|
|
+ var nowDay = now.getDate(); //当前日
|
|
|
+ var nowMonth = now.getMonth(); //当前月
|
|
|
+ var nowYear = now.getFullYear(); //当前年
|
|
|
+
|
|
|
+ var monthStartDate = new Date(nowYear, nowMonth, 1);
|
|
|
+ return monthStartDate.format("yyyy-MM-dd")
|
|
|
+ },
|
|
|
+
|
|
|
+ //获得上月的开端日期
|
|
|
+ getLastMonthStartDate :function (){
|
|
|
+ var now = new Date(); //当前日期
|
|
|
+ var nowDayOfWeek = now.getDay(); //今天本周的第几天
|
|
|
+ var nowDay = now.getDate(); //当前日
|
|
|
+ var nowMonth = now.getMonth(); //当前月
|
|
|
+ var nowYear = now.getFullYear(); //当前年
|
|
|
+ var monthStartDate = new Date(nowYear, nowMonth-1, 1);
|
|
|
+ return monthStartDate.format("yyyy-MM-dd")
|
|
|
+ },
|
|
|
+
|
|
|
+ //获得本月的停止日期
|
|
|
+ getMonthEndDate :function (){
|
|
|
+ var now = new Date(); //当前日期
|
|
|
+ var nowDayOfWeek = now.getDay(); //今天本周的第几天
|
|
|
+ var nowDay = now.getDate(); //当前日
|
|
|
+ var nowMonth = now.getMonth(); //当前月
|
|
|
+ var nowYear = now.getFullYear(); //当前年
|
|
|
+
|
|
|
+ var monthEndDate = new Date(nowYear, nowMonth, this.getMonthDays(nowMonth));
|
|
|
+ return monthEndDate.format("yyyy-MM-dd");
|
|
|
+ },
|
|
|
+
|
|
|
+ //获得上月的停止日期
|
|
|
+ getLastMonthEndDate :function (){
|
|
|
+ var now = new Date(); //当前日期
|
|
|
+ var nowDayOfWeek = now.getDay(); //今天本周的第几天
|
|
|
+ var nowDay = now.getDate(); //当前日
|
|
|
+ var nowMonth = now.getMonth(); //当前月
|
|
|
+ var nowYear = now.getFullYear(); //当前年
|
|
|
+ var monthEndDate = new Date(nowYear, nowMonth-1, this.getMonthDays(nowMonth));
|
|
|
+ return monthEndDate.format("yyyy-MM-dd");
|
|
|
+ },
|
|
|
+
|
|
|
+ //获得上月开端时候
|
|
|
+ getLastMonthStartDate :function (){
|
|
|
+ var now = new Date(); //当前日期
|
|
|
+ var nowYear = now.getFullYear(); //当前年
|
|
|
+ var lastMonthDate = new Date(); //上月日期
|
|
|
+ lastMonthDate.setDate(1);
|
|
|
+ lastMonthDate.setMonth(lastMonthDate.getMonth()-1);
|
|
|
+ var lastYear = lastMonthDate.getFullYear();
|
|
|
+ var lastMonth = lastMonthDate.getMonth();
|
|
|
+ var lastMonthStartDate = new Date(lastYear, lastMonth, 1);
|
|
|
+ return lastMonthStartDate.format("yyyy-MM-dd");
|
|
|
+ },
|
|
|
+
|
|
|
+ //获得上月停止时候
|
|
|
+ getLastMonthEndDate :function (){
|
|
|
+ var now = new Date(); //当前日期
|
|
|
+ var nowYear = now.getFullYear(); //当前年
|
|
|
+ var lastMonthDate = new Date(); //上月日期
|
|
|
+ lastMonthDate.setDate(1);
|
|
|
+ lastMonthDate.setMonth(lastMonthDate.getMonth()-1);
|
|
|
+ var lastYear = lastMonthDate.getFullYear();
|
|
|
+ var lastMonth = lastMonthDate.getMonth();
|
|
|
+ var lastMonthEndDate = new Date(lastYear, lastMonth, this.getMonthDays(lastMonth));
|
|
|
+ return lastMonthEndDate.format("yyyy-MM-dd");
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ //获得本季度的开端日期
|
|
|
+ getQuarterStartDate :function (){
|
|
|
+ var now = new Date(); //当前日期
|
|
|
+ var nowYear = now.getFullYear(); //当前年
|
|
|
+ var quarterStartDate = new Date(nowYear, this.getQuarterStartMonth(), 1);
|
|
|
+ return quarterStartDate.format("yyyy-MM-dd");
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ //获得上季度季度的开端日期
|
|
|
+ getLastQuarterStartDate :function (){
|
|
|
+ var now = new Date(); //当前日期
|
|
|
+ var nowYear = now.getFullYear(); //当前年
|
|
|
+ var quarterStartDate = new Date(nowYear, this.getQuarterStartMonth(), 1);
|
|
|
+ return quarterStartDate.format("yyyy-MM-dd");
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ //获的本季度的停止日期
|
|
|
+ getQuarterEndDate :function (){
|
|
|
+ var now = new Date(); //当前日期
|
|
|
+ var nowYear = now.getFullYear(); //当前年
|
|
|
+ var quarterEndMonth = this.getQuarterStartMonth() + 2;
|
|
|
+ var quarterStartDate = new Date(nowYear, quarterEndMonth, this.getMonthDays(quarterEndMonth));
|
|
|
+ return quarterStartDate.format("yyyy-MM-dd");
|
|
|
+ },
|
|
|
+
|
|
|
+ //获取本年度初
|
|
|
+ getAnnualStartDate : function(){
|
|
|
+ var now = new Date(); //当前日期
|
|
|
+ var nowYear = now.getFullYear(); //当前年
|
|
|
+ var AnnualStartDate = new Date(nowYear, 0, 1);
|
|
|
+ return AnnualStartDate.format("yyyy-MM-dd");
|
|
|
+ },
|
|
|
+
|
|
|
+ //获取本年度初
|
|
|
+ getLastAnnualStartDate : function(){
|
|
|
+ var now = new Date(); //当前日期
|
|
|
+ var nowYear = now.getFullYear(); //当前年
|
|
|
+ var AnnualStartDate = new Date(nowYear-1, 0, 1);
|
|
|
+ return AnnualStartDate.format("yyyy-MM-dd");
|
|
|
+ },
|
|
|
+
|
|
|
+ //获取本年度末
|
|
|
+ getAnnualEndDate : function(){
|
|
|
+ var now = new Date(); //当前日期
|
|
|
+ var nowYear = now.getFullYear(); //当前年
|
|
|
+ var AnnualStartDate = new Date(nowYear, 11, 31);
|
|
|
+ return AnnualStartDate.format("yyyy-MM-dd");
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ //获取上年度末
|
|
|
+ getLastAnnualEndDate : function(){
|
|
|
+ var now = new Date(); //当前日期
|
|
|
+ var nowYear = now.getFullYear(); //当前年
|
|
|
+ var AnnualStartDate = new Date(nowYear-1, 11, 31);
|
|
|
+ return AnnualStartDate.format("yyyy-MM-dd");
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 得到上季度的起始日期
|
|
|
+ * year 这个年应该是运算后得到的当前本季度的年份
|
|
|
+ * month 这个应该是运算后得到的当前季度的开始月份
|
|
|
+ * */
|
|
|
+ getPriorSeasonFirstDay : function(year,month){
|
|
|
+ var quarterMonthStart=0;
|
|
|
+ var spring=0; //春
|
|
|
+ var summer=3; //夏
|
|
|
+ var fall=6; //秋
|
|
|
+ var winter=9;//冬
|
|
|
+ //月份从0-11
|
|
|
+ switch(month){//季度的其实月份
|
|
|
+ case spring:
|
|
|
+ //如果是第一季度则应该到去年的冬季
|
|
|
+ year--;
|
|
|
+ month=winter;
|
|
|
+ break;
|
|
|
+ case summer:
|
|
|
+ month=spring;
|
|
|
+ break;
|
|
|
+ case fall:
|
|
|
+ month=summer;
|
|
|
+ break;
|
|
|
+ case winter:
|
|
|
+ month=fall;
|
|
|
+ break;
|
|
|
+
|
|
|
+ };
|
|
|
+ return (new Date(year,month,1)).format("yyyy-MM-dd");
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 得到上季度的结束日期
|
|
|
+ * year 这个年应该是运算后得到的当前本季度的年份
|
|
|
+ * month 这个应该是运算后得到的当前季度的开始月份
|
|
|
+ * */
|
|
|
+ getPriorSeasonEndDay : function(year,month){
|
|
|
+ var quarterMonthStart=0;
|
|
|
+ var spring=0; //春
|
|
|
+ var summer=3; //夏
|
|
|
+ var fall=6; //秋
|
|
|
+ var winter=9;//冬
|
|
|
+ //月份从0-11
|
|
|
+ switch(month){//季度的其实月份
|
|
|
+ case spring:
|
|
|
+ //如果是第一季度则应该到去年的冬季
|
|
|
+ year--;
|
|
|
+ month=winter;
|
|
|
+ break;
|
|
|
+ case summer:
|
|
|
+ month=spring;
|
|
|
+ break;
|
|
|
+ case fall:
|
|
|
+ month=summer;
|
|
|
+ break;
|
|
|
+ case winter:
|
|
|
+ month=fall;
|
|
|
+ break;
|
|
|
+
|
|
|
+ };
|
|
|
+ return (new Date(year,month+2,this.getMonthDays(month))).format("yyyy-MM-dd");
|
|
|
+ },
|
|
|
+ getJSessionCookie : function () {
|
|
|
+ var array = document.cookie.split(";");
|
|
|
+ for (var i = 0; i < array.length; i++) {
|
|
|
+ if (array[i].indexOf("JSESSIONID") >= 0) {
|
|
|
+ return array[i].trim().substring('JSESSIONID'.length + 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ },
|
|
|
+
|
|
|
+ // 检查报表完整性
|
|
|
+ checkReportIntegrity : function(reportId){
|
|
|
+ var checkresult ;
|
|
|
+ $.ajax({
|
|
|
+ url : shr.getContextPath() + "/dynamic.do?method=checkReportIntegrity",
|
|
|
+ async : false,
|
|
|
+ data : {
|
|
|
+ uipk : shr.getUipk(),
|
|
|
+ reportId : reportId,
|
|
|
+ permItemId:shr.getCurrentPagePermItemId(),
|
|
|
+ serviceId:shr.getUrlRequestParam('serviceId')
|
|
|
+ },
|
|
|
+ success : function (data) {
|
|
|
+ checkresult = data;
|
|
|
+ },
|
|
|
+ error : function(data){
|
|
|
+ checkresult = data;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return checkresult;
|
|
|
+ },
|
|
|
+});
|