Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/materialTypeWorkloadReportView.js =================================================================== diff -u -r30854 -r31202 --- ssts-web/src/main/webapp/disinfectsystem/reportforms/materialTypeWorkloadReportView.js (.../materialTypeWorkloadReportView.js) (revision 30854) +++ ssts-web/src/main/webapp/disinfectsystem/reportforms/materialTypeWorkloadReportView.js (.../materialTypeWorkloadReportView.js) (revision 31202) @@ -1,25 +1,25 @@ var entityName = "清洗区材料分类工作量统计报表"; var grid; -var rd = new Ext.data.JsonReader( { - fields : [ - {name : 'id'}, - {name : 'departId'}, - {name : 'name'} - +var rd = new Ext.data.JsonReader({ + fields: [ + { name: 'id' }, + { name: 'departId' }, + { name: 'name' } + ] }); var supplyRoomStore = 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"}, - reader : rd, - listeners :{ - 'load' : function(thiz,records,options){ - if(records.length > 0){ + baseParams: { type: "12" }, + reader: rd, + listeners: { + 'load': function (thiz, records, options) { + if (records.length > 0) { Ext.getCmp('querySupplyRoom').setValue(records[0].data.departId); Ext.getCmp('querySupplyRoom').setValue(records[0].data.name); } @@ -29,75 +29,75 @@ //supplyRoomStore.load(); var myMask; -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 - function reloadReport(){ - var monthSearch= $Id('monthSearch').value; + function reloadReport() { + var monthSearch = $Id('monthSearch').value; var querySupplyRoom = Ext.getCmp('querySupplyRoom').getValue(); - if(querySupplyRoom.indexOf(ALL) == 0){ + if (querySupplyRoom.indexOf(ALL) == 0) { querySupplyRoom = ""; } myMask = new Ext.LoadMask(Ext.getBody(), { @@ -108,94 +108,94 @@ var url = WWWROOT + '/jasperreports/jasperreportsAction!createReportFromJavaBeanSource.do'; var params = { - jasperreportName : 'materialTypeWorkloadReport.jasper', - month : monthSearch, - querySupplyRoom : querySupplyRoom, - reportName:'materialTypeWorkloadReport' + jasperreportName: 'materialTypeWorkloadReport.jasper', + month: monthSearch, + querySupplyRoom: querySupplyRoom, + reportName: 'materialTypeWorkloadReport' } - searchReport(url,params); + searchReport(url, params); } var sign = true; var dwrCallParams = null; - + var tbar = [{ - text : '导出Excel', - iconCls : 'btn_ext_refresh', - id : 'editTbar', - handler : function() { + text: '导出Excel', + iconCls: 'btn_ext_refresh', + id: 'editTbar', + handler: function () { var month = Ext.getCmp('monthSearch').getRawValue(); - location.href=WWWROOT + "/disinfectsystem/reportforms/departmentMonthlyExport.jsp?month="+month+"&reportType=科室月报明细"; + location.href = WWWROOT + "/disinfectsystem/reportforms/departmentMonthlyExport.jsp?month=" + month + "&reportType=科室月报明细"; } - } ]; + }]; - Ext.ux.ForgonPageGrid.prototype.getGridParameterMap = function() { + Ext.ux.ForgonPageGrid.prototype.getGridParameterMap = function () { }; - + var departJsonStore = new Ext.data.SimpleStore({ - fields : [ 'departName' ], - url : WWWROOT + '/disinfectSystem/reportFormsCenterAction!getAllDepartName.do' + fields: ['departName'], + url: WWWROOT + '/disinfectSystem/reportFormsCenterAction!getAllDepartName.do' }); - + var 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', - height : 110, - items : [{ - layout : 'column', - height : 40, - items : [{ - width : 220, - layout : 'form', - labelWidth : 90, - items : [new Ext.form.DateField({ - id:'monthSearch', - name : 'monthSearch', - fieldLabel : '年月', - readOnly : true, - format:'Y-m', - value : new Date(), - anchor : '95%', - listeners : { - specialkey : function(field, ee) { + title: entityName + "月报", + region: 'north', + labelAlign: 'right', + buttonAlign: 'center', + collapsible: true, + collapseMode: 'mini', + split: true, + border: 0, + frame: true, + bodyStyle: 'padding:0px auto;margin:0px', + height: 110, + items: [{ + layout: 'column', + height: 40, + items: [{ + width: 220, + layout: 'form', + labelWidth: 90, + items: [new Ext.form.DateField({ + id: 'monthSearch', + name: 'monthSearch', + fieldLabel: '年月', + readOnly: true, + format: 'Y-m', + value: new Date(), + anchor: '95%', + listeners: { + specialkey: function (field, ee) { if (ee.getKey() == Ext.EventObject.ENTER) { initQueryValueAndReload(); } } } })] - },{ - layout : 'form', - items : [{ - width : 300, - layout : 'form', - 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%', + }, { + layout: 'form', + items: [{ + width: 300, + layout: 'form', + 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、如果选中“全部”的项,则把所有的项选中,反之全部取消选择 @@ -206,16 +206,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); @@ -226,62 +226,62 @@ } } }] - -// items : [{ -// xtype : 'combo', -// id : 'querySupplyRoom', -// name : 'querySupplyRoom', -// valueField : 'departId', -// displayField : 'name', -// allowBlank : true, -// editable : false, -// store : supplyRoomStore, -// forceSelection : true, -// mode : 'local', -// triggerAction : 'all', -// anchor : '95%' -// }] + + // items : [{ + // xtype : 'combo', + // id : 'querySupplyRoom', + // name : 'querySupplyRoom', + // valueField : 'departId', + // displayField : 'name', + // allowBlank : true, + // editable : false, + // store : supplyRoomStore, + // forceSelection : true, + // mode : 'local', + // triggerAction : 'all', + // anchor : '95%' + // }] }] - + }] }], - buttons:[{ - text : '查询', - minWidth : 70, - iconCls : 'icon_search', - handler : function() { + buttons: [{ + text: '查询', + minWidth: 70, + iconCls: 'icon_search', + handler: function () { reloadReport(); } - },{ - text : '重置', - minWidth : 70, - iconCls : 'icon_set', - handler : function() { + }, { + text: '重置', + minWidth: 70, + iconCls: 'icon_set', + handler: function () { $Id('startTime').value = ""; $Id('endTime').value = ""; $Id('querySupplyRoom').value = ""; } }] }); - + 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, { - id:'reportPanel', - region : 'center', - margins : '0 0 0 0', - layout : 'fit', - items : reportForm + layout: 'border', + items: [form, { + id: 'reportPanel', + region: 'center', + margins: '0 0 0 0', + layout: 'fit', + items: reportForm }] }); //supplyRoomStore.load(); - supplyRoomRemoteStore.load();//20181225 + supplyRoomRemoteStore.load();//20181225 }); \ No newline at end of file