Index: ssts-web/src/main/webapp/js/common.js =================================================================== diff -u -r35159 -r35300 --- ssts-web/src/main/webapp/js/common.js (.../common.js) (revision 35159) +++ ssts-web/src/main/webapp/js/common.js (.../common.js) (revision 35300) @@ -101,7 +101,6 @@ function isFormValid(form) { var fields = form.getForm().items.items; var arr = []; - for (var i = 0; i < fields.length; i++) { var field = fields[i]; if (!field.ownerCt.hidden) { @@ -4963,4 +4962,176 @@ } }); } +} + +//RFID感应范围调节 +function updateRSSI(rssiValue,id) { + var formObj = new top.Ext4.form.Panel({ + width: 800, + height: 200, + bodyStyle: 'padding: 10px;', + buttonAlign: 'left', + // 拉动滑块的时候会显示值 + defaults: { + anchor: '95%', + border: false + }, + items: [{ + layout: 'column', + items: [{ + layout: 'form', + columnWidth: 0.7, + border: false, + items: [{ + xtype: 'sliderfield', + tipText: function (thumb) { + return '-' + String(100 - thumb.value); + }, + value: (100-rssiValue), + height: 25, + id: 'sliderValue', + name: 'sliderValue', + listeners: { + change: function (field, nV, oV) { + top.Ext4.getCmp('rssiValue').setValue(100 - nV) + } + } + }] + }, { + layout: 'form', + columnWidth: 0.25, + style: 'margin-left: 10px;', + border: false, + items: [{ + xtype: 'numberfield', + id: 'rssiValue', + name: 'rssiValue', + value: rssiValue, + maxValue: 100, + minValue: 0, + listeners: { + change: function (field, nV, oV) { + top.Ext4.getCmp('sliderValue').setValue(100 - nV) + } + } + }] + }] + }] + }); + var rssiWindow = new top.Ext4.Window({ + layout: 'fit', + title: 'RFID感应范围调节(-100 到 0)', + width: 400, + border: true, + modal: true, + height: 200, + plain: true, + items: [formObj], + buttonAlign: 'center', + buttons: [{ + text: '确定', + handler: function () { + var value = top.Ext4.getCmp('sliderValue').getValue(); + var params = {}; + if(id !== ''){ + params = { + id:id, + rssiValue:100-value + } + }else { + params = { + rssiValue:100-value + } + } + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/rssiRecordAction!saveRssiRecord.do', + params: params, + success: function (response, options) { + showResult("保存成功!"); + sessionStorage.setItem('rssiValue',params.rssiValue) + rssiWindow.close(); + }, + failure: function (response, options) { + showResult("保存失败!"); + } + }); + } + }, { + text: '取消', + handler: function () { + rssiWindow.close(); + } + }] + }); + + rssiWindow.show(); +} + +//获取供应室store +function getSupplyRoomStore(domID){ + var supplyRoomStore = new Ext.data.SimpleStore({ + fields: ['departCode', 'name'] + }); + var supplyRoomRecord = Ext.data.Record.create([ + { name: 'departCode', type: 'string' }, + { name: 'name', type: 'string' } + ]); + /** + * “供应室combo”的store,仅用于普通的ajax请求的数据源 + */ + var supplyRoomRemoteStore = new Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!loadSupplyRoomConfigRoom.do', + method: 'POST' + }), + baseParams: { type: "12" }, + reader: new Ext.data.JsonReader({ + fields: [ + { name: 'id', mapping: 'id' }, + { name: 'departCode', mapping: 'departId' }, + { name: 'name', mapping: 'name' } + ] + }), + listeners: { + beforeload: function () { + loadMask = new Ext.LoadMask(Ext.getBody(), { + msg: '正在加载供应室...,请稍候!', removeMask: true + }); + loadMask.show(); + }, + load: function (thiz, records, options) { + loadMask.hide(); + var currentOrgUnitIsSupplyRoom = false; + 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 })); + currentOrgUnitIsSupplyRoom = true; + } + } 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 (currentOrgUnitIsSupplyRoom) { + Ext.getCmp(domID).setValue(currentOrgUnitCoding); + } + } + } + }); + + supplyRoomRemoteStore.load(); + + return supplyRoomStore; } \ No newline at end of file