Both sides claimed victory for their own good. As a Chinese, I just share some thoughts on why we think we won (and I don’t really care what Vietnames think of it).
China invaded Vietnam mainly for two reason: on one hand, to demolish Vietnam as an aggressive threat; on the other, to prove to the US that China had set the mind to be a partner to tackle with the Soviet, who had not been a friend for a while and aiding Vietnam as well at the time, and in return to get some investment from the capitalist world.
As a result, although China cost more than expected and Chinese military leaders were surprised by that more or less , Vietnamese economy had been successfully destroyed and not a threat to China any more — all Vietnamese infrastructures and factories in the northern cities were destroyed and some taken to China. After that, China’s FDI from the US and her partners increased.
Edit: Vague descriptions revised.