Index: ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js =================================================================== diff -u -r29512 -r29527 --- ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 29512) +++ ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 29527) @@ -1097,9 +1097,15 @@ Ext4.each(record.parentNode.childNodes, function(pNode) { sum += parseInt(pNode.get('amount')); }); + if(context.value > record.raw.maxAmount){ + showResult(record.get('tousseName') + "的数量不能大于最大装配数量"+record.raw.maxAmount , null , sstsConfig.messagePauseTimeOnPackingPage); + record.set('amount',context.originalValue); + return; + } if(sum > unPackingAmount){ showResult(record.get('tousseName') + ",装配数量不能大于"+unPackingAmount , null , sstsConfig.messagePauseTimeOnPackingPage); record.set('amount',context.originalValue); + return; } }else { var unPackingAmount = record.get('unPackingAmount'); @@ -3509,9 +3515,13 @@ var taskIdToAmountMapInfo = []; var status; var parentAmout = 0; + var isChackAll = false; var taskIdsArray = []; //遍历器械包下的每条装配任务数据 Ext4.each(selNodes,function(cNode){ + if(cNode.childNodes.length > 0){ + isChackAll = true; + } if(cNode.get("tousseName") == pTousseName && cNode.childNodes.length == 0){ tousseName = cNode.get("tousseName"); status = cNode.get("status"); @@ -3595,8 +3605,14 @@ } } } + var lastAmount = 0; + if(isChackAll){ + lastAmount = pNode.get('amount'); + }else { + lastAmount = parentAmout; + } //请求后台装配方法 - packingTousse(false,basketBarcode,scannedBasketBarcodes.join(";"),taskIdArray.join(";"),tousseName,tousseType,parentAmout,packageType,sterilingType,supplierName,departmentArray.join(";"),pNode.get('urgentAmount'),JSON.stringify(taskIdDest)); + packingTousse(false,basketBarcode,scannedBasketBarcodes.join(";"),taskIdArray.join(";"),tousseName,tousseType,lastAmount,packageType,sterilingType,supplierName,departmentArray.join(";"),pNode.get('urgentAmount'),JSON.stringify(taskIdDest)); } //格式[{tousseName:"",amount:1,packed:true,taskItems:[{taskId:11,amount:20},{taskId:12,amount:30}]},{tousseName:"",amount:1,packed:true,taskItems:[{taskId:11,amount:20},{taskId:12,amount:30}]}] // 一次打印 @@ -3623,7 +3639,6 @@ var selNodes = waitPackingTreeGrid.getView().getChecked(); var selLength = selNodes.length; var map = {},dest = []; - var parentAmout = 0; Ext4.each(selNodes, function(pNode){ if(pNode.childNodes.length == 0){ var ai = pNode; @@ -3652,7 +3667,12 @@ var departmentArray = []; var taskIdToAmountMapInfo = []; var status; + var parentAmout = 0; + var isChackAll = false; Ext4.each(selNodes,function(cNode){ + if(cNode.childNodes.length > 0){ + isChackAll = true; + } if(cNode.get("tousseName") == pTousseName && cNode.childNodes.length == 0){ tousseName = cNode.get("tousseName"); var haveIDCard = pNode.get('haveIDCard'); @@ -3695,7 +3715,13 @@ parentAmout += amount; } }) - packingTousse(false,'','',taskIdArray.join(";"),tousseName,tousseType,pNode.get('amount'),packageType,sterilingType,supplierName,departmentArray.join(";"),urgentAmount,JSON.stringify(taskIdToAmountMapInfo)); + var lastAmount = 0; + if(isChackAll){ + lastAmount = pNode.get('amount'); + }else { + lastAmount = parentAmout; + } + packingTousse(false,'','',taskIdArray.join(";"),tousseName,tousseType,lastAmount,packageType,sterilingType,supplierName,departmentArray.join(";"),urgentAmount,JSON.stringify(taskIdToAmountMapInfo)); } // 一次打印 printLabelsAfterPacking(); @@ -5249,33 +5275,6 @@ resetTimer(); }; -//计算文字的宽度 -function textSize(fontSize,fontFamily,text){ - var span = document.createElement("span"); - var result = {}; - result.width = span.offsetWidth; - result.height = span.offsetHeight; - span.style.visibility = "hidden"; - span.style.fontSize = fontSize; - span.style.fontFamily = fontFamily; - span.style.display = "inline-block"; - document.body.appendChild(span); - if(typeof span.textContent != "undefined"){ - span.textContent = text; - }else{ - span.innerText = text; - } - if(window.getComputedStyle){ - result.width = parseInt(window.getComputedStyle(span).width) - result.width; - result.height = parseInt(window.getComputedStyle(span).height) - result.height; - }else{ - //针对IE9以下兼容 - result.width = parseInt(span.offsetWidth) - result.width; - result.height = parseInt(span.offsetHeight) - result.height; - } - return result; -} - /** * websocket的业务回调函数(将需要处理的业务写在此函数中) */