register.js 32 KB

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