Index: ssts-web/src/main/webapp/disinfectsystem/foreigntousseapplication/foreignTousseInfoForm.js =================================================================== diff -u -r14971 -r14983 --- ssts-web/src/main/webapp/disinfectsystem/foreigntousseapplication/foreignTousseInfoForm.js (.../foreignTousseInfoForm.js) (revision 14971) +++ ssts-web/src/main/webapp/disinfectsystem/foreigntousseapplication/foreignTousseInfoForm.js (.../foreignTousseInfoForm.js) (revision 14983) @@ -167,7 +167,26 @@ } return tousses; } - +function refreshMaterialAmountInfo(){ + var toolsAmount = 0; + var includeImplantAmount = 0; + var nodes = foreignTousseStore.getRootNode().childNodes; + for(var i = 0;i < nodes.length ; i++){ + var n = nodes[i]; + var materialNodes = n.childNodes; + for (var j=0; j < materialNodes.length; j++){ + var includeImplant = materialNodes[j].get("includeImplant"); + var amount = materialNodes[j].get("amount"); + if(includeImplant == '是'){ + includeImplantAmount += parseInt(amount); + }else{ + toolsAmount += parseInt(amount); + } + } + } + var text = '工具:'+toolsAmount+'件 植入物: '+includeImplantAmount+'件'; + top.Ext4.getCmp('materialAmountInfo').setText(text); +} function getStoreDepartCoding(store,deptName){ var deptCoding = ""; for(var i = 0;i < store.data.length;i++){ @@ -582,6 +601,9 @@ showResult(foreignTousseName + ",已存在!"); } } + },{ + text: "", + id : 'materialAmountInfo' }]; }else if(formType == 'recycle'){ forigntousseTbar = [{ @@ -893,7 +915,13 @@ confirmRecycle : confirmRecycle }; Ext4.apply(store.proxy.extraParams, params); - } + }, + datachanged: function(store,eOpts){ + refreshMaterialAmountInfo(); + }, + update: function( store, record, operation, eOpts ){ + refreshMaterialAmountInfo(); + } }, folderSort: true });