Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/instrumentConfig.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/instrumentConfig.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/instrumentConfig.js (revision 34609) @@ -0,0 +1,767 @@ +var IDCardInstanceInstrumentInstanceStore; +var useRecordStore; +var instrumentWin; +//显示绑定标识牌实例的器械窗口 +function showInstrumentWindow(oid, materialDefinitionId, idCardInstanceId) { + var InstrumentStore = new top.Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/instrumentInstanceController/loadInstrumentInstancesByMaterialDefinitionID.mhtml', + method: 'POST' + }), + baseParams: { + materialDefinitionId: materialDefinitionId, + noBindIDCardInstance: true + }, + reader: new Ext.data.JsonReader({ + root: 'data' + }, [ + { name: 'id' }, + { name: 'materialDefinitionName' }, + { name: 'udi' }, + { name: 'instrumentBarcode' }, + { name: 'isReceive' } + ]) + }); + + InstrumentStore.load(); + + var gridPanel = new top.Ext.grid.GridPanel({ + id: 'InstrumentPanel', + store: InstrumentStore, + columns: [{ + header: '名称', + dataIndex: 'materialDefinitionName', + width: 100, + menuDisabled: true + }, { + header: "UDI码", + dataIndex: 'udi', + width: 100, + menuDisabled: true + }, { + header: "器械条码", + dataIndex: 'instrumentBarcode', + width: 100, + menuDisabled: true + }, { + header: "是否已领用", + dataIndex: 'isReceive', + width: 80, + menuDisabled: true + }, { + header: "操作", + width: 50, + renderer: function (v, p, record) { + var id = record.get('id') || ''; + if (oid == 0 || oid == '0') { + return "添加"; + } else { + return "替换"; + } + } + }], + viewConfig: { + forceFit: true + }, + autoExpandColumn: 'modifyField', + bodyStyle: 'border:1px solid #afd7af', + anchor: '100%', + frame: false + }); + instrumentWin = new top.Ext.Window({ + id: 'showInstrumentWin', + layout: 'fit', + title: '选择器械', + width: 600, + border: false, + modal: true, + height: 300, + plain: true, + items: [gridPanel] + }) + instrumentWin.show(); +} + +//显示使用说明窗口 +function amendDisinfectionTousse(row) { + var materialName = row.materialName; + var tousseDefinitionID = row.td_id; + var currentPage = row.currentPage; + var materialDefinitionId = row.materialDefinitionId; + var imgName = row.type; + var iframeHeight = window.screen.height; + var url = WWWROOT + '/disinfectsystem/touchScreen/recycle/tousseImage.jsp?resolution=1980&clientHeight=' + iframeHeight + '&parentPageName=packingView&tousseDefinitionID=' + tousseDefinitionID + '&materialDefinitionId=' + materialDefinitionId + '&materialName=' + encodeURIComponent(materialName) + '&imgName=' + encodeURIComponent(imgName) + '&number=' + currentPage; + openFullSizeWindowWithName(url, false, imgName); +} + +//绑定器械 +function bindInstrument(instrumentInstanceId, IDCardInstanceId) { + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/baseData/IDCardInstanceBindInstrumentController/IDCardInstanceBindInstrument.mhtml', + async: false, + params: { + IDCardInstanceId: IDCardInstanceId, + instrumentInstanceId: instrumentInstanceId + }, + success: function (response) { + var result = Ext.decode(response.responseText); + if (result.success) { + showResult('绑定成功'); + IDCardInstanceInstrumentInstanceStore.load(); + instrumentWin.close(); + } else { + showResult(result.message); + } + }, + failure: function (response, options) { + showResult(response.responseText); + } + }); +} + +//替换器械 +function replaceInstrument(newInstrumentInstanceId, oldInstrumentInstanceId, IDCardInstanceId) { + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/baseData/IDCardInstanceBindInstrumentController/IDCardInstanceReplaceInstrument.mhtml', + async: false, + params: { + newInstrumentInstanceId: newInstrumentInstanceId, + oldInstrumentInstanceId: oldInstrumentInstanceId, + IDCardInstanceId: IDCardInstanceId + }, + success: function (response) { + var result = Ext.decode(response.responseText); + if (result.success) { + showResult('替换成功'); + IDCardInstanceInstrumentInstanceStore.load(); + instrumentWin.close(); + } else { + showResult(result.message); + } + }, + failure: function (response, options) { + showResult(response.responseText); + } + }); +} + +//移除器械 +function removeInstrument(instrumentInstanceId, IDCardInstanceId) { + top.Ext.MessageBox.confirm("请确认", '是否移除器械?', function (button, text) { + if ("yes" == button) { + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/baseData/IDCardInstanceBindInstrumentController/IDCardInstanceRemoveInstrument.mhtml', + async: false, + params: { + IDCardInstanceId: IDCardInstanceId, + instrumentInstanceId: instrumentInstanceId + }, + success: function (response) { + var result = Ext.decode(response.responseText); + if (result.success) { + showResult('移除成功'); + IDCardInstanceInstrumentInstanceStore.load(); + } else { + showResult(result.message); + } + }, + failure: function (response, options) { + showResult(response.responseText); + } + }); + } + }); +} + +//加载器械实例基础信息及使用情况数据汇总 +function loadInstrumentInstanceDetail(instrumentInstanceId) { + if (instrumentInstanceId == 0 || instrumentInstanceId == '') { + top.Ext.getCmp('materialDefinitionName').setValue(''); + top.Ext.getCmp('udi').setValue(''); + top.Ext.getCmp('instrumentBarcode').setValue(''); + top.Ext.getCmp('inventorySerialNumber').setValue(''); + top.Ext.getCmp('specification').setValue(''); + top.Ext.getCmp('materialEntryCost').setValue(''); + top.Ext.getCmp('productionDate').setValue(''); + top.Ext.getCmp('materialEntryTime').setValue(''); + top.Ext.getCmp('materialEntryUser').setValue(''); + top.Ext.getCmp('productionSerialNumber').setValue(''); + top.Ext.getCmp('registUser').setValue(''); + top.Ext.getCmp('useAmount').setValue(''); + top.Ext.getCmp('useDay').setValue(''); + top.Ext.getCmp('averageCost').setValue(''); + top.Ext.getCmp('monthUseRate').setValue(''); + return; + } + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/baseData/instrumentInstanceController/loadInstrumentInstanceDetail.mhtml', + async: false, + params: { + instrumentInstanceId: instrumentInstanceId + }, + success: function (response) { + var result = Ext.decode(response.responseText); + if (result.success) { + if (result.data) { + var materialDefinitionName = result.data.materialDefinitionName; + var udi = result.data.udi; + var instrumentBarcode = result.data.instrumentBarcode; + var inventorySerialNumber = result.data.inventorySerialNumber; + var specification = result.data.specification; + var materialEntryCost = result.data.materialEntryCost; + var productionDate = result.data.productionDate; + var materialEntryTime = result.data.materialEntryTime; + var materialEntryUser = result.data.materialEntryUser; + var productionSerialNumber = result.data.productionSerialNumber; + var registUser = result.data.registUser; + var useAmount = result.data.useAmount; + var useDay = result.data.useDay; + var averageCost = result.data.averageCost; + var monthUseRate = result.data.monthUseRate; + + top.Ext.getCmp('materialDefinitionName').setValue(materialDefinitionName); + top.Ext.getCmp('udi').setValue(udi); + top.Ext.getCmp('instrumentBarcode').setValue(instrumentBarcode); + top.Ext.getCmp('inventorySerialNumber').setValue(inventorySerialNumber); + top.Ext.getCmp('specification').setValue(specification); + top.Ext.getCmp('materialEntryCost').setValue(materialEntryCost); + top.Ext.getCmp('productionDate').setValue(productionDate); + top.Ext.getCmp('materialEntryTime').setValue(materialEntryTime); + top.Ext.getCmp('materialEntryUser').setValue(materialEntryUser); + top.Ext.getCmp('productionSerialNumber').setValue(productionSerialNumber); + top.Ext.getCmp('registUser').setValue(registUser); + top.Ext.getCmp('useAmount').setValue(useAmount); + top.Ext.getCmp('useDay').setValue(useDay); + top.Ext.getCmp('averageCost').setValue(averageCost); + top.Ext.getCmp('monthUseRate').setValue(monthUseRate); + } + } else { + showResult(result.message); + } + }, + failure: function (response, options) { + showResult(response.responseText); + } + }); +} + +//加载器械实例使用记录 +function useRecordStoreFun(instrumentInstanceId) { + useRecordStore = new top.Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/instrumentInstanceController/loadInstrumentInstanceUseRecord.mhtml', + method: 'POST' + }), + baseParams: { + instrumentInstanceId: instrumentInstanceId, + pageSize: 3, + pageNum: 0 + }, + reader: new Ext.data.JsonReader({ + root: 'data' + }, [ + { name: 'departNameOfpatient' }, + { name: 'doctorName' }, + { name: 'enteringDate' }, + { name: 'id' }, + { name: 'operation' }, + { name: 'patientArea' }, + { name: 'tousseNameBarcode' } + ]), + listeners: { + beforeload: function (store, options) { + if (top.Ext.getCmp('hiddenInstrumentInstanceId') && top.Ext.getCmp('hiddenInstrumentInstanceId').getValue() !== '') { + store.baseParams.instrumentInstanceId = top.Ext.getCmp('hiddenInstrumentInstanceId').getValue(); + } + } + } + }); + + var gridPanel = new top.Ext.grid.GridPanel({ + id: 'instrumentGridPanel', + title: '器械近三条病人使用记录', + store: useRecordStore, + columns: [{ + header: '时间', + dataIndex: 'enteringDate', + width: 100, + menuDisabled: true + }, { + header: "所属器械包", + dataIndex: 'tousseNameBarcode', + width: 100, + menuDisabled: true + }, { + header: "病区", + dataIndex: 'patientArea', + width: 100, + menuDisabled: true + }, { + header: "患者科室", + dataIndex: 'departNameOfpatient', + width: 100, + menuDisabled: true + }, { + header: "使用医生", + dataIndex: 'doctorName', + width: 100, + menuDisabled: true + }, { + header: "手术名称", + dataIndex: 'operation', + width: 100, + menuDisabled: true + }], + viewConfig: { + forceFit: true + }, + autoExpandColumn: 'modifyField', + bodyStyle: 'border:1px solid #afd7af', + anchor: '100%', + frame: false + }); + + return gridPanel; +} + +//加载标识牌列表 +function loadIDCardInfoFun(id) { + var idCardDefinitionStore2 = new top.Ext.data.Store({ + proxy: new top.Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/idCardDefinitionAction!loadIDCardInfo.do', + baseParams: { + id: id + }, + method: 'POST' + }), + reader: new top.Ext.data.JsonReader({ + fields: idCardFields + }) + }); + + var leftGridPanel = new top.Ext.grid.GridPanel({ + id: 'leftGridPanel', + title: '标识牌列表', + store: idCardDefinitionStore2, + columns: [ + { header: '序号', dataIndex: 'number', width: 30 }, + { header: "当前条码", dataIndex: 'curIdCardInstanceBarcode', width: 70 } + ], + viewConfig: { + forceFit: true + }, + selModel: new top.Ext.grid.CheckboxSelectionModel({ + singleSelect: true, + listeners: { + 'selectionchange': function (sm) { + var record = sm.getSelected(); + if (record) { + top.Ext.getCmp('curIdCardInstanceBarcode').setValue(record.get('curIdCardInstanceBarcode')); + IDCardInstanceInstrumentInstanceStore.load(); + } + } + } + }), + anchor: '100%', + frame: false + }); + + idCardDefinitionStore2.baseParams['id'] = id; + idCardDefinitionStore2.baseParams['viewAll'] = false; + + idCardDefinitionStore2.load({ + callback: function (records, options, success) { + if (success) { + leftGridPanel.getSelectionModel().selectFirstRow(); + } + } + }); + + return leftGridPanel; +} + +//加载器械实例清单 +function loadIDCardInstanceInstrumentInstanceFun() { + var centerGridPanel; + IDCardInstanceInstrumentInstanceStore = new top.Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/instrumentInstanceController/loadIDCardInstanceInstrumentInstance.mhtml', + method: 'POST' + }), + baseParams: { + IDCardInstanceBarcode: '' + }, + reader: new Ext.data.JsonReader({ + root: 'data' + }, [ + { name: 'id' }, + { name: 'materialDefinitionName' }, + { name: 'udi' }, + { name: 'materialDefinitionId' }, + { name: 'idCardInstanceId' }, + { name: 'instrumentBarcode' } + ]), + listeners: { + beforeload: function (store, options) { + if (top.Ext.getCmp('curIdCardInstanceBarcode') && top.Ext.getCmp('curIdCardInstanceBarcode').getValue() !== '') { + store.baseParams.IDCardInstanceBarcode = top.Ext.getCmp('curIdCardInstanceBarcode').getValue(); + } + }, + load: function (store, records) { + if (records.length > 0) { + centerGridPanel.getSelectionModel().selectFirstRow(); + } + } + } + }); + + centerGridPanel = new top.Ext.grid.GridPanel({ + id: 'centerGridPanel', + title: '器械实例清单', + store: IDCardInstanceInstrumentInstanceStore, + columns: [ + { header: '名称', dataIndex: 'materialDefinitionName', width: 100 }, + { header: "UDI码", dataIndex: 'udi', width: 70 }, + { header: '器械条码', dataIndex: 'instrumentBarcode', width: 100 }, + { + header: "操作", width: 50, renderer: function (v, p, record) { + var instrumentBarcode = record.get('instrumentBarcode') || ''; + var materialDefinitionId = record.get('materialDefinitionId') || ''; + var idCardInstanceId = record.get('idCardInstanceId') || ''; + var id = record.get('id'); + if (instrumentBarcode == '') { + return "添加"; + } else { + return "替换 | 移除"; + } + } + } + ], + viewConfig: { + forceFit: true + }, + selModel: new top.Ext.grid.CheckboxSelectionModel({ + singleSelect: true, + listeners: { + 'selectionchange': function (sm) { + var record = sm.getSelected(); + if (record) { + var materialDefinitionId = record.get('materialDefinitionId'); + var materialDefinitionName = record.get('materialDefinitionName'); + top.Ext.getCmp('hiddenMaterialDefinitionId').setValue(materialDefinitionId); + top.Ext.getCmp('hiddenMaterialDefinitionName').setValue(materialDefinitionName); + loadInstrumentInstanceDetail(record.get('id')) + if (record.get('id') !== 0 && record.get('id') !== '') { + top.Ext.getCmp('hiddenInstrumentInstanceId').setValue(record.get('id')); + useRecordStore.load(); + } else { + useRecordStore.removeAll(); + } + } + } + } + }), + anchor: '100%', + frame: false + }); + + return centerGridPanel; +} + +//加载器械基础信息 +function instrumentInfoForm() { + var form = { + columnWidth: .3, + height: 500, + layout: 'fit', + autoScroll: false, + items: [{ + xtype: 'hidden', + id: 'curIdCardInstanceBarcode', + name: 'curIdCardInstanceBarcode' + }, { + xtype: 'hidden', + id: 'hiddenMaterialDefinitionId', + name: 'hiddenMaterialDefinitionId' + }, { + xtype: 'hidden', + id: 'hiddenMaterialDefinitionName', + name: 'hiddenMaterialDefinitionName' + }, { + xtype: 'hidden', + id: 'hiddenInstrumentInstanceId', + name: 'hiddenInstrumentInstanceId' + }, { + columnWidth: 1, + title: '器械基础信息', + labelWidth: 106, + labelAlign: "right", + id: 'instrumentInfoConfig', + items: [{ + xtype: 'button', + text: "使用说明", + style: 'padding:10px', + handler: function () { + var materialDefinitionId = top.Ext.getCmp('hiddenMaterialDefinitionId').getValue(); + var materialDefinitionName = top.Ext.getCmp('hiddenMaterialDefinitionName').getValue(); + var row = { + materialName: materialDefinitionName, + td_id: '', + type: '器械包说明', + materialDefinitionId: materialDefinitionId, + currentPage: 1 + } + + amendDisinfectionTousse(row); + } + }, { + columnWidth: .99, + layout: 'form', + border: false, + items: [{ + xtype: 'textfield', + fieldLabel: "物品名称", + anchor: '100%', + readOnly: true, + id: 'materialDefinitionName', + cls: 'fieldReadOnlyNoRemove' + }] + }, { + columnWidth: .99, + layout: 'form', + border: false, + items: [{ + xtype: 'textfield', + fieldLabel: "UDI", + anchor: '100%', + readOnly: true, + id: 'udi', + cls: 'fieldReadOnlyNoRemove' + }] + }, { + columnWidth: .99, + layout: 'form', + border: false, + items: [{ + xtype: 'textfield', + fieldLabel: "器械条码", + anchor: '100%', + readOnly: true, + id: 'instrumentBarcode', + cls: 'fieldReadOnlyNoRemove' + }] + }, { + columnWidth: .99, + layout: 'form', + border: false, + items: [{ + xtype: 'textfield', + fieldLabel: "物资编码", + anchor: '100%', + readOnly: true, + id: 'inventorySerialNumber', + cls: 'fieldReadOnlyNoRemove' + }] + }, { + columnWidth: .99, + layout: 'form', + border: false, + items: [{ + xtype: 'textfield', + fieldLabel: "器械规格", + anchor: '100%', + readOnly: true, + id: 'specification', + cls: 'fieldReadOnlyNoRemove' + }] + }, { + columnWidth: .99, + layout: 'form', + border: false, + items: [{ + xtype: 'textfield', + fieldLabel: "价格", + anchor: '100%', + readOnly: true, + id: 'materialEntryCost', + cls: 'fieldReadOnlyNoRemove' + }] + }, { + columnWidth: .99, + layout: 'form', + border: false, + items: [{ + xtype: 'textfield', + fieldLabel: "出厂日期", + anchor: '100%', + readOnly: true, + id: 'productionDate', + cls: 'fieldReadOnlyNoRemove' + }] + }, { + columnWidth: .99, + layout: 'form', + border: false, + items: [{ + xtype: 'textfield', + fieldLabel: "入库日期", + anchor: '100%', + readOnly: true, + id: 'materialEntryTime', + cls: 'fieldReadOnlyNoRemove' + }] + }, { + columnWidth: .99, + layout: 'form', + border: false, + items: [{ + xtype: 'textfield', + fieldLabel: "接收人", + anchor: '100%', + readOnly: true, + id: 'materialEntryUser', + cls: 'fieldReadOnlyNoRemove' + }] + }, { + columnWidth: .99, + layout: 'form', + border: false, + items: [{ + xtype: 'textfield', + fieldLabel: "生产序列号", + anchor: '100%', + readOnly: true, + id: 'productionSerialNumber', + cls: 'fieldReadOnlyNoRemove' + }] + }, { + columnWidth: .99, + layout: 'form', + border: false, + items: [{ + xtype: 'textfield', + fieldLabel: "注册人/备案人", + anchor: '100%', + readOnly: true, + id: 'registUser', + cls: 'fieldReadOnlyNoRemove' + }] + }, { + columnWidth: .99, + xtype: "fieldset", + title: '器械数据汇总', + bodyStyle: 'padding:1px;', + layout: 'column', + autoHeight: true, + labelWidth: 90, + labelAlign: "right", + items: [{ + columnWidth: .99, + layout: 'form', + border: false, + items: [{ + xtype: 'textfield', + fieldLabel: "已使用次数", + anchor: '100%', + readOnly: true, + id: 'useAmount', + cls: 'fieldReadOnlyNoRemove' + }] + }, { + columnWidth: .99, + layout: 'form', + border: false, + items: [{ + xtype: 'textfield', + fieldLabel: "总使用天数", + anchor: '100%', + readOnly: true, + id: 'useDay', + cls: 'fieldReadOnlyNoRemove' + }] + }, { + columnWidth: .99, + layout: 'form', + border: false, + items: [{ + xtype: 'textfield', + fieldLabel: "平均成本", + anchor: '100%', + readOnly: true, + id: 'averageCost', + cls: 'fieldReadOnlyNoRemove' + }] + }, { + columnWidth: .99, + layout: 'form', + border: false, + items: [{ + xtype: 'textfield', + fieldLabel: "月使用率", + anchor: '100%', + readOnly: true, + id: 'monthUseRate', + cls: 'fieldReadOnlyNoRemove' + }] + }] + }] + }] + } + return form; +} + +//显示器械追溯配置 +function showInstrumentConfigView(id) { + var gridPanel = useRecordStoreFun(id); + + var leftGridPanel = loadIDCardInfoFun(id); + + var centerGridPanel = loadIDCardInstanceInstrumentInstanceFun(); + + var rightForm = instrumentInfoForm(); + + var instrumentConfigForm = new top.Ext.FormPanel({ + id: 'instrumentConfigForm', + width: 900, + height: 600, + layout: 'column', + bodyStyle: 'padding:0px 0px 0px 0px;', + autoScroll: true, + items: [{ + layout: 'fit', + columnWidth: 1, + items: [{ + layout: 'column', + columnWidth: 1, + labelAlign: 'right', + items: [{ + columnWidth: .2, + height: 500, + layout: 'fit', + items: [leftGridPanel] + }, { + columnWidth: .5, + height: 500, + layout: 'fit', + items: [centerGridPanel] + }, rightForm] + }] + }, { + layout: 'fit', + columnWidth: 1, + items: [{ + layout: 'column', + columnWidth: 1, + labelAlign: 'right', + items: [{ + columnWidth: 1, + height: 140, + layout: 'fit', + items: [gridPanel] + }] + }] + }] + }) + + return instrumentConfigForm; +} \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/instrumentInstanceManager/instrumentInstanceView.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/instrumentInstanceManager/instrumentInstanceView.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/instrumentInstanceManager/instrumentInstanceView.js (revision 34609) @@ -0,0 +1,394 @@ +var listStore; +var leftStore; +var instrumentGrid; +var params = { + materialDefinitonId: '', + udi: '', + instrumentBarcode: '' +} + +function modify(v, data) { + showEditWindow(data.id); +} + +//重新加载器械列表 +function reloadGird(pageNum) { + leftStore.proxy.extraParams = { + pageNum: pageNum, + pageSize: 20 + } + leftStore.reload(); +} + +//加载器械条码 +function leftGridPanel() { + var columns = [ + { header: "id", dataIndex: 'id', hidden: true }, + { header: "名称", dataIndex: 'name', width: 190, align: 'center' } + ]; + + leftStore = new Ext4.data.JsonStore({ + proxy: { + type: 'ajax', + url: WWWROOT + '/disinfectSystem/baseData/materialDefinitionController/loadMaterialDefinitionList.mhtml', + reader: { + root: 'data' + }, + extraParams: { + pageSize: 20, + pageNum: 1 + } + }, + fields: [ + { name: 'id' }, + { name: 'name' } + ], + listeners: { + load: function (store) { + var data = { 'id': '', 'name': '全部器械' }; + leftStore.insert(0, data); + } + } + }); + + Ext4.Ajax.request({ + url: WWWROOT + '/disinfectSystem/baseData/materialDefinitionController/loadMaterialDefinitionList.mhtml?pageSize=20&pageNum=1', + method: 'POST', + success: function (response, options) { + var result = Ext4.decode(response.responseText); + if (result) { + var rowCount = result.rowCount; + var pageCount = result.pageCount; + Ext4.getCmp('pageCount').setValue(pageCount); + Ext4.getCmp('rowCount').setValue(rowCount); + leftStore.loadPage(1); + } + }, + failure: function (response, options) { + showResult("数据加载异常!"); + } + }); + + var leftGrid = new Ext4.grid.GridPanel({ + columns: columns, + frame: false, + autoScroll: false, + store: leftStore, + hideHeaders: true, + bbar: [{ + xtype: 'button', + text: '', + tooltip: "第一页", + cls: 'pageFirst', + handler: function () { + Ext4.getCmp('pageNow').setValue(1); + reloadGird(1); + } + }, { + xtype: 'button', + text: '', + tooltip: "上一页", + cls: 'pagePrev', + handler: function () { + var pageNow = Ext4.getCmp('pageNow').getValue(); + pageNow = parseInt(pageNow); + if (pageNow - 1 <= 0) { + return; + } + pageNow = pageNow - 1; + Ext4.getCmp('pageNow').setValue(pageNow); + reloadGird(pageNow); + } + }, { + xtype: 'label', + text: '第 ', + style: 'margin:0 5px' + }, { + xtype: 'numberfield', + hideTrigger: true, + id: 'pageNow', + value: 1, + minValue: 1, + width: 30, + enableKeyEvents: true, + listeners: { + keypress: function (that, e, eOpts) { + if (e.getKey() == 13) { + var pageCount = Ext4.getCmp('pageCount').getValue(); + var pageNow = 1; + if (that.value > pageCount) { + pageNow = pageCount; + } else { + pageNow = that.value; + } + Ext4.getCmp('pageNow').setValue(pageNow); + reloadGird(pageNow); + } + } + } + }, { + xtype: 'label', + text: ' 页', + style: 'margin:0 5px' + }, { + xtype: 'button', + text: '', + cls: 'pageNext', + tooltip: "下一页", + handler: function () { + var pageNow = Ext4.getCmp('pageNow').getValue(); + var pageCount = Ext4.getCmp('pageCount').getValue(); + pageNow = parseInt(pageNow); + if (pageNow + 1 > pageCount) { + return; + } + pageNow = pageNow + 1; + Ext4.getCmp('pageNow').setValue(pageNow); + reloadGird(pageNow); + } + }, { + xtype: 'button', + text: '', + tooltip: "最后页", + cls: 'pageLast', + handler: function () { + var pageCount = Ext4.getCmp('pageCount').getValue(); + Ext4.getCmp('pageNow').setValue(pageCount); + reloadGird(pageCount); + } + }, { + xtype: 'hidden', + id: 'pageCount' + }, { + xtype: 'hidden', + id: 'rowCount' + }], + viewConfig: { + autoFill: true + }, + listeners: { + itemclick: function (thiz, record, item, index, e, eOpts) { + var materialDefinitonId = record.data.id; + params.materialDefinitonId = materialDefinitonId; + params.udi = ''; + params.instrumentBarcode = ''; + Ext4.getCmp('udi').setValue(''); + Ext4.getCmp('instrumentBarcode').setValue(''); + listStore.loadPage(1); + } + } + }); + return leftGrid; +} + +//加载器械实例列表 +function loadInstrumentInstanceList() { + var instrumentGrid; + var columns = [ + { header: "id", dataIndex: 'id', hidden: true }, + { header: "名称", dataIndex: 'materialDefinitionName', width: 150, renderer: modifyRecord }, + { header: "器械条码", dataIndex: 'instrumentBarcode', width: 100, sortable: false }, + { header: "UDI码", dataIndex: 'udi', width: 100, sortable: false }, + { header: "物资编码", dataIndex: 'inventorySerialNumber', width: 100, sortable: false }, + { header: "器械规格", dataIndex: 'specification', width: 80, sortable: false }, + { header: "接收人", dataIndex: 'materialEntryUser', width: 80, sortable: false }, + { header: "入库日期", dataIndex: 'materialEntryTime', width: 100, sortable: false }, + { header: "生产日期", dataIndex: 'productionDate', width: 100, sortable: false }, + { header: "生产序列号", dataIndex: 'productionSerialNumber', width: 120, sortable: false }, + { header: "注册人/备案人", dataIndex: 'registUser', width: 120, sortable: false } + ]; + var tbar = [{ + text: '修改', + iconCls: 'btn_ext_application_edit', + handler: function () { + var records = instrumentGrid.getSelectionModel().getSelection(); + if (records.length == 0) { + showResult("请选择要修改的记录!"); + return false; + } else if (records.length > 1) { + showResult("只能选择一条记录!"); + return false; + } + + var id = records[0].data.id; + + showEditWindow(id); + } + }, '-', { + text: '打印条码', + iconCls: 'icon_print', + handler: function () { + var records = instrumentGrid.getSelectionModel().getSelection(); + if (records.length > 0) { + for (var i = 0; i < records.length; i++) { + var name = records[i].get("materialDefinitionName"); + var barcode = records[i].get("instrumentBarcode"); + var unit = ""; + print_commonFun(barcode, name, unit, 'print', '器械实例'); + } + } else { + showResult("请选择要打印的记录!"); + } + } + }]; + + listStore = new Ext4.data.JsonStore({ + proxy: { + type: 'ajax', + url: WWWROOT + '/disinfectSystem/baseData/instrumentInstanceController/loadInstrumentInstanceList.mhtml', + reader: { + root: 'data' + } + }, + fields: [ + { name: 'id' }, + { name: 'materialDefinitionName' }, + { name: 'instrumentBarcode' }, + { name: 'udi' }, + { name: 'inventorySerialNumber' }, + { name: 'specification' }, + { name: 'materialEntryUser' }, + { name: 'materialEntryTime' }, + { name: 'productionDate' }, + { name: 'productionSerialNumber' }, + { name: 'registUser' } + ], + listeners: { + beforeload: function (store, options) { + listStore.proxy.extraParams.materialDefinitonId = params.materialDefinitonId; + listStore.proxy.extraParams.udi = params.udi; + listStore.proxy.extraParams.instrumentBarcode = params.instrumentBarcode; + } + } + }); + + listStore.loadPage(1); + + instrumentGrid = new Ext4.grid.GridPanel({ + title: '器械实例列表', + columns: columns, + frame: false, + autoScroll: false, + store: listStore, + tbar: tbar, + height: Ext4.getBody().dom.clientHeight - 85, + dockedItems: [{ + xtype: 'pagingtoolbar', + store: listStore, // same store GridPanel is using + dock: 'bottom', + displayInfo: true + }], + viewConfig: { + autoFill: true + }, + selModel: new Ext4.selection.CheckboxModel() + }); + + return instrumentGrid; +} + +//加载查询条件 +function searchForm() { + var form = new Ext4.form.Panel({ + region: 'north', + buttonAlign: 'center', + border: 0, + frame: true, + bodyStyle: 'padding:0px auto;margin:0px', + height: 80, + id: 'searchForm', + fieldDefaults: { + labelAlign: 'right', + labelWidth: 110 + }, + items: [{ + layout: 'column', + autoHeight: true, + items: [{ + layout: 'form', + columnWidth: .2, + items: [{ + xtype: 'textfield', + border: 0, + fieldLabel: 'UDI码', + allowBlank: true, + id: 'udi', + name: 'udi', + anchor: '100%' + }] + }, { + layout: 'form', + columnWidth: .3, + items: [{ + xtype: 'textfield', + border: 0, + fieldLabel: '器械条码', + allowBlank: true, + id: 'instrumentBarcode', + name: 'instrumentBarcode', + anchor: '100%' + }] + }] + }], + buttons: [{ + xtype: 'button', + text: '查询', + minWidth: 70, + iconCls: 'icon_search', + handler: function () { + var udi = Ext4.getCmp('udi').getValue(); + var instrumentBarcode = Ext4.getCmp('instrumentBarcode').getValue(); + params.udi = udi; + params.instrumentBarcode = instrumentBarcode; + listStore.loadPage(1); + } + }, { + xtype: 'button', + text: '重置', + minWidth: 70, + iconCls: 'icon_set', + handler: function () { + params.udi = ''; + params.instrumentBarcode = ''; + Ext4.getCmp('udi').setValue(''); + Ext4.getCmp('instrumentBarcode').setValue(''); + listStore.loadPage(1); + } + }] + }); + return form; +} + +Ext4.onReady(function () { + Ext4.QuickTips.init(); + + var instrumentGrid = loadInstrumentInstanceList(); + + var leftGrid = leftGridPanel(); + + var form = searchForm(); + + new Ext4.container.Viewport({ + layout: 'border', + items: [{ + title: '器械列表', + region: 'west', + width: 200, + layout: 'fit', + items: [leftGrid] + }, { + region: 'center', + layout: 'fit', + items: [{ + layout: 'anchor', + items: [{ + height: 80, + items: [form] + }, { + anchor: '100% -80', + items: [instrumentGrid] + }] + }] + }] + }); +}); \ No newline at end of file Index: ssts-web/src/main/webapp/homepage/menuconfigure.js =================================================================== diff -u -r34517 -r34609 --- ssts-web/src/main/webapp/homepage/menuconfigure.js (.../menuconfigure.js) (revision 34517) +++ ssts-web/src/main/webapp/homepage/menuconfigure.js (.../menuconfigure.js) (revision 34609) @@ -457,7 +457,8 @@ {hidden :SSTS_MaterialCancellingStocks_Manager,text:"材料退库管理",href:WWWROOT+'/disinfectsystem/materialmanager/materialOutView.jsp',hrefTarget:linkTarget,leaf:true}, {hidden :SSTS_MaterialCheck_Manager,text:"材料盘点管理",href:WWWROOT+'/disinfectsystem/stocktakerecordmanager/inventoryrecordView.jsp?type=' + inventoryTypeCodeMaterial,hrefTarget:linkTarget,leaf:true}, {hidden :SSTS_MaterialMonthCheck_list,text:"器械材料月盘点记录",href:WWWROOT+'/disinfectsystem/stocktakerecordmanager/materialCheckView.jsp',hrefTarget:linkTarget,leaf:true}, - {hidden :SSTS_MaterialAppropriation_Manager,text:"材料调拨管理",href:WWWROOT+'/disinfectsystem/materialmanager/materialAppropriationView.jsp',hrefTarget:linkTarget,leaf:true} + {hidden :SSTS_MaterialAppropriation_Manager,text:"材料调拨管理",href:WWWROOT+'/disinfectsystem/materialmanager/materialAppropriationView.jsp',hrefTarget:linkTarget,leaf:true}, + {hidden :!sstsConfig.enableInstrumentLifeCycleTraceabilityManagement,text:"器械生命周期管理",href:WWWROOT+'/disinfectsystem/instrumentInstanceManager/instrumentInstanceView.jsp',hrefTarget:linkTarget,leaf:true} ] },{ text:"同步入库单", Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseForm.js =================================================================== diff -u -r34492 -r34609 --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseForm.js (.../tousseForm.js) (revision 34492) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseForm.js (.../tousseForm.js) (revision 34609) @@ -751,7 +751,7 @@ name: 'configGrid', store: configStore, cm: materialCm, - height: top.screen.height > 800 ? 610 : 450, + height: Ext.getBody().dom.clientHeight > 800 ? 610 : 450, frame: false, bodyStyle: 'border:1px solid #afd7af', autoExpandColumn: 'count', @@ -857,7 +857,7 @@ columnWidth: 0.6, labelWidth: 90, autoScroll: true, - height: top.screen.height > 800 ? 610 : 450, + height: Ext.getBody().dom.clientHeight > 800 ? 610 : 450, items: [{ xtype: 'hidden', name: 'id', @@ -2668,148 +2668,162 @@ }); var tabs; - if (id != 0 && !sstsConfig.disableIdCard) { //修改,并且启用标识牌功能 - showIDCardListView(); //创建标识牌信息页面 + if (id != 0) { //修改,并且启用标识牌功能 var modifyRecordGrid = showModifyRecordGrid(id); - tabs = new top.Ext.TabPanel({ - activeTab: 0, - plain: false, - bufferResize: true, - deferredRender: false, - items: [{ - id: 'tousseFormInfo', - layout: 'column', - title: '基本信息', - items: [formObj, { - columnWidth: 0.4, - layout: 'fit', - items: [materialsPanel] - }], - buttonAlign : 'center', - buttons: [{ - id: 'saveBtn', - text: '保存', - handler: function () { - save2(null, this, false, false); + var items = [{ + id: 'tousseFormInfo', + layout: 'column', + title: '基本信息', + items: [formObj, { + columnWidth: 0.4, + layout: 'fit', + items: [materialsPanel] + }], + buttonAlign : 'center', + buttons: [{ + id: 'saveBtn', + text: '保存', + handler: function () { + save2(null, this, false, false); + } + }, { + id: 'saveBtnAndClose', + text: '保存并关闭', + handler: function () { + save2(null, this, false, true); + } + }, { + xtype: 'button', + text: "另存为", + id: "saveAsTousse", + listeners: { + click: function (thiz) { + newSave(); } - }, { - id: 'saveBtnAndClose', - text: '保存并关闭', - handler: function () { - save2(null, this, false, true); - } - }, { - xtype: 'button', - text: "另存为", - id: "saveAsTousse", - listeners: { - click: function (thiz) { - newSave(); + } + }, { + text: '打印条码', + id: 'printTDBarcode', + handler: function () { + printTDBarcode(id); + } + }, { + text: '器械包图片', + id: 'uploadFile', + hidden: id == 0 ? true : false, + handler: function () { + var tousseName = top.Ext.getCmp('name').getValue(); + uploadToussePackingImageFile(imageTypeTousse, id, tousseName); + } + }, { + text: '说明书', + id: 'uploadFile', + hidden: id == 0 ? true : false, + handler: function () { + var tousseName = top.Ext.getCmp('name').getValue(); + uploadToussePackingImageFile(imageTypeSpecification, id, tousseName); + } + }, { + text: '清洗操作指引', + hidden: id == 0 ? true : false, + menu: new top.Ext.menu.Menu({ + items: [{ + text: '清洗指引图片', + id: 'washGuideImageFile', + handler: function () { + var tousseName = top.Ext.getCmp('name').getValue(); + uploadToussePackingImageFile(imageTypeWashGuide, id, tousseName); } - } - }, { - text: '打印条码', - id: 'printTDBarcode', - handler: function () { - printTDBarcode(id); - } - }, { - text: '器械包图片', - id: 'uploadFile', - hidden: id == 0 ? true : false, - handler: function () { - var tousseName = top.Ext.getCmp('name').getValue(); - uploadToussePackingImageFile(imageTypeTousse, id, tousseName); - } - }, { - text: '说明书', - id: 'uploadFile', - hidden: id == 0 ? true : false, - handler: function () { - var tousseName = top.Ext.getCmp('name').getValue(); - uploadToussePackingImageFile(imageTypeSpecification, id, tousseName); - } - }, { - text: '清洗操作指引', - hidden: id == 0 ? true : false, - menu: new top.Ext.menu.Menu({ - items: [{ - text: '清洗指引图片', - id: 'washGuideImageFile', - handler: function () { - var tousseName = top.Ext.getCmp('name').getValue(); - uploadToussePackingImageFile(imageTypeWashGuide, id, tousseName); - } - }, { - text: '清洗教学视频', - id: 'washGuideVedio', - handler: function () { - var tousseName = top.Ext.getCmp('name').getValue(); - uploadToussePackingVideoFile(vidoeTypeTousseWashTeaching, id, tousseName); - } - }] - }) - }, { - text: '装配教学', - hidden: id == 0 ? true : false, - menu: new top.Ext.menu.Menu({ - items: [{ - text: '装配教学图片', - id: 'uploadToussePackingImageFile', - handler: function () { - var tousseName = top.Ext.getCmp('name').getValue(); - uploadToussePackingImageFile(imageTypeToussePacking, id, tousseName); - } - }, { - text: '装配教学视频', - id: 'uploadVedio', - handler: function () { - var tousseName = top.Ext.getCmp('name').getValue(); - uploadToussePackingVideoFile(videoType, id, tousseName); - } - }] - }) - }, { - text: '配包注意事项', - hidden: id == 0 ? true : false, - handler: function () { - if(SSTS_TousseInstanceManager_Note_update){ + }, { + text: '清洗教学视频', + id: 'washGuideVedio', + handler: function () { var tousseName = top.Ext.getCmp('name').getValue(); - var note = top.Ext.getCmp('hiddenNoteValue').getValue(); - if(isIE() && note.indexOf('

') >= 0){ - showResult('不再支持IE浏览器编辑'); - }else { - showWangEditor('【'+tousseName+'】', id); - } - }else { + uploadToussePackingVideoFile(vidoeTypeTousseWashTeaching, id, tousseName); + } + }] + }) + }, { + text: '装配教学', + hidden: id == 0 ? true : false, + menu: new top.Ext.menu.Menu({ + items: [{ + text: '装配教学图片', + id: 'uploadToussePackingImageFile', + handler: function () { var tousseName = top.Ext.getCmp('name').getValue(); - var note = top.Ext.getCmp('hiddenNoteValue').getValue(); - if(note == ''){ - showResult('暂无注意事项'); - return; - } - previewWangEditor('【'+tousseName+'】', id); + uploadToussePackingImageFile(imageTypeToussePacking, id, tousseName); } + }, { + text: '装配教学视频', + id: 'uploadVedio', + handler: function () { + var tousseName = top.Ext.getCmp('name').getValue(); + uploadToussePackingVideoFile(videoType, id, tousseName); + } + }] + }) + }, { + text: '配包注意事项', + hidden: id == 0 ? true : false, + handler: function () { + if(SSTS_TousseInstanceManager_Note_update){ + var tousseName = top.Ext.getCmp('name').getValue(); + var note = top.Ext.getCmp('hiddenNoteValue').getValue(); + if(isIE() && note.indexOf('

') >= 0){ + showResult('不再支持IE浏览器编辑'); + }else { + showWangEditor('【'+tousseName+'】', id); + } + }else { + var tousseName = top.Ext.getCmp('name').getValue(); + var note = top.Ext.getCmp('hiddenNoteValue').getValue(); + if(note == ''){ + showResult('暂无注意事项'); + return; + } + previewWangEditor('【'+tousseName+'】', id); } - }, { - text: '取消', - id: 'saveAndNewBtn', - handler: function () { - tousseWin.close(); - grid.dwrReload(); - } - }] + } }, { + text: '取消', + id: 'saveAndNewBtn', + handler: function () { + tousseWin.close(); + grid.dwrReload(); + } + }] + }] + if(!sstsConfig.disableIdCard){ + showIDCardListView(); //创建标识牌信息页面 + items.push({ id: 'signBoardID', layout: 'fit', title: '标识牌', items: [signBoardForm] - }, { - id: 'modifyRecord', + }) + } + if(sstsConfig.enableInstrumentLifeCycleTraceabilityManagement){ + var instrumentConfigForm = showInstrumentConfigView(id); //创建标识牌信息页面 + items.push({ + id: 'instrumentConfig', layout: 'fit', - title: '改动记录', - items: [modifyRecordGrid] - }] + title: '追溯器械配置', + items: [instrumentConfigForm] + }) + } + items.push({ + id: 'modifyRecord', + layout: 'fit', + title: '改动记录', + items: [modifyRecordGrid] + }) + tabs = new top.Ext.TabPanel({ + activeTab: 0, + plain: false, + bufferResize: true, + deferredRender: false, + items: items }); } @@ -2820,10 +2834,10 @@ width: fontSize == 12 ? 1200 : 1300, border: false, modal: true, - height: top.screen.height > 800 ? 710 : 550, + height: Ext.getBody().dom.clientHeight > 800 ? 710 : 550, plain: true, items: [tabs ? tabs : { - id: 'abc', + id: 'tousseFormInfo', layout: 'column', title: '基本信息', items: [formObj, { Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseView.jsp =================================================================== diff -u -r34475 -r34609 --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseView.jsp (.../tousseView.jsp) (revision 34475) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseView.jsp (.../tousseView.jsp) (revision 34609) @@ -179,6 +179,7 @@ + Index: ssts-web/src/main/webapp/disinfectsystem/instrumentInstanceManager/instrumentInstanceForm.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/instrumentInstanceManager/instrumentInstanceForm.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/instrumentInstanceManager/instrumentInstanceForm.js (revision 34609) @@ -0,0 +1,436 @@ +var configWin; +var formPanel; + +//关闭窗口 +function cancel() { + configWin.close(); +} + +//保存 +function saveConfig(id) { + var udi = top.Ext4.getCmp('udi').getValue(); + var productionDate = top.Ext4.getCmp('productionDate').getValue(); + var productionSerialNumber = top.Ext4.getCmp('productionSerialNumber').getValue(); + var registUser = top.Ext4.getCmp('registUser').getValue(); + + Ext4.Ajax.request({ + url: WWWROOT + '/disinfectSystem/baseData/instrumentInstanceController/saveInstrumentInstance.mhtml', + method: 'POST', + params: { + udi: udi, + productionDate: productionDate, + productionSerialNumber: productionSerialNumber, + registUser: registUser, + id: id + }, + success: function (response, options) { + var result = Ext4.decode(response.responseText); + showResult(result.message); + if (result.success) { + configWin.close(); + } + }, + failure: function (response, options) { + showResult("数据加载异常!"); + } + }); +} + +//获取基础信息表单 +function getFormPanel() { + var formPanel = new top.Ext4.form.Panel({ + id: 'formPanel', + frame: true, + bodyStyle: 'padding:5px 0px 0px 0px;', + width: 990, + border: 0, + height: 130, + fieldDefaults: { + labelAlign: 'right', + labelWidth: 120 + }, + items: [{ + layout: 'column', + items: [{ + columnWidth: .24, + layout: 'form', + items: [{ + xtype: 'displayfield', + fieldLabel: '物品名称', + id: 'materialDefinitionName', + name: 'materialDefinitionName', + anchor: '98%' + }] + }, { + columnWidth: .24, + layout: 'form', + items: [{ + xtype: 'displayfield', + fieldLabel: '器械规格', + id: 'specification', + name: 'specification', + anchor: '98%' + }] + }, { + columnWidth: .24, + layout: 'form', + items: [{ + xtype: 'datefield', + fieldLabel: '出厂日期', + id: 'productionDate', + name: 'productionDate', + format: 'Y-m-d', + anchor: '98%' + }] + }, { + columnWidth: .24, + layout: 'form', + items: [{ + xtype: 'displayfield', + fieldLabel: '入库日期', + id: 'materialEntryTime', + name: 'materialEntryTime', + anchor: '98%' + }] + }, { + columnWidth: .24, + layout: 'form', + items: [{ + xtype: 'textfield', + fieldLabel: 'UDI码', + id: 'udi', + name: 'udi', + anchor: '98%' + }] + }, { + columnWidth: .24, + layout: 'form', + items: [{ + xtype: 'displayfield', + fieldLabel: '价格', + id: 'materialEntryCost', + name: 'materialEntryCost', + anchor: '98%' + }] + }, { + columnWidth: .24, + layout: 'form', + items: [{ + xtype: 'textfield', + fieldLabel: '生产序列号', + id: 'productionSerialNumber', + name: 'productionSerialNumber', + anchor: '98%' + }] + }, { + columnWidth: .24, + layout: 'form', + items: [{ + xtype: 'displayfield', + fieldLabel: '接收人', + id: 'materialEntryUser', + name: 'materialEntryUser', + anchor: '98%' + }] + }, { + columnWidth: .24, + layout: 'form', + items: [{ + xtype: 'displayfield', + fieldLabel: '器械条码', + id: 'instrumentBarcode', + name: 'instrumentBarcode', + anchor: '98%' + }] + }, { + columnWidth: .24, + layout: 'form', + items: [{ + xtype: 'displayfield', + fieldLabel: '物资编码', + id: 'inventorySerialNumber', + name: 'inventorySerialNumber', + anchor: '98%' + }] + }, { + columnWidth: .24, + layout: 'form', + items: [{ + xtype: 'textfield', + fieldLabel: '注册人/备案人', + id: 'registUser', + name: 'registUser', + anchor: '98%' + }] + }] + }] + }); + return formPanel; +} + +//获取数据汇总表单 +function getFormSumPanel() { + var formSumPanel = new top.Ext4.form.Panel({ + id: 'formSumPanel', + frame: true, + bodyStyle: 'padding:5px 0px 0px 0px;', + width: 990, + border: 0, + height: 80, + fieldDefaults: { + labelAlign: 'right', + labelWidth: 100 + }, + items: [{ + layout: 'column', + items: [{ + columnWidth: .24, + layout: 'form', + items: [{ + xtype: 'displayfield', + fieldLabel: '已使用次数', + id: 'useAmount', + name: 'useAmount', + anchor: '98%' + }] + }, { + columnWidth: .24, + layout: 'form', + items: [{ + xtype: 'displayfield', + fieldLabel: '总使用天数', + id: 'useDay', + name: 'useDay', + anchor: '98%' + }] + }, { + columnWidth: .24, + layout: 'form', + items: [{ + xtype: 'displayfield', + fieldLabel: '平均成本', + id: 'averageCost', + name: 'averageCost', + anchor: '98%' + }] + }, { + columnWidth: .24, + layout: 'form', + items: [{ + xtype: 'displayfield', + fieldLabel: '月使用率', + id: 'monthUseRate', + name: 'monthUseRate', + anchor: '98%' + }] + }] + }] + }); + return formSumPanel; +} + +//加载器械实例使用记录 +function useRecordStoreFun(instrumentInstanceId) { + var useRecordStore = new top.Ext4.data.JsonStore({ + proxy: { + type: 'ajax', + url: WWWROOT + '/disinfectSystem/baseData/instrumentInstanceController/loadInstrumentInstanceUseRecord.mhtml', + reader: { + root: 'data' + } + }, + fields: [ + { name: 'departNameOfpatient' }, + { name: 'doctorName' }, + { name: 'enteringDate' }, + { name: 'id' }, + { name: 'operation' }, + { name: 'patientArea' }, + { name: 'tousseNameBarcode' } + ], + listeners: { + beforeload: function (store, options) { + useRecordStore.proxy.extraParams.instrumentInstanceId = instrumentInstanceId; + if (top.Ext4.getCmp('spell')) { + var spell = top.Ext4.getCmp('spell').getValue(); + useRecordStore.proxy.extraParams.spell = spell; + } + } + } + }); + + useRecordStore.loadPage(1); + + var tbar = [{ + text: '病人使用记录' + }, '->', { + xtype: 'textfield', + name: 'spell', + id: 'spell', + enableKeyEvents: true, + listeners: { + keydown: function (thisTextfield, e, eOpts) { + if (e.keyCode == 13) { + useRecordStore.loadPage(1); + } + } + } + }, { + text: '搜索', + handler: function (thisButton) { + useRecordStore.loadPage(1); + } + }]; + + var gridPanel = new top.Ext4.grid.GridPanel({ + columns: [{ + header: '时间', + dataIndex: 'enteringDate', + width: 100, + menuDisabled: true + }, { + header: "所属器械包", + dataIndex: 'tousseNameBarcode', + width: 300, + menuDisabled: true + }, { + header: "病区", + dataIndex: 'patientArea', + width: 100, + menuDisabled: true + }, { + header: "患者科室", + dataIndex: 'departNameOfpatient', + width: 100, + menuDisabled: true + }, { + header: "使用医生", + dataIndex: 'doctorName', + width: 100, + menuDisabled: true + }, { + header: "手术名称", + dataIndex: 'operation', + width: 200, + menuDisabled: true + }], + frame: false, + autoScroll: false, + height: 320, + tbar: tbar, + store: useRecordStore, + dockedItems: [{ + xtype: 'pagingtoolbar', + store: useRecordStore, + dock: 'bottom', + displayInfo: true + }], + viewConfig: { + autoFill: true + } + }); + + return gridPanel; +} + +//加载基础数据和数据汇总信息 +function loadInstrumentInstanceDetail(id) { + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/baseData/instrumentInstanceController/loadInstrumentInstanceDetail.mhtml', + async: false, + params: { + instrumentInstanceId: id + }, + success: function (response) { + var result = Ext.decode(response.responseText); + if (result.success) { + if (result.data) { + var materialDefinitionName = result.data.materialDefinitionName; + var udi = result.data.udi; + var instrumentBarcode = result.data.instrumentBarcode; + var inventorySerialNumber = result.data.inventorySerialNumber; + var specification = result.data.specification; + var materialEntryCost = result.data.materialEntryCost; + var productionDate = result.data.productionDate; + var materialEntryTime = result.data.materialEntryTime; + var materialEntryUser = result.data.materialEntryUser; + var productionSerialNumber = result.data.productionSerialNumber; + var registUser = result.data.registUser; + var useAmount = result.data.useAmount; + var useDay = result.data.useDay; + var averageCost = result.data.averageCost; + var monthUseRate = result.data.monthUseRate; + + top.Ext4.getCmp('materialDefinitionName').setValue(materialDefinitionName); + top.Ext4.getCmp('udi').setValue(udi); + top.Ext4.getCmp('instrumentBarcode').setValue(instrumentBarcode); + top.Ext4.getCmp('inventorySerialNumber').setValue(inventorySerialNumber); + top.Ext4.getCmp('specification').setValue(specification); + top.Ext4.getCmp('materialEntryCost').setValue(materialEntryCost); + top.Ext4.getCmp('productionDate').setValue(productionDate); + top.Ext4.getCmp('materialEntryTime').setValue(materialEntryTime); + top.Ext4.getCmp('materialEntryUser').setValue(materialEntryUser); + top.Ext4.getCmp('productionSerialNumber').setValue(productionSerialNumber); + top.Ext4.getCmp('registUser').setValue(registUser); + top.Ext4.getCmp('useAmount').setValue(useAmount); + top.Ext4.getCmp('useDay').setValue(useDay); + top.Ext4.getCmp('averageCost').setValue(averageCost); + top.Ext4.getCmp('monthUseRate').setValue(monthUseRate); + } + } else { + showResult(result.message); + } + }, + failure: function (response, options) { + showResult(response.responseText); + } + }); +} + +//弹出器械信息的窗口 +function showEditWindow(id) { + var formPanel = getFormPanel(); + + var formSumPanel = getFormSumPanel(); + + var gridPanel = useRecordStoreFun(id); + + configWin = new top.Ext4.window.Window({ + id: 'configWin', + layout: 'anchor', + title: '器械信息', + width: 1000, + height: 600, + buttonAlign: 'center', + border: false, + plain: true, + modal: true, + items: [{ + title: '基础信息', + height: 130, + items: [formPanel] + }, { + title: '数据汇总', + height: 80, + items: [formSumPanel] + }, { + height: 320, + items: [gridPanel] + }], + buttons: [{ + id: 'saveBtn', + text: '保存', + handler: function () { + saveConfig(id); + } + }, { + text: '取消', + handler: cancel + }] + }); + + configWin.show(); + + loadInstrumentInstanceDetail(id); +} + Index: ssts-web/src/main/webapp/disinfectsystem/instrumentInstanceManager/instrumentInstanceView.jsp =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/instrumentInstanceManager/instrumentInstanceView.jsp (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/instrumentInstanceManager/instrumentInstanceView.jsp (revision 34609) @@ -0,0 +1,58 @@ +<%@page import="java.util.Date"%> +<%@page import="java.text.SimpleDateFormat"%> +<%@ page contentType="text/html; charset=UTF-8"%> +<%@ include file="/common/taglibs.jsp"%> + + + +<%@ include file="/common/includeExtJsAndCss.jsp"%> +<%@ include file="/common/includeExtJs4_2.jsp"%> +<%@ include file="/disinfectsystem/print/print.jsp"%> + +器械生命周期管理 + + + + + + + + + + + + + + \ No newline at end of file