Refining Alignment Framework for Diffusion Models with Intermediate-Step Preference Ranking