Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js =================================================================== diff -u -r14024 -r14132 --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js (.../goodsTemplateApplicationView.js) (revision 14024) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js (.../goodsTemplateApplicationView.js) (revision 14132) @@ -716,6 +716,12 @@ var count = top.Ext4.getCmp('count1').getValue(); var tousseType = top.Ext4.getCmp('tousseType').getValue(); var materials = top.Ext4.getCmp('materials').getValue(); + + var price = top.Ext4.getCmp('price').getValue(); + var externalCode = isDiposableGoods == '是' ?top.Ext4.getCmp('externalCode').getValue() : ''; + var unit = top.Ext4.getCmp('unit').getValue(); + var packageSpec = top.Ext4.getCmp('packageSpec').getValue(); + var isApplyEntireTousse = top.Ext4.getCmp('isApplyEntireTousse').getValue(); if(Ext4.isEmpty(name)){ var alertTips = "请输入器械包!"; showResult(alertTips); @@ -731,32 +737,32 @@ var storageAmount = parseInt(top.Ext4.getCmp('diposableGoodsAmount').getValue(),10); var isDiposableGoods = top.Ext4.getCmp('isDiposableGoods').getValue(); var minApplyAmount = top.Ext4.getCmp('minApplyAmount').getValue(); - if(isDiposableGoods == '是' && parseInt(count,10) > storageAmount ){ - if(!allowApplyDisposableGoodsWhenUnderstock){ - showResult("申请数量不能大于库存数量!"); + //如果是一次性物品 + if(isDiposableGoods == '是'){ + if(!isValidDiposableAmount(minApplyAmount,count)){ + showResult("该一次性物品最小申请数量为"+minApplyAmount+",所填数量必须是"+minApplyAmount+"的倍数。"); + top.Ext4.getCmp('count1').setValue(""); + top.Ext4.getCmp('count1').focus(); return false; - } - top.Ext4.Msg.confirm("请确认", "申请数量大于库存数量,发货可能会延迟,是否继续申请该物品?",function(btn) { - if (btn != 'yes') { - top.Ext4.getCmp('count1').setValue(""); - top.Ext4.getCmp('count1').focus(); + }else if(parseInt(count,10) > storageAmount ){ + if(!allowApplyDisposableGoodsWhenUnderstock){ + showResult("申请数量不能大于库存数量!"); return false; } - }) - }else if(isDiposableGoods == '是' && !isValidDiposableAmount(minApplyAmount,count)){ - showResult("该一次性物品最小申请数量为"+minApplyAmount+",所填数量必须是"+minApplyAmount+"的倍数。"); - top.Ext4.getCmp('count1').setValue(""); - top.Ext4.getCmp('count1').focus(); - return false; + top.Ext4.Msg.confirm("请确认", "申请数量大于库存数量,发货可能会延迟,是否继续申请该物品?",function(btn) { + if (btn != 'yes') { + top.Ext4.getCmp('count1').setValue(""); + top.Ext4.getCmp('count1').focus(); + return false; + }else{ + addItems(id,name,count,isDiposableGoods,isApplyEntireTousse,price,externalCode,storageAmount,tousseType,materials,unit,packageSpec,minApplyAmount); + } + }); + } + }else{ + addItems(id,name,count,isDiposableGoods,isApplyEntireTousse,price,externalCode,storageAmount,tousseType,materials,unit,packageSpec,minApplyAmount); } - var price = top.Ext4.getCmp('price').getValue(); - var externalCode = isDiposableGoods == '是' ?top.Ext4.getCmp('externalCode').getValue() : ''; - var unit = top.Ext4.getCmp('unit').getValue(); - var packageSpec = top.Ext4.getCmp('packageSpec').getValue(); - var isApplyEntireTousse = top.Ext4.getCmp('isApplyEntireTousse').getValue(); - - addItems(id,name,count,isDiposableGoods,isApplyEntireTousse,price,externalCode,storageAmount,tousseType,materials,unit,packageSpec,minApplyAmount); top.Ext4.getCmp('diposableGoodsAmount').setValue(''); top.Ext4.getCmp('minApplyAmount').setValue(''); top.Ext4.getCmp('isDiposableGoods').setValue("");