Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/useRecordRecyclingDelayView.jsp =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/reportforms/useRecordRecyclingDelayView.jsp (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/reportforms/useRecordRecyclingDelayView.jsp (revision 41249) @@ -0,0 +1,108 @@ +<%@ page contentType="text/html; charset=UTF-8"%> +<%@ include file="/common/taglibs.jsp"%> +<%@page import="java.util.Date"%> +<%@page import="java.text.SimpleDateFormat"%> + + + +<%@ include file="/common/includeExtJsAndCss.jsp"%> + +<% + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd"); + request.setAttribute("newDate", dateFormat.format(new Date())); +%> + + + + + + + + + + + + + + + + + + + + + + + + +消毒供应中心运作监控管理 + + + + + + + +
+
+
+ + +
+ + +
+ + + + + + \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/useRecordRecyclingDelayView.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/reportforms/useRecordRecyclingDelayView.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/reportforms/useRecordRecyclingDelayView.js (revision 41249) @@ -0,0 +1,476 @@ +var entityName = "未及时回收处理器械包统计报表"; +var appGrid; +var rowIndex = 0; +var IDS = Ext.id(); +var defaultWidth = window.screen.width >= 1366 ? 280:240; +var formHeight = window.screen.width >= 1280 ? 150:170; +// grid的高度 +var gridHeight = 530 * fontSizeScale; + +/* + *IE8以下兼容document.getElementsByClassName + */ +function documentGetElementsByClassName(document,className) { + if (!document.getElementsByClassName) { + document.getElementsByClassName = function(className) { + var children = document.getElementsByTagName('*'); + var elements = new Array(); + for (var i = 0; i < children.length; i++) { + var child = children[i]; + var classNames = child.className.split(' '); + for (var j = 0; j < classNames.length; j++) { + if (classNames[j] == className) { + elements.push(child); + break; + } + } + } + return elements; + }; + + return document.getElementsByClassName(className); + } else { + return document.getElementsByClassName(className); + } +} + +function loadData() { + var tousseName = $Id('tousseName').value; + var operation = $Id('operation').value; + var doctorName = Ext.getCmp('doctorName').getValue(); + var departCode = Ext.getCmp('departCode').getValue(); + //ie下不加IDS也能找到对应的dom + var startDate = $Id('startDate' + IDS).value || $Id('startDate').value; + var endDate = $Id('endDate' + IDS).value || $Id('endDate').value; + + if (startDate == null || startDate == '' + || endDate == null || endDate == '') { + showResult('查询时间有误,请正确选择查询时间。'); + return false; + } + var queryParam = { + tousseName: tousseName, + operation: operation, + departCode: departCode, + startDay: startDate, + endDay: endDate, + doctorName: doctorName + }; + var loader = appGrid.getLoader(); + loader.baseParams = queryParam; + rowIndex = 0; + loader.load(appGrid.root, function () { + var length = appGrid.root.childNodes.length; + if (length <= 0) { + return; + } + }); +} + +function GetDateStr(AddDayCount, hh, mm) { + var dd = new Date(); + dd.setDate(dd.getDate() + AddDayCount);//获取AddDayCount天后的日期 + var y = dd.getFullYear(); + var m = dd.getMonth() + 1;//获取当前月份的日期 + var d = dd.getDate(); + if (m < 10) { + m = "0" + m; + } + if (d < 10) { + d = "0" + d; + } + var date = new Date(); + date.setFullYear(y); + date.setMonth(m - 1); + date.setDate(d); + date.setHours(hh); + date.setMinutes(mm); + date.setSeconds(mm); + + return date; +} + +Ext.onReady(function () { + Ext.QuickTips.init(); + var tousseDefinitionStore = new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!getAllTousseDefinitionData.do', + method : 'POST' + }), + reader : new Ext.data.JsonReader({ + totalProperty : 'totalCount', + root : 'data' + }, [ + {name : 'id',mapping : 'id'}, + {name : 'spelling',mapping : 'spelling'}, + {name : 'name',mapping : 'name'}, + {name : 'displayName',mapping : 'displayName'}, + {name : 'amount',mapping : 'amount'}] + ),listeners : { + beforeload : function (){ + tousseDefinitionStore.baseParams["tousseTypes"] = '聚合包,器械包,外部代理灭菌,外来器械包,外来器械拆分小包,消毒物品,自定义器械包' + tousseDefinitionStore.baseParams["distinctName"] = true;//同名只返回一个 + } + } + }); + + var departRecord = Ext.data.Record.create([ { + name : 'id' + }, { + name : 'name' + } ]); + var departJsonStore = new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getAllOrgUnitName.do', + method : 'POST' + }), + reader : new Ext.data.JsonReader({ + root : 'data' + },departRecord + ), + listeners:{ + load : function(thiz,records,options){ + thiz.insert(0, new departRecord({id:"",name:"全部"})); + } + } + }); + + var operationNameStore = new Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectsystem/basedatamanager/operationOrgAction!findOrgUnitOperationName.do', + method: 'POST' + }), + reader: new Ext.data.JsonReader({ + totalProperty: 'totalCount', + root: 'data' + }, [ + { name: 'id', mapping: 'id' }, + { name: 'operationName', mapping: 'operationName' }] + ) + }); + + var dt = new Date(); + var startDayofMonth = dt.getFullYear() + "/" + (dt.getMonth() + 1) + "/01"; + var startDate = startDayofMonth + " 00:00:00"; + var endDateValue = newDate + " 23:59:59"; + var form = new Ext.form.FormPanel({ + title: entityName, + region: 'north', + buttonAlign: 'center', + labelAlign: 'right', + // collapsible: true, + // collapseMode: 'mini', + split: true, + border: 0, + frame: true, + bodyStyle: 'padding:0px auto;margin:0px', + height: formHeight, + items: [{ + layout: 'column', + height: 103, + labelWidth: 130, + items: [{ + width: defaultWidth, + layout: 'form', + labelWidth: 90, + height: 30, + items: [{ + xtype: 'datefieldWithMin', + id: 'startDate' + IDS, + name: 'startDate', + fieldLabel: '开始时间', + format: 'Y-m-d H:i:s', + value: new Date(startDate), + theHours: 0, + theMinutes: 0, + anchor: '95%', + 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 endTime = Ext.getCmp('endDate'); + endTime.setValue(''); + endTime.focus(); + } + + } + } + } + }] + }, { + width: defaultWidth, + layout: 'form', + labelWidth: 90, + height: 30, + items: [{ + xtype: 'datefieldWithMin', + id: 'endDate' + IDS, + name: 'endDate', + fieldLabel: '结束时间', + format: 'Y-m-d H:i:s', + theHours: 23, + theMinutes: 59, + value: new Date(endDateValue), + anchor: '95%' + }] + }, { + width: defaultWidth, + layout: 'form', + labelWidth: 90, + height: 30, + items: [{//20181225 + xtype: 'multiSelect', + fieldLabel: '手术名称', + id: 'operation', + name: 'operation', + valueField: 'operationName', + displayField: 'operationName', + minChars: 0, + allowBlank: true, + editable: false, + store: operationNameStore, + forceSelection: false, + // mode: 'local', + triggerAction: 'all', + lazyInit: true, + typeAhead: false, + anchor: '95%' + }] + }, { + width: defaultWidth, + layout: 'form', + labelWidth: 90, + height: 30, + items: [{ + xtype: 'textfield', + id: 'doctorName', + name: 'doctorName', + fieldLabel: '医生名称', + anchor: '95%' + }] + }, { + width: defaultWidth, + layout: 'form', + labelWidth: 90, + height: 30, + items: [{ + xtype: 'combo', + id: 'tousseName', + name: 'tousseName', + queryParam: 'spell', + fieldLabel: '器械包名称', + minChars: 0, + valueField: 'name', + displayField: 'name', + anchor: '95%', + listWidth: 370, + store: tousseDefinitionStore, + lazyInit: true, + triggerAction: 'all', + hideTrigger: true, + typeAhead: false, + allowBlank: true + }] + }, { + width: defaultWidth, + layout: 'form', + labelWidth: 90, + height: 30, + items: [{ + xtype: 'combo', + id: 'departCode', + name: 'departCode', + queryParam: 'spell', + fieldLabel: '科室', + minChars: 0, + valueField: 'id', + displayField: 'name', + anchor: '95%', + listWidth: 370, + store: departJsonStore, + lazyInit: true, + triggerAction: 'all', + hideTrigger: true, + typeAhead: false, + allowBlank: true + }] + }] + }], + buttonAlign: 'center', + buttons: [ { + text: '查询', + minWidth: 70, + iconCls: 'icon_search', + handler: function () { + loadData(); + } + }, { + text: '重置', + minWidth: 70, + iconCls: 'icon_set', + handler: function () { + $Id('tousseName').value; + $Id('departCode').value = ""; + $Id('operation').value = ""; + $Id('doctorName').value = ""; + Ext.getCmp('tousseName').setValue(""); + Ext.getCmp('departCode').setValue(""); + Ext.getCmp('operation').setValue(""); + Ext.getCmp('doctorName').setValue(""); + Ext.getCmp('startDate' + IDS).setValue(new Date(startDate)); + Ext.getCmp('endDate' + IDS).setValue(new Date(endDateValue)); + } + }] + }); + //回收记录信息 + var appColumns = [ + {xtype: 'rownumberer', width: 40, align: 'center',renderer:function(v, p, record){ + if(p.attributes.children){ + rowIndex++; + return rowIndex; + }else { + return ''; + } + }}, + { header: "日期", width: 120 * fontSizeScale, dataIndex: 'date'}, + { header: "器械包名称", width: 120 * fontSizeScale, dataIndex: 'tousseName'}, + { header: "器械包条码", width: 120 * fontSizeScale, dataIndex: 'barcode'}, + { header: "超过半小时回收数量", width: 120 * fontSizeScale, dataIndex: 'halfHourRecycledCount'}, + { header: "超过1小时回收数量", width: 120 * fontSizeScale, dataIndex: 'oneHourRecycledCount'}, + { header: "超过2小时回收数量", width: 120 * fontSizeScale, dataIndex: 'twoHourRecycledCount'}, + { header: "病人姓名", width: 120 * fontSizeScale, dataIndex: 'patientName'}, + { header: "手术间", width: 120 * fontSizeScale, dataIndex: 'operationRoom'}, + { header: "巡回护士", width: 120 * fontSizeScale, dataIndex: 'circuitNurse'}, + { header: "手术名称", width: 180 * fontSizeScale, dataIndex: 'operation' }, + { header: "状态", width: 60 * fontSizeScale, dataIndex: 'status' }, + { width: 18} + ]; + appGrid = new Ext.tree.ColumnTree({ + rootVisible: false, + autoScroll: true, + title: entityName, + // height: '100%', //gridHeight, + autoHeight: true, + frame: false, + columns: appColumns, + loader: new Ext.tree.TreeLoader({ + url: WWWROOT + '/disinfectSystem/reports/recyclingdelay.mhtml', + requestMethod: 'GET', + uiProviders: { + 'col': top.Ext.tree.ColumnNodeUI + }, + listeners: { + // 在加载前处理数据 + beforeload: function(treeLoader, node) { + // 设置请求参数 + var tousseName = $Id('tousseName').value; + var operation = $Id('operation').value; + var departCode = Ext.getCmp('departCode').getValue(); + var doctorName = Ext.getCmp('doctorName').getValue(); + var startDate = $Id('startDate' + IDS).value || $Id('startDate').value; + var endDate = $Id('endDate' + IDS).value || $Id('endDate').value; + + treeLoader.baseParams = { + tousseName: tousseName, + operation: operation, + doctorName: doctorName, + startDay: startDate, + endDay: endDate, + departCode: departCode + }; + }, + load: function(treeLoader, node, response) { + appGrid.getEl().unmask(); + } + }, + processResponse: function (response, node, callback) { + try { + var json = response.responseText; + var o = Ext.decode(json); + if (o.success && o.data) { + // 转换数据格式为树形结构 + var treeData = []; + Ext.each(o.data, function(dateRecord) { + var dateNode = { + text: '', + date: dateRecord.date, + halfHourRecycledCount: dateRecord.halfHourRecycledCount, + oneHourRecycledCount: dateRecord.oneHourRecycledCount, + twoHourRecycledCount: dateRecord.twoHourRecycledCount, + expanded: false, // 默认不展开 + uiProvider: "col", + cls: "master-task", + iconCls: "task-folder", + children: [] + }; + + // 添加器械包详情作为子节点 + if (dateRecord.tousseInstances && dateRecord.tousseInstances.length > 0) { + Ext.each(dateRecord.tousseInstances, function(tousse) { + var halfHourRecycledCount = tousse.recyclingDelayType===1?1:0; + var oneHourRecycledCount = tousse.recyclingDelayType===2?1:0; + var twoHourRecycledCount = tousse.recyclingDelayType===3?1:0; + dateNode.children.push({ + text: '', + tousseName: tousse.tousseName, + barcode: tousse.barcode, + operation: tousse.operation, + operationRoom: tousse.operationRoom, + patientName: tousse.patientName, + halfHourRecycledCount: halfHourRecycledCount, + oneHourRecycledCount: oneHourRecycledCount, + twoHourRecycledCount: twoHourRecycledCount, + // recyclingDelayType: tousse.recyclingDelayType, + circuitNurse: tousse.circuitNurse, + status: tousse.status, + uiProvider: "col", + leaf: true, + iconCls: 'task' + }); + }); + } + + treeData.push(dateNode); + }); + + // 替换响应数据 + response.responseText = Ext.encode(treeData); + } + } catch(e) { + console.error('数据处理错误:', e); + } + + // 调用父类方法继续处理 + Ext.tree.TreeLoader.prototype.processResponse.call(this, response, node, callback); + } + }), + root: new top.Ext.tree.AsyncTreeNode({ + text: '器械包名称' + }) + }); + + var reportForm = new Ext.Panel({ + id: 'reportFormID', + frame: false,//渲染面板 + autoScroll: true,//自动显示滚动条 + autoHeight: true, + collapsible: true,//允许展开和收缩 + bodyStyle: 'border:1px solid #afd7af; height: 100%;', + bodyPadding: 0, + items: appGrid + }); + + var viewport = new Ext.Viewport({ + layout: 'border', + items: [form, { + region: 'center', + margins: '0 0 0 0', + autoHeight: true, + layout: 'fit', + items: reportForm + }] + }); +}); \ No newline at end of file