Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/urgentNeedGoodsProcessingCycleView.js =================================================================== diff -u -r36851 -r38147 --- ssts-web/src/main/webapp/disinfectsystem/reportforms/urgentNeedGoodsProcessingCycleView.js (.../urgentNeedGoodsProcessingCycleView.js) (revision 36851) +++ ssts-web/src/main/webapp/disinfectsystem/reportforms/urgentNeedGoodsProcessingCycleView.js (.../urgentNeedGoodsProcessingCycleView.js) (revision 38147) @@ -1,138 +1,320 @@ var entityName = "急用物品处理周期统计报表"; var form; +var widthArr = []; +var is2Column = true; + +function getTitleColumn() { + var titleColumnArr = [{ + title: '日期', + dataIndex: 'recyclingDate', + width: 100 + }, { + title: '物品名称', + dataIndex: 'goodsName', + width: 100 + }, { + title: '申请单号', + dataIndex: 'serialNumber', + width: 100 + }, { + title: '申请科室', + dataIndex: 'depart', + width: 100 + }, { + title: '外来器械拆分小包', + dataIndex: 'splitTousseName', + width: 120 + }, { + title: '加急类型', + dataIndex: 'urgentLevel', + width: 100 + }, { + title: '回收时间', + dataIndex: 'recyclingTime', + width: 100 + }, { + title: '发货时间', + dataIndex: 'deliveryTime', + width: 100 + }] + if (sstsConfig.extendedColumnConfigOfUrgentNeedGoodsProcessingCycleReport) { + var extendedColumnConfigOfUrgentNeedGoodsProcessingCycleReport = sstsConfig.extendedColumnConfigOfUrgentNeedGoodsProcessingCycleReport || []; + if (extendedColumnConfigOfUrgentNeedGoodsProcessingCycleReport.indexOf('useTime') >= 0) { + titleColumnArr.push({ + title: '使用时间', + dataIndex: 'enteringDateStr', + width: 100 + }) + } + if (extendedColumnConfigOfUrgentNeedGoodsProcessingCycleReport.indexOf('useTime') >= 0) { + titleColumnArr.push({ + title: '回收与使用间隔时长(分钟)', + dataIndex: 'intervalBetweenRecyclingAndUse', + width: 100 + }) + } + } + titleColumnArr = titleColumnArr.concat([{ + title: '加急处理总时长(分钟)', + dataIndex: 'totalDuration', + width: 100 + }, { + title: '回收-清洗交接时长(分钟)', + dataIndex: 'recyclingToWashTransitionDuration', + width: 100 + }, { + title: '装配-入炉灭菌时长(分钟)', + dataIndex: 'packingToSterilizationDuration', + width: 100 + }, { + title: '灭菌完成-发货时长(分钟)', + dataIndex: 'sterilizationToDeliveryDuration', + width: 100 + }, { + title: '清洗时长(分钟)', + dataIndex: 'washTime', + width: 120 + }, { + title: '灭菌方式', + dataIndex: 'sterilerGroup', + width: 100 + }, { + title: '灭菌时长(分钟)', + dataIndex: 'sterilizationDuration', + width: 120 + }, { + title: '器械包条码', + dataIndex: 'barcode', + width: 100 + }, { + title: '标识牌条码', + dataIndex: 'idCardInstanceBarcode', + width: 100 + }]) + + return titleColumnArr; +} + +function getTableHtml(result) { + var getHeadTdHtml = ''; + var sumWidth = 0; + for (var i = 0; i < result.parametMap.titleColumnArr.length; i++) { + var title = result.parametMap.titleColumnArr[i].title; + var width = result.parametMap.titleColumnArr[i].width; + getHeadTdHtml += getHeadTd(title, width, 1, 1); + widthArr.push(width); + sumWidth += width; + } + var html = "
查询无数据
'; + myMask.hide(); + } + }, + failure: function (response, options) { + showResult(response.responseText); + myMask.hide() + } + }); } -Ext.onReady(function() { +Ext.onReady(function () { Ext.QuickTips.init(); - + var dt = new Date(); var startDayofMonth = dt.getFullYear() + "/" + (dt.getMonth() + 1) + "/01"; 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); } } } }); //“器械包combo”的数据储存器 var tousseStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!searchTousseByTypeArr.do', - method : 'POST' + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!searchTousseByTypeArr.do', + method: 'POST' }), - reader : new Ext.data.JsonReader({ - totalProperty : 'totalCount', - root : 'data' + reader: new Ext.data.JsonReader({ + totalProperty: 'totalCount', + root: 'data' }, [ - {name : 'id',mapping : 'id'}, - {name : 'name',mapping : 'name'}] + { name: 'id', mapping: 'id' }, + { name: 'name', mapping: 'name' }] ) }); @@ -160,88 +342,88 @@ } } }); - + 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 : 140, - items : [{ - layout : 'column', - height : 60, - labelWidth : 70, - items : [{ + 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: 140, + items: [{ + layout: 'column', + height: 60, + labelWidth: 70, + items: [{ columnWidth: .25, - layout : 'form', - items : [{ - xtype : 'datefield', - fieldLabel : '开始日期', - id : 'startTime', - name : 'startTime', - format : 'Y-m-d', - allowBlank : true, - anchor : '95%', - value : new Date(startDayofMonth) + layout: 'form', + items: [{ + xtype: 'datefield', + fieldLabel: '开始日期', + id: 'startTime', + name: 'startTime', + format: 'Y-m-d', + allowBlank: true, + anchor: '95%', + value: new Date(startDayofMonth) }] - },{ + }, { columnWidth: .25, - layout : 'form', - items : [{ - xtype : 'datefield', - fieldLabel : '结束日期', - id : 'endTime', - name : 'endTime', - format : 'Y-m-d', - allowBlank : true, - anchor : '95%', - value : dt + layout: 'form', + items: [{ + xtype: 'datefield', + fieldLabel: '结束日期', + id: 'endTime', + name: 'endTime', + format: 'Y-m-d', + allowBlank: true, + anchor: '95%', + value: dt }] - },{ + }, { columnWidth: .25, - layout : 'form', - labelWidth : 100, - labelSeparator : '选择器械包:', - items : [{ - xtype : 'combo', - id : 'tousse', - name : 'tousse', - valueField : 'id', - displayField : 'name', - store : tousseStore, - forceSelection : true, - triggerAction : 'all', - queryParam : 'spell', - minChars : 0, - anchor : '95%' + layout: 'form', + labelWidth: 100, + labelSeparator: '选择器械包:', + items: [{ + xtype: 'combo', + id: 'tousse', + name: 'tousse', + valueField: 'id', + displayField: 'name', + store: tousseStore, + forceSelection: true, + triggerAction: 'all', + queryParam: 'spell', + minChars: 0, + anchor: '95%' }] - },{ + }, { columnWidth: .25, - layout : 'form', - labelWidth : 100, - labelSeparator : '选择供应室:', - items : [{ - 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', + labelWidth: 100, + labelSeparator: '选择供应室:', + items: [{ + 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、如果选中“全部”的项,则把所有的项选中,反之全部取消选择 @@ -252,16 +434,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); @@ -272,30 +454,30 @@ } } }] - },{ + }, { columnWidth: .25, - layout : 'form', - labelWidth : 100, - labelSeparator : '器械包类型:', - items : [{ - xtype : 'multiSelect', - id : 'tousseTypes', - name : 'tousseTypes', - valueField : 'value', - displayField : 'text', - minChars : 0, - allowBlank : true, - editable : false, + layout: 'form', + labelWidth: 100, + labelSeparator: '器械包类型:', + items: [{ + xtype: 'multiSelect', + id: 'tousseTypes', + name: 'tousseTypes', + valueField: 'value', + displayField: 'text', + minChars: 0, + allowBlank: true, + editable: false, store: new Ext.data.SimpleStore({ - fields: ['text','value'], + fields: ['text', 'value'], data: tousseTypeDataArray }), - forceSelection : false, - mode : 'local', - triggerAction : 'all', - lazyInit : true, - typeAhead : false, - anchor : '95%', + forceSelection: false, + mode: 'local', + triggerAction: 'all', + lazyInit: true, + typeAhead: false, + anchor: '95%', listeners: { select: function (combo, record, index) { //1、如果选中“全部”的项,则把所有的项选中,反之全部取消选择 @@ -306,16 +488,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); @@ -326,12 +508,12 @@ } } }] - },{ + }, { columnWidth: .25, - layout : 'form', - labelWidth : 100, - labelSeparator : '申请科室:', - items : [{ + layout: 'form', + labelWidth: 100, + labelSeparator: '申请科室:', + items: [{ xtype: 'multiSelect', id: 'departs', name: 'departs', @@ -358,15 +540,15 @@ } } }] - },{ + }, { columnWidth: .25, layout: 'form', - hidden:!sstsConfig.enableInstrumentSetTypeSetting, + hidden: !sstsConfig.enableInstrumentSetTypeSetting, items: [{ - xtype:'hidden', - id:'instrumentSetTypeIds', - name:'instrumentSetTypeIds' - },{ + xtype: 'hidden', + id: 'instrumentSetTypeIds', + name: 'instrumentSetTypeIds' + }, { xtype: 'trigger', fieldLabel: "器械包种类", allowBlank: true, @@ -394,49 +576,48 @@ }] }] }], - 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 () { Ext.getCmp('startTime').setValue(new Date(startDayofMonth)) Ext.getCmp('endTime').setValue(dt); Ext.getCmp('tousse').setValue(''); Ext.getCmp('tousseTypes').setValue(''); - if(sstsConfig.enableInstrumentSetTypeSetting){ + if (sstsConfig.enableInstrumentSetTypeSetting) { Ext.getCmp('instrumentSetTypeIds').setValue(""); Ext.getCmp('tousseSetTypeName').setValue(""); } } }] }); - - - var reportForm = new Ext.Panel({ - frame:false,//渲染面板 - autoScroll:true,//自动显示滚动条 - collapsible:true,//允许展开和收缩 - bodyPadding:5, - html:'' + + var reportForm = new Ext.Panel({ + 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 }] }); supplyRoomRemoteStore.load();