Is it legal to pledge all enterprise shares and mortgage fixed assets at the same time?

Actually, your question is not clear. Whether the mortgaged fixed assets belong to the enterprise with pledged equity, or whether the mortgaged fixed assets and pledged equity belong to the enterprise you refer to. I need you to write down the details clearly.

Mortgaged fixed assets belong to the company with equity pledge: in this case, mortgage of fixed assets to the bank is the economic behavior of the enterprise you refer to, and pledge of all equity to the bank is the economic behavior of the shareholders of the enterprise you refer to, which is not prohibited by law; In addition, the bank will review the loans of two different applicants separately. Therefore, there is no conflict between the two, and there is no illegal situation.

If banks exercise the right to pledge and auction fixed assets, won't the pledged equity be gone?

After exercising the mortgage, the bank obtained the collateral: fixed assets, auction rights and pledged shares still exist.

After exercising the pledge right, the bank obtained the pledge: stock right, auction right and enterprise ownership change.

In fact, the second loan bank will consider the potential risks according to the specific situation, and then decide whether to lend, no matter who lends first.