You can lock your door without the lever handle attached, it’s as simple as using the key since replacing the handle shouldn’t affect the lock.
However, if you can’t go and get the handle changed right away and still wish to use the door, a temporary fix can be made, though it shouldn’t be used for long. This video runs through the temporary fix solution: