Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js =================================================================== diff -u -r30587 -r30678 --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js (.../goodsApplicationView.js) (revision 30587) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js (.../goodsApplicationView.js) (revision 30678) @@ -2499,22 +2499,24 @@ } function reloadTimeField(){ - var startDate = Ext.getCmp("startDate").getValue(); - var endDate = Ext.getCmp("endDate").getValue(); - if (isUndefinedOrNullOrEmpty(startDate) || isUndefinedOrNullOrEmpty(endDate)){ - Ext.Msg.alert('警告', '时间不能为空!'); - return; - } - var value1 = Date.parse(startDate); - var value2 = Date.parse(endDate); - if (value1 > value2) { - Ext.Msg.alert('警告', '开始时间不能大于结束时间!'); - return; - } + if(Ext.getCmp("startDate") && Ext.getCmp("endDate")){ + var startDate = Ext.getCmp("startDate").getValue(); + var endDate = Ext.getCmp("endDate").getValue(); + if (isUndefinedOrNullOrEmpty(startDate) || isUndefinedOrNullOrEmpty(endDate)){ + Ext.Msg.alert('警告', '时间不能为空!'); + return; + } + var value1 = Date.parse(startDate); + var value2 = Date.parse(endDate); + if (value1 > value2) { + Ext.Msg.alert('警告', '开始时间不能大于结束时间!'); + return; + } - document.getElementById('parm_s_startTime').value = value1; - document.getElementById('parm_s_endTime').value = value2; - grid.dwrReload(); + document.getElementById('parm_s_startTime').value = value1; + document.getElementById('parm_s_endTime').value = value2; + grid.dwrReload(); + } } function reloadGrid(){