Index: ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js =================================================================== diff -u -r15249 -r15299 --- ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 15249) +++ ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 15299) @@ -810,7 +810,12 @@ } }); -function loadUserByBarcode(barcodeField,jobType){ +function loadUserByBarcode(barcodeField,userNameField,userCodeField,focusField){ + + if(userNameField == null || userCodeField == null || barcodeField == null){ + showResult("参数错误,请联系管理员!"); + return; + } var peopleOfBarcode = barcodeField.getValue(); if(peopleOfBarcode){ @@ -821,51 +826,18 @@ showResult("输入的条码有误!"); return; } - if (jobType == 'jobType_inspector') { - Ext4.getCmp('inspector').setValue(result.fullName); - Ext4.getCmp('inspectorCode').setValue(result.name); - inspectorCode = result.name; - jobType_inspector_name = result.fullName; - // 装配人条码输入框 - focusExtJSField(Ext4.getCmp('operatorBarcode')); - } - else if(jobType=='jobType_pack') { - Ext4.getCmp('operator').setValue(result.fullName); - Ext4.getCmp('operatorCode').setValue(result.name); - operatorCode = result.name; - jobType_pack_name = result.fullName; - // 审核人条码输入框 - focusExtJSField(Ext4.getCmp('reviewerBarcode')); - } else if(jobType=='jobType_review') { - Ext4.getCmp('reviewer').setValue(result.fullName); - Ext4.getCmp('reviewerCode').setValue(result.name); - reviewerCode = result.name; - jobType_review_name = result.fullName; - // 包装者条码输入框 - focusExtJSField(Ext4.getCmp('wrapperBarcode')); - }else if (jobType == 'jobType_wrapper') { - Ext4.getCmp('wrapper').setValue(result.fullName); - Ext4.getCmp('wrapperCode').setValue(result.name); - wrapperCode = result.name; - jobType_wrapper_name = result.fullName; + userNameField.setValue(result.fullName); + userCodeField.setValue(result.name); + if(focusField != null){ + focusExtJSField(focusField); } - }else{ showResult('找不到该条码所对应的人员信息'); - if(jobType=='jobType_inspector') { - Ext4.getCmp('inspector').setValue(); - } else if(jobType=='jobType_pack') { - Ext4.getCmp('operator').setValue(); - } else if(jobType=='jobType_review') { - Ext4.getCmp('reviewer').setValue(); - } else if(jobType=='jobType_wrapper') { - Ext4.getCmp('wrapper').setValue(); - } - + userNameField.setValue(); } }); } - barcodeField.setValue(); + barcodeField.setValue(); } var imagePanel = new Ext4.Panel({ @@ -1131,6 +1103,11 @@ value : reviewerCode },{ xtype : 'hidden', + id : 'sterileCode', + name : 'sterileCode', + value : sterileUserCode + },{ + xtype : 'hidden', id : 'wrapperCode', name : 'wrapperCode', value : wrapperCode @@ -1183,7 +1160,9 @@ listeners : { specialkey : function(thiz, e){ if(e.getKey() == 13){ - loadUserByBarcode(thiz,'jobType_inspector'); + loadUserByBarcode(thiz,Ext4.getCmp('inspector'),Ext4.getCmp('inspectorCode'),Ext4.getCmp('operatorBarcode')); + inspectorCode = Ext4.getCmp('inspectorCode').getValue(); + jobType_inspector_name = Ext4.getCmp('inspector').getValue(); } } } @@ -1215,7 +1194,9 @@ listeners : { specialkey : function(thiz, e){ if(e.getKey() == 13){ - loadUserByBarcode(thiz,'jobType_pack'); + loadUserByBarcode(thiz,Ext4.getCmp('operator'),Ext4.getCmp('operatorCode'),Ext4.getCmp('reviewerBarcode')); + operatorCode = Ext4.getCmp('operatorCode').getValue(); + jobType_pack_name = Ext4.getCmp('operator').getValue(); } } } @@ -1248,7 +1229,13 @@ listeners : { specialkey : function(thiz, e){ if(e.getKey() == 13){ - loadUserByBarcode(thiz,'jobType_review'); + var focusField = Ext4.getCmp('wrapperBarcode'); + if(sstsConfig.showSterileField){ + focusField = Ext4.getCmp('sterileBarcode'); + } + loadUserByBarcode(thiz,Ext4.getCmp('reviewer'),Ext4.getCmp('reviewerCode'),focusField); + reviewerCode = Ext4.getCmp('reviewerCode').getValue(); + jobType_review_name = Ext4.getCmp('reviewer').getValue(); } } } @@ -1268,10 +1255,44 @@ allowBlank : false, readOnly : true, value:jobType_review_name - },{ columnWidth :.5, xtype : 'textfield', + fieldLabel : '灭菌人条码', + componentCls:'formItemMgn', + id : 'sterileBarcode', + name : 'sterileBarcode', + hidden : !sstsConfig.showSterileField, + labelWidth:90, + anchor : '90%', + labelAlign:'right', + listeners : { + specialkey : function(thiz, e){ + if(e.getKey() == 13){ + loadUserByBarcode(thiz,Ext4.getCmp('sterileUser'),Ext4.getCmp('sterileCode'),null); + sterileUserCode = Ext4.getCmp('sterileCode').getValue(); + jobType_sterile_name = Ext4.getCmp('sterileUser').getValue(); + } + } + } + },{ + columnWidth :.47, + xtype : 'textfield', + fieldLabel : '灭菌人', + componentCls:'formItemMgn', + id : 'sterileUser', + name : 'sterileUser', + hidden : !sstsConfig.showSterileField, + labelAlign:'right', + labelWidth:60, + anchor : '95%', + allowBlank : false, + allowBlank : false, + readOnly : true, + value:jobType_sterile_name + },{ + columnWidth :.5, + xtype : 'textfield', fieldLabel : '包装人条码', componentCls:'formItemMgn', id : 'wrapperBarcode', @@ -1283,7 +1304,9 @@ listeners : { specialkey : function(thiz, e){ if(e.getKey() == 13){ - loadUserByBarcode(thiz,'jobType_wrapper'); + loadUserByBarcode(thiz,Ext4.getCmp('wrapper'),Ext4.getCmp('wrapperCode'),null); + wrapperCode = Ext4.getCmp('wrapperCode').getValue(); + jobType_wrapper_name = Ext4.getCmp('wrapper').getValue();; } } } @@ -2310,10 +2333,12 @@ operator = Ext4.getCmp('operator').getValue(); reviewer = Ext4.getCmp('reviewer').getValue(); wrapper = Ext4.getCmp('wrapper').getValue(); + sterileUserName = Ext4.getCmp('sterileUser').getValue(); inspectorCode = Ext4.getCmp('inspectorCode').getValue(); operatorCode = Ext4.getCmp('operatorCode').getValue(); reviewerCode = Ext4.getCmp('reviewerCode').getValue(); wrapperCode = Ext4.getCmp('wrapperCode').getValue(); + sterileUserCode = Ext4.getCmp('sterileCode').getValue(); var stock = '';//托盘条码 var sterilizer = Ext4.getCmp("sterilizer").getValue(); var frequency = Ext4.getCmp("frequency").getValue();; @@ -2348,6 +2373,8 @@ operatorCode: operatorCode, reviewer: reviewer, reviewerCode: reviewerCode, + sterileUserName : sterileUserName, + sterileUserCode : sterileUserCode, wrapper: wrapper, wrapperCode: wrapperCode, packageType: packageType,