Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseForm.js =================================================================== diff -u -r14720 -r14868 --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseForm.js (.../tousseForm.js) (revision 14720) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseForm.js (.../tousseForm.js) (revision 14868) @@ -525,8 +525,16 @@ }); } } + },{ + text : '材料总件数:', + id : 'materialCount' + // style : 'margin-top:1px' + },{ + text : '材料种类:', + id : 'materialType' + // style : 'margin-top:1px' }], - listeners: { + listeners: { beforeedit: function(obj){ eventEdit = obj; }, @@ -1949,11 +1957,32 @@ top.Ext.getCmp('isSterile').setValue('是'); top.Ext.getCmp('isApplyEntireTousse').disable(); } + setMaterialCountAndMaterialType(materialsPanel); }, failure : function(form, action) {}, params : {id : id} }); } + + /** + * 设置材料数量和种类 + * @param panel 材料的panel + */ + function setMaterialCountAndMaterialType(panel) { + var mStore = panel.getStore(); + var materialCount = 0; + var materialType = 0; + mStore.each(function (record) { + // 只统计机械类型的数量和种类 + if ("器械" == record.get('type')){ + materialCount += record.get('count'); + materialType++; + } + // console.info(record.get('name') + ":" + record.get('type') + "-" + record.get('count')); + }); + top.Ext.getCmp('materialCount').setText('材料总件数:' + materialCount); + top.Ext.getCmp('materialType').setText('材料种类:' + materialType); + } function uploadVideoWindow(videoType){ var dialog = new top.Ext.ux.UploadDialog.Dialog({