Index: ssts-web/src/main/webapp/disinfectsystem/departmentStock/departmentStockInputView.js =================================================================== diff -u -r26717 -r26757 --- ssts-web/src/main/webapp/disinfectsystem/departmentStock/departmentStockInputView.js (.../departmentStockInputView.js) (revision 26717) +++ ssts-web/src/main/webapp/disinfectsystem/departmentStock/departmentStockInputView.js (.../departmentStockInputView.js) (revision 26757) @@ -13,6 +13,8 @@ Ext.getCmp("tousseName2").setValue(""); Ext.getCmp("tousseGroupName").setValue(""); Ext.getCmp("tousseGroupName").setRawValue(""); + Ext.getCmp("wareHouseName").store.baseParams.departCoding = currentClickNode.attributes.keyId; + Ext.getCmp("wareHouseName").store.load(); $Id("parm_s_currentOrgUnitCoding").value = currentClickNode.attributes.keyId; $Id("parm_s_tousseName").value = ""; $Id("parm_s_tousseGroupName").value = ""; @@ -129,6 +131,33 @@ ] ) }); + var records = Ext.data.Record.create([ + {name : 'id',mapping : 'id'}, + {name : 'name',mapping : 'name'} + ]); + var newRecord = new records({id:"all",name:"全部"}); + //仓库 + var wareHouseStore = new Ext.data.JsonStore({ + url : WWWROOT + '/disinfectSystem/baseData/wareHouseAction!getWareHouseByDepartCoding.do', + root: 'data', + fields: [ + {name : 'id',mapping : 'id'}, + {name : 'name',mapping : 'name'} + ], + listeners : { + load : function(store,record) { + if(record.length > 1){//大于1个仓库才显示全部 + store.insert(0,newRecord); + } + if(record.length > 0) { + if (Ext.getCmp('wareHouseName')) { + Ext.getCmp('wareHouseName').setValue(record[0].data.id); + } + } + } + } + }); + wareHouseStore.load(); var stockItem = Ext.data.Record.create([ {name : 'id'}, {name : 'tousseName'}, @@ -294,7 +323,38 @@ + record.data["id"]+"','"+departCoding+"','"+departName+"','"+record.data.tousseName + "','"+STATUS_SHIPPED +"','"+v +"');return false;\" >" + v + ""; return str; } - + //盘点验证 + function checkBaseCountInventory(inventoryType){ + if(!currentClickNode){ + showResult("请选择申请科室!"); + return false; + } + var wareHouseId = Ext.getCmp('wareHouseName').getValue(); + var wareHouseName = Ext.getCmp('wareHouseName').getRawValue(); + var departCoding = currentClickNode.attributes.keyId; + var departName = currentClickNode.attributes.text; + var tousseNames = ""; + if('部分盘点' == inventoryType){ + var recordArr = grid.getSelectionModel().getSelections(); + if(recordArr.length < 1){ + showResult("请选择需要盘点的科室库存!"); + return false; + }else{ + for (var i = 0; i < recordArr.length; i++) { + if(i == 0){ + tousseNames += recordArr[i].data["tousseName"]; + }else{ + tousseNames += ',' + recordArr[i].data["tousseName"]; + } + } + } + } + if(wareHouseId == null || wareHouseId == ''){ + showResult("请选择盘点仓库!"); + return false; + } + goBaseCountInventory(null,departCoding,departName,wareHouseId,wareHouseName,tousseNames); + } var columns = [ {header:"器械包名称",width:300,dataIndex:'tousseName',menuDisabled:true, renderer : gotoPage}, {header:"库存数量",width:100,dataIndex:'signedAmount',menuDisabled:true,renderer :amountDetailsStock}, @@ -500,6 +560,7 @@ Ext.getCmp('tousseName2').setValue(""); $Id("parm_s_tousseName").value = ""; Ext.getCmp("tousseGroupName").setValue(""); + Ext.getCmp("wareHouseName").setValue(""); $Id("parm_s_tousseGroupName").value = ""; } },{ @@ -510,6 +571,50 @@ handler : function() { queryDepartmentTousse(); } + },{ + text: "仓库:" + },{ + /*xtype : 'combo', + id : 'wareHouseName', + name : 'wareHouseName', + editable:false, + valueField : 'id', + displayField : 'name', + store : wareHouseStore, + forceSelection : true, + allowBlank : false, + triggerAction : 'all', + anchor : '100%'*/ + xtype : 'multiSelect', + id : 'wareHouseName', + name : 'wareHouseName', + valueField : 'id', + displayField : 'name', + allowBlank : true, + editable : false, + fieldLabel:'仓库', + listeners : { + select : function(combo, record, index){ + onAllChoosedOrNot(combo, record,index,'name'); + } + }, + store : wareHouseStore, + triggerAction : 'all', + anchor : '95%' + },{ + xtype : 'button', + text : '全部盘点', + minWidth : 70, + handler : function() { + checkBaseCountInventory('全部盘点'); + } + },{ + xtype : 'button', + text : '部分盘点', + minWidth : 70, + handler : function() { + checkBaseCountInventory('部分盘点'); + } } ] });