Index: ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/sterilizationRecordForm.js =================================================================== diff -u -r15752 -r15756 --- ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/sterilizationRecordForm.js (.../sterilizationRecordForm.js) (revision 15752) +++ ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/sterilizationRecordForm.js (.../sterilizationRecordForm.js) (revision 15756) @@ -2061,7 +2061,13 @@ 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', selectOnFocus :true, format : 'Y-m-d H:i', - anchor : '100%' + anchor : '100%', + listeners : { + select : function() { //联动把生物监测的结束时间填上 + var temp = top.Ext.getCmp('biologicalMonitoringStartDate').getValue().getTime() + _biologicalMonitoringTime; + top.Ext.getCmp('biologicalMonitoringEndDate').setValue(new Date(temp)); + } + } }] }, { columnWidth : .5, Index: ssts-web/src/main/webapp/ext/ext_datefield/Datetime.js =================================================================== diff -u -r12331 -r15756 --- ssts-web/src/main/webapp/ext/ext_datefield/Datetime.js (.../Datetime.js) (revision 12331) +++ ssts-web/src/main/webapp/ext/ext_datefield/Datetime.js (.../Datetime.js) (revision 15756) @@ -502,6 +502,9 @@ initComponent : function(){ Ext.form.DateField.superclass.initComponent.call(this); + + this.addEvents('select'); //扩展了'select'事件(cjr) + if(typeof this.minValue == "string"){ this.minValue = this.parseDate(this.minValue); } @@ -618,6 +621,17 @@ } }, + initEvents: function() { + Ext.form.DateField.superclass.initEvents.call(this); + this.keyNav = new Ext.KeyNav(this.el, { + "down": function(e) { + this.onTriggerClick(); + }, + scope: this, + forceKeyDown: true + }); + }, + onTriggerClick : function(){ if(this.disabled){ return; @@ -643,7 +657,22 @@ })); this.menu.picker.setValue(this.getValue() || new Date()); this.menu.show(this.el, "tl-bl?"); + this.menuEvents('on'); }, + menuEvents: function(method){ + this.menu[method]('select', this.onSelect, this); + this.menu[method]('hide', this.onMenuHide, this); + this.menu[method]('show', this.onFocus, this); + }, + onSelect: function(m, d){ + this.setValue(d); + this.fireEvent('select', this, d); + this.menu.hide(); + }, + onMenuHide: function(){ + this.focus(false, 60); + this.menuEvents('un'); + }, beforeBlur : function(){ var v = this.parseDate(this.getRawValue());