Index: ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/foreignProxyDisinfectionForm.js =================================================================== diff -u -r32861 -r32934 --- ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/foreignProxyDisinfectionForm.js (.../foreignProxyDisinfectionForm.js) (revision 32861) +++ ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/foreignProxyDisinfectionForm.js (.../foreignProxyDisinfectionForm.js) (revision 32934) @@ -89,20 +89,6 @@ foreignItemStore.add(tousseInstance); } -function loadPeopleByBarcode(peopleOfBarcode, targetFieldObj){ - if(peopleOfBarcode){ - UserTableManager.getUserObjByBarcode(peopleOfBarcode,function(userStr){ - if(userStr){ - var userName = userStr.split(",")[0]; - targetFieldObj.setValue(userName); - }else{ - showResult('找不到该条码所对应的人员信息'); - targetFieldObj.setValue(); - } - }); - } - top.Ext.getCmp('scanBarcode').setValue(); -} //FSSDERMYY-13:查看图片 function openPhotos(tousseItemId,tousseId){ var hiddenRecyclingApplicantID = $('#hiddenRecyclingApplicantID').val(); Index: ssts-web/src/main/webapp/disinfectsystem/useRecord/useRecordForm.js =================================================================== diff -u -r32924 -r32934 --- ssts-web/src/main/webapp/disinfectsystem/useRecord/useRecordForm.js (.../useRecordForm.js) (revision 32924) +++ ssts-web/src/main/webapp/disinfectsystem/useRecord/useRecordForm.js (.../useRecordForm.js) (revision 32934) @@ -2400,33 +2400,14 @@ render : function(c){ c.getEl().on('keypress',function(e,thiz){ if(e.getKey() == 13){ - var text = top.Ext.getCmp('washHandNurse').getValue(); - if (isValidBarcode(text)){ - top.Ext.getCmp('washHandNurse').setValue(""); - UserTableManager.getUserObjByBarcode(text,function(responseText){ - if(responseText != null && responseText != ""){ - var userName = responseText.split(",")[0]; - top.Ext.getCmp('washHandNurse').setValue(userName); - top.Ext.getCmp('circuitNurse').focus(); - }else{ - showResult('找不到该条码所对应的人员信息'); - } - }); - } - else if (isValidStaffNumber(text)){ - UserTableManager.getUserObjByName(text,function(responseText){ - if(responseText != null && responseText != ""){ - var userName = responseText.split(",")[0]; - top.Ext.getCmp('washHandNurse').setValue(userName); - top.Ext.getCmp('circuitNurse').focus(); - }else{ - showResult('找不到该工号对应的人员信息'); - } - }); - } - else{ - top.Ext.getCmp('circuitNurse').focus(); - } + var washHandNurseBox = top.Ext.getCmp('washHandNurse'); + var text = washHandNurseBox.getValue(); + getUserObjByBarcode(text,washHandNurseBox,'',function(userName){ + if(userName !== ''){ + washHandNurseBox.setValue(userName); + top.Ext.getCmp('circuitNurse').focus(); + } + }) } }); c.getEl().on('dblclick',function(e,thiz){ @@ -2461,37 +2442,15 @@ render : function(c){ c.getEl().on('keypress',function(e,thiz){ if(e.getKey() == 13){ - var text = top.Ext.getCmp('circuitNurse').getValue(); - if (isValidBarcode(text)){ - top.Ext.getCmp('circuitNurse').setValue(""); - UserTableManager.getUserObjByBarcode(text,function(responseText){ - if(responseText != null && responseText != ""){ - var userName = responseText.split(",")[0]; - top.Ext.getCmp('circuitNurse').setValue(userName); - top.Ext.getCmp('operationRoom').focus(); - - top.Ext.getCmp("tempBarcode").focus(); - - }else{ - showResult('找不到该条码所对应的人员信息'); - } - - }); - } - else if (isValidStaffNumber(text)){ - UserTableManager.getUserObjByName(text,function(responseText){ - if(responseText != null && responseText != ""){ - var userName = responseText.split(",")[0]; - top.Ext.getCmp('circuitNurse').setValue(userName); - top.Ext.getCmp('tempBarcode').focus(); - }else{ - showResult('找不到该工号对应的人员信息'); - } - }); - } - else{ - top.Ext.getCmp('tempBarcode').focus(); - } + var circuitNurseBox = top.Ext.getCmp('circuitNurse'); + var text = circuitNurseBox.getValue(); + getUserObjByBarcode(text,circuitNurseBox,'',function(userName){ + if(userName !== ''){ + circuitNurseBox.setValue(userName); + top.Ext.getCmp('operationRoom').focus(); + top.Ext.getCmp("tempBarcode").focus(); + } + }) } }); c.getEl().on('dblclick',function(e,thiz){ Index: ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/foreignProxyDisinfectionView.js =================================================================== diff -u -r32896 -r32934 --- ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/foreignProxyDisinfectionView.js (.../foreignProxyDisinfectionView.js) (revision 32896) +++ ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/foreignProxyDisinfectionView.js (.../foreignProxyDisinfectionView.js) (revision 32934) @@ -281,22 +281,6 @@ url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getAllOrgUnitName.do' }); -function loadPeopleByBarcode(peopleOfBarcode, targetFieldObj){ - //var peopleOfBarcode = barcodeField.getValue(); - if(peopleOfBarcode){ - UserTableManager.getUserObjByBarcode(peopleOfBarcode,function(userStr){ - if(userStr){ - var userName = userStr.split(",")[0]; - targetFieldObj.setValue(userName); - }else{ - showResult('找不到该条码所对应的人员信息'); - targetFieldObj.setValue(); - } - }); - } - top.Ext.getCmp('scanBarcode').setValue(); -} - var loadFormData = function(grid) { var records = grid.getSelectionModel().getSelections(); if (records.length == 0) { @@ -440,34 +424,6 @@ url : WWWROOT + '/disinfectSystem/baseData/expirationDateInfoAction!getPackageType.do' }); -function loadUserByBarcode2(barcodeField,jobType){ - var peopleOfBarcode = barcodeField.getValue(); - - if(peopleOfBarcode){ - UserTableManager.getUserByBarcode(peopleOfBarcode,function(user){ - if(user != null && user != ""){ - if(user == 'notSameDepart'){ - showResult("配包者必须与当前登录用户的科室相同!"); - return; - } - if(jobType=='jobType_pack') { - top.Ext.getCmp('operator2').setValue(user); - } else if(jobType=='jobType_review') { - top.Ext.getCmp('reviewer').setValue(user); - } - }else{ - showResult('找不到该条码所对应的人员信息'); - if(jobType=='jobType_pack') { - top.Ext.getCmp('operator2').setValue(); - } else if(jobType=='jobType_review') { - top.Ext.getCmp('reviewer').setValue(); - } - } - }); - } - barcodeField.setValue(); -} - function loadBasketBarcode(barcode){ //var barcode = thiz.getValue(); ForeignProxyDisinfectionTableManager.getResultJsonStrByBarcode(barcode,"外部代理灭菌",function(jsonStr){ @@ -879,7 +835,9 @@ } }); }else if (result.returnType == 'user'){ - loadPeopleByBarcode(barcode,top.Ext.getCmp('sterilizationUser')); + getUserObjByBarcode(barcode,top.Ext.getCmp('sterilizationUser'),top.Ext.getCmp('scanBarcode'),function(name){ + top.Ext.getCmp('sterilizationUser').setValue(name); + }); }else if(result.returnType == 'container'){ if(result.containerType == '灭菌筐'){ if(result.status == '灭菌'){ @@ -1000,35 +958,33 @@ allowBlank : sstsConfig.hideCssdForeignProxyDisinfectionApplicant || sstsConfig.foreignProxyDisinfectionViewApplicantAllowBlank, anchor : '97%', listeners:{ + render : function(c){ + c.getEl().on('keypress',function(e,thiz){ + if(e.getKey() == 13){ + var applicantBox = top.Ext.getCmp('applicant'); + var applicantCodeBox = top.Ext.getCmp('applicantCode'); + getUserObjByBarcode(thiz.value,applicantBox,applicantCodeBox,function(userName,userCode){ + if(userName !== ''){ + applicantBox.setValue(userName); + applicantCodeBox.setValue(userCode); + setTimeout(() => { + top.Ext.getCmp('maker').focus(); + }, 1000); + } + }) + } + }); + }, select:function(combo, record, index){ var code = record.json.name || ''; top.Ext.getCmp("applicantCode").setValue(code); } } }] - }/*,{ + },{ columnWidth : .5, layout : 'form', labelWidth : 70, - items : [{ - xtype : 'textfield', - fieldLabel : "灭菌员条码", - name : "applicantBarcode", - id : "applicantBarcode", - allowBlank : true, - listeners : { - specialkey : function(thiz, e){ - if(e.getKey() == 13){ - loadPeopleByBarcode(thiz,top.Ext.getCmp('sterilizationUser')); - } - } - }, - anchor : '97%' - }] - }*/,{ - columnWidth : .5, - layout : 'form', - labelWidth : 70, hidden : sstsConfig.hiddenForeignProxyPartElement, items : [{ xtype : 'textfield', @@ -1063,6 +1019,23 @@ allowBlank : true, anchor : '97%', listeners:{ + render : function(c){ + c.getEl().on('keypress',function(e,thiz){ + if(e.getKey() == 13){ + var makerBox = top.Ext.getCmp('maker'); + var makerCodeBox = top.Ext.getCmp('makerCode'); + getUserObjByBarcode(thiz.value,makerBox,makerCodeBox,function(userName,userCode){ + if(userName !== ''){ + makerBox.setValue(userName); + makerCodeBox.setValue(userCode); + setTimeout(() => { + top.Ext.getCmp('assistant').focus(); + }, 1000); + } + }) + } + }); + }, select:function(combo, record, index){ var code = record.json.name || ''; top.Ext.getCmp("makerCode").setValue(code); @@ -1092,6 +1065,20 @@ allowBlank : true, anchor : '97%', listeners:{ + render : function(c){ + c.getEl().on('keypress',function(e,thiz){ + if(e.getKey() == 13){ + var assistantBox = top.Ext.getCmp('assistant'); + var assistantCodeBox = top.Ext.getCmp('assistantCode'); + getUserObjByBarcode(thiz.value,assistantBox,assistantCodeBox,function(userName,userCode){ + if(userName !== ''){ + assistantBox.setValue(userName); + assistantCodeBox.setValue(userCode); + } + }) + } + }); + }, select:function(combo, record, index){ var code = record.json.name || ''; top.Ext.getCmp("assistantCode").setValue(code); Index: ssts-web/src/main/webapp/js/common.js =================================================================== diff -u -r32863 -r32934 --- ssts-web/src/main/webapp/js/common.js (.../common.js) (revision 32863) +++ ssts-web/src/main/webapp/js/common.js (.../common.js) (revision 32934) @@ -4349,4 +4349,46 @@ _printType: printType } printObjWithdefaultPrintFun(obj); -}; \ No newline at end of file +}; + +//根据用户条码转换为用户名称 +//需要引入cssdUtils.js和UserTableManager.js +function getUserObjByBarcode(text, objName, objCode, callback) { + if (isValidBarcode(text)) { + if (objName !== '') { + objName.setValue(''); + } + if (objCode !== '') { + objCode.setValue(''); + } + UserTableManager.getUserObjByBarcode(text, function (responseText) { + if (responseText != null && responseText != "") { + var userName = responseText.split(",")[0]; + var userCode = responseText.split(",")[1]; + callback(userName, userCode); + } else { + showResult('找不到该条码所对应的人员信息'); + callback(''); + } + }); + } else if (isValidStaffNumber(text)) { + if (objName !== '') { + objName.setValue(''); + } + if (objCode !== '') { + objCode.setValue(''); + } + UserTableManager.getUserObjByName(text, function (responseText) { + if (responseText != null && responseText != "") { + var userName = responseText.split(",")[0]; + var userCode = responseText.split(",")[1]; + callback(userName, userCode); + } else { + showResult('找不到该工号对应的人员信息'); + callback(''); + } + }); + } else { + callback(''); + } +} \ No newline at end of file