The House yesterday voted to eliminate virtually all economic assistance for Panama from a $4.2 billion foreign aid bill.

By 246 to 150, $11.5 million in economic aid was knocked out, leaving Panama with about $1.2 million in Food for Peace aid for fiscal 1980. Last week, the House voted to cut out $2.5 million in military assistance to Panama.

Rep. Robert E. Bauman (R-Md.), who offered the amendment, said it was not his intention to deny assistance to Panama permanently, but to delay it until legislation implementing the Panama Canal treaties is signed into law.

Bauman said Panama is expected to get $70 million in canal tolls and $20 billion worth of facilities when the treaties take effect, and he questioned why the United States should give Panama foreign aid on top of that.

While Bauman said he recognized the treaties that the aid cutoff was related to upcoming implementing legislation, the two votes to cut off military and economic aid are widely seen as indications that the implementing legislation is in serious trouble in the House.

An official from the State Department's congressional liaison office, Brian Atwood, while admitting that the administration has "a lot of work to do" in passing the implementing legislation, said yesterday's vote should not be taken as an indication that the legislation would be defeated. He said it was a "free political vote" in which House members could express opposition to the Panama Canal treaties without voting against implementing legislation.

He noted that about 30 fewer members voted against the economic aid than had voted against military aid, and said the administration has a month or so to round up support for the legislation implementing the treaties.

Atwood said the Panamanian government's reaction to the vote to cut off military aid was "quite restrained."

"We'll just have to see" what the reaction will be to the economic aid cutback, he said.

In consideration of the bill Wednesday, the House voted 222 to 175 against cutting off aid to members of the Organization of Petroleum Exporting Countries, which has voted to raise its oil prices.

Rep. Joseph G. Minish (D.N.J.), who offered the amendment, said the OPEC nations of Indonesia, Nigeria and Ecuador receive a total of $100 million in direct and indirect U.S. aid.

Minish argued that the OPEC countries, which raised their oil prices 9 percen, tare trying "to bleed every dollar they can get from the American consumer." Cutting off aid would send them a message that "we will not be subject to economic blackmail," Minish said.

But Rep. Edward J. Derwinski (RIll.) said, "I have no objection to telling every one of the OPEC nations to go and stuff it, but not until we are self-sufficient in energy."

By 239 to 157, the House voted to cut back the froeign aid bill from a two-year authorization to one year.

Foreign aid has had difficulty passing the House in recent years, but this year, because of a move toward austerity and budget cuts at home, it may have more difficulty than ever.

It is expected, when the House takes up the bill again next week, that cuts of 8 to 10 percent across the board will be proposed. And an effort to move the Peace Corps out of Action is expected.