Index: ssts-web/src/main/webapp/homepage/supplyRoomsUnfinishedWork.js =================================================================== diff -u -r27301 -r27802 --- ssts-web/src/main/webapp/homepage/supplyRoomsUnfinishedWork.js (.../supplyRoomsUnfinishedWork.js) (revision 27301) +++ ssts-web/src/main/webapp/homepage/supplyRoomsUnfinishedWork.js (.../supplyRoomsUnfinishedWork.js) (revision 27802) @@ -61,31 +61,41 @@ var goodNmae ="";// $Id('goodsSearch').value; var tousseType = $Id('tousseType').value; var department = $Id('department').value; + var orgUnitCoding = Ext.getCmp('querySupplyRoom').getValue(); + if(orgUnitCoding.indexOf(ALL) == 0){ + orgUnitCoding = ""; + } applicationStore.baseParams['tousseName'] = goodNmae; applicationStore.baseParams['tousseType'] = tousseType; applicationStore.baseParams['department'] = department; + applicationStore.baseParams['orgUnitCoding'] = orgUnitCoding; applicationStore.load({params:{start: 0, limit: 10}}); pendingBasketStore.baseParams['department'] = department; + pendingBasketStore.baseParams['orgUnitCoding'] = orgUnitCoding; pendingBasketStore.load({params:{start: 0, limit: 10}}); packingStore.baseParams['tousseName'] = goodNmae; packingStore.baseParams['tousseType'] = tousseType; packingStore.baseParams['department'] = department; + packingStore.baseParams['orgUnitCoding'] = orgUnitCoding; packingStore.load({params:{start: 0, limit: 10}}); reviewStore.baseParams['tousseName'] = goodNmae; reviewStore.baseParams['tousseType'] = tousseType; + reviewStore.baseParams['orgUnitCoding'] = orgUnitCoding; reviewStore.load({params:{start: 0, limit: 10}}); sterilizationStore.baseParams['tousseName'] = goodNmae; sterilizationStore.baseParams['tousseType'] = tousseType; + sterilizationStore.baseParams['orgUnitCoding'] = orgUnitCoding; sterilizationStore.load({params:{start: 0, limit: 10}}); invoicePlanStore.baseParams['tousseName'] = goodNmae; invoicePlanStore.baseParams['tousseType'] = tousseType; invoicePlanStore.baseParams['department'] = department; + invoicePlanStore.baseParams['orgUnitCoding'] = orgUnitCoding; invoicePlanStore.load({params:{start: 0, limit: 10}}); } @@ -279,6 +289,71 @@ ) }); + var supplyRoomRecord = Ext.data.Record.create([ + {name: 'departCode', type: 'string'}, + {name: 'name', type: 'string'} + ]); + + var supplyRoomStore = new Ext.data.SimpleStore({ + fields : ['departCode','name'] + }); + + /** + * “供应室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('querySupplyRoom').setValue(currentOrgUnitCoding); + } + } + } + }); + supplyRoomRemoteStore.load();//20181225 end + var form = new Ext.form.FormPanel({ title : entityName, region : 'north', @@ -355,6 +430,63 @@ } }] + },{ + columnWidth : .2, + layout : 'form', + labelWidth : 70, + //labelSeparator : '选择供应室:', + items : [{//20181225 + xtype : 'multiSelect', + fieldLabel : '选择供应室', + id : 'querySupplyRoom', + name : 'querySupplyRoom', + valueField : 'departCode', + displayField : 'name', + minChars : 0, + listWidth : 260, + 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、如果选中“全部”的项,则把所有的项选中,反之全部取消选择 + if (record.get('departCode') == ALL) { + if (record.get('checked')) { + combo.selectAll(); + } else { + combo.deselectAll(); + } + } + + //2、如果已经选中所有的项,则把“全部”项选中,反之把“全部”项取消选择 + var selectAll = true; + 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); + } else { + all.set(combo.checkField, false); + } + combo.setValue(combo.getCheckedValue()); + //taskGroupStore.reload(); + /* if(!combo.getValue()){ + taskGroupStore.removeAll(); + } */ + } + } + }] }] }], buttonAlign :'center',