Based on hot big bang theory, the cosmological matter is conjectured to undergo QCD phase transition(s) to hadrons, when the universe was about $1-10 \mu$s old. In the present work, we study the quark-hadron phase transition, by taking into account the effect of the bulk viscosity. We analyze the evolution of the quantities relevant for the physical description of the early universe, namely, the energy density $\rho$, temperature $T$, Hubble parameter $H$ and scale factor $a$ before, during and after the phase transition. To study the cosmological dynamics and the time evolution we use both analytical and numerical methods. By assuming that the phase transition may be described by an effective nucleation theory (prompt {\it first-order} phase transition), we also consider the case where the universe evolved through a mixed phase with a small initial supercooling and monotonically growing hadronic bubbles. The numerical estimation of the cosmological parameters, $a$ and $H$ for instance, makes it clear that the time evolution varies from phase to phase. As the QCD era turns to be fairly accessible in the high-energy experiments and the lattice QCD simulations, the QCD equation of state is very well defined. In light of this, we introduce a systematic study of the {\it cross-over} quark-hadron phase transition and an estimation for the time evolution of Hubble parameter.