Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js =================================================================== diff -u -r12338 -r12387 --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js (.../goodsTemplateApplicationView.js) (revision 12338) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js (.../goodsTemplateApplicationView.js) (revision 12387) @@ -5,6 +5,7 @@ var dispableGoodSum; var applicationWindow; var curSelectedGoods = null; +var allowApplyDisposableGoodsWhenUnderstock = true;// 一次性物品库存不足时,是否允许申领 var windowHeight = top.document.body.clientHeight > 650 ? 650 : top.document.body.clientHeight; var invoicePlanPrintButtonName = '发货计划'; if (sstsConfig.invoicePlanPrintButtonName != undefined){ @@ -785,6 +786,10 @@ var isDiposableGoods = top.Ext4.getCmp('isDiposableGoods').getValue(); var minApplyAmount = top.Ext4.getCmp('minApplyAmount').getValue(); if(isDiposableGoods == '是' && parseInt(count,10) > storageAmount ){ + if(!allowApplyDisposableGoodsWhenUnderstock){ + showResult("申请数量不能大于库存数量!"); + return false; + } top.Ext4.Msg.confirm("请确认", "申请数量大于库存数量,发货可能会延迟,是否继续申请该物品?",function(btn) { if (btn != 'yes') { top.Ext4.getCmp('count1').setValue(""); @@ -912,6 +917,7 @@ } function comboApplication(id,editable,hiddenCommitButton,hiddenSaveButton,hiddenReturnEditButton,type, originalCommittedStatus) { + allowApplyDisposableGoodsWhenUnderstock = getBoolValueFromJs('sstsConfig.allowApplyDisposableGoodsWhenUnderstock',true); //是否供应室用户 var isSupplyRoomUser = validateIsSupplyRoomUser(); var departCoding = $Id('departCoding').value; @@ -1406,6 +1412,11 @@ var isDiposableGoods = record.get("diposable"); var minApplyAmount = record.get("minApplyAmount"); if (isDiposableGoods == '是' && context.value != null && context.value != ''){ + var storage = record.get("storage"); + if(parseInt(context.value,10) > storage && !allowApplyDisposableGoodsWhenUnderstock){ + showResult("申请数量不能大于库存数量!"); + record.set("count", ""); + } if (!isValidDiposableAmount(minApplyAmount,context.value)){ showResult("该一次性物品最小申请数量为"+minApplyAmount+",所填数量必须是"+minApplyAmount+"的倍数。"); record.set("count", "");