Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/tousseTournoverDaysStatisticsReport.js =================================================================== diff -u -r36308 -r37004 --- ssts-web/src/main/webapp/disinfectsystem/reportforms/tousseTournoverDaysStatisticsReport.js (.../tousseTournoverDaysStatisticsReport.js) (revision 36308) +++ ssts-web/src/main/webapp/disinfectsystem/reportforms/tousseTournoverDaysStatisticsReport.js (.../tousseTournoverDaysStatisticsReport.js) (revision 37004) @@ -3,10 +3,12 @@ var myMask; function reloadReport() { - var startYear = $Id('startYear').value; - var endYear = $Id('endYear').value; + var startDate = $Id('startDate').value; + var endDate = $Id('endDate').value; var orgUnitCoding = Ext.getCmp('querySupplyRoom').getValue(); var packageTypes = Ext.getCmp('packageTypes').getValue(); + var tousseName = Ext.getCmp('tousseName').getValue(); + var comparisonOperators = Ext.getCmp('comparisonOperators').getValue(); if(packageTypes == '全部' || packageTypes.indexOf('全部') >= 0){ packageTypes = ''; } @@ -19,18 +21,41 @@ return; } - myMask.show(); - var url = WWWROOT + '/jasperreports/jasperreportsAction!createReportFromJavaBeanSource.do'; var params = { jasperreportName: 'tousseTournoverDaysStatisticsReport.jasper', orgUnitCoding: orgUnitCoding, - startYear: startYear, - endYear: endYear, + startDate: startDate, + endDate: endDate, packageTypes: packageTypes, + tousseName:tousseName, + comparisonOperators:comparisonOperators, reportName: 'tousseTournoverDaysStatisticsReport' } + if(comparisonOperators !== ''){ + if(comparisonOperators == '介于'){ + var startValue = Ext.getCmp('startValue').getValue(); + var endValue = Ext.getCmp('endValue').getValue(); + if(startValue == '' || endValue == ''){ + showResult("周转天数不能为空!"); + return; + } + params.startValue = startValue; + params.endValue = endValue; + }else { + var startValue = Ext.getCmp('startValue').getValue(); + if(startValue == ''){ + showResult("周转天数不能为空!"); + return; + } + params.startValue = startValue; + params.endValue = null; + } + } + + myMask.show(); + searchReport(url, params); } @@ -113,6 +138,11 @@ packageTypeJsonStore.load() + var dt = new Date(); + var fullYear = dt.getFullYear(); + var startDay = fullYear + "/" + (dt.getMonth() + 1) + "/01"; + var currentDate = fullYear + "/" + (dt.getMonth() + 1) + "/" + dt.getDate(); + var form = new Ext.form.FormPanel({ title: entityName, region: 'north', @@ -124,39 +154,70 @@ border: 0, frame: true, bodyStyle: 'padding:0px auto;margin:0px', - height: 110, + height: 130, labelWidth: 90, items: [{ layout: 'column', - height: 40, + height: 60, items: [{ columnWidth: .2, layout: 'form', - items: [ - new Ext.ux.MonthField({ - id: 'startYear', - name: 'startYear', - fieldLabel: '开始年份', - readOnly: true, - anchor: '95%', - format: 'Y', - value: startYear - }) - ] + items : [{ + xtype : 'datefield', + fieldLabel : '开始日期', + id : 'startDate', + name : 'startDate', + editable : false, + format : 'Y-m-d', + 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', + allowBlank : false, + anchor : '95%', + value:new Date(startDay), + listeners : { + specialkey : function(field, e) { + if (e.getKey() == Ext.EventObject.ENTER) { + var isOK = field.validate(); + if(isOK){ + var value = field.getValue(); + field.setValue(value); + var endDate = Ext.getCmp('endDate'); + endDate.setValue(''); + endDate.focus(); + } + + } + } + } + }] }, { columnWidth: .2, layout: 'form', - items: [ - new Ext.ux.MonthField({ - id: 'endYear', - name: 'endYear', - fieldLabel: '结束年份', - readOnly: true, - anchor: '95%', - format: 'Y', - value: newYear - }) - ] + items : [{ + xtype : 'datefield', + fieldLabel : '结束日期', + id : 'endDate', + name : 'endDate', + editable : false, + format : 'Y-m-d', + 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', + allowBlank : false, + anchor : '95%', + value: currentDate, + theHours : 23, + theMinutes : 59, + listeners : { + specialkey : function(field, e) { + if (e.getKey() == Ext.EventObject.ENTER) { + var isOK = field.validate(); + if(isOK){ + var value = field.getValue(); + field.setValue(value); + } + + } + } + } + }] }, { columnWidth: .2, layout: 'form', @@ -235,6 +296,75 @@ } } }] + }, { + columnWidth: .2, + layout: 'form', + items: [{ + xtype: 'textfield', + fieldLabel: "器械包名称", + anchor: '95%', + name: "tousseName", + id: "tousseName" + }] + }, { + columnWidth: .2, + layout: 'form', + items: [{ + xtype: 'combo', + fieldLabel: "周转天数", + name: "comparisonOperators", + id: "comparisonOperators", + valueField: 'value', + displayField: 'value', + store: new Ext.data.SimpleStore( { + fields : [ 'value'], + data : [['小于'],['小于等于'],['等于'],['大于'],['大于等于'],['介于']] + }), + forceSelection: true, + editable: false, + mode: 'local', + anchor: '95%', + triggerAction: 'all', + listeners:{ + select:function(combo, records, index){ + if(combo.getValue() == '介于'){ + Ext.getCmp('startValueBox').show(); + Ext.getCmp('endValueBox').show(); + }else { + Ext.getCmp('startValueBox').show(); + Ext.getCmp('endValueBox').hide(); + } + } + } + }] + }, { + columnWidth: .1, + layout: 'form', + labelWidth:10, + id:'startValueBox', + hidden:true, + items: [{ + xtype: 'numberfield', + labelWidth:10, + labelSeparator:'', + allowDecimals : false, + name: "startValue", + id: "startValue" + }] + }, { + columnWidth: .1, + layout: 'form', + labelWidth:10, + id:'endValueBox', + hidden:true, + items: [{ + xtype: 'numberfield', + labelWidth:10, + labelSeparator:'', + allowDecimals : false, + name: "endValue", + id: "endValue" + }] }] }], buttons: [{ @@ -249,8 +379,8 @@ minWidth: 70, iconCls: 'icon_set', handler: function () { - $Id('startYear').value = startYear; - $Id('endYear').value = newYear; + $Id('startDate').value = startDate; + $Id('endDate').value = newYear; Ext.getCmp('packageTypes').setValue('全部'); } }]