President Reagan signed the $300 billion compromise defense authorization bill that provides money for military spending in fiscal 1989.

Reagan signed the legislation before leaving for Chicago, where he planned to campaign for the Republican ticket.Congress, meanwhile, was on the verge of completing a task it has not been able to do in 40 years - passing all regular appropriations bills before the start of the new fiscal year.

The new year begins at midnight and both the House and Senate faced a full day of work to complete action on the last of the 13 money bills and send them to Reagan for his signature.

If all the bills are passed and signed before the deadline, it will be the first time since 1948 that has been accomplished.

Congressional leaders wanted to avoid submitting a catch-all money bill, something that Reagan has vowed to veto.

Reagan planned to hold an extraordinary signing ceremony in the Oval Office shortly before midnight after he returns from Chicago to clear the way for implementation of all the federal government spending bills in time for the start of the new fiscal year on Saturday.

Reagan vetoed the original version of the defense authorization measure and Defense Secretary Frank Carlucci worked with members of the Armed Services committees to eliminate some of the proposed curbs on the Strategic Defense Initiative and other weapons programs that caused Reagan to reject the bill.

All 13 individiual money bills have been passed by the House and Senate and most differences between the two chambers were worked out by negotiators in conference committees. As of late Thursday, six final bills had been sent to the White House and signed by Reagan and two were awaiting his approval.

During the day, the House passed the $42 billion agriculture appropriations bill, the $1.4 billion legislative branch bill and $14.3 billion foreign aid measure.

The $283 billion Defense Department appropriations bill was scheduled for final House action today.

But plans to vote in the House on a $537 million appropriation for the District of Columbia derailed Thursday night, raising the possibility the target of passing all bills might be in trouble. The House, by voice vote, sent that bill back to conference with the Senate over a disputed abortion provision that has prompted a veto threat from Reagan.

If that can be resolved, the Senate was ready to act on both measures as soon as they were received from the House.

Meanwhile, the Senate voted overwhelmingly for a plan to reform the nation's welfare system. That bill, estimated to cost $3.34 billion over the next few years, was expected to win House approval today.

In recent years, because of squabbles between the House and Senate or with the White House, Congress has been unable to pass all 13 appropriations bills before the start of the new fiscal year or even before adjournment. Instead, the remaining bills were lumped into a continuing resolution, which in 1987 became the largest spending bill ever passed by Congress.