Solution (source code)

= Solution

Take the <normal vector> to point outward from the box. The <divergence theorem> changes the closed-surface <flux> into a <volume integral>. The <divergence> is
$$
\nabla\cdot F=\pi\cos(\pi x)+3zy^2+2z.
$$
The first term integrates to zero in $x$, since $\int_{-1}^{2}\pi\cos(\pi x)\,dx=\sin2\pi-\sin(-\pi)=0$. Therefore
$$
\begin{aligned}
\iint_SF\cdot d\boldsymbol S
&=\int_{-1}^2\int_0^1\int_1^4z(3y^2+2)\,dz\,dy\,dx\\
&=3\left(\frac{4^2-1^2}{2}\right)\left(\int_0^1(3y^2+2)\,dy\right)\\
&=3\cdot\frac{15}{2}\cdot3.
\end{aligned}
$$
Hence
$$
\boxed{\iint_SF\cdot d\boldsymbol S=\frac{135}{2}.}
$$
A direct face check gives zero from the two $x$ faces, $45/2$ from the pair of $y$ faces, and $45$ from the pair of $z$ faces. This also checks the outward-orientation signs.