The invention discloses a preparation method of phosphorus building gypsum-based water-resisting and self-leveling mortar. The anti-cracking mortar is prepared from the following components in percentage by mass: 50 to 90 percent of phosphorus building gypsum, 10 to 50 percent of baked sand, 0 to 20 percent of cement, 0 to 5 percent of fly ash, 0 to 15 percent of an active activator, 0 to 3 percent of a water repellent, 0.1 to 1 percent of a high-performance plasticizer, 0 to 0.2 percent of an anti-settling agent, 0 to 0.2 percent of a flocculating agent, 0.01 to 0.4 percent of a calcium sulfate retarder, 0 to 3 percent of a high-molecular polymer and 0.05 to 0.3 percent of a high-performance defoaming agent. According to the preparation method disclosed by the invention, phosphogypsum which is an industrial waste is used as a main raw material, so that the prepared self-leveling mortar is high in quality performance and high in water resistance, can be applied to a leveling project for indoor and outdoor grounds, is particularly applicable to a floor heating project and a wood floor base course leveling project, is high in coagulation and hardening speed, high in volume stability,high in temperature change resistance, and low in cost, and does not crack, and product properties meet relevant standard requirements; a production process is simple and low in energy consumption; compared with other self-leveling mortar products, the phosphorus building gypsum-based water-resisting and self-leveling mortar is higher in market competitiveness and high in practicability.