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