Index: ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/sterilizationRecordForm.js =================================================================== diff -u -r29939 -r29941 --- ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/sterilizationRecordForm.js (.../sterilizationRecordForm.js) (revision 29939) +++ ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/sterilizationRecordForm.js (.../sterilizationRecordForm.js) (revision 29941) @@ -795,8 +795,8 @@ */ function scanFixedBarcode(fixedBarcode,isLoadAll) { var rootNode = sterilizationColumnTree.getRootNode(); - var leftFixedLenght = parseInt(leftFixedBarcodeMap.get(fixedBarcode) || 0); - var rightFixedLenght = parseInt(rightFixedBarcodeMap.get(fixedBarcode) || 0); + var leftFixedLenght = parseInt(getLeftFixedBarcodeAmount(fixedBarcode) || 0); + var rightFixedLenght = parseInt(getRigthFixedBarcodeAmount(fixedBarcode) || 0); var scanAmount = scanAmountMap.get(fixedBarcode); var finalAmount = 0; var isLast = false; @@ -811,6 +811,7 @@ if(rightFixedLenght > scanAmount && scanAmount !== 0){ finalAmount = isLoadAll?rightFixedLenght:scanAmount; }else { + rightFixedLenght = rightFixedLenght>0?rightFixedLenght:0; finalAmount = rightFixedLenght; } if(leftFixedLenght+finalAmount >= 2000){ @@ -829,6 +830,9 @@ finalAmount -= (leftFixedLenght+finalAmount)-2000; } } + console.log(leftFixedLenght) + console.log(rightFixedLenght) + console.log(finalAmount) if(rightFixedLenght == 0){ showResult('已超过'+pNode.attributes.name+'的最大待灭菌物品总数'+leftFixedLenght+'!'); } @@ -2556,10 +2560,13 @@ sterilizationRecordWin.getEl().unmask(); return false; } - if (newAmount > 2000) { - newAmount = parseInt(rigthAmount) + parseInt(oldAmount); - newAmount = newAmount>2000?2000:newAmount; - showResult('已超过'+attr.name+'的最大待灭菌物品总数'+newAmount+'!'); + var amount = parseInt(newAmount) - parseInt(oldAmount); + var leftAmount = parseInt(getLeftFixedBarcodeAmount(barcode)); + if (amount > rigthAmount) { + var sumAmount = (leftAmount+rigthAmount)>2000?2000:(leftAmount+rigthAmount); + sterilizationRecordWin.getEl().unmask(); + showResult('已超过'+attr.name+'的最大待灭菌物品总数'+sumAmount+'!'); + return false; } updateLeftAndRightMap(thiz,newAmount,oldAmount,'add'); } else if (newAmount < oldAmount) {