Index: ssts-web/src/main/webapp/js/common.js =================================================================== diff -u -r38131 -r38355 --- ssts-web/src/main/webapp/js/common.js (.../common.js) (revision 38131) +++ ssts-web/src/main/webapp/js/common.js (.../common.js) (revision 38355) @@ -1385,11 +1385,13 @@ Array.prototype.contains = function (value) { for (var i = 0; i < this.length; i++) { - if (arguments.length == 1) { - if (this[i].toString() == value) return true; - } else { - for (var j = 1; j < arguments.length; j++) { - if (this[i][arguments[j]] == value) return true; + if(this[i]){ + if (arguments.length == 1) { + if (this[i].toString() == value) return true; + } else { + for (var j = 1; j < arguments.length; j++) { + if (this[i][arguments[j]] == value) return true; + } } } } @@ -5603,4 +5605,24 @@ } return msg; +} + +//QYSRMYY-70:新增支持设置默认查询时间 +function getDefaultDate(newDate,queryPeriod){ + var today = new Date(newDate); + var targetday_milliseconds = today.getTime(); + if(queryPeriod){ + targetday_milliseconds = today.getTime() - 1000 * 60 * 60 * 24 * queryPeriod; + } + today.setTime(targetday_milliseconds); + var tYear = today.getFullYear(); + var tMonth = today.getMonth() + 1; + var tDate = today.getDate(); + if (parseInt(tMonth) < 10) { + tMonth = '0' + tMonth; + } + if (parseInt(tDate) < 10) { + tDate = '0' + tDate; + } + return tYear + "-" + tMonth + "-" + tDate +' '; } \ No newline at end of file