Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsGodownEntryForm.js =================================================================== diff -u -r22295 -r22302 --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsGodownEntryForm.js (.../expensiveGoodsGodownEntryForm.js) (revision 22295) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsGodownEntryForm.js (.../expensiveGoodsGodownEntryForm.js) (revision 22302) @@ -211,17 +211,12 @@ anchor : '95%', allowBlank:true, listeners : { - specialkey : function(field, e) { - if (e.getKey() == Ext.EventObject.ENTER) { - var isOK = field.validate(); - if(isOK){ - var value = field.getValue(); - field.setValue(value); - top.Ext.getCmp('secondBodyCode1').focus(); - top.Ext.getCmp('secondBodyCode1').selectText(); + render : function(c) { + c.getEl().on('keypress',function(e) { + if (e.getKey() == 13) {//回车键 + onScanBodyCode('firstBodyCode1'); } - - } + }); } } },{ @@ -233,17 +228,12 @@ width : 150, anchor : '95%', listeners : { - specialkey : function(field, e) { - if (e.getKey() == Ext.EventObject.ENTER) { - var isOK = field.validate(); - if(isOK){ - var value = field.getValue(); - field.setValue(value); - top.Ext.getCmp('thirdBodyCode1').focus(); - top.Ext.getCmp('thirdBodyCode1').selectText(); + render : function(c) { + c.getEl().on('keypress',function(e) { + if (e.getKey() == 13) {//回车键 + onScanBodyCode('secondBodyCode1'); } - - } + }); } } },{ @@ -256,18 +246,12 @@ anchor : '95%', allowBlank:true, listeners : { - specialkey : function(field, e) { - if (e.getKey() == Ext.EventObject.ENTER) { - var isOK = field.validate(); - if(isOK){ - var value = field.getValue(); - field.setValue(value); - if(commonEntry.isNoCheck()){ - addGodown(); - } + render : function(c) { + c.getEl().on('keypress',function(e) { + if (e.getKey() == 13) {//回车键 + onScanBodyCode('thirdBodyCode1'); } - - } + }); } } },{ @@ -381,7 +365,7 @@ anchor : '95%' }] },{ - columnWidth : .2, + columnWidth : .19, layout : 'form', labelWidth : 40, items:[{ @@ -408,7 +392,7 @@ } }] },{ - columnWidth : .2, + columnWidth : .22, layout : 'form', labelWidth : 50, items:[{ @@ -425,12 +409,12 @@ store : authorizedExpensiveGoodsSupplierStore, forceSelection : false, lazyInit : false, - listWidth : 200, + listWidth : 250, triggerAction : 'all', hideTrigger : true, typeAhead : false, allowBlank : false, - width : 150, + width : 170, tabIndex : 10, listeners : { select : function(combo, record, index) { @@ -450,7 +434,7 @@ } }] },{ - columnWidth : .20, + columnWidth : .19, layout : 'form', labelWidth : 60, items : [{ @@ -637,6 +621,10 @@ top.Ext.getCmp('model1').setValue(""); top.Ext.getCmp('expDate1').setValue(""); top.Ext.getCmp('batchNumber1').setValue(""); + top.Ext.getCmp('firstBodyCode1').setValue(""); + top.Ext.getCmp('secondBodyCode1').setValue(""); + top.Ext.getCmp('thirdBodyCode1').setValue(""); + top.Ext.getCmp('amount1').setValue(''); modelStore.baseParams.expensiveGoodsID = record.data.id; batchNumStore.baseParams.expensiveGoodsID = record.data.id; batchNumStore.load(); @@ -680,7 +668,7 @@ var key = e.getKey(); if (key == Ext.EventObject.ENTER) { top.Ext.getCmp('model1').focus(); - top.Ext.getCmp('model1').selectText(); +// top.Ext.getCmp('model1').selectText(); } } } @@ -1391,3 +1379,34 @@ return false; } ////////////////////////// + +//////////扫描自身条码////////// +function onScanBodyCode(f){ + value = top.Ext.getCmp(f).getValue(); + var fCmp = top.Ext.getCmp(f); + fCmp.setValue(value); + + var firstBodyCodeCmp = top.Ext.getCmp("firstBodyCode1"); + var secondBodyCodeCmp = top.Ext.getCmp("secondBodyCode1"); + var thirdBodyCodeCmp = top.Ext.getCmp("thirdBodyCode1"); + + var firstBodyCode = firstBodyCodeCmp.getValue(); + var secondBodyCode = secondBodyCodeCmp.getValue(); + var thirdBodyCode = thirdBodyCodeCmp.getValue(); + +// if(!isUndefinedOrNullOrEmpty(firstBodyCode) && !isUndefinedOrNullOrEmpty(secondBodyCode) && !isUndefinedOrNullOrEmpty(thirdBodyCode)){ +// +// }else{ + //根据条码获得对应的数据 (firstBodyCode/secondBodyCode/thirdBodyCode) + //processScanBodyCode(firstBodyCode); + if(f == 'firstBodyCode1'){ + top.Ext.getCmp('secondBodyCode1').focus(); + }else if(f == 'secondBodyCode1'){ + top.Ext.getCmp('thirdBodyCode1').focus(); + }else if(f == 'thirdBodyCode1'){ + if(commonEntry.isNoCheck()){ + addGodown(); + } + } +// } +}