Index: ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/sterilizationRecordForm.js =================================================================== diff -u -r28871 -r28897 --- ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/sterilizationRecordForm.js (.../sterilizationRecordForm.js) (revision 28871) +++ ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/sterilizationRecordForm.js (.../sterilizationRecordForm.js) (revision 28897) @@ -1994,35 +1994,40 @@ var node; delTousseInsAmount(delAmount,fixedBarcode)//从全局数组中删除 myFixedBarcodes.removeByValue(fixedBarcode);//在全局条码中移除该固定条码 - pendingSterilizationColumnTree.getRootNode().eachChild(function(pNode){ - //移除某一个节点后,再遍历其他节点得到的是undefined - if (pNode != null && pNode.attributes && pNode.attributes.objBarcode) { - if(pNode.attributes.objBarcode == fixedBarcode &&i<1 ){ - i++ - var name2 = pNode.attributes.objName; - var type2 = pNode.attributes.type; - var depart2 = pNode.attributes.depart; - var reviewTime2 = pNode.attributes.reviewTime; - var amountRight = parseInt(pNode.attributes.objAmount);//右边的数量 - var rootNode2 = sterilizationColumnTree.getRootNode(); - removePendingSterilizationGoods(fixedBarcode)//删除右边的数据 - node = createPendingSterilizationGoodsNode(fixedBarcode,objName,amount+amountRight,'TOUSSE','',reviewTime,sterilingMode) - }else{ - if(stockAmount<0 || isNaN(stockAmount)){ - stockAmount = 0; + var childNode = pendingSterilizationColumnTree.getRootNode().childNode || []; + if(childNode.length > 0){ + pendingSterilizationColumnTree.getRootNode().eachChild(function(pNode){ + if (pNode != null && pNode.attributes && pNode.attributes.objBarcode) { + if(pNode.attributes.objBarcode == fixedBarcode &&i<1 ){ + i++ + var name2 = pNode.attributes.objName; + var type2 = pNode.attributes.type; + var depart2 = pNode.attributes.depart; + var reviewTime2 = pNode.attributes.reviewTime; + var amountRight = parseInt(pNode.attributes.objAmount);//右边的数量 + var rootNode2 = sterilizationColumnTree.getRootNode(); + removePendingSterilizationGoods(fixedBarcode)//删除右边的数据 + node = createPendingSterilizationGoodsNode(fixedBarcode,objName,amount+amountRight,'TOUSSE','',reviewTime,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','',reviewTime,sterilingMode) } - } - }); - if(pendingSterilizationColumnTree.getRootNode().childNode){ + }); pendingSterilizationColumnTree.getRootNode().appendChild(node); }else { pendingSterilizationColumnTree.getRootNode().childNode = []; + if(stockAmount<0 || isNaN(stockAmount)){ + stockAmount = 0; + } + node = createPendingSterilizationGoodsNode(fixedBarcode,objName,parseInt(stockAmount)+parseInt(amount),'TOUSSE','',reviewTime,sterilingMode); pendingSterilizationColumnTree.getRootNode().appendChild(node); } clickNode.remove();//将当前节点移除 - statisticsTousseAndBasket(); + statisticsTousseAndBasket(); + top.Ext.getCmp('btnBatchAddTousse').enable(); } /**