Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/tousseDeliverStatisticsView.js =================================================================== diff -u -r30854 -r37770 --- ssts-web/src/main/webapp/disinfectsystem/reportforms/tousseDeliverStatisticsView.js (.../tousseDeliverStatisticsView.js) (revision 30854) +++ ssts-web/src/main/webapp/disinfectsystem/reportforms/tousseDeliverStatisticsView.js (.../tousseDeliverStatisticsView.js) (revision 37770) @@ -5,17 +5,17 @@ * */ var myMask; -function reloadReport(){ - +function reloadReport() { + if (!form.getForm().isValid()) { showResult('请正确填写表单各值'); return false; } - - var startTime= $Id('startTime').value; + + var startTime = $Id('startTime').value; var endTime = $Id('endTime').value; var departCoding = Ext.getCmp('querySupplyRoom').getValue();//20181225 - if(departCoding.indexOf(ALL) == 0){ + if (departCoding.indexOf(ALL) == 0) { departCoding = ""; } myMask = new Ext.LoadMask(Ext.getBody(), { @@ -26,146 +26,146 @@ var url = WWWROOT + '/jasperreports/jasperreportsAction!createJasperPrint.do'; var params = { - jasperreportName : 'tousseDeliverStatistics.jasper', - startDay : startTime, - endDay : endTime, - departCoding : departCoding, - reportName:'tousseDeliverStatistics' + jasperreportName: 'tousseDeliverStatistics.jasper', + startDay: startTime, + endDay: endTime, + departCoding: departCoding, + reportName: 'tousseDeliverStatistics' } - - searchReport(url,params); + + searchReport(url, params); } -Ext.onReady(function() { +Ext.onReady(function () { Ext.QuickTips.init(); //20181225 var supplyRoomRecord = Ext.data.Record.create([ - {name: 'departCode', type: 'string'}, - {name: 'name', type: 'string'} + { name: 'departCode', type: 'string' }, + { name: 'name', type: 'string' } ]); var supplyRoomStore = new Ext.data.SimpleStore({ - fields : ['departCode','name'] - }); + fields: ['departCode', 'name'] + }); var supplyRoomRemoteStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!loadSupplyRoomConfigRoom.do', - method : 'POST' + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!loadSupplyRoomConfigRoom.do', + method: 'POST' }), - baseParams :{type:"12"}, + baseParams: { type: "12" }, // reader : rd, - reader : new Ext.data.JsonReader({ - fields : [ - {name : 'id', mapping : 'id'}, - {name : 'departCode', mapping : 'departId'}, - {name : 'name', mapping : 'name'} + reader: new Ext.data.JsonReader({ + fields: [ + { name: 'id', mapping: 'id' }, + { name: 'departCode', mapping: 'departId' }, + { name: 'name', mapping: 'name' } ] }), - listeners:{ - beforeload : function(){ + listeners: { + beforeload: function () { loadMask = new Ext.LoadMask(Ext.getBody(), { - msg: '正在加载供应室...,请稍候!',removeMask: true + msg: '正在加载供应室...,请稍候!', removeMask: true }); loadMask.show(); }, - load :function (thiz,records,options ){ + load: function (thiz, records, options) { loadMask.hide(); var currentOrgUnitIsSupplyRoom = false; - if(records && records.length > 0){ + if (records && records.length > 0) { for (var i = 0; i < records.length; i++) { var supplyRoomData = records[i].data; var departCodeTemp = supplyRoomData.departCode; //如果没有查看其它供应室权限时,只显示是当前用户的科室 - if(SSTS_View_All_Supply_Room_Report){ - if(departCodeTemp == currentOrgUnitCoding){ - supplyRoomStore.add(new supplyRoomRecord({'departCode':departCodeTemp,'name':supplyRoomData.name})); + if (SSTS_View_All_Supply_Room_Report) { + if (departCodeTemp == currentOrgUnitCoding) { + supplyRoomStore.add(new supplyRoomRecord({ 'departCode': departCodeTemp, 'name': supplyRoomData.name })); currentOrgUnitIsSupplyRoom = true; } - }else{ - supplyRoomStore.add(new supplyRoomRecord({'departCode':departCodeTemp,'name':supplyRoomData.name})); - if(departCodeTemp == currentOrgUnitCoding){ + } else { + supplyRoomStore.add(new supplyRoomRecord({ 'departCode': departCodeTemp, 'name': supplyRoomData.name })); + if (departCodeTemp == currentOrgUnitCoding) { currentOrgUnitIsSupplyRoom = true; } } } } - if(supplyRoomStore.getCount() > 1){ - supplyRoomStore.insert(0 , new supplyRoomRecord({'departCode':ALL,'name':ALL})); + if (supplyRoomStore.getCount() > 1) { + supplyRoomStore.insert(0, new supplyRoomRecord({ 'departCode': ALL, 'name': ALL })); } //最后使供应室下拉框默认选中用户所属的当前的科室(前提是用户所属的当前的科室也在选项中) - if(currentOrgUnitIsSupplyRoom){ + if (currentOrgUnitIsSupplyRoom) { Ext.getCmp('querySupplyRoom').setValue(currentOrgUnitCoding); } } } }); //20181225 end form = new Ext.form.FormPanel({ - title : entityName, - region : 'north', - labelAlign : 'right', - buttonAlign : 'center', - collapsible : true, - collapseMode : 'mini', - split : true, - border : 0, - frame : true, - bodyStyle : 'padding:0px auto;margin:0px',// padding:1px;padding-top:5px; - height : 110, - labelWidth : 80, - items : [{ - layout : 'column', - height : 40, - items : [{ - columnWidth : .3, - layout : 'form', - items : [{ - xtype : 'datefield', - fieldLabel : '开始日期', - id : 'startTime', - name : 'startTime', - 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%', + title: entityName, + region: 'north', + labelAlign: 'right', + buttonAlign: 'center', + collapsible: true, + collapseMode: 'mini', + split: true, + border: 0, + frame: true, + bodyStyle: 'padding:0px auto;margin:0px',// padding:1px;padding-top:5px; + height: 110, + labelWidth: 80, + items: [{ + layout: 'column', + height: 40, + items: [{ + columnWidth: .3, + layout: 'form', + items: [{ + xtype: 'datefield', + fieldLabel: '开始日期', + id: 'startTime', + name: 'startTime', + 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(), - listeners : { - specialkey : function(field, e) { + listeners: { + specialkey: function (field, e) { if (e.getKey() == Ext.EventObject.ENTER) { var isOK = field.validate(); - if(isOK){ + if (isOK) { var value = field.getValue(); field.setValue(value); var endTime = Ext.getCmp('endTime'); endTime.selectText(); endTime.focus(); } - + } } } }] - },{ - columnWidth : .3, - layout : 'form', - items : [{ - xtype : 'datefield', - fieldLabel : '结束日期', - id : 'endTime', - name : 'endTime', - 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%', + }, { + columnWidth: .3, + layout: 'form', + items: [{ + xtype: 'datefield', + fieldLabel: '结束日期', + id: 'endTime', + name: 'endTime', + 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(), - listeners : { - specialkey : function(field, e) { + listeners: { + specialkey: function (field, e) { if (e.getKey() == Ext.EventObject.ENTER) { var isOK = field.validate(); - if(isOK){ + if (isOK) { var value = field.getValue(); field.setValue(value); reloadReport(); @@ -174,27 +174,27 @@ } } }] - },{ - columnWidth : .3, - layout : 'form', - labelWidth : 90, - labelSeparator : '选择供应室:', - items : [{//20181225 - xtype : 'multiSelect', - id : 'querySupplyRoom', - name : 'querySupplyRoom', - valueField : 'departCode', - displayField : 'name', - minChars : 0, - allowBlank : true, - editable : false, - store : supplyRoomStore, - forceSelection : false, - mode : 'local', - triggerAction : 'all', - lazyInit : true, - typeAhead : false, - anchor : '95%', + }, { + columnWidth: .3, + layout: 'form', + labelWidth: 90, + labelSeparator: '选择供应室:', + items: [{//20181225 + xtype: 'multiSelect', + id: 'querySupplyRoom', + name: 'querySupplyRoom', + valueField: 'departCode', + displayField: 'name', + minChars: 0, + allowBlank: true, + editable: false, + store: supplyRoomStore, + forceSelection: false, + mode: 'local', + triggerAction: 'all', + lazyInit: true, + typeAhead: false, + anchor: '95%', listeners: { select: function (combo, record, index) { //1、如果选中“全部”的项,则把所有的项选中,反之全部取消选择 @@ -205,16 +205,16 @@ combo.deselectAll(); } } - + //2、如果已经选中所有的项,则把“全部”项选中,反之把“全部”项取消选择 var selectAll = true; - combo.store.each(function(record) { + combo.store.each(function (record) { if (record.get('departCode') != ALL && !record.get(this.checkField)) { selectAll = false; return; } }, combo); - + var all = combo.store.getAt(0); if (selectAll) { all.set(combo.checkField, true); @@ -225,95 +225,95 @@ } } }] - -// items : [{ -// xtype : 'combo', -// id : 'querySupplyRoom', -// name : 'querySupplyRoom', -// valueField : 'departCode', -// displayField : 'name', -// allowBlank : true, -// editable : false, -// store : supplyRoomStore, -// forceSelection : true, -// mode : 'local', -// triggerAction : 'all', -// anchor : '95%', -// listeners : { -// render : function(_this) { -// supplyRoomStore.load(); -// } -// } -// }] -// + + // items : [{ + // xtype : 'combo', + // id : 'querySupplyRoom', + // name : 'querySupplyRoom', + // valueField : 'departCode', + // displayField : 'name', + // allowBlank : true, + // editable : false, + // store : supplyRoomStore, + // forceSelection : true, + // mode : 'local', + // triggerAction : 'all', + // anchor : '95%', + // listeners : { + // render : function(_this) { + // supplyRoomStore.load(); + // } + // } + // }] + // }] }], - buttons:[{ - xtype : 'button', - text : '查询', - minWidth : 70, - iconCls : 'icon_search', - handler : function() { + buttons: [{ + xtype: 'button', + text: '查询', + minWidth: 70, + iconCls: 'icon_search', + handler: function () { reloadReport(); } - },{ - xtype : 'button', - text : '重置', - minWidth : 70, - iconCls : 'icon_set', - handler : function() { + }, { + xtype: 'button', + text: '重置', + minWidth: 70, + iconCls: 'icon_set', + handler: function () { $Id('startTime').value = ""; $Id('endTime').value = ""; } - },{ - xtype : 'button', - text : '设置统计的器械包', - minWidth : 100, - iconCls : 'icon_set', - handler : function(){ + }, { + xtype: 'button', + text: '设置统计的器械包', + minWidth: 100, + iconCls: 'icon_set', + handler: function () { var code = Ext.getCmp('querySupplyRoom').getValue(); - if(code.length <= 0){ + if (code.length <= 0) { showResult("请选择供应室"); return false; } setNeedStatisticsTousse(model, code, null); } }] }); - - + + var reportForm = new Ext.Panel({ - frame:false,//渲染面板 - autoScroll:true,//自动显示滚动条 - collapsible:true,//允许展开和收缩 - bodyPadding:5, - html:'' + frame: false,//渲染面板 + autoScroll: true,//自动显示滚动条 + collapsible: true,//允许展开和收缩 + bodyPadding: 5, + html: '' }); - + var viewport = new Ext.Viewport({ - layout : 'border', - items : [form, { - region : 'center', - margins : '0 0 0 0', - layout : 'fit', - items : reportForm + layout: 'border', + items: [form, { + region: 'center', + margins: '0 0 0 0', + layout: 'fit', + items: reportForm }] }); - + Ext.Ajax.request({ - url : WWWROOT + '/system/serverTimeAction!getServerDateTime.do', - params:{dateformat:"yyyy/MM/dd"}, - success : function(response, options) { + url: WWWROOT + '/system/serverTimeAction!getServerDateTime.do', + params: { dateformat: "yyyy/MM/dd" }, + success: function (response, options) { var result = Ext.decode(response.responseText); - if(result.success){ + if (result.success) { var servertime = result.serverTime; Ext.getCmp('startTime').setValue(new Date(servertime)); Ext.getCmp('endTime').setValue(new Date(servertime)); reloadReport(); } }, - failure : function(response, options) { + failure: function (response, options) { } }); supplyRoomRemoteStore.load();//20181225