No, even for Dedekind domains, which are in some sense the "nearest" generalization of a PID, this is no longer true. The problem is that, while over a PID a module is projective iff it is free, over a Dedekind domain (and many other types of rings), there are projective modules that are not free.
For a concrete example, consider the ideal $I = \left(2, 1 + \sqrt{-5}\right)$ of $R = \mathbb{Z}\left[\sqrt{-5}\right]$. One can show that $I$ is projective (it is finitely generated and principal in the localization $R_P$ for each prime ideal $P$) and has rank $1$, but it is not principal, hence not free. So you cannot find a decomposition for $I$ as in your question.
However, there is a generalization of the Fundamental Theorem of Finitely Generated Modules over a PID to Dedekind domains. See Theorem $22$ of $\S16.3$ in Dummit and Foote:
Theorem 22: Suppose $M$ is a finitely generated module over a Dedekind domain $R$. Let $n \geq 0$ be the rank of $M$ and let $M_\text{tors}$ be its torsion submodule. Then
$$
M \cong \overbrace{R \oplus \cdots \oplus R \oplus I}^{n \text{ factors}} \oplus M_\text{tors}
$$
for some ideal $I$ of $R$, and
$$
M_\text{tors} \cong R/P_1^{e_1} \times \cdots \times R/P_s^{e_s}
$$
for some $s \geq 0$ and powers of prime ideals $P_i$. The ideals $P_i^{e_i}$ are unique, and the ideal $I$ is unique up to multiplication by a principal ideal.