register.js 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001
  1. var Register = {
  2. registData: {},
  3. validateFields: {
  4. username: {validators: {notEmpty: {message: '登录账号不能为空'}}},
  5. name: {validators: {notEmpty: {message: '单位/企业名称不能为空'}}}, //, regexp: {regexp: /^([\u4E00-\u9FA5]|\(|\)){1,100}$/, message: "单位/企业名称只允许中文"}
  6. //idCard: {validators: {notEmpty: {message: '统一社会信用代码不能为空'}}},
  7. agentName: {validators: {notEmpty: {message: '人才联络员不能为空'}}},
  8. agentPhone: {
  9. validators: {
  10. notEmpty: {
  11. message: '人才联络员手机号不能为空'
  12. }, regexp: {
  13. regexp: /(^(\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})))$/,
  14. message: "人才联络员手机号格式不合法"
  15. }
  16. }
  17. },
  18. verificationCode: {validators: {notEmpty: {message: '手机验证码不能为空'}}},
  19. //legal: {validators: {notEmpty: {message: '法人代表不能为空'},regexp:{regexp:/^[\u4e00-\u9fa5]{1,50}$/,message:"法人代表只允许中文"}}},
  20. street: {validators: {notEmpty: {message: '所属街道不能为空'}}},
  21. address: {validators: {notEmpty: {message: '单位/企业地址不能为空'}}},
  22. ephone: {
  23. validators: {
  24. notEmpty: {
  25. message: '单位/企业电话不能为空'
  26. }, regexp: {
  27. regexp: /(^(\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})))$/,
  28. message: "单位/企业电话格式不合法"
  29. }
  30. }
  31. },
  32. agentEmail: {
  33. validators: {
  34. notEmpty: {
  35. message: '电子邮箱不能为空'
  36. },
  37. regexp: {
  38. regexp: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/,
  39. message: "电子邮箱格式不正确"
  40. }
  41. }
  42. },
  43. //bankCard: {validators: {notEmpty: {message: '企业银行账号不能为空'}}},
  44. //bankNetwork: {validators: {notEmpty: {message: '企业开户银行网点不能为空'}}},
  45. //bank: {validators: {notEmpty: {message: '企业开户银行不能为空'}}}
  46. },
  47. sy_validateFields: {
  48. username: {validators: {notEmpty: {message: '登录账号不能为空'}}},
  49. name: {validators: {notEmpty: {message: '单位名称不能为空'}, regexp: {regexp: /^[\u4e00-\u9fa5]{1,100}$/, message: "单位名称只允许中文"}}},
  50. agentName: {validators: {notEmpty: {message: '人才联络员不能为空'}}},
  51. agentPhone: {
  52. validators: {
  53. notEmpty: {
  54. message: '人才联络员手机号不能为空'
  55. }, regexp: {
  56. regexp: /(^(\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})))$/,
  57. message: "人才联络员手机号格式不合法"
  58. }
  59. }
  60. },
  61. verificationCode: {validators: {notEmpty: {message: '手机验证码不能为空'}}},
  62. street: {validators: {notEmpty: {message: '所属街道不能为空'}}},
  63. address: {validators: {notEmpty: {message: '单位地址不能为空'}}},
  64. ephone: {
  65. validators: {
  66. notEmpty: {
  67. message: '单位电话不能为空'
  68. }, regexp: {
  69. regexp: /(^(\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})))$/,
  70. message: "单位电话格式不合法"
  71. }
  72. }
  73. },
  74. agentEmail: {
  75. validators: {
  76. notEmpty: {
  77. message: '电子邮箱不能为空'
  78. },
  79. regexp: {
  80. regexp: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/,
  81. message: "电子邮箱格式不正确"
  82. }
  83. }
  84. }
  85. }
  86. };
  87. var enterpriseCountDown = 0;
  88. var enterpriseSmsBtn = $("#enterprise_sms_btn");
  89. var persionCountDown = 0;
  90. var psSmsBtn = $("#ps_sms_btn");
  91. var lock = false;
  92. Register.addSubmit = function () {
  93. var regType = $(".active").attr("regType");
  94. if (regType == "en") { //企业用户注册
  95. Register.enterpriseUserRegister();
  96. } else if (regType == "ps") { //个人用户注册
  97. Register.personUserRegister();
  98. }
  99. };
  100. /**
  101. * 验证数据
  102. */
  103. Register.validate = function () {
  104. $('#ep_form').data("bootstrapValidator").resetForm();
  105. $('#ep_form').bootstrapValidator('validate');
  106. return $("#ep_form").data('bootstrapValidator').isValid();
  107. }
  108. var isDis = false;
  109. Register.enterpriseUserRegister = function () {
  110. var type = $("#type").val();
  111. var special = $("#ep_form .active").attr("special");
  112. $("#special").val(special)
  113. $('#ep_form').bootstrapValidator({
  114. feedbackIcons: {
  115. valid: 'glyphicon glyphicon-ok',
  116. invalid: 'glyphicon glyphicon-remove',
  117. validating: 'glyphicon glyphicon-refresh'
  118. },
  119. group: '.rowGroup',
  120. fields: Register.validateFields,
  121. live: 'enabled',
  122. message: '该字段不能为空'
  123. });
  124. //初始化
  125. $("#tab-3 .form-control").attr("disabled", "disabled");
  126. $("#tab-4 .form-control").attr("disabled", "disabled");
  127. $("#tab-5 .form-control").attr("disabled", "disabled");
  128. $("#tab-6 .form-control").attr("disabled", "disabled");
  129. $("#tab-7 .form-control").attr("disabled", "disabled");
  130. $('#ep_form').bootstrapValidator("addField", "name", {validators: {notEmpty: {message: '单位/企业名称不能为空'}}});
  131. $('#ep_form').bootstrapValidator("addField", "name", {validators: {notEmpty: {message: '所属街道不能为空'}}});
  132. $('#ep_form').bootstrapValidator("addField", "address", {validators: {notEmpty: {message: '单位/企业地址不能为空'}}});
  133. $('#ep_form').bootstrapValidator("addField", "ephone", {validators: {
  134. notEmpty: {
  135. message: '单位/企业电话不能为空'
  136. }, regexp: {
  137. regexp: /(^(\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})))$/,
  138. message: "单位/企业电话格式不合法"
  139. }
  140. }}
  141. );
  142. $('#ep_form').bootstrapValidator("removeField", "idCard");
  143. $('#ep_form').bootstrapValidator("removeField", "legal");
  144. $('#ep_form').bootstrapValidator("removeField", "bankCard");
  145. $('#ep_form').bootstrapValidator("removeField", "bankNetwork");
  146. $('#ep_form').bootstrapValidator("removeField", "bank");
  147. $('#ep_form').bootstrapValidator("removeField", "medicalCommunityId");
  148. $('#ep_form').bootstrapValidator("removeField", "isGeneral");
  149. $('#ep_form').bootstrapValidator("removeField", "province");
  150. $('#ep_form').bootstrapValidator("removeField", "city");
  151. $('#ep_form').bootstrapValidator("removeField", "county");
  152. switch (special) {
  153. case 'qiye':
  154. $("#tab-3 .form-control").removeAttr("disabled");
  155. $('#ep_form').bootstrapValidator("addField", "idCard", {validators: {notEmpty: {message: '统一社会信用代码不能为空'}}});
  156. $('#ep_form').bootstrapValidator("addField", "legal", {validators: {notEmpty: {message: '法人代表不能为空'}}});//, regexp: {regexp: /^[\u4e00-\u9fa5]{1,50}$/, message: "法人代表只允许中文"}
  157. if (type == 1) {
  158. $('#ep_form').bootstrapValidator("addField", "bankCard", {validators: {notEmpty: {message: '开户银行账号不能为空'}}});
  159. $('#ep_form').bootstrapValidator("addField", "bankNetwork", {validators: {notEmpty: {message: '开户银行网点不能为空'},
  160. regexp: {
  161. regexp: /^[\u4e00-\u9fa5]*银行[\u4e00-\u9fa5]*$/,
  162. message: "开户银行网点格式不正确"
  163. }}});
  164. $('#ep_form').bootstrapValidator("addField", "bank", {validators: {notEmpty: {message: '开户银行不能为空'}, regexp: {
  165. regexp: /^[\u4e00-\u9fa5]*$/,
  166. message: "开户银行必须为中文"
  167. }}});
  168. }
  169. var prefix = '企业';
  170. break;
  171. case 'minfei':
  172. $("#tab-5 .form-control").removeAttr("disabled");
  173. $('#ep_form').bootstrapValidator("addField", "idCard", {validators: {notEmpty: {message: '统一社会信用代码不能为空'}}});
  174. $('#ep_form').bootstrapValidator("addField", "legal", {validators: {notEmpty: {message: '法人代表不能为空'}}});//, regexp: {regexp: /^[\u4e00-\u9fa5]{1,50}$/, message: "法人代表只允许中文"}
  175. $('#ep_form').bootstrapValidator("addField", "bankCard", {validators: {notEmpty: {message: '开户银行账号不能为空'}}});
  176. $('#ep_form').bootstrapValidator("addField", "bankNetwork", {validators: {notEmpty: {message: '开户银行网点不能为空'},
  177. regexp: {
  178. regexp: /^[\u4e00-\u9fa5]*银行[\u4e00-\u9fa5]*$/,
  179. message: "开户银行网点格式不正确"
  180. }}});
  181. $('#ep_form').bootstrapValidator("addField", "bank", {validators: {notEmpty: {message: '开户银行不能为空'}, regexp: {
  182. regexp: /^[\u4e00-\u9fa5]*$/,
  183. message: "开户银行必须为中文"
  184. }}});
  185. var prefix = '企业';
  186. break;
  187. case 'shiye':
  188. $("#tab-4 .form-control").removeAttr("disabled");
  189. var prefix = '单位';
  190. break;
  191. case 'weijian':
  192. $("#tab-6 .form-control").removeAttr("disabled");
  193. $('#ep_form').bootstrapValidator("addField", "name", {validators: {notEmpty: {message: '医院名称不能为空'}}});
  194. $('#ep_form').bootstrapValidator("addField", "idCard", {validators: {notEmpty: {message: '登记号不能为空'}}});
  195. $('#ep_form').bootstrapValidator("addField", "legal", {validators: {notEmpty: {message: '法人代表不能为空'}}});
  196. $('#ep_form').bootstrapValidator("addField", "ephone", {validators: {notEmpty: {message: '医院电话不能为空'}}});
  197. $('#ep_form').bootstrapValidator("addField", "medicalCommunityId", {validators: {notEmpty: {message: '请选择医共体'}}});
  198. $('#ep_form').bootstrapValidator("addField", "isGeneral", {validators: {notEmpty: {message: '请选择是否总院'}}});
  199. $('#ep_form').bootstrapValidator("addField", "province", {validators: {notEmpty: {message: '请选择医院所在省份'}}});
  200. $('#ep_form').bootstrapValidator("addField", "city", {validators: {notEmpty: {message: '请选择医院所在市'}}});
  201. $('#ep_form').bootstrapValidator("addField", "county", {
  202. validators: {
  203. callback: {
  204. message: "请选择医院所在县/区",
  205. callback: function (value, validator) {
  206. if ($("#wj_province").val() > 0 && $("#wj_city").val() > 0 && $("#wj_county option").length > 1 && $("#wj_county option:selected").length == 0) {
  207. //当省市都有值时,如果县有列表,必选
  208. return false;
  209. }
  210. return true;
  211. }
  212. }
  213. }
  214. });
  215. $('#ep_form').bootstrapValidator("addField", "address", {validators: {notEmpty: {message: '请填写医院详细地址'}}});
  216. $('#ep_form').bootstrapValidator("addField", "bankCard", {validators: {notEmpty: {message: '银行账号不能为空'}}});
  217. $('#ep_form').bootstrapValidator("addField", "bank", {validators: {notEmpty: {message: '开户银行不能为空'}, regexp: {
  218. regexp: /^[\u4e00-\u9fa5]*$/,
  219. message: "开户银行必须为中文"
  220. }}});
  221. $('#ep_form').bootstrapValidator("addField", "bankNetwork", {validators: {notEmpty: {message: '开户银行网点不能为空'},
  222. regexp: {
  223. regexp: /^[\u4e00-\u9fa5]*银行[\u4e00-\u9fa5]*$/,
  224. message: "开户银行网点格式不正确"
  225. }}});
  226. $('#ep_form').bootstrapValidator("removeField", "street");
  227. var prefix = "医院";
  228. break;
  229. case 'gaojiao':
  230. $("#tab-7 .form-control").removeAttr("disabled");
  231. $('#ep_form').bootstrapValidator("addField", "idCard", {validators: {notEmpty: {message: '统一社会信用代码不能为空'}}});
  232. $('#ep_form').bootstrapValidator("addField", "legal", {validators: {notEmpty: {message: '法人代表不能为空'}}});
  233. $('#ep_form').bootstrapValidator("addField", "ephone", {validators: {notEmpty: {message: '学校电话不能为空'}}});
  234. $('#ep_form').bootstrapValidator("addField", "province", {validators: {notEmpty: {message: '请选择学校所在省份'}}});
  235. $('#ep_form').bootstrapValidator("addField", "city", {validators: {notEmpty: {message: '请选择学校所在市'}}});
  236. $('#ep_form').bootstrapValidator("addField", "county", {
  237. validators: {
  238. callback: {
  239. message: "请选择学校所在县/区",
  240. callback: function (value, validator) {
  241. if ($("#gj_province").val() > 0 && $("#gj_city").val() > 0 && $("#gj_county option").length > 1 && $("#gj_county option:selected").length == 0) {
  242. //当省市都有值时,如果县有列表,必选
  243. return false;
  244. }
  245. return true;
  246. }
  247. }
  248. }
  249. });
  250. $('#ep_form').bootstrapValidator("addField", "address", {validators: {notEmpty: {message: '请填写学校详细地址'}}});
  251. $('#ep_form').bootstrapValidator("removeField", "street");
  252. var prefix = "学校";
  253. break;
  254. }
  255. if (!Register.validate()) {
  256. return;
  257. }
  258. isDis = $("#type").prop("disabled");
  259. var source = $("#source").val();
  260. switch (special) {
  261. case 'qiye':
  262. var username = $("#username").val();
  263. var password = $("#password").val();
  264. var rePassword = $("#re_password").val();
  265. var name = $("#name").val();
  266. var idCard = $("#idCard").val();
  267. var legal = $("#legal").val();
  268. var street = $("#street").val();
  269. var address = $("#address").val();
  270. var ephone = $("#ephone").val();
  271. var bankCard = $("#bankCard").val();
  272. var bank = $("#bank").val();
  273. var bankNetwork = $("#bankNetwork").val();
  274. break;
  275. case 'minfei':
  276. var username = $("#mf_username").val();
  277. var password = $("#mf_password").val();
  278. var rePassword = $("#mf_re_password").val();
  279. var name = $("#mf_name").val();
  280. var idCard = $("#mf_idCard").val();
  281. var legal = $("#mf_legal").val();
  282. var street = $("#mf_street").val();
  283. var address = $("#mf_address").val();
  284. var ephone = $("#mf_ephone").val();
  285. var bankCard = $("#mf_bankCard").val();
  286. var bank = $("#mf_bank").val();
  287. var bankNetwork = $("#mf_bankNetwork").val();
  288. break;
  289. case 'shiye':
  290. var username = $("#sy_username").val();
  291. var password = $("#sy_password").val();
  292. var rePassword = $("#sy_re_password").val();
  293. var name = $("#sy_name").val();
  294. var street = $("#sy_street").val();
  295. var address = $("#sy_address").val();
  296. var ephone = $("#sy_ephone").val();
  297. break;
  298. case "weijian":
  299. var username = $("#wj_username").val();
  300. var password = $("#wj_password").val();
  301. var rePassword = $("#wj_re_password").val();
  302. var name = $("#wj_name").val();
  303. var idCard = $("#wj_idCard").val();
  304. var legal = $("#wj_legal").val();
  305. var ephone = $("#wj_ephone").val();
  306. var medicalCommunityId = $("#wj_medicalCommunityId").val();
  307. var isGeneral = $("#wj_isGeneral").val();
  308. var province = $("#wj_province").val();
  309. var city = $("#wj_city").val();
  310. var county = $("#wj_county").val();
  311. var address = $("#wj_address").val();
  312. var bankCard = $("#wj_bankCard").val();
  313. var bank = $("#wj_bank").val();
  314. var bankNetwork = $("#wj_bankNetwork").val();
  315. break;
  316. case "gaojiao":
  317. var username = $("#gj_username").val();
  318. var password = $("#gj_password").val();
  319. var rePassword = $("#gj_re_password").val();
  320. var name = $("#gj_name").val();
  321. var idCard = $("#gj_idCard").val();
  322. var legal = $("#gj_legal").val();
  323. var ephone = $("#gj_ephone").val();
  324. var province = $("#gj_province").val();
  325. var city = $("#gj_city").val();
  326. var county = $("#gj_county").val();
  327. var address = $("#gj_address").val();
  328. break;
  329. }
  330. var agentName = $("#agentName").val();
  331. var agentPhone = $("#agentPhone").val();
  332. var verificationCode = $("#verificationCode").val();
  333. if (isDis) {
  334. $("#type").removeAttr("disabled");
  335. }
  336. var agencyType = $("#agencyType").val();
  337. var agentEmail = $("#agentEmail").val();
  338. var enterpriseTag = $("#enterpriseTag").val();
  339. var enterpriseType = $("#enterpriseType").val();
  340. var industryFieldNew = $("#industryFieldNew").val();
  341. var industryFieldOld = $("#industryFieldOld").val();
  342. if (username == null || username == '') {
  343. Feng.info("请填写账号!");
  344. return;
  345. }
  346. if (username.length > 50) {
  347. Feng.info("账号最多50个字符!");
  348. return;
  349. }
  350. if (source != 2) {
  351. if (password == null || password == '') {
  352. Feng.info("请填写密码!");
  353. return;
  354. }
  355. if (!/^(?=.*\d)(?=.*[a-zA-Z]).{8,20}$/.test(password)) {
  356. Feng.info("密码格式错误,密码由字母与数字组成,且长度必须8个字符及以上!");
  357. return;
  358. }
  359. if (rePassword == null || rePassword == '') {
  360. Feng.info("请填写重复密码!");
  361. return;
  362. }
  363. if (password != rePassword) {
  364. Feng.info("两次密码填写不一致!");
  365. return;
  366. }
  367. }
  368. if (name == null || name == '') {
  369. Feng.info("请填写" + prefix + "名称!");
  370. return;
  371. }
  372. /*if (!/^([\u4E00-\u9FA5]|\(|\)|\(|\)){1,100}$/.test(name)) {
  373. Feng.info(prefix + "名称只能输入中文 !");
  374. return;
  375. }*/
  376. if (name.length > 100) {
  377. Feng.info(prefix + "名称最多100个字符!");
  378. return;
  379. }
  380. if (ephone == null || ephone == '') {
  381. Feng.info("请填写" + prefix + "电话");
  382. return;
  383. }
  384. if ((street == null || street == '') && special != "weijian" && special != "gaojiao") {
  385. Feng.info("请选择所属街道!");
  386. return;
  387. }
  388. if (address == null || address == '') {
  389. Feng.info("请填写" + prefix + "地址!");
  390. return;
  391. }
  392. switch (special) {
  393. case 'qiye':
  394. if ((idCard == null || idCard == '')) {
  395. Feng.info("请填写统一社会信用代码!");
  396. return;
  397. }
  398. if (idCard.length > 40) {
  399. Feng.info("统一社会信用代码最多40个字符!");
  400. return;
  401. }
  402. if (legal == null || legal == '') {
  403. Feng.info("请填写法人代表!");
  404. return;
  405. }
  406. if (type == null || type == '') {
  407. Feng.info("请选择申报类型!");
  408. return;
  409. }
  410. /*if (!/^[\u4e00-\u9fa5]{1,50}$/.test(legal)) {
  411. Feng.info("法人代表只能输入中文 !");
  412. return;
  413. }*/
  414. if (type == 1) {
  415. if (bankCard == null || bankCard == '') {
  416. Feng.info("请填写企业银行账号!");
  417. return;
  418. }
  419. if (bank == null || bank == '') {
  420. Feng.info("请填写企业开户银行!");
  421. return;
  422. }
  423. if (bankNetwork == null || bankNetwork == '') {
  424. Feng.info("请填写企业开户银行网点");
  425. return;
  426. }
  427. }
  428. var x = document.getElementById("imgurl").value;
  429. if (x == "") {
  430. Feng.info("请上传营业执照照片!");
  431. return;
  432. }
  433. if (!Feng.chkFileInvalid(document.getElementById("imgurl").files[0], 5, 10, ["image/jpeg", "image/gif", "image/png", "image/jpg", "application/pdf"], "营业执照只允许上传PDF或图片")) {
  434. return;
  435. }
  436. if (type == 1) {
  437. var xx = document.getElementById("bankImg").value;
  438. if (xx == "") {
  439. Feng.info("请上传开户银行许可证!");
  440. return;
  441. }
  442. if (!Feng.chkFileInvalid(document.getElementById("bankImg").files[0], 5, 10, ["image/jpeg", "image/gif", "image/png", "image/jpg", "application/pdf"], "开户银行许可证只允许上传PDF或图片")) {
  443. return;
  444. }
  445. if (agencyType == null || agencyType == '') {
  446. Feng.info("请选择机构类型");
  447. return;
  448. }
  449. switch (agencyType) {
  450. case "1":
  451. if (industryFieldNew == null || industryFieldNew == '') {
  452. Feng.info("请选择产业领域");
  453. return;
  454. }
  455. if (industryFieldOld == null || industryFieldOld == '') {
  456. Feng.info("请选择行业领域");
  457. return;
  458. }
  459. var xxx = document.getElementById("domainImg").value;
  460. if (xxx == "") {
  461. Feng.info("请上传行业领域佐证材料!");
  462. return;
  463. }
  464. if (!Feng.chkFileInvalid(document.getElementById("domainImg").files[0], 5, 10, ["image/jpeg", "image/gif", "image/png", "image/jpg", "application/pdf"], "行业领域佐证材料只允许上传PDF或图片")) {
  465. return;
  466. }
  467. break;
  468. case "2":
  469. break;
  470. }
  471. if (enterpriseTag == null || enterpriseTag == '') {
  472. Feng.info("请选择企业标签!");
  473. return;
  474. }
  475. if (enterpriseType == null || enterpriseType == '') {
  476. Feng.info("请选择企业类型!");
  477. return;
  478. }
  479. var checkType = ["guishang", "gaoxinjishu", "zhuanjingtexin"];
  480. if (checkType.indexOf(enterpriseType) > -1) {
  481. var typeImg = document.getElementById("typeImg").value;
  482. if (typeImg == "") {
  483. Feng.info("规上、高新技术、专精特新企业需要上传佐证材料!");
  484. return;
  485. }
  486. if (!Feng.chkFileInvalid(document.getElementById("typeImg").files[0], 5, 10, ["image/jpeg", "image/gif", "image/png", "image/jpg", "application/pdf"], "规上、高新技术、专精特新企业佐证材料只允许上传PDF或图片")) {
  487. return;
  488. }
  489. }
  490. }
  491. break;
  492. case 'minfei':
  493. if ((idCard == null || idCard == '')) {
  494. Feng.info("请填写统一社会信用代码!");
  495. return;
  496. }
  497. if (idCard.length > 40) {
  498. Feng.info("统一社会信用代码最多40个字符!");
  499. return;
  500. }
  501. if (legal == null || legal == '') {
  502. Feng.info("请填写法人代表!");
  503. return;
  504. }
  505. /*if (!/^[\u4e00-\u9fa5]{1,50}$/.test(legal)) {
  506. Feng.info("法人代表只能输入中文 !");
  507. return;
  508. }*/
  509. if (bankCard == null || bankCard == '') {
  510. Feng.info("请填写机构银行账号!");
  511. return;
  512. }
  513. if (bank == null || bank == '') {
  514. Feng.info("请填写机构开户银行!");
  515. return;
  516. }
  517. if (bankNetwork == null || bankNetwork == '') {
  518. Feng.info("请填写机构开户银行网点");
  519. return;
  520. }
  521. var x = document.getElementById("mf_imgurl").value;
  522. if (x == "") {
  523. Feng.info("请上传营业执照照片!");
  524. return;
  525. }
  526. if (!Feng.chkFileInvalid(document.getElementById("mf_imgurl").files[0], 5, 10, ["image/jpeg", "image/gif", "image/png", "image/jpg", "application/pdf"], "营业执照只允许上传PDF或图片")) {
  527. return;
  528. }
  529. var xx = document.getElementById("mf_bankImg").value;
  530. if (xx == "") {
  531. Feng.info("请上传开户银行许可证!");
  532. return;
  533. }
  534. if (!Feng.chkFileInvalid(document.getElementById("mf_bankImg").files[0], 5, 10, ["image/jpeg", "image/gif", "image/png", "image/jpg", "application/pdf"], "开户银行许可证只允许上传PDF或图片")) {
  535. return;
  536. }
  537. break;
  538. case 'shiye':
  539. var x = document.getElementById("sy_imgurl").value;
  540. if (x == "") {
  541. Feng.info("请上传法人证或批文!");
  542. return;
  543. }
  544. if (!Feng.chkFileInvalid(document.getElementById("sy_imgurl").files[0], 5, 10, ["image/jpeg", "image/gif", "image/png", "image/jpg", "application/pdf"], "法人证或批文只允许上传PDF或图片")) {
  545. return;
  546. }
  547. break;
  548. case "weijian":
  549. var x = document.getElementById("wj_imgurl").value;
  550. if (x == "") {
  551. Feng.info("请上传医疗机构执业许可证!");
  552. return;
  553. }
  554. if (!Feng.chkFileInvalid(document.getElementById("wj_imgurl").files[0], 5, 10, ["image/jpeg", "image/gif", "image/png", "image/jpg", "application/pdf"], "医疗机构执业许可证只允许上传PDF或图片")) {
  555. return;
  556. }
  557. var xx = document.getElementById("wj_bankImg").value;
  558. if (xx == "") {
  559. Feng.info("请上传开户银行许可证!");
  560. return;
  561. }
  562. if (!Feng.chkFileInvalid(document.getElementById("wj_bankImg").files[0], 5, 10, ["image/jpeg", "image/gif", "image/png", "image/jpg", "application/pdf"], "开户银行许可证只允许上传PDF或图片")) {
  563. return;
  564. }
  565. break;
  566. case "gaojiao":
  567. var x = document.getElementById("gj_imgurl").value;
  568. if (x == "") {
  569. Feng.info("办学许可证、法人证书或登记证书!");
  570. return;
  571. }
  572. if (!Feng.chkFileInvalid(document.getElementById("gj_imgurl").files[0], 5, 10, ["image/jpeg", "image/gif", "image/png", "image/jpg", "application/pdf"], "办学许可证、法人证书或登记证书只允许上传PDF或图片")) {
  573. return;
  574. }
  575. break;
  576. }
  577. if (agentName == null || agentName == '') {
  578. Feng.info("请填写人才联络员!");
  579. return;
  580. }
  581. if (agentName.length > 30) {
  582. Feng.info("人才联络员最多30个字符!");
  583. return;
  584. }
  585. if (agentPhone == null || agentPhone == '') {
  586. Feng.info("请填写人才联络员电话!");
  587. return;
  588. }
  589. if (verificationCode == null || verificationCode == '') {
  590. Feng.info("请填写手机验证码!");
  591. return;
  592. }
  593. if (agentEmail == null || agentEmail == '') {
  594. Feng.info("请填写电子邮箱!");
  595. return;
  596. }
  597. var xxxx = document.getElementById("beian").value;
  598. if (xxxx == "") {
  599. Feng.info("请上传人才联络员信息备案表!");
  600. return;
  601. }
  602. if (!Feng.chkFileInvalid(document.getElementById("beian").files[0], 5, 10, ["image/jpeg", "image/gif", "image/png", "image/jpg", "application/pdf"], "人才联络员信息备案表只允许上传PDF或图片")) {
  603. return;
  604. }
  605. if (!/(^(\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})))$/.test(ephone)) {
  606. Feng.info(prefix + "电话格式不合法!");
  607. return;
  608. }
  609. if (!/(^(\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})))$/.test(agentPhone)) {
  610. Feng.info("人才联络员电话格式不合法!");
  611. return;
  612. }
  613. if (!/[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/.test(agentEmail)) {
  614. Feng.info("电子邮箱格式不合法!");
  615. return;
  616. }
  617. if (!lock) {
  618. lock = true;
  619. } else {
  620. Feng.info("不能重复点击");
  621. return;
  622. }
  623. $("#ep_form")[0].submit();
  624. };
  625. Register.changeEnterpriseType = function () {
  626. var enterpriseType = $("#enterpriseType").val();
  627. switch (enterpriseType) {
  628. case "guishang":
  629. console.log("规上")
  630. $("#typeName").text("规上");
  631. $("td.typeUploader").css("display", "table-cell");
  632. break;
  633. case "gaoxinjishu":
  634. console.log("高新技术")
  635. $("#typeName").html("高新技术");
  636. $("td.typeUploader").css("display", "table-cell");
  637. break;
  638. case "zhuanjingtexin":
  639. console.log("专精特新")
  640. $("#typeName").html("专精特新");
  641. $("td.typeUploader").css("display", "table-cell");
  642. break;
  643. default:
  644. $("td.typeUploader").css("display", "none");
  645. break;
  646. }
  647. };
  648. Register.personUserRegister = function () {
  649. var source = $("#ps_source").val();
  650. var username = $("#ps_username").val();
  651. var password = $("#ps_password").val();
  652. var rePassword = $("#ps_re_password").val();
  653. var name = $("#ps_name").val();
  654. var sex = $("#ps_sex").val();
  655. var idCard = $("#ps_idCard").val();
  656. var phone = $("#ps_phone").val();
  657. var verificationCode = $("#ps_verificationCode").val();
  658. if (username == null || username == '') {
  659. Feng.info("请填写账号!");
  660. return;
  661. }
  662. if (username.length > 50) {
  663. Feng.info("账号最多20个字符!");
  664. return;
  665. }
  666. if (source != 2) {
  667. if (password == null || password == '') {
  668. Feng.info("请填写密码!");
  669. return;
  670. }
  671. if (rePassword == null || rePassword == '') {
  672. Feng.info("请填写重复密码!");
  673. return;
  674. }
  675. if (password != rePassword) {
  676. Feng.info("两次密码填写不一致!");
  677. return;
  678. }
  679. }
  680. if (name == null || name == '') {
  681. Feng.info("请填写姓名!");
  682. return;
  683. }
  684. if (name.length > 20) {
  685. Feng.info("姓名最多20个字符!");
  686. return;
  687. }
  688. if (sex == null || sex == '') {
  689. Feng.info("请选择性别!");
  690. return;
  691. }
  692. if (idCard == null || idCard == '') {
  693. Feng.info("请填写身份证号!");
  694. return;
  695. }
  696. if (phone == null || phone == '') {
  697. Feng.info("请填写手机号!");
  698. return;
  699. }
  700. if (verificationCode == null || verificationCode == '') {
  701. Feng.info("请填写手机验证码!")
  702. return;
  703. }
  704. if (!/0?(13|14|15|17|18|19)[0-9]{9}/.test(phone)) {
  705. Feng.info("手机号格式不合法!");
  706. return;
  707. }
  708. var da = {"source": source, "username": username, "password": password, "name": name, "sex": sex, "idCard": idCard, "phone": phone, "verificationCode": verificationCode};
  709. var ajax = new $ax("/common/auth/person_register", function (data) {
  710. Feng.info(data.msg);
  711. if (data.code == 200) {
  712. parent.layer.close(window.parent.Login.layerIndex);
  713. }
  714. }, function (data) {
  715. Feng.error("操作失败!" + data.responseJSON.message + "!");
  716. });
  717. ajax.set(da);
  718. ajax.start();
  719. };
  720. Register.getEnterpriseSms = function () {
  721. var agentPhone = $("#agentPhone").val();
  722. if (agentPhone == null || agentPhone == "") {
  723. Feng.info("请填写人才联络员手机号!");
  724. return;
  725. }
  726. agentPhone = $.trim(agentPhone);
  727. if (!Feng.checkMobilePhoneNum(agentPhone)) {
  728. Feng.info("手机号格式有误,请填写正确的手机号码!");
  729. return;
  730. }
  731. Register.enterpriseBtnCountDown();
  732. var ajax = new $ax(Feng.ctxPath + "/common/auth/verificationCode?phone=" + agentPhone + "&type=1", function (data) {
  733. Feng.info(data.msg);
  734. }, function (data) {
  735. Feng.error("操作失败!" + data.responseJSON.message + "!");
  736. });
  737. ajax.set(null);
  738. ajax.start();
  739. };
  740. Register.enterpriseBtnCountDown = function () {
  741. if (enterpriseCountDown == 0) {
  742. enterpriseCountDown = 60;
  743. } else if (enterpriseCountDown == 1) {
  744. enterpriseSmsBtn.removeAttr("disabled");
  745. enterpriseSmsBtn.html("获取验证码");
  746. enterpriseCountDown = 0;
  747. return;
  748. }
  749. enterpriseSmsBtn.attr("disabled", true);
  750. enterpriseSmsBtn.html(enterpriseCountDown + "秒");
  751. enterpriseCountDown--;
  752. setTimeout("Register.enterpriseBtnCountDown()", 1000);
  753. };
  754. Register.getPersionSms = function () {
  755. var phone = $("#ps_phone").val();
  756. if (phone == null || phone == "") {
  757. Feng.info("请填写手机号!");
  758. return;
  759. }
  760. phone = $.trim(phone);
  761. if (!Feng.checkMobilePhoneNum(phone)) {
  762. Feng.info("手机号格式有误,请填写正确的手机号码!");
  763. return;
  764. }
  765. Register.getPersionBtnCountDown();
  766. var ajax = new $ax(Feng.ctxPath + "/common/auth/verificationCode?phone=" + phone + "&type=1", function (data) {
  767. Feng.info(data.msg);
  768. }, function (data) {
  769. Feng.error("操作失败!" + data.responseJSON.message + "!");
  770. });
  771. ajax.set(null);
  772. ajax.start();
  773. };
  774. Register.getPersionBtnCountDown = function () {
  775. if (persionCountDown == 0) {
  776. persionCountDown = 60;
  777. } else if (persionCountDown == 1) {
  778. psSmsBtn.removeAttr("disabled");
  779. psSmsBtn.html("获取验证码");
  780. persionCountDown = 0;
  781. return;
  782. }
  783. psSmsBtn.attr("disabled", true);
  784. psSmsBtn.html(persionCountDown + "秒");
  785. persionCountDown--;
  786. setTimeout("Register.getPersionBtnCountDown()", 1000);
  787. };
  788. /**
  789. * 企业用户注册回调
  790. */
  791. Register.epCallBack = function (data) {
  792. lock = false;
  793. var nowDis = $("#type").prop("disabled");
  794. if (isDis != nowDis) {
  795. $("#type").attr("disabled", "disabled");
  796. }
  797. Feng.info(data.msg);
  798. if (data.code == 200) {
  799. parent.layer.close(window.parent.Login.layerIndex);
  800. }
  801. };
  802. Register.typeChange = function () {
  803. $("#type").removeAttr("disabled");
  804. var type = $("#type").val();
  805. if (type == 1) {
  806. $(".agencyType").attr("style", "display:block");
  807. $("#bankCard").parent().find("span").css("display", "");
  808. $("#bankNetwork").parent().find("span").css("display", "");
  809. $("#bank").parent().find("span").css("display", "");
  810. $("#bankImg").parent().find("span").css("display", "");
  811. } else {
  812. $(".agencyType").attr("style", "display:none");
  813. $("#typeGroup").attr("style", "display:none");
  814. $("#enterpriseTag,#industryFieldNew,#industryFieldOld,#enterpriseType").val("");
  815. $("#bankCard").parent().find("span").css("display", "none");
  816. $("#bankNetwork").parent().find("span").css("display", "none");
  817. $("#bank").parent().find("span").css("display", "none");
  818. $("#bankImg").parent().find("span").css("display", "none");
  819. }
  820. }
  821. Register.agencyTypeChange = function () {
  822. var agencyType = $("#agencyType").val();
  823. switch (agencyType) {
  824. case "1":
  825. $("#typeGroup").attr("style", "display:block");
  826. $(".agencyType1").attr("style", "");
  827. $(".agencyType2").attr("style", "");
  828. break;
  829. case "2":
  830. $("#typeGroup").attr("style", "display:block");
  831. $(".agencyType1").attr("style", "display:none");
  832. $(".agencyType2").attr("style", "");
  833. $("#industryFieldNew").val("");
  834. $("#industryFieldOld").val("");
  835. break;
  836. default:
  837. $("#typeGroup").attr("style", "display:none");
  838. break;
  839. }
  840. }
  841. Register.industryChange = function () {
  842. var industryNew = $("#industryFieldNew").val();
  843. var arr = [{"name": "industryFieldOld", "code": industryNew + "_field"}];
  844. Feng.findChildDictBatch(JSON.stringify(arr));
  845. }
  846. Register.afterSelectProvince = function (prefix) {
  847. var province = $("#" + prefix + "_province").val();
  848. $("#" + prefix + "_city").empty();
  849. $("#" + prefix + "_county").empty();
  850. if (province == null || province == '') {
  851. return;
  852. }
  853. Feng.addAjaxSelect({
  854. "id": prefix + "_city",
  855. "displayCode": "code",
  856. "displayName": "name",
  857. "type": "GET",
  858. "url": Feng.ctxPath + "/common/tool/findCityByProvinceSelect/code/" + province
  859. });
  860. }
  861. /**
  862. * 加载县
  863. */
  864. Register.afterSelectCity = function (prefix) {
  865. var city = $("#" + prefix + "_city").val();
  866. $("#" + prefix + "_county").empty();
  867. if (city == null || city == '') {
  868. return;
  869. }
  870. Feng.addAjaxSelect({
  871. "id": prefix + "_county",
  872. "displayCode": "code",
  873. "displayName": "name",
  874. "type": "GET",
  875. "url": Feng.ctxPath + "/common/tool/findCountyByCitySelect/code/" + city
  876. });
  877. }
  878. $(function () {
  879. $('#ep_form').bootstrapValidator({
  880. feedbackIcons: {
  881. valid: 'glyphicon glyphicon-ok',
  882. invalid: 'glyphicon glyphicon-remove',
  883. validating: 'glyphicon glyphicon-refresh'
  884. },
  885. group: '.rowGroup',
  886. fields: Register.validateFields,
  887. live: 'enabled',
  888. message: '该字段不能为空'
  889. });
  890. var userType = Feng.getUrlValue("userType");
  891. var username = Feng.getUrlValue("username");
  892. var name = Feng.getUrlValue("name");
  893. var idCard = Feng.getUrlValue("idCard");
  894. var type = Feng.getUrlValue("type");
  895. if (userType == 1) { //企业用户trigger
  896. $("#source").val(2);
  897. $("#username").val(username).attr("readonly", "readonly");
  898. $("#name").val(name).attr("readonly", "readonly");
  899. $("#idCard").val(idCard).attr("readonly", "readonly");
  900. $("#type").val(type).trigger("change");
  901. $("#type").attr("disabled", "disabled");
  902. $("#password").val("").attr("placeholder", "密码为聚才网账号密码").attr("readonly", "readonly");
  903. $("#re_password").val("").attr("placeholder", "密码为聚才网账号密码").attr("readonly", "readonly");
  904. $("#personTab").css("pointer-events", "none");
  905. } else if (userType == 2) { //个人用户
  906. $("#personTab").css("pointer-events", "block");
  907. $("#personTab").children().click();
  908. $("#ps_source").val(2);
  909. $("#ps_username").val(name).attr("readonly", "readonly");
  910. $("#ps_idCard").val(idCard).attr("readonly", "readonly");
  911. $("#ps_password").val("").attr("placeholder", "密码为聚才网账号密码").attr("readonly", "readonly");
  912. $("#ps_re_password").val("").attr("placeholder", "密码为聚才网账号密码").attr("readonly", "readonly");
  913. $("#enTab").css("pointer-events", "none");
  914. } else { //无
  915. }
  916. var arr = [
  917. {"name": "street", "code": "street"},
  918. {"name": "enterpriseTag", "code": "enterprise_tag"},
  919. {"name": "organizationTag", "code": "organization_tag"},
  920. {"name": "institutionTag", "code": "institution_tag"},
  921. {"name": "industryFieldNew", "code": "industry_field"},
  922. {"name": "enterpriseType", "code": "enterprise_type"},
  923. {"name": "sy_street", "code": "street"},
  924. {"name": "mf_street", "code": "street"},
  925. {"name": "agencyType", "code": "agency_type"}];
  926. Feng.findChildDictBatch(JSON.stringify(arr));
  927. $("#imgurl,#sy_imgurl,#mf_imgurl,#wj_imgurl,#wj_bankImg,#gj_imgurl,#bankImg,#mf_bankImg,#sy_bankImg,#beian,#domainImg,#typeImg").change(function (e) {
  928. var that = this;
  929. if (!Feng.chkFileInvalid(that.files[0], 5, 10)) {
  930. return;
  931. }
  932. var file = that.files[0];
  933. var imgSrc;
  934. var reader = new FileReader();
  935. reader.readAsDataURL(file);
  936. reader.onload = function () {
  937. if (Feng.isImg(file.type)) {
  938. imgSrc = this.result;
  939. $(that).prev("img").attr("src", imgSrc);
  940. } else {
  941. $(that).prev("img").attr("src", Feng.ctxPath + "/static/img/Pdf.png");
  942. }
  943. };
  944. });
  945. //加载省份
  946. Feng.addAjaxSelect({
  947. "id": "wj_province",
  948. "displayCode": "code",
  949. "displayName": "name",
  950. "type": "GET",
  951. "url": Feng.ctxPath + "/common/tool/getProvinceSelect"
  952. });
  953. var provinceList = $("#wj_province option").clone();
  954. $("#gj_province").html(provinceList);
  955. });