Index: ssts-web/src/main/webapp/disinfectsystem/config/zsykzx/config.js =================================================================== diff -u -r41226 -r41267 --- ssts-web/src/main/webapp/disinfectsystem/config/zsykzx/config.js (.../config.js) (revision 41226) +++ ssts-web/src/main/webapp/disinfectsystem/config/zsykzx/config.js (.../config.js) (revision 41267) @@ -266,8 +266,10 @@ OCRServerAddress: 'http://192.168.2.229:5000', //启用第三方标识牌条码功能 enbaleThirdPartyIdCard:true, - // 是否启用未录入使用记录器械包报表 ZSYKEQ-26 - enableUnusedTousseInstanceReport: true + // 是否启用未录入使用记录器械包报表 ZSYKEQ-26 + enableUnusedTousseInstanceReport: true, + // 是否启用未及时回收处理的器械包统计报表 ZSYKEQ-12 + enableUseRecordRecyclingDelayReport: true Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/useRecordRecyclingDelayView.js =================================================================== diff -u -r41256 -r41267 --- ssts-web/src/main/webapp/disinfectsystem/reportforms/useRecordRecyclingDelayView.js (.../useRecordRecyclingDelayView.js) (revision 41256) +++ ssts-web/src/main/webapp/disinfectsystem/reportforms/useRecordRecyclingDelayView.js (.../useRecordRecyclingDelayView.js) (revision 41267) @@ -1,232 +1,102 @@ 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; +var IDS = Ext4.id(); +var defaultWidth = window.screen.width >= 1366 ? 280 : 240; +var formHeight = window.screen.width >= 1280 ? 150 : 170; +var gridHeight = 530 * (window.fontSizeScale || 1); -/* - *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; - }; +Ext4.onReady(function() { + Ext4.QuickTips.init(); - 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; - } + // 定义数据模型 + Ext4.define('RecyclingRecord', { + extend: 'Ext4.data.Model', + fields: [ + 'date', + 'halfHourRecycledCount', + 'oneHourRecycledCount', + 'twoHourRecycledCount', + 'tousseName', + 'barcode', + 'operation', + 'operationRoom', + 'patientName', + 'circuitNurse', + 'status' + ] }); -} -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(); - - function adjustLayoutHeight() { - if (!viewport || !appGrid || !reportForm) return; - - setTimeout(function() { - try { - // 方法1:使用视口高度计算 - var viewportHeight = Ext.getBody().getViewSize().height; - var formEl = form.getEl(); - var formHgt = form.collapsed ? 0 : (formEl ? formEl.getHeight() : formHeight); - - // 方法2:使用 Viewport 内部计算 - var centerRegion = viewport.findBy(function(comp) { - return comp.region === 'center'; - })[0]; - - var availableHeight; - if (centerRegion && centerRegion.getHeight) { - availableHeight = centerRegion.getHeight(); - } else { - // 备用计算方法 - availableHeight = viewportHeight - formHgt - 10; - } - - // 确保合理的高度范围 - availableHeight = Math.max(300, availableHeight); - - // console.log('高度计算 - 视口:', viewportHeight, '表单:', formHgt, '可用:', availableHeight); - - // 设置 Grid 高度 - reportForm.setHeight(availableHeight); - appGrid.setHeight(availableHeight - 10); - - // 强制刷新 - if (viewport.doLayout) { - viewport.doLayout(); - } - if (reportForm.doLayout) { - reportForm.doLayout(); - } - - } catch(e) { - console.error('高度调整错误:', e); + // 存储定义 + var tousseDefinitionStore = Ext4.create('Ext4.data.Store', { + proxy: { + type: 'ajax', + url: WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!getAllTousseDefinitionData.do', + method: 'POST', + reader: { + type: 'json', + root: 'data' } - }, 100); - } - - 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;//同名只返回一个 + }, + fields: ['id', 'spelling', 'name', 'displayName', 'amount'], + listeners: { + beforeload: function(store) { + store.getProxy().extraParams = { + tousseTypes: '聚合包,器械包,外部代理灭菌,外来器械包,外来器械拆分小包,消毒物品,自定义器械包', + 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 departJsonStore = Ext4.create('Ext4.data.Store', { + proxy: { + type: 'ajax', + url: WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getAllOrgUnitName.do', + method: 'POST', + reader: { + type: 'json', + root: 'data' } + }, + fields: ['id', 'name'], + listeners: { + load: function(store, records) { + store.insert(0, { id: "", name: "全部" }); + } } }); - var operationNameStore = new Ext.data.Store({ - proxy: new Ext.data.HttpProxy({ + var operationNameStore = Ext4.create('Ext4.data.Store', { + proxy: { + type: 'ajax', url: WWWROOT + '/disinfectsystem/basedatamanager/operationOrgAction!findOrgUnitOperationName.do', - method: 'POST' - }), - reader: new Ext.data.JsonReader({ - totalProperty: 'totalCount', + method: 'POST', + reader: { + type: 'json', root: 'data' - }, [ - { name: 'id', mapping: 'id' }, - { name: 'operationName', mapping: 'operationName' }] - ) + } + }, + fields: ['id', '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({ + var endDateValue = (window.newDate || new Date().toISOString().split('T')[0]) + " 23:59:59"; + + // 创建表单 + var form = Ext4.create('Ext4.form.FormPanel', { title: entityName, region: 'north', buttonAlign: 'center', labelAlign: 'right', collapsible: true, - collapseMode: 'mini', + // collapseMode: 'mini', split: true, - border: 0, + border: 1, frame: true, - bodyStyle: 'padding:0px auto;margin:0px', height: formHeight, - listeners: { - // 添加展开/折叠事件监听 - collapse: function() { - // console.log('表单折叠'); - adjustLayoutHeight(); - }, - expand: function() { - // console.log('表单展开'); - adjustLayoutHeight(); - }, - afterrender: function() { - // 表单渲染后也调整一次高度 - setTimeout(adjustLayoutHeight, 100); - } - }, items: [{ layout: 'column', height: 103, @@ -237,44 +107,27 @@ labelWidth: 90, height: 30, items: [{ - xtype: 'datefieldWithMin', + xtype: 'datefield', id: 'startDate' + IDS, name: 'startDate', fieldLabel: '开始时间', - format: 'Y-m-d H:i:s', + format: 'Y-m-d', + submitFormat: 'Y-m-d', // 提交格式,关键配置! 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(); - } - - } - } - } + anchor: '95%' }] }, { width: defaultWidth, layout: 'form', labelWidth: 90, height: 30, items: [{ - xtype: 'datefieldWithMin', + xtype: 'datefield', id: 'endDate' + IDS, name: 'endDate', fieldLabel: '结束时间', - format: 'Y-m-d H:i:s', - theHours: 23, - theMinutes: 59, + format: 'Y-m-d', + submitFormat: 'Y-m-d', // 提交格式,关键配置! value: new Date(endDateValue), anchor: '95%' }] @@ -283,19 +136,18 @@ layout: 'form', labelWidth: 90, height: 30, - items: [{//20181225 - xtype: 'multiSelect', + items: [{ + xtype: 'combo', fieldLabel: '手术名称', id: 'operation', name: 'operation', valueField: 'operationName', displayField: 'operationName', minChars: 0, allowBlank: true, - editable: false, + editable: true, store: operationNameStore, forceSelection: false, - // mode: 'local', triggerAction: 'all', lazyInit: true, typeAhead: false, @@ -306,7 +158,7 @@ layout: 'form', labelWidth: 90, height: 30, - items: [{ + items: [{ xtype: 'textfield', id: 'doctorName', name: 'doctorName', @@ -322,7 +174,6 @@ xtype: 'combo', id: 'tousseName', name: 'tousseName', - queryParam: 'spell', fieldLabel: '器械包名称', minChars: 0, valueField: 'name', @@ -332,7 +183,7 @@ store: tousseDefinitionStore, lazyInit: true, triggerAction: 'all', - // hideTrigger: true, + hideTrigger: false, typeAhead: false, allowBlank: true }] @@ -345,7 +196,6 @@ xtype: 'combo', id: 'departCode', name: 'departCode', - queryParam: 'spell', fieldLabel: '科室', minChars: 0, valueField: 'id', @@ -355,199 +205,162 @@ store: departJsonStore, lazyInit: true, triggerAction: 'all', - // hideTrigger: true, + hideTrigger: false, typeAhead: false, allowBlank: true }] }] }], - buttonAlign: 'center', - buttons: [ { + buttons: [{ text: '查询', minWidth: 70, - iconCls: 'icon_search', - handler: function () { - loadData(); + iconCls: 'icon-search', + handler: function() { + appGrid.getStore().load(); } }, { 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)); + iconCls: 'icon-reset', + handler: function() { + form.getForm().reset(); + Ext4.getCmp('startDate' + IDS).setValue(new Date(startDate)); + Ext4.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, + + // 列定义 + var appColumns = [{ + xtype: 'rownumberer', + width: 40, + align: 'center' + }, { + text: "日期", + width: 120, + dataIndex: 'date', + flex: 1 + }, { + text: "超过半小时回收数量", + width: 180, + dataIndex: 'halfHourRecycledCount' + }, { + text: "超过1小时回收数量", + width: 180, + dataIndex: 'oneHourRecycledCount' + }, { + text: "超过2小时回收数量", + width: 180, + dataIndex: 'twoHourRecycledCount' + }]; + + // 创建树网格 + appGrid = Ext4.create('Ext4.grid.Panel', { autoScroll: true, title: entityName, - // height: gridHeight, - // autoHeight: true, frame: false, columns: appColumns, + plugins: [{ + ptype: 'rowexpander', + rowBodyTpl: [ + '
| 器械包名称 | ', + '器械包条码 | ', + '手术名称 | ', + '手术间 | ', + '病人姓名 | ', + '巡回护士 | ', + '状态 | ', + '
|---|---|---|---|---|---|---|
| {tousseName} | ', + '{barcode} | ', + '{operation} | ', + '{operationRoom} | ', + '{patientName} | ', + '{circuitNurse} | ', + '{status} | ', + '