Index: ssts-web/src/main/webapp/disinfectsystem/goodsBindingConfig/goodsBindHandler.js =================================================================== diff -u -r27586 -r27591 --- ssts-web/src/main/webapp/disinfectsystem/goodsBindingConfig/goodsBindHandler.js (.../goodsBindHandler.js) (revision 27586) +++ ssts-web/src/main/webapp/disinfectsystem/goodsBindingConfig/goodsBindHandler.js (.../goodsBindHandler.js) (revision 27591) @@ -123,7 +123,10 @@ var records = result.data; if (records.length > 0) { var lcmArr = []; - var isTrue = 0; + var isMaxApplyAmountTrue = false; + var isMinApplyAmountTrue = false; + var showName = ''; + var showMinApplyAmount = 0; for(var i=0,j=0;i 0){ - var msgBox = new top.Ext4.create('Ext.window.MessageBox', { - width : 500, - height : 200 - }); - msgBox.alert('提示信息', records[i].name+'的数量必须为最小申请数量('+minApplyAmount+')的倍数'); - return; + if((records[i].count%minApplyAmount) !== 0){ + isMinApplyAmountTrue = true; + showName = records[i].name; + showMinApplyAmount = minApplyAmount; } - if(records[i].count > maxApplyAmount && minApplyAmount > 0){ - var msgBox = new top.Ext4.create('Ext.window.MessageBox', { - width : 500, - height : 200 - }); - msgBox.alert('提示信息', records[i].name+'的数量必须小于最大申请数量'); - return; + if(records[i].count > maxApplyAmount){ + isMaxApplyAmountTrue = true; + showName = records[i].name; + showMaxApplyAmount = maxApplyAmount; } } + if(isMinApplyAmountTrue && showMinApplyAmount > 0){ + var msgBox = new top.Ext4.create('Ext.window.MessageBox', { + width : 500, + height : 200 + }); + msgBox.alert('提示信息', showName+'的数量必须为最小申请数量('+showMinApplyAmount+')的倍数'); + return; + } + + if(isMaxApplyAmountTrue && showMaxApplyAmount > 0){ + var msgBox = new top.Ext4.create('Ext.window.MessageBox', { + width : 500, + height : 200 + }); + msgBox.alert('提示信息', showName+'的数量必须小于最大申请数量('+showMaxApplyAmount+')'); + return; + } + if(lcmArr.length > 0 && lcm(lcmArr) > 0 && (params.bindCount%lcm(lcmArr)) !== 0){ var msgBox = new top.Ext4.create('Ext.window.MessageBox', { width : 500, @@ -163,6 +178,7 @@ msgBox.alert('提示信息', params.goodName+'的数量必须为'+lcm(lcmArr)+'的倍数'); return; } + me.addBindGood(records); } } else {