Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/js/setGoodsOption.js =================================================================== diff -u -r33377 -r33379 --- ssts-web/src/main/webapp/disinfectsystem/reportforms/js/setGoodsOption.js (.../setGoodsOption.js) (revision 33377) +++ ssts-web/src/main/webapp/disinfectsystem/reportforms/js/setGoodsOption.js (.../setGoodsOption.js) (revision 33379) @@ -77,7 +77,7 @@ if (ids.length > 0) { ids += ';'; } - ids += record.id; + ids += record.get('id'); } JasperreportsTableManager.setTousseWorkLoadOption(model,code,ids,function(result){ @@ -98,7 +98,7 @@ * * @returns */ -function addGoodsToGridPanel(goodsName) { +function addGoodsToGridPanel(goodsName,goodsId) { if (goodsName) { for (var i = 0; i < apparatusInfuTypeStore.getCount(); i++) { @@ -107,9 +107,10 @@ return false; } } - var goodsRecord = new GoodsRecord({name : goodsName}); + var goodsRecord = new GoodsRecord({name : goodsName,id:goodsId}); apparatusInfuTypeStore.add(goodsRecord); top.Ext.getCmp('goodsSearch').setValue(''); + top.Ext.getCmp('goodsIdSearch').setValue(''); } } @@ -167,6 +168,8 @@ reader : new Ext.data.JsonReader({ fields : [{ name : 'name' + },{ + name:'id' }] }) }); @@ -219,6 +222,10 @@ var tbar = [{ text : '选择物品' },{ + xtype:'hidden', + id:'goodsIdSearch', + name:'goodsIdSearch' + },{ xtype : 'combo', id : 'goodsSearch', name : 'goodsSearch', @@ -239,19 +246,24 @@ listeners : { select : function(combo, record, index) { top.Ext.getCmp('goodsSearch').setValue(record.data.name); + top.Ext.getCmp('goodsIdSearch').setValue(record.data.id); }, render : function(c) { c.getEl().on('keypress',function(e) { if (e.getKey() == 13) { - addGoodsToGridPanel(top.Ext.getCmp('goodsSearch').getValue()); + var name = top.Ext.getCmp('goodsSearch').getValue(); + var id = top.Ext.getCmp('goodsIdSearch').getValue(); + addGoodsToGridPanel(name,id); } }); } } },{ text : '添加', handler : function () { - addGoodsToGridPanel(top.Ext.getCmp('goodsSearch').getValue()); + var name = top.Ext.getCmp('goodsSearch').getValue(); + var id = top.Ext.getCmp('goodsIdSearch').getValue(); + addGoodsToGridPanel(name,id); } },{ text : '全部器械包', @@ -269,7 +281,7 @@ var recordArray = new Array(); var tousseArray = result.data; for(var i = 0; i < tousseArray.length; i ++){ - recordArray.push(new GoodsRecord({name : tousseArray[i].name})); + recordArray.push(new GoodsRecord({name : tousseArray[i].name,id : tousseArray[i].id})); } batchAddGoodsToGridPanel(recordArray); }