Step 1: Identify a point on the line and its direction vector.
The line is
\[
\vec{r}=(3\vec{i}+7\vec{j}+\vec{k})+t(\vec{j}+\vec{k}).
\]
Hence, a point on the line is
\[
A(3,7,1)
\]
and the direction vector is
\[
\vec{d}=\hat{j}+\hat{k}=(0,1,1).
\]
The given point is
\[
P(5,1,3).
\]
Step 2: Form the vector \(\overrightarrow{AP}\).
\[
\overrightarrow{AP}
=
(5-3)\hat{i}+(1-7)\hat{j}+(3-1)\hat{k}.
\]
\[
\overrightarrow{AP}
=
2\hat{i}-6\hat{j}+2\hat{k}.
\]
Step 3: Use the distance formula from a point to a line.
The distance of point \(P\) from the line is
\[
d=
\frac{\left|\overrightarrow{AP}\times \vec{d}\right|}
{|\vec{d}|}.
\]
Compute the cross product:
\[
\overrightarrow{AP}\times \vec{d}
=
\begin{vmatrix}
\hat{i} & \hat{j} & \hat{k}
2 & -6 & 2
0 & 1 & 1
\end{vmatrix}.
\]
\[
=
\hat{i}(-6-2)
-\hat{j}(2-0)
+\hat{k}(2-0).
\]
\[
=
-8\hat{i}-2\hat{j}+2\hat{k}.
\]
Step 4: Find its magnitude.
\[
\left|\overrightarrow{AP}\times \vec{d}\right|
=
\sqrt{(-8)^2+(-2)^2+2^2}.
\]
\[
=
\sqrt{64+4+4}.
\]
\[
=
\sqrt{72}
=
6\sqrt{2}.
\]
Also,
\[
|\vec{d}|
=
\sqrt{0^2+1^2+1^2}
=
\sqrt{2}.
\]
Step 5: Calculate the distance.
\[
d
=
\frac{6\sqrt{2}}{\sqrt{2}}
=
6.
\]
Step 6: Final conclusion.
Therefore,
\[
\boxed{6}
\]