Semi-analytical model of self-amplified spontaneous-emission free-electron lasers, including diffraction and pulse-propagation effects