Index: ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js =================================================================== diff -u -r16098 -r16187 --- ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 16098) +++ ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 16187) @@ -60,6 +60,27 @@ } } +function getErrorAndDamgeCount(){ + Ext4.Ajax.request({ + url : WWWROOT + '/disinfectSystem/packingAction!getErrorAndDamageCount.do', + success : function(response, options) { + var result = Ext4.decode(response.responseText); + Ext4.getCmp("addErrorMaterial").setText("补充丢失器械("+result.errorCount+")"); + Ext4.getCmp("addDamageMaterial").setText("补充报损器械("+result.damageCount+")"); + }, + failure : function(response, options) { + var result = Ext4.decode(response.responseText); + showResult(result.cause); + } + }); +} + +function reflushGrid(){ + Ext4.getCmp('basketTreeGrid').getStore().reload(); + reflushWaitPackingTreeGrid(); + getErrorAndDamgeCount(); +} + function checkedAllNode(checked){ var rootNode = Ext4.getCmp('basketTreeGrid').getRootNode(); if(rootNode != null){ @@ -1608,7 +1629,7 @@ handler : function() { reflushWaitPackingTreeGrid(); } -},{ +},"-",{ text : '删除', hidden:SSTS_PackingTask_Delete, iconCls : 'btn_ext_application_del', @@ -1627,22 +1648,22 @@ }); deletePackingTask(ids); } -},{ +},"-",{ text : '添加报损器械', hidden : SSTS_QualityRecord_Create, iconCls : 'btn_ext_application_add', handler : function() { addAndEditRecyclingDamageRecord('', LINKTYPE_PACKINGRECORD); } -},{ +},"-",{ text : '添加质量监测', hidden:SSTS_QualityRecord_Create, iconCls : 'btn_ext_application_add', handler : function() { // addQualityMonitoring(); addQualityMonitoringByResponPart("装配管理"); } -},{ +},"-",{ text : '打印回收清单', hidden:SSTS_RecyclingDetail_Print, iconCls : 'icon_print', @@ -1651,22 +1672,6 @@ } }]; -DWREngine.setAsync(false); -RecyclingDamageTableManager.countDamageMaterialAmount(function callBackFun(count){ - if(count > 0){ - waitPackingTbar.push({ - id : 'damageSupplyBtn', - text : '补充报损器械('+count+')', - hidden : SSTS_DamageRecord_Create, - iconCls : 'btn_ext_application_add', - handler : function() { - additionalMaterial(type_damage,""); - } - }); - } -}); -DWREngine.setAsync(true); - var basketStore = new Ext4.data.TreeStore({ model: cModel, proxy: { @@ -2420,7 +2425,23 @@ } } })], - flex : 1 + bbar:[ + { + id : 'addErrorMaterial', + text: "补充丢失器械", + iconCls : 'btn_ext_application_add', + handler : function() { + additionalMaterial(type_lost,""); + } + },"-",{ + id : 'addDamageMaterial', + text : '补充报损器械', + iconCls : 'btn_ext_application_add', + handler : function() { + additionalMaterial(type_damage,""); + } + } + ] }); var waitPackColumnTreeGrid = Ext4.create('columnTreeGrid', { id : 'waitPackingTreeGrid', @@ -2686,5 +2707,8 @@ }); }); +//查询全部丢失、报损数量 +getErrorAndDamgeCount(); + });