Let $K$ be number field of degree $d$. Suppose we are given module $ \mathcal{M}$ in form: \begin{equation}\label{key} \mathcal{M} = v_1 \cdot \mathfrak{a}_1 \oplus v_2 \cdot \mathfrak{a}_2 \oplus \ldots \oplus v_{n}\cdot \mathfrak{a}_{n}, \end{equation} where all $v_i \in K^m$ - vectors of length $m$. Therefore we are provided with the pseudobasis $(\boldsymbol{V},\mathfrak{A})$ where $\boldsymbol{V} \,$ is the $m \times n$ matrix with $v_i$ as columns and $\mathfrak{A} = \{ \mathfrak{a}_i \}_{i=\overline{1,n}}$ - set of corresponding fraction ideals of $K$. Wlog we can assume that pseudo-basis $(\boldsymbol{V},\mathfrak{A})$ is in HNF form (see Cohen H. - Advanced Topics in Computational Number Theory).

Since the arbitrary fraction ideal $\mathfrak{a} $ of $K$ is also a $\mathbb{Z}$-module, we can construct its $\mathbb{Z}$-basis $\bigoplus_{i=1}^{d} a_i \cdot \mathbb{Z}$ where all $a_i$ are integers (for example using pari gp). I think, we even can force all $v_i$ to be integers by finding equivalent pair $(v_i', \mathfrak{a}_i')$ such that $v_i' \mathfrak{a}_i' = v_i \mathfrak{a}_i$ so that we obtain a direct sum of $\mathbb{Z}$-modules which must be a $\mathbb{Z}$-module itself.

The question is: how to compute matrix that corresponds to the $\mathbb{Z}$-basis of $\mathcal{M}$?

Is it in the next form given by the block matrix: \begin{equation*} \begin{pmatrix} Z(v_{1,1}\cdot \mathfrak{a}_1) & Z(v_{1,2}\cdot \mathfrak{a}_2) & \ldots & Z(v_{1,n}\cdot \mathfrak{a}_n) \\ Z(v_{2,1}\cdot \mathfrak{a}_1) & Z(v_{2,2}\cdot \mathfrak{a}_2) & \ldots & Z(v_{2,n}\cdot \mathfrak{a}_n) \\ \vdots & \vdots & \ddots & \vdots \\ Z(v_{m,1}\cdot \mathfrak{a}_1) & Z(v_{m,2}\cdot \mathfrak{a}_2) & \ldots & Z(v_{m,n}\cdot \mathfrak{a}_n) \\ \end{pmatrix}, \end{equation*} where $Z(\mathfrak{a})$ - is matrix of $\mathbb{Z}$-basis of fraction ideal $\mathfrak{a}$?