register.js 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802
  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 special = $("#ep_form .active").attr("special");
  111. $("#special").val(special)
  112. $('#ep_form').bootstrapValidator({
  113. feedbackIcons: {
  114. valid: 'glyphicon glyphicon-ok',
  115. invalid: 'glyphicon glyphicon-remove',
  116. validating: 'glyphicon glyphicon-refresh'
  117. },
  118. group: '.rowGroup',
  119. fields: Register.validateFields,
  120. live: 'enabled',
  121. message: '该字段不能为空'
  122. });
  123. switch (special) {
  124. case 'qiye':
  125. $("#tab-3 .form-control").removeAttr("disabled");
  126. $("#tab-4 .form-control").attr("disabled", "disabled");
  127. $("#tab-5 .form-control").attr("disabled", "disabled");
  128. $('#ep_form').bootstrapValidator("addField", "idCard", {validators: {notEmpty: {message: '统一社会信用代码不能为空'}}});
  129. $('#ep_form').bootstrapValidator("addField", "legal", {validators: {notEmpty: {message: '法人代表不能为空'}}});//, regexp: {regexp: /^[\u4e00-\u9fa5]{1,50}$/, message: "法人代表只允许中文"}
  130. $('#ep_form').bootstrapValidator("addField", "bankCard", {validators: {notEmpty: {message: '开户银行账号不能为空'}}});
  131. $('#ep_form').bootstrapValidator("addField", "bankNetwork", {validators: {notEmpty: {message: '开户银行网点不能为空'},
  132. regexp: {
  133. regexp: /^[\u4e00-\u9fa5]*银行[\u4e00-\u9fa5]*$/,
  134. message: "开户银行网点格式不正确"
  135. }}});
  136. $('#ep_form').bootstrapValidator("addField", "bank", {validators: {notEmpty: {message: '开户银行不能为空'}, regexp: {
  137. regexp: /^[\u4e00-\u9fa5]*$/,
  138. message: "开户银行必须为中文"
  139. }}});
  140. var prefix = '企业';
  141. break;
  142. case 'minfei':
  143. $("#tab-5 .form-control").removeAttr("disabled");
  144. $("#tab-4 .form-control").attr("disabled", "disabled");
  145. $("#tab-3 .form-control").attr("disabled", "disabled");
  146. $('#ep_form').bootstrapValidator("addField", "idCard", {validators: {notEmpty: {message: '统一社会信用代码不能为空'}}});
  147. $('#ep_form').bootstrapValidator("addField", "legal", {validators: {notEmpty: {message: '法人代表不能为空'}}});//, regexp: {regexp: /^[\u4e00-\u9fa5]{1,50}$/, message: "法人代表只允许中文"}
  148. $('#ep_form').bootstrapValidator("addField", "bankCard", {validators: {notEmpty: {message: '开户银行账号不能为空'}}});
  149. $('#ep_form').bootstrapValidator("addField", "bankNetwork", {validators: {notEmpty: {message: '开户银行网点不能为空'},
  150. regexp: {
  151. regexp: /^[\u4e00-\u9fa5]*银行[\u4e00-\u9fa5]*$/,
  152. message: "开户银行网点格式不正确"
  153. }}});
  154. $('#ep_form').bootstrapValidator("addField", "bank", {validators: {notEmpty: {message: '开户银行不能为空'}, regexp: {
  155. regexp: /^[\u4e00-\u9fa5]*$/,
  156. message: "开户银行必须为中文"
  157. }}});
  158. var prefix = '企业';
  159. break;
  160. case 'shiye':
  161. $("#tab-4 .form-control").removeAttr("disabled");
  162. $("#tab-3 .form-control").attr("disabled", "disabled");
  163. $('#ep_form').bootstrapValidator("removeField", "idCard");
  164. $('#ep_form').bootstrapValidator("removeField", "legal");
  165. $('#ep_form').bootstrapValidator("removeField", "bankCard");
  166. $('#ep_form').bootstrapValidator("removeField", "bankNetwork");
  167. $('#ep_form').bootstrapValidator("removeField", "bank");
  168. var prefix = '单位';
  169. break;
  170. }
  171. if (!Register.validate()) {
  172. return;
  173. }
  174. isDis = $("#type").prop("disabled");
  175. var source = $("#source").val();
  176. switch (special) {
  177. case 'qiye':
  178. var username = $("#username").val();
  179. var password = $("#password").val();
  180. var rePassword = $("#re_password").val();
  181. var name = $("#name").val();
  182. var idCard = $("#idCard").val();
  183. var legal = $("#legal").val();
  184. var street = $("#street").val();
  185. var address = $("#address").val();
  186. var ephone = $("#ephone").val();
  187. var bankCard = $("#bankCard").val();
  188. var bank = $("#bank").val();
  189. var bankNetwork = $("#bankNetwork").val();
  190. break;
  191. case 'minfei':
  192. var username = $("#mf_username").val();
  193. var password = $("#mf_password").val();
  194. var rePassword = $("#mf_re_password").val();
  195. var name = $("#mf_name").val();
  196. var idCard = $("#mf_idCard").val();
  197. var legal = $("#mf_legal").val();
  198. var street = $("#mf_street").val();
  199. var address = $("#mf_address").val();
  200. var ephone = $("#mf_ephone").val();
  201. var bankCard = $("#mf_bankCard").val();
  202. var bank = $("#mf_bank").val();
  203. var bankNetwork = $("#mf_bankNetwork").val();
  204. break;
  205. case 'shiye':
  206. var username = $("#sy_username").val();
  207. var password = $("#sy_password").val();
  208. var rePassword = $("#sy_re_password").val();
  209. var name = $("#sy_name").val();
  210. var street = $("#sy_street").val();
  211. var address = $("#sy_address").val();
  212. var ephone = $("#sy_ephone").val();
  213. break;
  214. }
  215. var agentName = $("#agentName").val();
  216. var agentPhone = $("#agentPhone").val();
  217. var verificationCode = $("#verificationCode").val();
  218. if (isDis) {
  219. $("#type").removeAttr("disabled");
  220. }
  221. var type = $("#type").val();
  222. var agencyType = $("#agencyType").val();
  223. var agentEmail = $("#agentEmail").val();
  224. var enterpriseTag = $("#enterpriseTag").val();
  225. var enterpriseType = $("#enterpriseType").val();
  226. var industryFieldNew = $("#industryFieldNew").val();
  227. var industryFieldOld = $("#industryFieldOld").val();
  228. if (username == null || username == '') {
  229. Feng.info("请填写账号!");
  230. return;
  231. }
  232. if (username.length > 50) {
  233. Feng.info("账号最多50个字符!");
  234. return;
  235. }
  236. if (source != 2) {
  237. if (password == null || password == '') {
  238. Feng.info("请填写密码!");
  239. return;
  240. }
  241. if (!/^(?=.*\d)(?=.*[a-zA-Z]).{8,20}$/.test(password)) {
  242. Feng.info("密码格式错误,密码由字母与数字组成,且长度必须8个字符及以上!");
  243. return;
  244. }
  245. if (rePassword == null || rePassword == '') {
  246. Feng.info("请填写重复密码!");
  247. return;
  248. }
  249. if (password != rePassword) {
  250. Feng.info("两次密码填写不一致!");
  251. return;
  252. }
  253. }
  254. if (name == null || name == '') {
  255. Feng.info("请填写" + prefix + "名称!");
  256. return;
  257. }
  258. /*if (!/^([\u4E00-\u9FA5]|\(|\)|\(|\)){1,100}$/.test(name)) {
  259. Feng.info(prefix + "名称只能输入中文 !");
  260. return;
  261. }*/
  262. if (name.length > 100) {
  263. Feng.info(prefix + "名称最多100个字符!");
  264. return;
  265. }
  266. if (ephone == null || ephone == '') {
  267. Feng.info("请填写" + prefix + "电话");
  268. return;
  269. }
  270. if (street == null || street == '') {
  271. Feng.info("请选择所属街道!");
  272. return;
  273. }
  274. if (address == null || address == '') {
  275. Feng.info("请填写单位地址!");
  276. return;
  277. }
  278. switch (special) {
  279. case 'qiye':
  280. if ((idCard == null || idCard == '')) {
  281. Feng.info("请填写统一社会信用代码!");
  282. return;
  283. }
  284. if (idCard.length > 40) {
  285. Feng.info("统一社会信用代码最多40个字符!");
  286. return;
  287. }
  288. if (legal == null || legal == '') {
  289. Feng.info("请填写法人代表!");
  290. return;
  291. }
  292. /*if (!/^[\u4e00-\u9fa5]{1,50}$/.test(legal)) {
  293. Feng.info("法人代表只能输入中文 !");
  294. return;
  295. }*/
  296. if (bankCard == null || bankCard == '') {
  297. Feng.info("请填写企业银行账号!");
  298. return;
  299. }
  300. if (bank == null || bank == '') {
  301. Feng.info("请填写企业开户银行!");
  302. return;
  303. }
  304. if (bankNetwork == null || bankNetwork == '') {
  305. Feng.info("请填写企业开户银行网点");
  306. return;
  307. }
  308. var x = document.getElementById("imgurl").value;
  309. if (x == "") {
  310. Feng.info("请上传营业执照照片!");
  311. return;
  312. }
  313. if (!Feng.chkFileInvalid(document.getElementById("imgurl").files[0], 5, 10, ["image/jpeg", "image/gif", "image/png", "image/jpg", "application/pdf"], "营业执照只允许上传PDF或图片")) {
  314. return;
  315. }
  316. var xx = document.getElementById("bankImg").value;
  317. if (xx == "") {
  318. Feng.info("请上传开户银行许可证!");
  319. return;
  320. }
  321. if (!Feng.chkFileInvalid(document.getElementById("bankImg").files[0], 5, 10, ["image/jpeg", "image/gif", "image/png", "image/jpg", "application/pdf"], "开户银行许可证只允许上传PDF或图片")) {
  322. return;
  323. }
  324. if (type == null || type == '') {
  325. Feng.info("请选择申报类型!");
  326. return;
  327. }
  328. if (type == 1) {
  329. if (agencyType == null || agencyType == '') {
  330. Feng.info("请选择机构类型");
  331. return;
  332. }
  333. switch (agencyType) {
  334. case "1":
  335. if (industryFieldNew == null || industryFieldNew == '') {
  336. Feng.info("请选择产业领域");
  337. return;
  338. }
  339. if (industryFieldOld == null || industryFieldOld == '') {
  340. Feng.info("请选择行业领域");
  341. return;
  342. }
  343. var xxx = document.getElementById("domainImg").value;
  344. if (xxx == "") {
  345. Feng.info("请上传行业领域佐证材料!");
  346. return;
  347. }
  348. if (!Feng.chkFileInvalid(document.getElementById("domainImg").files[0], 5, 10, ["image/jpeg", "image/gif", "image/png", "image/jpg", "application/pdf"], "行业领域佐证材料只允许上传PDF或图片")) {
  349. return;
  350. }
  351. break;
  352. case "2":
  353. break;
  354. }
  355. if (enterpriseTag == null || enterpriseTag == '') {
  356. Feng.info("请选择企业标签!");
  357. return;
  358. }
  359. if (enterpriseType == null || enterpriseType == '') {
  360. Feng.info("请选择企业类型!");
  361. return;
  362. }
  363. var checkType = ["guishang", "gaoxinjishu", "zhuanjingtexin"];
  364. if (checkType.indexOf(enterpriseType) > -1) {
  365. var typeImg = document.getElementById("typeImg").value;
  366. if (typeImg == "") {
  367. Feng.info("规上、高新技术、专精特新企业需要上传佐证材料!");
  368. return;
  369. }
  370. if (!Feng.chkFileInvalid(document.getElementById("typeImg").files[0], 5, 10, ["image/jpeg", "image/gif", "image/png", "image/jpg", "application/pdf"], "规上、高新技术、专精特新企业佐证材料只允许上传PDF或图片")) {
  371. return;
  372. }
  373. }
  374. }
  375. break;
  376. case 'minfei':
  377. if ((idCard == null || idCard == '')) {
  378. Feng.info("请填写统一社会信用代码!");
  379. return;
  380. }
  381. if (idCard.length > 40) {
  382. Feng.info("统一社会信用代码最多40个字符!");
  383. return;
  384. }
  385. if (legal == null || legal == '') {
  386. Feng.info("请填写法人代表!");
  387. return;
  388. }
  389. /*if (!/^[\u4e00-\u9fa5]{1,50}$/.test(legal)) {
  390. Feng.info("法人代表只能输入中文 !");
  391. return;
  392. }*/
  393. if (bankCard == null || bankCard == '') {
  394. Feng.info("请填写机构银行账号!");
  395. return;
  396. }
  397. if (bank == null || bank == '') {
  398. Feng.info("请填写机构开户银行!");
  399. return;
  400. }
  401. if (bankNetwork == null || bankNetwork == '') {
  402. Feng.info("请填写机构开户银行网点");
  403. return;
  404. }
  405. var x = document.getElementById("mf_imgurl").value;
  406. if (x == "") {
  407. Feng.info("请上传营业执照照片!");
  408. return;
  409. }
  410. if (!Feng.chkFileInvalid(document.getElementById("mf_imgurl").files[0], 5, 10, ["image/jpeg", "image/gif", "image/png", "image/jpg", "application/pdf"], "营业执照只允许上传PDF或图片")) {
  411. return;
  412. }
  413. var xx = document.getElementById("mf_bankImg").value;
  414. if (xx == "") {
  415. Feng.info("请上传开户银行许可证!");
  416. return;
  417. }
  418. if (!Feng.chkFileInvalid(document.getElementById("mf_bankImg").files[0], 5, 10, ["image/jpeg", "image/gif", "image/png", "image/jpg", "application/pdf"], "开户银行许可证只允许上传PDF或图片")) {
  419. return;
  420. }
  421. break;
  422. case 'shiye':
  423. var x = document.getElementById("sy_imgurl").value;
  424. if (x == "") {
  425. Feng.info("请上传法人证或批文!");
  426. return;
  427. }
  428. if (!Feng.chkFileInvalid(document.getElementById("sy_imgurl").files[0], 5, 10, ["image/jpeg", "image/gif", "image/png", "image/jpg", "application/pdf"], "法人证或批文只允许上传PDF或图片")) {
  429. return;
  430. }
  431. break;
  432. }
  433. if (agentName == null || agentName == '') {
  434. Feng.info("请填写人才联络员!");
  435. return;
  436. }
  437. if (agentName.length > 30) {
  438. Feng.info("人才联络员最多30个字符!");
  439. return;
  440. }
  441. if (agentPhone == null || agentPhone == '') {
  442. Feng.info("请填写人才联络员电话!");
  443. return;
  444. }
  445. if (verificationCode == null || verificationCode == '') {
  446. Feng.info("请填写手机验证码!");
  447. return;
  448. }
  449. if (agentEmail == null || agentEmail == '') {
  450. Feng.info("请填写电子邮箱!");
  451. return;
  452. }
  453. var xxxx = document.getElementById("beian").value;
  454. if (xxxx == "") {
  455. Feng.info("请上传人才联络员信息备案表!");
  456. return;
  457. }
  458. if (!Feng.chkFileInvalid(document.getElementById("beian").files[0], 5, 10, ["image/jpeg", "image/gif", "image/png", "image/jpg", "application/pdf"], "人才联络员信息备案表只允许上传PDF或图片")) {
  459. return;
  460. }
  461. 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)) {
  462. Feng.info(prefix + "电话格式不合法!");
  463. return;
  464. }
  465. 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)) {
  466. Feng.info("人才联络员电话格式不合法!");
  467. return;
  468. }
  469. if (!/[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/.test(agentEmail)) {
  470. Feng.info("电子邮箱格式不合法!");
  471. return;
  472. }
  473. if (!lock) {
  474. lock = true;
  475. } else {
  476. Feng.info("不能重复点击");
  477. return;
  478. }
  479. $("#ep_form")[0].submit();
  480. };
  481. Register.changeEnterpriseType = function () {
  482. var enterpriseType = $("#enterpriseType").val();
  483. switch (enterpriseType) {
  484. case "guishang":
  485. console.log("规上")
  486. $("#typeName").text("规上");
  487. $("td.typeUploader").css("display", "table-cell");
  488. break;
  489. case "gaoxinjishu":
  490. console.log("高新技术")
  491. $("#typeName").html("高新技术");
  492. $("td.typeUploader").css("display", "table-cell");
  493. break;
  494. case "zhuanjingtexin":
  495. console.log("专精特新")
  496. $("#typeName").html("专精特新");
  497. $("td.typeUploader").css("display", "table-cell");
  498. break;
  499. default:
  500. $("td.typeUploader").css("display", "none");
  501. break;
  502. }
  503. };
  504. Register.personUserRegister = function () {
  505. var source = $("#ps_source").val();
  506. var username = $("#ps_username").val();
  507. var password = $("#ps_password").val();
  508. var rePassword = $("#ps_re_password").val();
  509. var name = $("#ps_name").val();
  510. var sex = $("#ps_sex").val();
  511. var idCard = $("#ps_idCard").val();
  512. var phone = $("#ps_phone").val();
  513. var verificationCode = $("#ps_verificationCode").val();
  514. if (username == null || username == '') {
  515. Feng.info("请填写账号!");
  516. return;
  517. }
  518. if (username.length > 50) {
  519. Feng.info("账号最多20个字符!");
  520. return;
  521. }
  522. if (source != 2) {
  523. if (password == null || password == '') {
  524. Feng.info("请填写密码!");
  525. return;
  526. }
  527. if (rePassword == null || rePassword == '') {
  528. Feng.info("请填写重复密码!");
  529. return;
  530. }
  531. if (password != rePassword) {
  532. Feng.info("两次密码填写不一致!");
  533. return;
  534. }
  535. }
  536. if (name == null || name == '') {
  537. Feng.info("请填写姓名!");
  538. return;
  539. }
  540. if (name.length > 20) {
  541. Feng.info("姓名最多20个字符!");
  542. return;
  543. }
  544. if (sex == null || sex == '') {
  545. Feng.info("请选择性别!");
  546. return;
  547. }
  548. if (idCard == null || idCard == '') {
  549. Feng.info("请填写身份证号!");
  550. return;
  551. }
  552. if (phone == null || phone == '') {
  553. Feng.info("请填写手机号!");
  554. return;
  555. }
  556. if (verificationCode == null || verificationCode == '') {
  557. Feng.info("请填写手机验证码!")
  558. return;
  559. }
  560. if (!/0?(13|14|15|17|18|19)[0-9]{9}/.test(phone)) {
  561. Feng.info("手机号格式不合法!");
  562. return;
  563. }
  564. var da = {"source": source, "username": username, "password": password, "name": name, "sex": sex, "idCard": idCard, "phone": phone, "verificationCode": verificationCode};
  565. var ajax = new $ax(Feng.ctxPath + "/api/personalUser/register", function (data) {
  566. Feng.info(data.msg);
  567. if (data.code == 200) {
  568. parent.layer.close(window.parent.Login.layerIndex);
  569. }
  570. }, function (data) {
  571. Feng.error("操作失败!" + data.responseJSON.message + "!");
  572. });
  573. ajax.set(da);
  574. ajax.start();
  575. };
  576. Register.getEnterpriseSms = function () {
  577. var agentPhone = $("#agentPhone").val();
  578. if (agentPhone == null || agentPhone == "") {
  579. Feng.info("请填写人才联络员手机号!");
  580. return;
  581. }
  582. agentPhone = $.trim(agentPhone);
  583. if (!Feng.checkMobilePhoneNum(agentPhone)) {
  584. Feng.info("手机号格式有误,请填写正确的手机号码!");
  585. return;
  586. }
  587. Register.enterpriseBtnCountDown();
  588. var ajax = new $ax(Feng.ctxPath + "/common/auth/verificationCode?phone=" + agentPhone + "&type=1", function (data) {
  589. Feng.info(data.msg);
  590. }, function (data) {
  591. Feng.error("操作失败!" + data.responseJSON.message + "!");
  592. });
  593. ajax.set(null);
  594. ajax.start();
  595. };
  596. Register.enterpriseBtnCountDown = function () {
  597. if (enterpriseCountDown == 0) {
  598. enterpriseCountDown = 60;
  599. } else if (enterpriseCountDown == 1) {
  600. enterpriseSmsBtn.removeAttr("disabled");
  601. enterpriseSmsBtn.html("获取验证码");
  602. enterpriseCountDown = 0;
  603. return;
  604. }
  605. enterpriseSmsBtn.attr("disabled", true);
  606. enterpriseSmsBtn.html(enterpriseCountDown + "秒");
  607. enterpriseCountDown--;
  608. setTimeout("Register.enterpriseBtnCountDown()", 1000);
  609. };
  610. Register.getPersionSms = function () {
  611. var phone = $("#ps_phone").val();
  612. if (phone == null || phone == "") {
  613. Feng.info("请填写手机号!");
  614. return;
  615. }
  616. phone = $.trim(phone);
  617. if (!Feng.checkMobilePhoneNum(phone)) {
  618. Feng.info("手机号格式有误,请填写正确的手机号码!");
  619. return;
  620. }
  621. Register.getPersionBtnCountDown();
  622. var ajax = new $ax(Feng.ctxPath + "/common/auth/verificationCode?phone=" + phone + "&type=1", function (data) {
  623. Feng.info(data.msg);
  624. }, function (data) {
  625. Feng.error("操作失败!" + data.responseJSON.message + "!");
  626. });
  627. ajax.set(null);
  628. ajax.start();
  629. };
  630. Register.getPersionBtnCountDown = function () {
  631. if (persionCountDown == 0) {
  632. persionCountDown = 60;
  633. } else if (persionCountDown == 1) {
  634. psSmsBtn.removeAttr("disabled");
  635. psSmsBtn.html("获取验证码");
  636. persionCountDown = 0;
  637. return;
  638. }
  639. psSmsBtn.attr("disabled", true);
  640. psSmsBtn.html(persionCountDown + "秒");
  641. persionCountDown--;
  642. setTimeout("Register.getPersionBtnCountDown()", 1000);
  643. };
  644. /**
  645. * 企业用户注册回调
  646. */
  647. Register.epCallBack = function (data) {
  648. lock = false;
  649. var nowDis = $("#type").prop("disabled");
  650. if (isDis != nowDis) {
  651. $("#type").attr("disabled", "disabled");
  652. }
  653. Feng.info(data.msg);
  654. if (data.code == 200) {
  655. parent.layer.close(window.parent.Login.layerIndex);
  656. }
  657. };
  658. Register.typeChange = function () {
  659. $("#type").removeAttr("disabled");
  660. var type = $("#type").val();
  661. if (type == 1) {
  662. $(".agencyType").attr("style", "display:block");
  663. } else {
  664. $(".agencyType").attr("style", "display:none");
  665. $("#typeGroup").attr("style", "display:none");
  666. $("#enterpriseTag,#industryFieldNew,#industryFieldOld,#enterpriseType").val("");
  667. }
  668. }
  669. Register.agencyTypeChange = function () {
  670. var agencyType = $("#agencyType").val();
  671. switch (agencyType) {
  672. case "1":
  673. $("#typeGroup").attr("style", "display:block");
  674. $(".agencyType1").attr("style", "");
  675. $(".agencyType2").attr("style", "");
  676. break;
  677. case "2":
  678. $("#typeGroup").attr("style", "display:block");
  679. $(".agencyType1").attr("style", "display:none");
  680. $(".agencyType2").attr("style", "");
  681. $("#industryFieldNew").val("");
  682. $("#industryFieldOld").val("");
  683. break;
  684. default:
  685. $("#typeGroup").attr("style", "display:none");
  686. break;
  687. }
  688. }
  689. Register.industryChange = function () {
  690. var industryNew = $("#industryFieldNew").val();
  691. var arr = [{"name": "industryFieldOld", "code": industryNew + "_field"}];
  692. Feng.findChildDictBatch(JSON.stringify(arr));
  693. }
  694. $(function () {
  695. $('#ep_form').bootstrapValidator({
  696. feedbackIcons: {
  697. valid: 'glyphicon glyphicon-ok',
  698. invalid: 'glyphicon glyphicon-remove',
  699. validating: 'glyphicon glyphicon-refresh'
  700. },
  701. group: '.rowGroup',
  702. fields: Register.validateFields,
  703. live: 'enabled',
  704. message: '该字段不能为空'
  705. });
  706. var userType = Feng.getUrlValue("userType");
  707. var username = Feng.getUrlValue("username");
  708. var name = Feng.getUrlValue("name");
  709. var idCard = Feng.getUrlValue("idCard");
  710. var type = Feng.getUrlValue("type");
  711. if (userType == 1) { //企业用户trigger
  712. $("#source").val(2);
  713. $("#username").val(username).attr("readonly", "readonly");
  714. $("#name").val(name).attr("readonly", "readonly");
  715. $("#idCard").val(idCard).attr("readonly", "readonly");
  716. $("#type").val(type).trigger("change");
  717. $("#type").attr("disabled", "disabled");
  718. $("#password").val("").attr("placeholder", "密码为聚才网账号密码").attr("readonly", "readonly");
  719. $("#re_password").val("").attr("placeholder", "密码为聚才网账号密码").attr("readonly", "readonly");
  720. $("#personTab").css("pointer-events", "none");
  721. } else if (userType == 2) { //个人用户
  722. $("#personTab").css("pointer-events", "block");
  723. $("#personTab").children().click();
  724. $("#ps_source").val(2);
  725. $("#ps_username").val(name).attr("readonly", "readonly");
  726. $("#ps_idCard").val(idCard).attr("readonly", "readonly");
  727. $("#ps_password").val("").attr("placeholder", "密码为聚才网账号密码").attr("readonly", "readonly");
  728. $("#ps_re_password").val("").attr("placeholder", "密码为聚才网账号密码").attr("readonly", "readonly");
  729. $("#enTab").css("pointer-events", "none");
  730. } else { //无
  731. }
  732. var arr = [
  733. {"name": "street", "code": "street"},
  734. {"name": "enterpriseTag", "code": "enterprise_tag"},
  735. {"name": "organizationTag", "code": "organization_tag"},
  736. {"name": "institutionTag", "code": "institution_tag"},
  737. {"name": "industryFieldNew", "code": "industry_field"},
  738. {"name": "enterpriseType", "code": "enterprise_type"},
  739. {"name": "sy_street", "code": "street"},
  740. {"name": "mf_street", "code": "street"},
  741. {"name": "agencyType", "code": "agency_type"}];
  742. Feng.findChildDictBatch(JSON.stringify(arr));
  743. $("#imgurl,#sy_imgurl,#mf_imgurl,#bankImg,#mf_bankImg,#sy_bankImg,#beian,#domainImg,#typeImg").change(function (e) {
  744. var that = this;
  745. if (!Feng.chkFileInvalid(that.files[0], 5, 10)) {
  746. return;
  747. }
  748. var file = that.files[0];
  749. var imgSrc;
  750. var reader = new FileReader();
  751. reader.readAsDataURL(file);
  752. reader.onload = function () {
  753. if (Feng.isImg(file.type)) {
  754. imgSrc = this.result;
  755. $(that).prev("img").attr("src", imgSrc);
  756. } else {
  757. $(that).prev("img").attr("src", Feng.ctxPath + "/static/img/Pdf.png");
  758. }
  759. };
  760. });
  761. });