上面是我做的报表但是有个问题:执行操作:编辑结束日期——编辑开始日期——修改结束日期,然后就会出现第三张图片的错误,出现了俩个日历而且点击确认也消除不掉。而且有时候参数框直接就不见了。 这是我的开始和结束日期写的js代码 开始: var start = this.options.form.getWidgetByName("p_ksrq").getValue(); var end = this.options.form.getWidgetByName("p_jsrq").getValue(); var that=this.options.form.getWidgetByName("p_jsrq"); var o = that.options; var data=that.options.data.getData(); if(data[0].data.startDate<start){ var ed = new Date(start); if (!FR.isInvalidDate(ed)) { o.startDate = FR.date2Str(ed, 'yyyy-MM-dd'); that.std = that._createStartDate(o.startDate ,o.format, that.viewMode); } that.datepicker = new FR.DatePicker({ renderEl: that.$view, viewMode: that.viewMode, date: FR.str2Date(that.editComp.val(), o.format), dateFormat: o.format, startDate: that.std, endDate: data[0].data.endDate, onDateUpdate: function() { if ($(':focus').length === 0) { self.editComp.focus(); } self.editComp.val(FR.date2Str(that.getValue(), o.format)); self.isValidateInput(); self.fireEvent(FR.Events.AFTEREDIT); } }); } 结束: var start = this.options.form.getWidgetByName("p_ksrq").getValue(); var end = this.options.form.getWidgetByName("p_jsrq").getValue(); var that=this.options.form.getWidgetByName("p_ksrq"); var o = that.options; var data=that.options.data.getData(); if(data[0].data.endDate>end){ var ed = new Date(end); if (!FR.isInvalidDate(ed)) { o.endDate = FR.date2Str(ed, 'yyyy-MM-dd'); that.edd = that._createEndDate(o.endDate, o.format, that.viewMode); } that.datepicker = new FR.DatePicker({ renderEl: that.$view, viewMode: that.viewMode, date: FR.str2Date(that.editComp.val(), o.format), dateFormat: o.format, startDate: data[0].data.startDate, endDate: that.edd, onDateUpdate: function() { if ($(':focus').length === 0) { self.editComp.focus(); } self.editComp.val(FR.date2Str(that.getValue(), o.format)); self.isValidateInput(); self.fireEvent(FR.Events.AFTEREDIT); } }); } 请问大佬们这是哪里有错误 |