Index: ssts-web/src/main/webapp/disinfectsystem/packing/directPacking.js =================================================================== diff -u -r14965 -r15299 --- ssts-web/src/main/webapp/disinfectsystem/packing/directPacking.js (.../directPacking.js) (revision 14965) +++ ssts-web/src/main/webapp/disinfectsystem/packing/directPacking.js (.../directPacking.js) (revision 15299) @@ -109,64 +109,39 @@ barcodeField.setValue(); } - function loadUserByBarcode(barcodeField,jobType){ - var peopleOfBarcode = barcodeField.getValue(); - if(peopleOfBarcode){ - UserTableManager.getUserByBarcode(peopleOfBarcode,function(responseText){ - if(responseText != null && responseText != ""){ - var result = Ext.decode(responseText); - if(!result.success){ - showResult("输入的条码有误!"); - return; - } - if (jobType == 'jobType_inspector') { - Ext.getCmp('inspector').setValue(result.fullName); - Ext.getCmp('inspectorCode').setValue(result.name); - inspectorCode = result.name; - jobType_inspector_name = result.fullName; - focusExtJSField(Ext.getCmp('wrapperBarcode')); - } - else if(jobType=='jobType_pack') { - Ext.getCmp('operator').setValue(result.fullName); - Ext.getCmp('operatorCode').setValue(result.name); - operatorCode = result.name; - jobType_pack_name = result.fullName; - // 审核人条码输入框 - focusExtJSField(Ext.getCmp('reviewerBarcode')); - } else if(jobType=='jobType_review') { - Ext.getCmp('reviewer').setValue(result.fullName); - Ext.getCmp('reviewerCode').setValue(result.name); - reviewerCode = result.name; - jobType_review_name = result.fullName; - focusExtJSField(Ext.getCmp('inspectorBarcode')); - }else if (jobType == 'jobType_wrapper') { - Ext.getCmp('wrapper').setValue(result.fullName); - Ext.getCmp('wrapperCode').setValue(result.name); - wrapperCode = result.name; - jobType_wrapper_name = result.fullName; - focusExtJSField(Ext.getCmp('tousseName')); - } - - }else{ - showResult('找不到该条码所对应的人员信息'); - if(jobType=='jobType_inspector') { - Ext.getCmp('inspector').setValue(); - } else if(jobType=='jobType_pack') { - Ext.getCmp('operator').setValue(); - } else if(jobType=='jobType_review') { - Ext.getCmp('reviewer').setValue(); - } else if(jobType=='jobType_wrapper') { - Ext.getCmp('wrapper').setValue(); - } - } - }); + function loadUserByBarcode(barcodeField,userNameField,userCodeField,focusField){ + + if(userNameField == null || userCodeField == null || barcodeField == null){ + showResult("参数错误,请联系管理员!"); + return; } - barcodeField.setValue(); + var peopleOfBarcode = barcodeField.getValue(); + + if(peopleOfBarcode){ + UserTableManager.getUserByBarcode(peopleOfBarcode,function(responseText){ + if(responseText != null && responseText != ""){ + var result = Ext4.decode(responseText); + if(!result.success){ + showResult("输入的条码有误!"); + return; + } + userNameField.setValue(result.fullName); + userCodeField.setValue(result.name); + if(focusField != null){ + focusExtJSField(focusField); + } + }else{ + showResult('找不到该条码所对应的人员信息'); + userNameField.setValue(); + } + }); + } + barcodeField.setValue(); } function printBarcode(barcodeStr,disinfectionDate,isTraceable,fixedBarcode,idCardDefinitionUseAmount){ - var names = getPrintNames(isPrintUserFullName, Ext.getCmp('operator').getValue(), Ext.getCmp('reviewer').getValue(), Ext.getCmp('operatorCode').getValue(), Ext.getCmp('reviewerCode').getValue()); + var names = getPrintNames(isPrintUserFullName, Ext.getCmp('operator').getValue(), Ext.getCmp('reviewer').getValue(), Ext.getCmp('sterileUser').getValue(), Ext.getCmp('operatorCode').getValue(), Ext.getCmp('reviewerCode').getValue(),Ext.getCmp('sterileCode').getValue()); var printNum = Ext.getCmp('tempPrintNum').getValue();//打印张数 var packageType = Ext.getCmp("packageType").getValue(); @@ -221,7 +196,7 @@ }); DWREngine.setAsync(true); - var obj = {'barcode':pBarcode, 'name':toussName,'pageType':barcodePaperType, 'materials':materials, 'operator':names.operatorToPrint, 'reviewer': names.reviewerToPrint, 'sterilizationDate':sterilizationDate, 'validDate':validDate, + var obj = {'barcode':pBarcode, 'name':toussName,'pageType':barcodePaperType, 'materials':materials, 'operator':names.operatorToPrint, 'reviewer': names.reviewerToPrint,'sterilizationUser':names.sterilizationUserToPrint,'washOperator':'', 'sterilizationDate':sterilizationDate, 'validDate':validDate, 'hospitalName':hospitalName, 'sterilizer':sterilizer, 'frequency':frequency, 'markTousse':markTousse, 'sterilingType':sterilingType ,'materialAmount':jsonObj.materialAmount,'diposableGoodsAmount':jsonObj.diposableGoodsAmount,'totalAmount':jsonObj.totalAmount, 'idCardDefinitionUseAmount':idCardDefinitionUseAmount,'packageTypeAbbreviation':packageTypeAbbreviation}; obj.sterilizerName = sterilizer; @@ -605,6 +580,11 @@ name : 'reviewerCode', value : reviewerCode },{ + xtype : 'hidden', + id : 'sterileCode', + name : 'sterileCode', + value : sterileUserCode + },{ xtype : 'hidden', id : 'operatorCode', name : 'operatorCode', @@ -661,7 +641,9 @@ listeners : { specialkey : function(thiz, e){ if(e.getKey() == 13){ - loadUserByBarcode(thiz,'jobType_pack'); + loadUserByBarcode(thiz,Ext.getCmp('operator'),Ext.getCmp('operatorCode'),Ext.getCmp('reviewerBarcode')); + operatorCode = Ext.getCmp('operatorCode').getValue(); + jobType_pack_name = Ext.getCmp('operator').getValue(); } } }, @@ -716,7 +698,13 @@ listeners : { specialkey : function(thiz, e){ if(e.getKey() == 13){ - loadUserByBarcode(thiz,'jobType_review'); + var focusField = Ext.getCmp('inspectorBarcode'); + if(sstsConfig.showSterileField){ + focusField = Ext.getCmp('sterileBarcode'); + } + loadUserByBarcode(thiz,Ext.getCmp('reviewer'),Ext.getCmp('reviewerCode'),focusField); + reviewerCode = Ext.getCmp('reviewerCode').getValue(); + jobType_review_name = Ext.getCmp('reviewer').getValue(); } } }, @@ -740,6 +728,43 @@ columnWidth : .33, layout : 'form', cls:'edit-5char-labelwidth', + hidden : !sstsConfig.showSterileField, + items : [{ + xtype : 'textfield', + fieldLabel : "灭菌人条码", + name : "sterileBarcode", + id : "sterileBarcode", + allowBlank : true, + listeners : { + specialkey : function(thiz, e){ + if(e.getKey() == 13){ + loadUserByBarcode(thiz,Ext.getCmp('sterileUser'),Ext.getCmp('sterileCode'),Ext.getCmp('tousseName')); + sterileUserCode = Ext.getCmp('sterileCode').getValue(); + jobType_sterile_name = Ext.getCmp('sterileUser').getValue(); + } + } + }, + anchor : '100%' + }] + },{ + columnWidth : .33, + layout : 'form', + cls:'edit-5char-labelwidth', + hidden : !sstsConfig.showSterileField, + items : [{ + xtype : 'textfield', + fieldLabel : "灭菌人", + name : "sterileUser", + id : "sterileUser", + allowBlank : false, + anchor : '100%', + value : jobType_sterile_name, + readOnly : true + }] + },{ + columnWidth : .33, + layout : 'form', + cls:'edit-5char-labelwidth', items : [ { xtype : 'combo', fieldLabel : "包装类型", @@ -768,7 +793,9 @@ listeners : { specialkey : function(thiz, e){ if(e.getKey() == 13){ - loadUserByBarcode(thiz,'jobType_inspector'); + loadUserByBarcode(thiz,Ext.getCmp('inspector'),Ext.getCmp('inspectorCode'),Ext.getCmp('wrapperBarcode')); + inspectorCode = Ext.getCmp('inspectorCode').getValue(); + jobType_inspector_name = Ext.getCmp('inspector').getValue(); } } }, @@ -856,7 +883,9 @@ listeners : { specialkey : function(thiz, e){ if(e.getKey() == 13){ - loadUserByBarcode(thiz,'jobType_wrapper'); + loadUserByBarcode(thiz,Ext.getCmp('wrapper'),Ext.getCmp('wrapperCode'),Ext.getCmp('tousseName')); + wrapperCode = Ext.getCmp('wrapperCode').getValue(); + jobType_wrapper_name = Ext.getCmp('wrapper').getValue(); } } },