If we measure which slit the electron goes through, the wave function of the system collapses. This means the wave function will no longer be a superposition of the states |slit1> and |slit2>, but only contains for example |slit1> (if we measure that the electron goes through slit1). This means that the total probability amplitude will be <slit1|phi>. If we take the modulus square of this, we do not get interference terms. This means the intensity pattern we will see on the screen is the same as if slit2 was not there.