Here is a self-contained proof using Poincare-Hopf theorem (as suggested by Ted). Let $\nabla$ be a connection on the bundle $p: E\to B$. Take a nondegenerate vector field $X$ on $B$ and lift it to a vector field $Y$ on $E$ using $\nabla$. Let $b_1,...,b_n$ denote the singular points of $X$; set $F_i:= p^{-1}(b_i), i=1,...,n$. Take small (pairwise disjoint) tubular neighborhoods $p^{-1}(U_i)$ of the fibers $F_i$, $i=1,...,n$. These neighborhoods admit a product structure $F_i\times U_i$ consistent with the fibration $p$. Pick a nondegenerate vector field $Z$ on $F\cong F_i, i=1,...,n$, extend it to each $U_i$ (using the product decomposition) and then multiply by pull-backs (via $p$) of suitable bump-functions, supported on $U_i$'s. Then extend the resulting vector field $W$ to the rest of $E$. Lastly, take the vector field $V=Y+W$. The set $Sing(V)$ of singular points of $V$ is the disjoint union of copies of $Sing(Z)$ in $F_1,...,F_n$. At each point $q\in F_i\cap Sing(V)$,
$$
index(V,q)= index(Z,q) \times index(X, b_i)$$
(this follows from the fact that the determinant of a square block-diagonal matrix with blocks $A_1, A_2$ equals $det(A_1)\times det(A_2)$).
Now, what's left is just to count the number of singular points of $V$ (with sign): Each fiber $F_i$ contributes
$$
index(X,b_i)\times index(Z)= index(X,b_i)\times \chi(F).$$
Summing up over all points $b_i$ we obtain
$$
index(V)= index(X)\times \chi(F)= \chi(B)\times \chi(F).
$$
qed