Index: ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js =================================================================== diff -u -r15653 -r15717 --- ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 15653) +++ ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 15717) @@ -5,7 +5,6 @@ var packedToussesArray = [];// 用于一次打印所有装配的包 var formPanel; var deletePackingTask; -var supplement; var showTousseDamageMaterial; var idCardBarcode = ''; var idCardInstanceID = ''; @@ -91,6 +90,24 @@ idCardErrorsInfoCmp.setText(text); // idCardInfo.recyclingError } + +function additionalMaterialCallback(success,type,packingTaskId){ + if(packingTaskId != ""){ + var rootNode = Ext4.getCmp('basketTreeGrid').getRootNode(); + rootNode.cascade(function(n) { + if(n.get('leaf') && n.get('taskId') == packingTaskId){ + if(type == type_lost){ + n.set('errors',new Array()); + }else{ + n.set('damages',new Array()); + } + return; + } + }); + } + Ext4.getCmp('waitPackingTreeGrid').getStore().reload(); +} + Ext4.onReady(function() { packingPageAutoSetSterilizationProgramAfterSelectTousse = getBoolValueFromJs('sstsConfig.packingPageAutoSetSterilizationProgramAfterSelectTousse',true); Ext4.QuickTips.init(); @@ -122,350 +139,7 @@ direction: 'desc' }] }) - /******** 缺失器械补充窗口start ********/ - supplement = function (taskid,tousseDefinitionName,tousseDefinitionId,errorsStr) { - var errors = Ext4.JSON.decode(decodeURI(errorsStr)); - if(errors == null){ - return; - } - var supplePanel = new top.Ext.FormPanel({ - id : 'supplePanel', - name : 'supplePanel', - frame : true, - border : 0, - labelSeperator : ':', - bodyStyle : 'padding:5px 5px 0px 5px', - labelAlign:'right', - buttonAlign :'center', - autoWidth : true, - height : 500, - items : [{ - xtype : 'fieldset', - id : 'suppleFieldset', - name : 'suppleFieldset', - title : '缺失器械列表', - autoHeight : true, - autoScroll : true - }], - buttons : [{ - text : '保存', - handler : function(){ - if(!top.Ext.getCmp('supplePanel').getForm().isValid()) { - showResult('超过最大补充数量!'); - return false; - } -// // 标识牌是否已经补充完 -// var idcardSupplemented = true; -// for(var i=0;i"; -// } -// } -// ], -// loader: new top.Ext.tree.TreeLoader({ -// url : WWWROOT + '/disinfectSystem/packingAction!getIdentificationCardForTousse.do', -// baseParams : {departCode :errors[i].departCodeForId,lostIDCardInstanceBarcode :errors[i].lostIDCardInstanceBarcode,tousseName : tousseDefinitionName}, -// uiProviders:{ -// 'col': top.Ext.tree.ColumnNodeUI -// } -// }), -// root: new top.Ext.tree.AsyncTreeNode({ -// text:'器械包标识牌' -// }) -// }); -// top.Ext.getCmp('suppleFieldset').add(identificationCardTree); - //var lostAmount = - var textfield = new top.Ext.form.TextField({ - id : 'idCardErrorsInfo', - name : 'idCardErrorsInfo', - fieldLabel : errors[i].materialName, - readOnly:true, - value : '丢失'+errors[i].amount+',已补充'+errors[i].additionalAmount - }); - var errorID = errors[i].id; - var buttonfield = new top.Ext.Button({ - text: '补充打印', - handler: function() { - forSupplement = true; - tousseDefinitionID = tousseDefinitionId; - recyclingErrorID = errorID; - packingTaskID = taskid; - showIDCardListView(); - - - suppleIDCardWin = new top.Ext4.Window({ - id : 'suppleIDCardWin', - layout : 'fit', - title : '标识牌补充', - modal : true, - border : false, - width : 950, - height : 660, -// autoHeight : true, -// plain : true, - items : [signBoardForm] - }); - suppleIDCardWin.show(); - } - }); - var layout = new top.Ext.Panel({ - layout:'column', - height:30, - items : [{ -// columnWidth: 0.5, - width: 105, - xtype: 'label', - id : 'idCardErrorsInfo', - name : 'idCardErrorsInfo', -// labelAlign:'left', -// text:errors[i].materialName+':'+'丢失'+errors[i].amount+',已补充'+errors[i].additionalAmount - text:errors[i].materialName+':' - },{ - width: 120, -// columnWidth: 0.25, - items : [buttonfield] - }] - }); - top.Ext.getCmp('suppleFieldset').add(layout); -// top.Ext.getCmp('suppleFieldset').add(textfield); -// top.Ext.getCmp('suppleFieldset').add(buttonfield); - } - } - suppleWin = new top.Ext.Window({ - id : 'suppleWin', - layout : 'fit', - title : '缺失器械补充', - modal : true, - border : false, - width : windowWidth, - height : windowHeight, - autoHeight : true, - plain : true, - items : [supplePanel] - }); - suppleWin.show(); - } - /******** 缺失器械补充窗口end ********/ - - showTousseDamageMaterial = function(taskid,damagesStr) { - var damages = Ext4.JSON.decode(decodeURI(damagesStr)); - if(damages == null){ - return; - } - var materialMap = {}; - var supplePanel = new top.Ext.FormPanel({ - id : 'damageMaterialPanel', - name : 'damageMaterialPanel', - frame : true, - border : 0, - labelSeperator : ':', - bodyStyle : 'padding:5px 5px 0px 5px', - labelAlign:'right', - buttonAlign :'center', - autoWidth : true, - height : 500, - items : [{ - xtype : 'fieldset', - id : 'suppleFieldset', - name : 'suppleFieldset', - title : '缺失器械列表', - autoHeight : true, - autoScroll : true - }], - buttons : [{ - text : '保存', - handler : function(){ - if(!top.Ext.getCmp('damageMaterialPanel').getForm().isValid()) { - showResult('超过最大补充数量!'); - return false; - } - var notAdditialMaterialNum = 0;//没有补充的材料数量 - - var materialArray = new Array(); - for(var i=0;i0){ - Ext4.getCmp('damageSupplyBtn').setText('补充报损器材('+notAdditialMaterialNum+')'); - }else{ - Ext4.getCmp('damageSupplyBtn').hide(); - } - }*/ - } - suppleWin.close(); - }, - failure : function(response, options) { - showResult(response.responseText); - } - }); - } - },{ - text : '取消', - handler : function() { - suppleWin.close(); - } - }] - }); - - var windowHeight = 600; - var windowWidth = 400; - for(var i=0;i"; + str += ""; } var damages = record.get('damages'); if(damages.length > 0){ - var damagesStr = JSON.stringify(damages); - str += ""; + str += ""; } } if(record.get('tousseType') == '外来器械包' && treeId == 'basketTreeGrid'){ @@ -1962,7 +1634,7 @@ hidden : SSTS_DamageRecord_Create, iconCls : 'btn_ext_application_add', handler : function() { - showAllDamageMaterial(); + additionalMaterial(type_damage,""); } }); }