I don't think the YJ-12 would be of much help, even if it arrived immediately.
In the past, the PLA primarily used the H-6K to extend its range; its land-based launch wouldn't pose much of a threat to carrier battle groups.
It's just better to have it in your back pocket, maybe they're interested in reverse engineering? Iran has done that before with chinese missiles.
The current Iranian arsenal of Anti-Ship missiles is quite primitive.
Subsonic ASCM and Supersonic Terminal ASBM just won't cut it.
They seriously should've gone for the YJ-21E, it's much better overall, assuming that it's offered to Iran for export, and that Iran would have the ability to acquire targeting data for CSG.
Either way, in the same Reuters article it was said that Iran is in discussions with China to "acquire Chinese surface‑to‑air missile systems, so-called MANPADS, anti‑ballistic weapons, and anti-satellite weapons" and potentially a wider array of Anti ship weaponry. So maybe this is just one part of the deal.