Israeli Foreign Minister Moshe Dayan said today that nearly all unresolved issues in the Middle East peace negotiations have been settled between the United States and Israel and that a treaty "seems wrapped up" as long as Egyptian President Anwar Sadat gives his approval.

The only issues remaining in the draft treaty itself, Dayan said, are the timing of an exchange of ambassadors and the precise phrasing of language establishing a target date for completing negotiations on autonomy for Palestinians in the West Bank and Gaza.

Apart from the treaty, Egypt and Israel still have to negotiate guarantees of Israeli access to oil produced in the Gulf of Suez and Israel and the United States still have to negotiate specific American commitments for economic and military assistance, Dayan said.

Beyond those issues, Dayan said, are several broader questions to be discussed when Prime Minister Menachem Begin and President Carter meet here over the weekend. They include a possible Egyptian role as surrogate negotiator if Jordan's King Hussein continues to refuse to join the West Bank autonomy talks and the possibility of beginning autonomy negotiations first for Gaza if West Bank Palestinians, as expected, refuse to cooperate.

Moreover, Dayan said. Carter and Begin still have to negotiate "the amount of responsibility" the United States will assume if the treaty is violated.

In a closed briefing to foreign ambassadors here, however, Dayan said that before Begin went to Washington last week, eight issues were unresolved between Israel and the United States, while now the differences have been narrowed to refinements of two aspects of the treaty itself, plus the related bilateral arrangements.

But Dayan was quoted by an aide as saying, "If we permit the erosion of one small thing, the whole agreement will come unraveled."

Despite persistent reports that Carter and Begin already have come to an understanding on American defense commitments, including increased U.S. military presence in the middle East, Dayan told the ambassadors that such a pact was not included in the negotiations.

The only discussion along those lines, Dayan was quoted as saying, were about a U.S. grant to Israel to offset the cost of relocating two Israeli air bases in the Sinai Peninsula to the Negev Desert.

Dayan said the question of U.S. security arrangements was raised during the Carter-Begin talks, but not negotiated. Begin is reported to have brought up the question of a permanent U.S. naval base at Haifa port on the Mediterranean and a U.S. Air Force presence at the Etzion Air Base in the Sinai.

Carter is said to be interested in increasing the U.S. military presence in this region, in light of shifting alliances and the collapse of the pro-Western government in Iran.

As more details of the compromise peace proposals continued to leak out, it became increasingly clear that while Israel was forced to make sizable concessions from the proposed draft treaty it rejected in November, Begin was able to whittle down a number of major Egyptian demands made since then.

The major points of the new draft, according to sources here, are:

Priority of obligations: Egypt will not be allowed to subordinate its obligations under the Israeli treaty to mutual defense pacts with other Arab states in the event of an outbreak of hostilities in the Middle East.

Linkage: Egypt had sought to make its commitments to Israel dependent on implementation of autonomy for the West Bank and Gaza, and Israel had sought to make the two issues totally independent. The compromise language says that although the separate Israeli-Egyptian provisions are part of a comprehensive pact -- including autonomy -- that connection does not diminish the obligations of both parties irrespective of the "action or inaction" of other parties, such as Palestinians or Jordan.

Target date for autonomy: Negotiations for Palestinian autonomy will begin one month after the signing and be concluded within one 12 months. Elections will be held "as soon as possible," but there is no obligation to establish a structure for self-rule within a specific time.

Israel has resisted a target date for elections, arguing that it has no control over Palestinian cooperation, and that Egypt could use the deadline to renege on its obligations once Israel withdraws from the Sinai.

The compromises for all three of the major sticking points are contained in joint letters to be signed by Israel and Egypt. Officials said there is an "understanding" between the United States and Israel on the target date compromise, but that the precise wording has to be worked out after Carter's meetings with Sadat.

Meanwhile, it was learned that officials of the U.S. Consulate in East Jerusalem have contacted public figures in the West Bank to set up meetings between them and U.S. national security adviser Zbigniew Brzezinski over the weekend. U.S. Embassy officials, however, stressed that there are no plans for Carter to visit East Jerusalem or the West Bank areas seized by Israel in the 1967 war.

Reaction to Carter's visit by West Bank political leaders has been negative, with most saying that the U.S. president is coming here to force an Israeli-Egyptian pact, rather than to solve the Palestinian problem.

"Carter is coming to finish cooking a dish he has prepared for two countries of the region. From the very beginning, we have opposed this dish, and therefore we have no interest in seeing how it is served on the tables of Israel and Egypt," said Hebron Mayor Fahd Kawasmeh.

Said Bethlehem Mayor Elias Freij, "We, the Palestinians, remain alone to confront our fate... I believe that in the Arab world there are still forces which will overcome Egypt's narrow interests."

There were reports today that Carter has raised the possiblity of visiting either the Holy Sepulchre Church in in the old City, part of East Jerusalem, or the Church of the Nativity in Bethlehem, on the West Bank. But U.S. Embassy spokesmen said neither of the holy places are in the president's schedule yet.

"I'm sure the president will want to go to church, but where we don't know yet," an embassy spokesman said. While there are no Babtist churches in West Jerusalem, possibilities include the YMCA chapel or St. Andrew's Scottish Church.