Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/tousseOperate.js =================================================================== diff -u -r28330 -r28343 --- ssts-web/src/main/webapp/disinfectsystem/reportforms/tousseOperate.js (.../tousseOperate.js) (revision 28330) +++ ssts-web/src/main/webapp/disinfectsystem/reportforms/tousseOperate.js (.../tousseOperate.js) (revision 28343) @@ -119,6 +119,8 @@ format : 'Y-m-d H:i', // altFormats:'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', value : startDate, + theHours : 0, + theMinutes : 0, anchor : '95%', listeners : { specialkey : function(field, e) { @@ -149,6 +151,8 @@ fieldLabel : '结束时间', // readOnly : true, format : 'Y-m-d H:i', + theHours : 23, + theMinutes : 59, // altFormats:'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', value : new Date(endDateValue), anchor : '95%' Index: ssts-web/src/main/webapp/homepage/supplyRoomOperate.js =================================================================== diff -u -r28340 -r28343 --- ssts-web/src/main/webapp/homepage/supplyRoomOperate.js (.../supplyRoomOperate.js) (revision 28340) +++ ssts-web/src/main/webapp/homepage/supplyRoomOperate.js (.../supplyRoomOperate.js) (revision 28343) @@ -525,6 +525,8 @@ fieldLabel : '开始时间', format : 'Y-m-d H:i', value : startDate, + theHours : 0, + theMinutes : 0, anchor : '95%', listeners : { specialkey : function(field, e) { @@ -553,6 +555,8 @@ name : 'endDate', fieldLabel : '结束时间', format : 'Y-m-d H:i', + theHours : 23, + theMinutes : 59, value : new Date(endDateValue), anchor : '95%' }] Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js =================================================================== diff -u -r28137 -r28343 --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js (.../goodsApplicationView.js) (revision 28137) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js (.../goodsApplicationView.js) (revision 28343) @@ -81,6 +81,62 @@ } } +/* + 可以获取每月第一天的00:00和每月当天的23:59 + dateformat 日期格式 + extObj Ext对象 + fieldId 要设置时间区域的id + */ +function getServerTime2(dateformat,extObj,fieldId){ + Ext.Ajax.request({ + url: WWWROOT + '/system/serverTimeAction!getDateTimeOfFirstDay.do', + params: {dateformat: dateformat}, + success: function(response, options) { + var result = Ext.decode(response.responseText); + if (result.success) { + if(extObj && fieldId && extObj.getCmp(fieldId)){ + if(fieldId == "startDate"){ + extObj.getCmp("startDate").setValue(result.data.startDateTime); + }else if(fieldId == "endDate"){ + extObj.getCmp("endDate").setValue(result.data.endDateTime); + } + } + } else { + showResult(result.message); + } + }, + failure : function(response, options) { + showResult('获取服务器时间失败!'); + } + }); +} + +/* + 可以获取当天时间的,可以获取到当天的00:00和23:59 + dateformat 日期格式 + extObj Ext对象 + fieldId 要设置时间区域的id + */ +function getServerCurTime(dateformat,extObj,fieldId){ + Ext.Ajax.request({ + url: WWWROOT + '/system/serverTimeAction!getTodayDataTime.do', + params: {dateformat: dateformat}, + success: function(response, options) { + var result = Ext.decode(response.responseText); + if (result.success) { + if(extObj && fieldId && extObj.getCmp(fieldId)){ + extObj.getCmp(fieldId).setValue(result.data.startDateTime); + } + } else { + showResult(result.message); + } + }, + failure : function(response, options) { + showResult('获取服务器时间失败!'); + } + }); +} + /** * 器械汇总单 */ @@ -2200,12 +2256,13 @@ grid.dwrReload(); - //开始日期、结束日期 - //如果开始日期为当天则设置开始时间为当天,否则设置开始时间为服务器当天当月第一天 - sstsConfig.startDateIsToday ? getServerTime('yyyy-MM-dd', Ext, 'startDate') : getServerTime('yyyy-MM-dd', Ext, 'startDate', null, WWWROOT + '/system/serverTimeAction!getFirstDay.do'); - //设置结束时间为服务器当天时间 - var format = sstsConfig.timeSearchFmt ? 'yyyy-MM-dd HH:mm' : 'yyyy-MM-dd'; - getServerTime(format,Ext,'endDate'); + //开始时间、结束时间 + //如果开始时间为当天则设置开始时间为当天,否则设置开始时间为服务器当天当月第一天,时间后面也要加上时分 FJSSSYY-10 + //sstsConfig.startDateIsToday ? getServerTime('yyyy-MM-dd', Ext, 'startDate') : getServerTime('yyyy-MM-dd', Ext, 'startDate', null, WWWROOT + '/system/serverTimeAction!getFirstDay.do'); + sstsConfig.startDateIsToday ? getServerCurTime('yyyy-MM-dd HH:mm', Ext, 'startDate') : getServerTime2('yyyy-MM-dd HH:mm' ,Ext,'startDate'); + //设置结束时间为服务器当天时间 FJSSSYY-10 去掉sstsConfig.timeSearchFmt配置项,改为结束时间都为23:59 + var format = 'yyyy-MM-dd HH:mm'; + getServerTime2(format ,Ext,'endDate'); } @@ -2215,13 +2272,13 @@ var startDate = Ext.getCmp("startDate").getValue(); var endDate = Ext.getCmp("endDate").getValue(); if (isUndefinedOrNullOrEmpty(startDate) || isUndefinedOrNullOrEmpty(endDate)){ - Ext.Msg.alert('警告', '日期不能为空!'); + Ext.Msg.alert('警告', '时间不能为空!'); return; } var value1 = Date.parse(startDate); var value2 = Date.parse(endDate); if (value1 > value2) { - Ext.Msg.alert('警告', '开始日期不能大于结束日期!'); + Ext.Msg.alert('警告', '开始时间不能大于结束时间!'); return; } document.getElementById('parm_s_startTime').value = value1; @@ -2297,24 +2354,34 @@ } //2、按时间过滤(width=415) - var time = [{text: '开始日期:'},{ - xtype: sstsConfig.timeSearchFmt ? 'datefieldWithMin' : 'datefield', - fieldLabel: '开始日期', + var time = [{text: '开始时间:'},{ + //xtype: sstsConfig.timeSearchFmt ? 'datefieldWithMin' : 'datefield', + xtype: 'datefieldWithMin', + fieldLabel: '开始时间', name: 'startDate', - format: sstsConfig.timeSearchFmt || 'Y-m-d', + //format: sstsConfig.timeSearchFmt || 'Y-m-d', + format : 'Y-m-d H:i', id: 'startDate', readOnly: false, editable: false, - width: sstsConfig.timeSearchFmt ? 120 : 90 - },{ text: '结束日期:'},{ - xtype: sstsConfig.timeSearchFmt ? 'datefieldWithMin' : 'datefield', - fieldLabel: '结束日期', + theHours : 0, + theMinutes : 0, + //width: sstsConfig.timeSearchFmt ? 120 : 90, + width: 120 + },{ text: '结束时间:'},{ + //xtype: sstsConfig.timeSearchFmt ? 'datefieldWithMin' : 'datefield', + xtype: 'datefieldWithMin', + fieldLabel: '结束时间', name: 'endDate', id: 'endDate', readOnly: false, editable: false, - format: sstsConfig.timeSearchFmt || 'Y-m-d', - width: sstsConfig.timeSearchFmt ? 120 : 90 + // format: sstsConfig.timeSearchFmt || 'Y-m-d', + format : 'Y-m-d H:i', + theHours : 23, + theMinutes : 59, + // width: sstsConfig.timeSearchFmt ? 120 : 90, + width: 120 },{ xtype: 'button', text: '查询', @@ -3732,13 +3799,16 @@ showResult('定时自动刷新时长的参数设置有误,只能设置为正整数,请检查,当前参数设置为:' + autoRefreshApplicationDataIntervalSeconds); } } + - //如果开始日期为当天则设置开始时间为当天,否则设置开始时间为服务器当天当月第一天 - sstsConfig.startDateIsToday ? getServerTime('yyyy-MM-dd', Ext, 'startDate') : getServerTime('yyyy-MM-dd', Ext, 'startDate', null, WWWROOT + '/system/serverTimeAction!getFirstDay.do'); - //设置结束时间为服务器当天时间 - var format = sstsConfig.timeSearchFmt ? 'yyyy-MM-dd HH:mm' : 'yyyy-MM-dd'; - getServerTime(format,Ext,'endDate'); - + + //如果开始时间为当天则设置开始时间为当天,否则设置开始时间为服务器当天当月第一天,时间也要加上时分00:00 + // sstsConfig.startDateIsToday ? getServerTime('yyyy-MM-dd', Ext, 'startDate') : getServerTime('yyyy-MM-dd', Ext, 'startDate', null, WWWROOT + '/system/serverTimeAction!getFirstDay.do'); + sstsConfig.startDateIsToday ? getServerCurTime('yyyy-MM-dd HH:mm', Ext, 'startDate') : getServerTime2('yyyy-MM-dd HH:mm' ,Ext,'startDate'); + //设置结束时间为服务器当天时间 FJSSSYY-10 去掉sstsConfig.timeSearchFmt配置项,改为结束时间都为23:59 + var format = 'yyyy-MM-dd HH:mm'; + getServerTime2(format ,Ext,'endDate'); + var tableContent; if (mouseHoverEventOfApply != '否') { grid.on('mouseover', function(e) {// 添加mouseover事件