Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js =================================================================== diff -u -r32418 -r33065 --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js (.../goodsApplicationView.js) (revision 32418) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js (.../goodsApplicationView.js) (revision 33065) @@ -550,6 +550,7 @@ {name : 'urgentLevel',mapping : 'urgentLevel'}, {name : 'materials',mapping : 'materials'}, {name : 'minApplyAmount',mapping : 'minApplyAmount'}, + {name : 'fullCaseApplicationAmount',mapping : 'fullCaseApplicationAmount'}, {name : 'expressInvoice',mapping : 'expressInvoice'}, //是否快速发货 {name : 'maxApplyAmount',mapping : 'maxApplyAmount'} ]; @@ -625,6 +626,7 @@ {name : 'displayName',mapping : 'displayName'}, {name : 'minApplyAmount',mapping : 'minApplyAmount'}, {name : 'maxApplyAmount',mapping : 'maxApplyAmount'}, + {name : 'fullCaseApplicationAmount',mapping : 'fullCaseApplicationAmount'}, {name : 'urgentAmount',mapping : 'urgentAmount'}, {name : 'urgentLevel',mapping : 'urgentLevel'}, {name : 'unit',mapping : 'unit'}, @@ -643,6 +645,7 @@ {name : 'urgentLevel'}, {name : 'minApplyAmount'}, {name : 'maxApplyAmount'}, + {name : 'fullCaseApplicationAmount'}, {name : 'diposable'}, {name : 'tousseType'}, {name : 'externalCode'}, @@ -719,6 +722,7 @@ {name : 'countBackup'}, {name : 'minApplyAmount'}, //最小申请数量 {name : 'maxApplyAmount'}, //最大申请数量 + {name : 'fullCaseApplicationAmount'}, {name : 'diposable'}, //是否一次性物品 {name : 'tousseType'}, //物品类型,一次性物品或者器械包的类型 {name : 'recyclingAmount'}, @@ -956,7 +960,7 @@ * @param type 申请单类型 */ function addItems(tousseDefinitionID,name,count,diposable,isApplyEntireTousse,originalPrice,price,externalCode, - storageAmount,tousseType,materials,unit,packageSpec,minApplyAmount,maxApplyAmount,urgentAmount,urgentLevel,urgentLevelId,para,expressInvoice,type){ + storageAmount,tousseType,materials,unit,packageSpec,minApplyAmount,maxApplyAmount,urgentAmount,urgentLevel,urgentLevelId,para,expressInvoice,type,fullCaseApplicationAmount){ //1、处理从模板里面找到的(因为前面过滤已经添加的物品,所以剩下的只是模板的物品了) var foundNode = null; var needToCheckNode = {tousseDefinitionID : tousseDefinitionID,name : name,tousseType : tousseType}; @@ -1052,6 +1056,7 @@ urgentAmount : urgentAmount, urgentLevel : urgentLevel, urgentLevelId:urgentLevelId, + fullCaseApplicationAmount:fullCaseApplicationAmount, totalPrice: isUndefinedOrNullOrEmpty(transferScale) ? roundValue(price*count) : roundValue(price*count*transferScale), packageSpec:packageSpec }); @@ -1110,6 +1115,19 @@ top.Ext4.getCmp('count1').focus(); } +//GYEY-761:如果该一次性物品定义了整箱申请数量,而填写的申请数量是整箱申请数量的整数倍(包括1倍),则无论申请数量是否满足最小或最大申请数量,都允许申请该数量。 +function isValidAddDiposable(fullCaseApplicationAmount,count){ + if(fullCaseApplicationAmount == '' || parseInt(fullCaseApplicationAmount) == 0){ + return false; + }else { + if(count % parseInt(fullCaseApplicationAmount) == 0){ + return true; + }else { + return false; + } + } +} + /** * 添加物品(器械包和一次性物品)到物品申请列表中. * @returns {Boolean} @@ -1189,20 +1207,24 @@ var storageAmount = sstsConfig.storageUseStorageSubtractWaitDeliver ? findStorageByDisposeIdAndHandleDepartCode(id) : parseInt(top.Ext4.getCmp('diposableGoodsAmount').getValue() || 0,10); var minApplyAmount = top.Ext4.getCmp('minApplyAmount').getValue(); var maxApplyAmount = top.Ext4.getCmp('maxApplyAmount').getValue(); + var fullCaseApplicationAmount = top.Ext4.getCmp('fullCaseApplicationAmount').getValue() || 0; if(type == "物品预约单" && sstsConfig.notAllowReservationAmountGreaterThanStorageAmount){ storageAmount = parseInt(storage); } //如果是一次性物品 if(isDiposableGoods == '是'){ - //如果配置了中包装单位,这个数量的校验要用中包装的数量来校验 - var checkCount = getMiddleAmount(count); - if(!isValidDiposableAmount(minApplyAmount,count)){ - showResult("该一次性物品最小申请数量为"+minApplyAmount+",所填数量必须是"+minApplyAmount+"的倍数。"); - return false; - }else if(!isUndefinedOrNullOrEmpty(maxApplyAmount) && count > maxApplyAmount){ - showResult("该一次性物品最大申请数量为"+maxApplyAmount+",申请数量不能大于最大申请数量。"); - return false; - }else if(!isValidDiposableAmount(minApplyAmount,urgentAmount) && urgentAmount != null){ + //如果配置了中包装单位,这个数量的校验要用中包装的数量来校验 + var checkCount = getMiddleAmount(count); + if(!isValidAddDiposable(fullCaseApplicationAmount,count)){ + if(!isValidDiposableAmount(minApplyAmount,count)){ + showResult("该一次性物品最小申请数量为"+minApplyAmount+",所填数量必须是"+minApplyAmount+"的倍数。"); + return false; + }else if(!isUndefinedOrNullOrEmpty(maxApplyAmount) && count > maxApplyAmount){ + showResult("该一次性物品最大申请数量为"+maxApplyAmount+",申请数量不能大于最大申请数量。"); + return false; + } + } + if(!isValidDiposableAmount(minApplyAmount,urgentAmount) && urgentAmount != null){ showResult("该一次性物品最小申请数量为"+minApplyAmount+",所填加急数量必须是"+minApplyAmount+"的倍数。"); return false; }else if(parseInt(checkCount,10) > storageAmount){ @@ -1214,16 +1236,16 @@ if (btn != 'yes') { return false; }else{ - addItems(id,name,count,isDiposableGoods,isApplyEntireTousse,originalPrice,price,externalCode,storageAmount,tousseType,materials,unit,packageSpec,minApplyAmount,maxApplyAmount,urgentAmount,urgentLevel,urgentLevelId,para,expressInvoice,type); + addItems(id,name,count,isDiposableGoods,isApplyEntireTousse,originalPrice,price,externalCode,storageAmount,tousseType,materials,unit,packageSpec,minApplyAmount,maxApplyAmount,urgentAmount,urgentLevel,urgentLevelId,para,expressInvoice,type,fullCaseApplicationAmount); afterAddItem(true,type); } }); }else{ - addItems(id,name,count,isDiposableGoods,isApplyEntireTousse,originalPrice,price,externalCode,storageAmount,tousseType,materials,unit,packageSpec,minApplyAmount,maxApplyAmount,urgentAmount,urgentLevel,urgentLevelId,para,expressInvoice,type); + addItems(id,name,count,isDiposableGoods,isApplyEntireTousse,originalPrice,price,externalCode,storageAmount,tousseType,materials,unit,packageSpec,minApplyAmount,maxApplyAmount,urgentAmount,urgentLevel,urgentLevelId,para,expressInvoice,type,fullCaseApplicationAmount); afterAddItem(true,type); } }else{ - addItems(id,name,count,isDiposableGoods,isApplyEntireTousse,originalPrice,price,externalCode,storageAmount,tousseType,materials,unit,packageSpec,minApplyAmount,maxApplyAmount,urgentAmount,urgentLevel,urgentLevelId,para,expressInvoice,type); + addItems(id,name,count,isDiposableGoods,isApplyEntireTousse,originalPrice,price,externalCode,storageAmount,tousseType,materials,unit,packageSpec,minApplyAmount,maxApplyAmount,urgentAmount,urgentLevel,urgentLevelId,para,expressInvoice,type,fullCaseApplicationAmount); afterAddItem(true,type); } } @@ -1256,6 +1278,7 @@ top.Ext4.getCmp('diposableGoodsAmount').setValue(''); top.Ext4.getCmp('minApplyAmount').setValue(''); top.Ext4.getCmp('maxApplyAmount').setValue(''); + top.Ext4.getCmp('fullCaseApplicationAmount').setValue(''); top.Ext4.getCmp('isDiposableGoods').setValue(""); top.Ext4.getCmp('package1').clearValue(); top.Ext4.getCmp('count1').setValue(""); @@ -1592,7 +1615,6 @@ var nodes = treeStore.getRootNode().childNodes; for (var i=0; i