Index: ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/sterilizationRecordForm.js =================================================================== diff -u -r29295 -r29364 --- ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/sterilizationRecordForm.js (.../sterilizationRecordForm.js) (revision 29295) +++ ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/sterilizationRecordForm.js (.../sterilizationRecordForm.js) (revision 29364) @@ -730,8 +730,7 @@ if(result.success){ var newBarcode = result.message.split(",") myBarcodes=myBarcodes.concat(newBarcode);//将返回的条码添加到全局中 - var leftAmount = getLeftFixedBarcodeAmount(fixedBarcode)//获取到左边对应的数量 - var finalAmount = parseInt(myBarcodes.length)-parseInt(leftAmount)//返回的条码数量 - 当前的数量 + var finalAmount = parseInt(newBarcode.length)//返回的条码数量 updateRigthFixedBarcodeAmount(fixedBarcode,finalAmount)//修改右边的数量 updateLeftFixedBarcodeAmount(fixedBarcode,finalAmount)//修改左边的数量 statisticsTousseAndBasket();//统计总数量 @@ -886,8 +885,7 @@ var rigthAmount = getRigthFixedBarcodeAmount(fixedBarcode)//获取右边的数量 pendingSterilizationColumnTree.getRootNode().eachChild(function(pNode){ if (pNode != null && pNode.attributes && pNode.attributes.objBarcode) { - if(pNode.attributes.objBarcode == fixedBarcode &&i<1 ){ - i++ + if(pNode.attributes.objBarcode == fixedBarcode){ var name = pNode.attributes.objName; var type = pNode.attributes.type; var depart = pNode.attributes.depart; @@ -899,7 +897,7 @@ if(editType==1){//如果是增加了数量,则对应右边要减少 resultAmount = amountRight - editCompleteAmount }else if(editType==2){//如果是减少了数量,则对应右边要增加 - resultAmount = amountRight + editCompleteAmount + resultAmount = amountRight } if(resultAmount>0){ var myNode = createNodeForPendingStarilizationGoods(true,fixedBarcode,name,type,"","",resultAmount) @@ -1490,12 +1488,25 @@ function loadContainerAndTousseToGrid(datas){ var position = top.Ext.getCmp('position').getValue(); var rootNode = sterilizationColumnTree.getRootNode(); + var newBarcodeArray = []; + var z=0; + rootNode.eachChild(function(pNode){ + newBarcodeArray[z] = pNode.attributes.barcode; + z++ + }); if(datas && datas.length){ for(var i = 0;i < datas.length;i++){ var data = datas[i];//一键入炉的待灭菌,没有入篮筐的器械包或篮筐节点 - var parentNode; + var parentNode = ''; + var exit = false; + var newObj = {}; if ('器械包' == data.type) { - parentNode = createNode(true,data.barcode,data.name,data.typeForSterilizationStatistics,data.depart,'器械包',position,data.amount,data.reviewTime,0,data.sterilingMode); + if(newBarcodeArray.indexOf(data.barcode) == -1){ + parentNode = createNode(true,data.barcode,data.name,data.typeForSterilizationStatistics,data.depart,'器械包',position,data.amount,data.reviewTime,0,data.sterilingMode); + }else { + exit = true; + newObj = data; + } } else { var tousseInstanceArr = data.dataList var length = tousseInstanceArr.length; @@ -1513,12 +1524,24 @@ } } } - var firstChildNode = rootNode.item(0); - if(!firstChildNode){ - rootNode.appendChild(parentNode); - }else{ - rootNode.insertBefore(parentNode,firstChildNode); + if(parentNode != ''){ + var firstChildNode = rootNode.item(0); + if(!firstChildNode){ + rootNode.appendChild(parentNode); + }else{ + rootNode.insertBefore(parentNode,firstChildNode); + } } + if(exit){ + rootNode.eachChild(function(pNode){ + if(pNode.attributes.barcode == newObj.barcode){ + var amount = parseInt(pNode.attributes.amount)+parseInt(newObj.amount); + var newNode = createNode(true,newObj.barcode,newObj.name,newObj.typeForSterilizationStatistics,newObj.depart,'器械包',position,amount,newObj.reviewTime,0,newObj.sterilingMode); + rootNode.replaceChild(newNode,pNode); + return true; + } + }); + } } } statisticsTousseAndBasket(); //每次成功扫描条码后统计一下器械包的数量和灭菌篮筐的数量 @@ -1843,7 +1866,6 @@ }); node.attributes.depart=depart; } - node.attributes.objBarcode=objBarcode; node.attributes.objName=objName; node.attributes.objAmount=objAmount; @@ -2006,31 +2028,25 @@ var amountRight = parseInt(pNode.attributes.objAmount);//右边的数量 var rootNode2 = sterilizationColumnTree.getRootNode(); removePendingSterilizationGoods(fixedBarcode)//删除右边的数据 - node = createPendingSterilizationGoodsNode(fixedBarcode,objName,amount+amountRight,'TOUSSE','',reviewTime,sterilingMode) + node = createPendingSterilizationGoodsNode(fixedBarcode,objName,amount+amountRight,'TOUSSE','','',sterilingMode) }else{ + if(stockAmount<0 || isNaN(stockAmount)){ stockAmount = 0; } - node = createPendingSterilizationGoodsNode(fixedBarcode,objName,parseInt(stockAmount)+parseInt(amount),'TOUSSE','',reviewTime,sterilingMode) + node = createPendingSterilizationGoodsNode(fixedBarcode,objName,parseInt(stockAmount)+parseInt(amount),'TOUSSE','','',sterilingMode) } } }); if(!pendingSterilizationColumnTree.getRootNode().childNode){ pendingSterilizationColumnTree.getRootNode().childNode = []; } if(node == ''){ - node = createPendingSterilizationGoodsNode(fixedBarcode,objName,parseInt(stockAmount),'BASKET','',reviewTime,sterilingMode);dd + node = createPendingSterilizationGoodsNode(fixedBarcode,objName,amount,'BASKET','',reviewTime,sterilingMode); pendingSterilizationColumnTree.getRootNode().appendChild(node); }else { pendingSterilizationColumnTree.getRootNode().appendChild(node); } - /* - if(node == ''){ - node = createPendingSterilizationGoodsNode(fixedBarcode,objName,parseInt(stockAmount),'TOUSSE','',reviewTime,sterilingMode) - pendingSterilizationColumnTree.getRootNode().appendChild(node); - }else { - pendingSterilizationColumnTree.getRootNode().appendChild(node); - }*/ clickNode.remove();//将当前节点移除 statisticsTousseAndBasket(); } @@ -2055,12 +2071,9 @@ if(result.success){ if(typeof(result.message)=="undefined" || result.message==""){ myBarcodes=[]; - }else{ myBarcodes = result.message.split(",") editAmountComplete(fixedBarcode,delAmount,2) - - } top.Ext.getCmp('saveBtn').enable(); }else{ @@ -2479,8 +2492,8 @@ loadTousseNamesInBasket : true, //是否要加载篮筐里的器械包名称 //sterilizationRecordId : sterilizationRecordId, //灭菌记录id checkProxyDisinfection : 'yes', //是否需要检查代理灭菌是否已录入代理灭菌单 - saveBarcode : getAlreadyScanBarcodes(), //此次扫描之前已经扫描的条码集合 - myBarcode : myBarcodes //此次扫描之前已经扫描的固定条码集合 + saveBarcode : myBarcodes.join(';'), //此次扫描之前已经扫描的条码集合 + myBarcode : getAlreadyScanBarcodes() //此次扫描之前已经扫描的固定条码集合 }, waitMsg : '正在处理,请稍候...', success : function(response, options) { @@ -2493,7 +2506,9 @@ //如果存在固定条码,则缓存在页面上 if(fixedBarodeJsonArray && barodeJsonArray ){ for(var f=0;f