Index: ssts-web/src/main/webapp/disinfectsystem/packing/comboToussePackingView.js =================================================================== diff -u -r27971 -r28577 --- ssts-web/src/main/webapp/disinfectsystem/packing/comboToussePackingView.js (.../comboToussePackingView.js) (revision 27971) +++ ssts-web/src/main/webapp/disinfectsystem/packing/comboToussePackingView.js (.../comboToussePackingView.js) (revision 28577) @@ -43,7 +43,8 @@ packageType : packageType, errorAmount : 0, damageAmount : 0, - unWashAmount : 0 + unWashAmount : 0, + tousseAmount : 0 }] sourceStore.insert(0,addItem); }else{ @@ -202,6 +203,88 @@ // resetComboTousseTotolAmount(); } +//一键聚合 +function comboAll_confirm(){ + var waitComboTousseGrid = top.Ext4.getCmp("waitComboTousseGrid"); + var waitComboTousseStore = waitComboTousseGrid.getStore(); + + var records = waitComboTousseGrid.getSelectionModel().getSelection(); + if (records.length == 0) { + showResult("请选择!" , null , sstsConfig.messagePauseTimeOnPackingPage); + return false; + } + var defaultTousseAmount = []; + var maxGroup = []; + var msg = ''; + for(var i = 0 ; i < records.length ; i++){ + var tousseAmount = records[i].raw.tousseAmount || 0;//默认设置聚合数量 + var tousseName = records[i].raw.tousseName; + var amount = records[i].data['amount'];//拆分数量 + var maxAmount = records[i].data["maxAmount"];//总数量 + + if(amount == 0){ + msg = tousseName+"的聚合数量必须大于0!"; + } + + if(amount < tousseAmount){ + msg = tousseName+"的可聚合数量小于默认聚合数量,不能一键聚合!"; + } + + if(amount > maxAmount){ + msg = tousseName+"的聚合数量不能大于可装配数量!"; + } + + if(tousseAmount == 0){ + defaultTousseAmount.push(tousseName) + } + + maxGroup[i] = parseInt(amount/tousseAmount); + } + + if(msg !== ''){ + showResult(msg , null , sstsConfig.messagePauseTimeOnPackingPage); + return false; + } + + if(defaultTousseAmount.length > 0){ + showResult(defaultTousseAmount.join(',')+"没有设置默认的聚合数量,请设置后再进行一键聚合"); + return false; + } + + var min = Math.min.apply(null,maxGroup); + for(var k=0;k>', - minWidth:48, + minWidth:65, handler : function(){ toComboTousseGrid(false); } }, { xtype :'button', hidden: true, text : '<<', - minWidth:48, + minWidth:65, handler : function(){ toTousseGrid(false); } }, { xtype :'button', hidden: true, text : '>>>>', - minWidth:48, + minWidth:65, handler : function(){ toComboTousseGrid(true); } }, { xtype :'button', hidden: true, text : '<<<<', - minWidth:48, + minWidth:65, handler : function(){ toTousseGrid(true); } @@ -1168,7 +1253,7 @@ hidden: true, text:'确定', border:false, - minWidth:48, + minWidth:65, handler : function(){ var tousseName = top.Ext4.getCmp('comboTousseName').getRawValue(); var id = top.Ext4.getCmp('comboTousseName').getValue(); @@ -1178,10 +1263,18 @@ xtype :'button', text:'聚合', border:false, - minWidth:48, + minWidth:65, handler : function(){ combo_confirm(); } + },{ + xtype :'button', + text:'一键聚合', + border:false, + minWidth:65, + handler : function(){ + comboAll_confirm(); + } } ] }, { height:'100%', @@ -1508,7 +1601,8 @@ packageType : item.packageType, errorAmount : 0, damageAmount : 0, - unWashAmount : 0 + unWashAmount : 0, + tousseAmount : 0 }] waitComboTousseGridStore.insert(0,addItem); continue; Index: ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js =================================================================== diff -u -r28568 -r28577 --- ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 28568) +++ ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 28577) @@ -4421,12 +4421,6 @@ var waitPackColumnTreeGrid = Ext4.create('columnTreeGrid', { id : 'waitPackingTreeGrid', border : false, - viewConfig : { - loadMask : {msg : '正在加载,请稍候...'}, - forceFit :false, - autoFill:false - }, - fiex:1, columns:buildColumnTreeColumns('waitPackingTreeGrid'), height: (document.body.clientHeight - 30)/2, listeners:{ @@ -4491,7 +4485,20 @@ }else{ return false; } - }, + }, + load: { + fn: function(store){ + var root = waitPackingTaskStore.getRootNode(); + var max = []; + for(var i=0;i