If currently you are in China with other kind of visa (M visa, or residence permit for ‘visiting a family member??? not the work visa). If you get a job offer , do you need to leave the country to apply for the Z visa / work residence permit? And if so, do you have to return to my home country?
It depends on the where your employer comes from, and the local relevant rules for foreigner’s work permit.
In most area of the mainland China, you must go out of China to get the z visa, and then come back.
But if you are hired by a company from Guangzhou Nansha Free Trade Zone, you can change your current visa to work residence permit directly, because there is a preferential policies for Guangzhou Nansha Free Trade Zone.
http://www.startupbusinesschina.com/chinese-foreign-investment-negative-list/