talentInfo_info.js 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087
  1. /**
  2. * 初始化人才认定申报详情对话框
  3. */
  4. var locked = false;
  5. var step = $("#step").val();
  6. var TalentInfoInfoDlg = step == 1 ? {
  7. talentInfoInfoData: {},
  8. validateFields: {
  9. source_county: {validators: {notEmpty: {message: '入选来源县市区不能为空'}}},
  10. talent_type: {validators: {notEmpty: {message: '人才类型不能为空'}}},
  11. name: {validators: {notEmpty: {message: '姓名不能为空'}}},
  12. card_type: {validators: {notEmpty: {message: '证件类型不能为空'}}},
  13. card_number: {
  14. validators: {
  15. notEmpty: {message: '证件号码不能为空'},
  16. regexp: {
  17. regexp: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
  18. message: "身份证号码格式不正确"
  19. }
  20. }
  21. },
  22. sex: {validators: {notEmpty: {message: '性别不能为空'}}},
  23. birthday: {validators: {notEmpty: {message: '出生日期不能为空'}}},
  24. nationality: {validators: {notEmpty: {message: '国籍/地区不能为空'}}},
  25. province: {validators: {notEmpty: {message: '户籍省份不能为空'}}},
  26. city: {validators: {notEmpty: {message: '户籍市不能为空'}}},
  27. nation: {validators: {notEmpty: {message: '民族不能为空'}}},
  28. politics: {validators: {notEmpty: {message: '政治面貌不能为空'}}},
  29. experience: {validators: {notEmpty: {message: '工作简历不能为空'}}},
  30. education: {validators: {notEmpty: {message: '教育背景不能为空'}}}
  31. }
  32. } : {
  33. talentInfoInfoData: {},
  34. validateFields: {
  35. apply_year: {validators: {notEmpty: {message: '申报年度不能为空'}}},
  36. import_way: {validators: {notEmpty: {message: '引进方式不能为空'}}},
  37. cur_entry_time: {validators: {notEmpty: {message: '本单位入职时间不能为空'}}},
  38. position: {validators: {notEmpty: {message: '本单位现任职务不能为空'}}},
  39. source: {validators: {notEmpty: {message: '申报来源不能为空'}}},
  40. talent_arrange: {validators: {notEmpty: {message: '人才层次不能为空'}}},
  41. talent_condition: {validators: {notEmpty: {message: '认定条件不能为空'}}},
  42. highest_degree: {validators: {notEmpty: {message: '最高学历不能为空'}}},
  43. graduate_school: {validators: {notEmpty: {message: '毕业院校不能为空'}}},
  44. major: {validators: {notEmpty: {message: '专业不能为空'}}},
  45. bank: {
  46. validators: {
  47. notEmpty: {
  48. message: '开户银行不能为空'
  49. },
  50. regexp: {
  51. regexp: /^[\u4e00-\u9fa5]*银行$/,
  52. message: "开户银行格式不正确"
  53. }
  54. }
  55. },
  56. bank_number: {
  57. validators: {
  58. notEmpty: {
  59. message: '银行行号不能为空'
  60. },
  61. regexp: {
  62. regexp: /^\d+$/,
  63. message: "银行行号格式不正确"
  64. }
  65. }
  66. },
  67. bank_branch_name: {
  68. validators: {
  69. notEmpty: {
  70. message: '开户银行网点不能为空'
  71. },
  72. regexp: {
  73. regexp: /^[\u4e00-\u9fa5]*银行[\u4e00-\u9fa5]*省?[\u4e00-\u9fa5]+市[\u4e00-\u9fa5]*$/,
  74. message: "开户银行格式不正确"
  75. }
  76. }
  77. },
  78. bank_account: {
  79. validators: {
  80. notEmpty: {
  81. message: '银行账号不能为空'
  82. },
  83. regexp: {
  84. regexp: /^\d+$/,
  85. message: "银行账号格式不正确"
  86. }
  87. }
  88. },
  89. phone: {
  90. validators: {
  91. notEmpty: {
  92. message: '手机号码不能为空'
  93. },
  94. regexp: {
  95. regexp: /0?(13|14|15|17|18|19)[0-9]{9}/,
  96. message: "手机号码格式不正确"
  97. }
  98. }
  99. },
  100. email: {
  101. validators: {
  102. notEmpty: {
  103. message: '电子邮箱不能为空'
  104. },
  105. emailAddress: {
  106. message: "电子邮箱格式不正确"
  107. }
  108. }
  109. }
  110. }
  111. };
  112. /**
  113. * 清除数据
  114. */
  115. TalentInfoInfoDlg.clearData = function () {
  116. this.talentInfoInfoData = {};
  117. }
  118. /**
  119. * 设置对话框中的数据
  120. *
  121. * @param key 数据的名称
  122. * @param val 数据的具体值
  123. */
  124. TalentInfoInfoDlg.set = function (key, val) {
  125. var dis = $("#" + key).attr("disabled");
  126. if (dis == "disabled") {
  127. $("#" + key).removeAttr("disabled");
  128. }
  129. this.talentInfoInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
  130. if (dis == "disabled") {
  131. $("#" + key).prop("disabled", true);
  132. }
  133. return this;
  134. }
  135. /**
  136. * 设置对话框中的数据
  137. *
  138. * @param key 数据的名称
  139. * @param val 数据的具体值
  140. */
  141. TalentInfoInfoDlg.get = function (key) {
  142. return $("#" + key).val();
  143. }
  144. /**
  145. * 关闭此对话框
  146. */
  147. TalentInfoInfoDlg.close = function () {
  148. parent.layer.close(window.parent.TalentInfo.layerIndex);
  149. }
  150. /**
  151. * 收集数据
  152. */
  153. TalentInfoInfoDlg.collectData = function () {
  154. this
  155. .set('id')
  156. .set('type')
  157. .set('talent_type')
  158. .set('tax_insurance_month')
  159. .set('labor_contract_rangetime')
  160. .set('pre_import_type')
  161. .set('enterprise_id')
  162. .set('name')
  163. .set('photo')
  164. .set('card_type')
  165. .set('card_number')
  166. .set('sex')
  167. .set('birthday')
  168. .set('nationality')
  169. .set('province')
  170. .set('city')
  171. .set('county')
  172. .set('nation')
  173. .set('politics')
  174. .set('talent_arrange')
  175. .set('talent_condition')
  176. .set('highest_degree')
  177. .set('graduate_school')
  178. .set('major')
  179. .set('professional')
  180. .set('bank')
  181. .set('bank_number')
  182. .set('bank_branch_name')
  183. .set('bank_account')
  184. .set('study_abroad')
  185. .set('abroad_school')
  186. .set('abroad_major')
  187. .set('phone')
  188. .set('email')
  189. .set('apply_year')
  190. .set('import_way')
  191. .set('fst_work_time')
  192. .set('cur_entry_time')
  193. .set('position')
  194. .set('source')
  195. .set('fujian_highcert_pubtime')
  196. .set('fujian_highcert_exptime')
  197. .set('quanzhou_highcert_pubtime')
  198. .set('quanzhou_highcert_exptime');
  199. if ($("#province").val() != null && $("#province").val() != '') {
  200. this.talentInfoInfoData["province_name"] = $("#province").find("option:selected").text();
  201. }
  202. if ($("#city").val() != null && $("#city").val() != '') {
  203. this.talentInfoInfoData["city_name"] = $("#city").find("option:selected").text();
  204. }
  205. if ($("#county").val() != null && $("#county").val() != '') {
  206. this.talentInfoInfoData["county_name"] = $("#county").find("option:selected").text();
  207. }
  208. if ($("#source_city").val() != null && $("#source_city").val() != '') {
  209. this.talentInfoInfoData["source_city_name"] = $("#source_city").find("option:selected").text();
  210. }
  211. if ($("#source_county").val() != null && $("#source_county").val() != '') {
  212. this.talentInfoInfoData["source_county_name"] = $("#source_county").find("option:selected").text();
  213. }
  214. }
  215. /**
  216. * 验证数据
  217. */
  218. TalentInfoInfoDlg.validate = function () {
  219. $('#talentInfoForm').data("bootstrapValidator").resetForm();
  220. $('#talentInfoForm').bootstrapValidator('validate');
  221. return $("#talentInfoForm").data('bootstrapValidator').isValid();
  222. }
  223. /**
  224. * 提交添加
  225. */
  226. TalentInfoInfoDlg.addSubmit = function () {
  227. this.clearData();
  228. this.collectData();
  229. if (!TalentInfoInfoDlg.validate()) {
  230. return;
  231. }
  232. var id = $('#id').val();
  233. $("#province_name").val($("#province").find("option:selected").text());
  234. $("#city_name").val($("#city").find("option:selected").text());
  235. if ($("#county").val() != null && $("#county").val() != '') {
  236. $("#county_name").val($("#county").find("option:selected").text());
  237. }
  238. if ($("#source_city").val() != null && $("#source_city").val() != '') {
  239. $("#source_city_name").val($("#source_city").find("option:selected").text());
  240. }
  241. if ($("#source_county").val() != null && $("#source_county").val() != '') {
  242. $("#source_county_name").val($("#source_county").find("option:selected").text());
  243. }
  244. if (id != null && id != '') {
  245. if (!TalentInfoInfoDlg.validateIsEdit())
  246. return;
  247. }
  248. $("select").each(function () {
  249. $(this).removeAttr("disabled");
  250. });
  251. if (locked) {
  252. return;
  253. }
  254. locked = true;
  255. $("#talentInfoForm")[0].submit();
  256. }
  257. //回调
  258. TalentInfoInfoDlg.infoCallback = function (data) {
  259. locked = false;
  260. TalentInfoInfoDlg.setNoChangeField();
  261. Feng.info(data.msg);
  262. if (data.code == 200) {
  263. window.parent.TalentInfo.table.refresh();
  264. $("#id").val(data.obj.id);
  265. $("#fileLi").removeAttr("style");
  266. $("#checkState").val(data.obj.checkState);
  267. }
  268. }
  269. /**
  270. * 获取人才认定
  271. */
  272. TalentInfoInfoDlg.getIdentifyCondition = function () {
  273. var level = $("#talent_arrange").val();
  274. var id = $('#id').val();
  275. Feng.addAjaxSelect({
  276. "id": "talent_condition",
  277. "displayCode": "id",
  278. "displayName": "name",
  279. "type": "GET",
  280. "url": Feng.ctxPath + "/common/api/findIdentifyConditionByLevel/level/" + level + "/id/" + id
  281. });
  282. $("#talent_condition").trigger('chosen:updated');
  283. }
  284. TalentInfoInfoDlg.getIdentifyNeedsFileTypes = function () {
  285. var queryData = {};
  286. queryData['project'] = CONFIG.project_rcrd;
  287. queryData['type'] = $("#type").val();
  288. queryData["talent_condition"] = $("#talent_condition").val();
  289. queryData['checkState'] = $("#checkState").val();
  290. $("#fileTable").bootstrapTable("refresh", {query: queryData});
  291. }
  292. TalentInfoInfoDlg.bankChange = function () {
  293. var bank = $("#bank").val();
  294. if ($.trim(bank) == '中国工商银行') {
  295. $("#bank_number").val('102391050013');
  296. } else {
  297. $("#bank_number").val('');
  298. }
  299. }
  300. TalentInfoInfoDlg.changeStudyAbroad = function () {
  301. var is_abroad = $("#study_abroad").val();
  302. if (is_abroad == 1) {
  303. $("#abroad_school").parent().css("display", "block");
  304. $("#abroad_major").parent().css("display", "block");
  305. $('#talentInfoForm').bootstrapValidator('addField', "abroad_school", {validators: {notEmpty: {message: '留学毕业院校不能为空'}}});
  306. $('#talentInfoForm').bootstrapValidator('addField', "abroad_major", {validators: {notEmpty: {message: '留学专业不能为空'}}});
  307. } else {
  308. $("#abroad_school").val("").parent().css("display", "none");
  309. $("#abroad_major").val("").parent().css("display", "none");
  310. $('#talentInfoForm').bootstrapValidator('removeField', "abroad_school");
  311. $('#talentInfoForm').bootstrapValidator('removeField', "abroad_major");
  312. }
  313. }
  314. /**
  315. * 加载市
  316. */
  317. TalentInfoInfoDlg.afterSelectProvince = function () {
  318. var province = $("#province").val();
  319. $("#city").empty();
  320. $("#county").empty();
  321. if (province == null || province == '') {
  322. return;
  323. }
  324. Feng.addAjaxSelect({
  325. "id": "city",
  326. "displayCode": "code",
  327. "displayName": "name",
  328. "type": "GET",
  329. "url": Feng.ctxPath + "/common/tool/findCityByProvinceSelect/code/" + province
  330. });
  331. }
  332. /**
  333. * 加载县
  334. */
  335. TalentInfoInfoDlg.afterSelectCity = function () {
  336. var city = $("#city").val();
  337. $("#county").empty();
  338. if (city == null || city == '') {
  339. return;
  340. }
  341. Feng.addAjaxSelect({
  342. "id": "county",
  343. "displayCode": "code",
  344. "displayName": "name",
  345. "type": "GET",
  346. "url": Feng.ctxPath + "/common/tool/findCountyByCitySelect/code/" + city
  347. });
  348. }
  349. TalentInfoInfoDlg.talentTypeChange = function () {
  350. var talent_type = $("#talent_type").val();
  351. //$("#tax_insurance_month").val("").parent().css("display", "none");
  352. //$("#labor_contract_rangetime").val("").parent().css("display", "none");
  353. $(".talentType1-2").css("display", "none");
  354. $(".talentType3").css("display", "none");
  355. var text = "";
  356. switch (talent_type) {
  357. case "1":
  358. TalentInfoInfoDlg.talentTypeOneTwo = true;
  359. $("#tipsBlock").css('display', 'block');
  360. $("#typeTips").html("含经晋江市认定且还在晋江市就业创业的人才,或在晋江市就业创业但未曾申报过晋江市现代产业体系人才的人才。");
  361. //$("#desc_talent_type").html("请上传社会保险或个人所得税缴费佐证材料");
  362. $(".talentType1-2").css("display", "table-row");
  363. $("#talentType_first").css('display', "none");
  364. $('#talentInfoForm').bootstrapValidator('addField', "tax_insurance_month", {
  365. validators: {
  366. notEmpty: {message: '在我市缴交社会保险或个人所得税月份不能为空'}
  367. }
  368. });
  369. $('#talentInfoForm').bootstrapValidator('addField', "labor_contract_rangetime", {validators: {notEmpty: {message: '劳动合同起止时间'}}});
  370. if (TalentInfoInfoDlg.talentTypeFlag) {
  371. TalentInfoInfoDlg.talentTypeFlag = false;
  372. $('#talentInfoForm').bootstrapValidator('removeField', "pre_import_type");
  373. }
  374. text = $("#fst_work_time").length > 0 ? $("#fst_work_time").prev("label").html().replace(/首次/, "近三年") : "";
  375. $("#come_in_jin").length > 0 ? $("#come_in_jin").css('display', 'table-row') : "";
  376. $("#come_in_jin_str").length > 0 ? $("#come_in_jin_str").css('display', 'table-cell') : "";
  377. break;
  378. case "2":
  379. TalentInfoInfoDlg.talentTypeOneTwo = true;
  380. $("#tipsBlock").css('display', 'block');
  381. $("#typeTips").html("含本办法出台后首次从晋江市以外引进认定的人才,或者流出晋江市满3年后又返回晋江市就业创业(不含企业集团内部人员调动)的人才。")
  382. //$("#desc_talent_type").html("请上传社会保险或个人所得税缴费佐证材料与来我市前工作情况证明,例如原工作单位出具的工作证明、离职证明或原创(领)办企业的营业执照复印件、经市场监管部门备案的公司章程复印件等证明材料");
  383. $(".talentType1-2").css("display", "table-row");
  384. $("#talentType_first").css('display', "inline");
  385. $('#talentInfoForm').bootstrapValidator('addField', "tax_insurance_month", {
  386. validators: {
  387. notEmpty: {message: '在我市缴交社会保险或个人所得税月份不能为空'}
  388. }
  389. });
  390. $('#talentInfoForm').bootstrapValidator('addField', "labor_contract_rangetime", {validators: {notEmpty: {message: '劳动合同起止时间'}}});
  391. if (TalentInfoInfoDlg.talentTypeFlag) {
  392. TalentInfoInfoDlg.talentTypeFlag = false;
  393. $('#talentInfoForm').bootstrapValidator('removeField', "pre_import_type");
  394. }
  395. text = $("#fst_work_time").length > 0 ? $("#fst_work_time").prev("label").html().replace(/近三年/, "首次") : "";
  396. $("#come_in_jin").length > 0 ? $("#come_in_jin").css('display', 'table-row') : "";
  397. $("#come_in_jin_str").length > 0 ? $("#come_in_jin_str").css('display', 'none') : "";
  398. break;
  399. case "3":
  400. TalentInfoInfoDlg.talentTypeFlag = true;
  401. $("#tipsBlock").css('display', 'block');
  402. $("#typeTips").html("含已经与晋江市用人单位达成就业意向且签订预引进意向合作协议(合同)的人才,或拟来我市创业且提交企业名称预先核准的人才。")
  403. //$("#desc_talent_type").html("请先提供意向合作协议(合同)或企业名称预先核准材料,落地我市后再补齐上述材料");
  404. $(".talentType3").css("display", "table-row");
  405. $("#talentType_first").css('display', "none");
  406. $('#talentInfoForm').bootstrapValidator('addField', "pre_import_type", {validators: {notEmpty: {message: '请选择预引进类型'}}});
  407. if (TalentInfoInfoDlg.talentTypeOneTwo) {
  408. TalentInfoInfoDlg.talentTypeOneTwo = false;
  409. $('#talentInfoForm').bootstrapValidator('removeField', "labor_contract_rangetime");
  410. $('#talentInfoForm').bootstrapValidator('removeField', "tax_insurance_month");
  411. }
  412. text = $("#fst_work_time").length > 0 ? $("#fst_work_time").prev("label").html().replace(/近三年/, "首次") : "";
  413. $("#come_in_jin").length > 0 ? $("#come_in_jin").css('display', 'none') : "";
  414. $("#come_in_jin_str").length > 0 ? $("#come_in_jin_str").css('display', 'none') : "";
  415. break;
  416. default:
  417. $("#tipsBlock").css('display', 'none');
  418. text = $("#fst_work_time").length > 0 ? $("#fst_work_time").prev("label").html().replace(/近三年/, "首次") : "";
  419. break;
  420. }
  421. $("#fst_work_time").prev("label").html(text);
  422. for (var i = 0; i < $("[data-rel=talent_type]").length; i++) {
  423. let option = $("[data-rel=talent_type]").eq(i);
  424. let options = option.data("option").toString().split(",");
  425. if (options.indexOf(talent_type) > -1) {
  426. option.css("display", "table-row");
  427. option.next("tr.detail-view").css("display", "table-row");
  428. } else {
  429. option.css("display", "none");
  430. option.next("tr.detail-view").css("display", "none");
  431. }
  432. }
  433. }
  434. TalentInfoInfoDlg.sourceChange = function () {
  435. var source = $("#source").val();
  436. $("#source_batch").val("").parent().css("display", "none");
  437. $("#fujian_highcert_pubtime").val("").parent().css("display", "none");
  438. $("#fujian_highcert_exptime").val("").parent().css("display", "none");
  439. $("#quanzhou_highcert_pubtime").val("").parent().css("display", "none");
  440. $("#quanzhou_highcert_exptime").val("").parent().css("display", "none");
  441. $("#source_city").val("").parent().css("display", "none");
  442. $("#source_county").val("").parent().css("display", "none");
  443. $('#talentInfoForm').bootstrapValidator('removeField', "source_batch");
  444. $('#talentInfoForm').bootstrapValidator('removeField', "fujian_highcert_pubtime");
  445. $('#talentInfoForm').bootstrapValidator('removeField', "fujian_highcert_exptime");
  446. $('#talentInfoForm').bootstrapValidator('removeField', "quanzhou_highcert_pubtime");
  447. $('#talentInfoForm').bootstrapValidator('removeField', "quanzhou_highcert_exptime");
  448. $('#talentInfoForm').bootstrapValidator('removeField', "source_city");
  449. $('#talentInfoForm').bootstrapValidator('removeField', "source_county");
  450. switch (source) {
  451. case "1":
  452. case "3":
  453. $("#source_batch").parent().css("display", "block");
  454. $("#fujian_highcert_pubtime").parent().css("display", "block");
  455. $("#fujian_highcert_exptime").parent().css("display", "block");
  456. $('#talentInfoForm').bootstrapValidator('addField', "source_batch", {validators: {notEmpty: {message: '申报来源批次不能为空'}}});
  457. $('#talentInfoForm').bootstrapValidator('addField', "fujian_highcert_pubtime", {validators: {notEmpty: {message: '福建省高层次人才证书发证日期不能为空'}}});
  458. $('#talentInfoForm').bootstrapValidator('addField', "fujian_highcert_exptime", {validators: {notEmpty: {message: '福建省高层次人才证书有效期不能为空'}}});
  459. break;
  460. case "2":
  461. case "4":
  462. $("#source_batch").parent().css("display", "block");
  463. $("#quanzhou_highcert_pubtime").parent().css("display", "block");
  464. $("#quanzhou_highcert_exptime").parent().css("display", "block");
  465. $('#talentInfoForm').bootstrapValidator('addField', "source_batch", {validators: {notEmpty: {message: '申报来源批次不能为空'}}});
  466. $('#talentInfoForm').bootstrapValidator('addField', "quanzhou_highcert_pubtime", {validators: {notEmpty: {message: '泉州高层次人才证书发证日期不能为空'}}});
  467. $('#talentInfoForm').bootstrapValidator('addField', "quanzhou_highcert_exptime", {validators: {notEmpty: {message: '泉州高层次人才证书有效期不能为空'}}});
  468. break;
  469. }
  470. if (source == 3) {
  471. //显示入选来源地级市除泉
  472. $("#source_city").parent().css("display", "block");
  473. Feng.addAjaxSelect({
  474. "id": "source_city",
  475. "displayCode": "code",
  476. "displayName": "name",
  477. "type": "GET",
  478. "url": "/common/tool/findChildAreaByCode/code/35/no/350500"
  479. });
  480. $('#talentInfoForm').bootstrapValidator('addField', "source_city", {validators: {notEmpty: {message: '入选来源地级市不能为空'}}});
  481. }
  482. if (source == 4) {
  483. //显示入选来源县市区除晋
  484. $("#source_county").parent().css("display", "block");
  485. Feng.addAjaxSelect({
  486. "id": "source_county",
  487. "displayCode": "code",
  488. "displayName": "name",
  489. "type": "GET",
  490. "url": "/common/tool/findChildAreaByCode/code/3505/no/350582"
  491. });
  492. $('#talentInfoForm').bootstrapValidator('addField', "source_county", {validators: {notEmpty: {message: '入选来源县市区不能为空'}}});
  493. }
  494. }
  495. /**
  496. * 初始化表格的列
  497. */
  498. TalentInfoInfoDlg._initFileTypeColumn = function () {
  499. return [
  500. {field: 'selectItem', checkbox: false, visible: false},
  501. {title: '名称', field: 'name', visible: true, align: 'left', valign: 'middle', width: "75%", 'class': 'uitd_showTip',
  502. formatter: function (value, row, index) {
  503. let str = '<div class="word-wrap">';
  504. if (row.must == 1) {
  505. str = str + '<i class="fa fa-paste"></i><span style="font-weight:bold;color:red;font-size:14px;font-family:宋体"> * </span> ' + value;
  506. }
  507. if (row.must == 2) {
  508. str = str + '<i class="fa fa-paste"></i>' + value;
  509. }
  510. str = str + '<br /><span id="desc_' + row.rel + '">' + row.description + '</span></div>'
  511. return str;
  512. }
  513. },
  514. {title: '模板', field: 'templateUrl', visible: true, align: 'center', valign: 'middle', width: "8%",
  515. formatter: function (value, row, index) {
  516. if (value == null || value == '' || value == 'null') {
  517. return '';
  518. }
  519. return "<button type='button' onclick=\"TalentInfoInfoDlg.downloadFile('" + row.id + "',3)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
  520. "<i class=\"fa fa-download\"></i>下载" +
  521. "</button>";
  522. }
  523. },
  524. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "17%",
  525. formatter: function (value, row, index) {
  526. return TalentInfoInfoDlg.validUploadButton(1, value, '', row.tableIndex, row.trIndex);
  527. }
  528. }
  529. ]
  530. };
  531. TalentInfoInfoDlg.initFile = function () {
  532. var ajax = new $ax("/common/api/findCommonFileType", function (data) {
  533. if (data == null || data.length == 0) {
  534. return;
  535. }
  536. var datas = new Array();
  537. for (var i = 0; i < $(".fileTable").length; i++) {
  538. datas.push([]);//创建空的多维数组,等下用来存每个附件表的各自的列
  539. }
  540. var enterpriseTag = $("#enterprise_tag").val();
  541. for (var k in data["rows"]) {
  542. if (data["rows"][k].enterprise_tag != "" && data["rows"][k].enterprise_tag != null && data["rows"][k].enterprise_tag.indexOf(enterpriseTag) == -1) {
  543. continue;
  544. }
  545. var rel = data["rows"][k].rel;
  546. if ($("#" + rel).length > 0) {
  547. var tableIndex = $("#" + rel).parents(".table").find("table.fileTable").index(".fileTable");
  548. data["rows"][k].rel = rel;
  549. data["rows"][k].tableIndex = tableIndex;
  550. data["rows"][k].trIndex = datas[tableIndex].length;
  551. datas[tableIndex].push(data["rows"][k]);
  552. if (data["rows"][k].option) {
  553. //指定了选项
  554. let selectVal = $("#" + rel).val();
  555. let options = data["rows"][k].option.split(",");
  556. if (options.indexOf(selectVal) == -1) {
  557. data["rows"][k].hidden = true;
  558. }
  559. }
  560. } else {
  561. if (data["rows"][k].isConditionFile) {
  562. var tableIndex = $("#talent_condition").parents(".row").next(".row").find("table.fileTable").index(".fileTable");
  563. data["rows"][k].tableIndex = tableIndex;
  564. data["rows"][k].trIndex = datas[tableIndex].length;
  565. datas[tableIndex].push(data["rows"][k]);//放入人才条件后面的附件表
  566. } else {
  567. var tableIndex = $(".fileTable").length - 1;
  568. data["rows"][k].tableIndex = tableIndex;
  569. data["rows"][k].trIndex = datas[tableIndex].length;
  570. datas[$(".fileTable").length - 1].push(data["rows"][k]);//没有归属,放入最后一个附件表
  571. }
  572. }
  573. }
  574. for (var i = 0; i < $(".fileTable").length; i++) {
  575. var that = $(".fileTable").eq(i);
  576. that.bootstrapTable({
  577. columns: TalentInfoInfoDlg._initFileTypeColumn(),
  578. data: datas[i],
  579. showHeader: false,
  580. rowStyle: function (row, index) {
  581. return {classes: ""};
  582. },
  583. onPostBody: function (data) {
  584. for (var k in data) {
  585. var files = data[k].files;
  586. var html = '<ul class="imgs"><li style="width: 70%;font-weight: bold;padding-top: 5px;">附件原名</li><li style="width: 10%;font-weight: bold;padding-top: 5px;">预览</li><li style="width: 20%;font-weight: bold;padding-top: 5px;">操作</li>';
  587. for (var key in files) {
  588. var btn = TalentInfoInfoDlg.validUploadButton(2, data[k].id, files[key].id, i, k);
  589. var sn = files[key].url.lastIndexOf(".");
  590. var suffix = files[key].url.substring(sn + 1, files[key].url.length);
  591. var imgStr = "";
  592. if (suffix == "pdf" || suffix == "PDF") {
  593. imgStr = "<button type='button' onclick=\"Feng.showPdf('" + files[key].url + "','" + files[key].id + "','" + files[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
  594. } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
  595. imgStr = "<button type='button' onclick=\"Feng.showExcel('" + files[key].url + "','" + files[key].id + "','" + files[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
  596. } else {
  597. imgStr = '<img class=\"imgUrl\" onclick=\"Feng.showImg(this)\" src=\"' + files[key].url + '\" style=\"width:25px;height:25px;\">';
  598. }
  599. console.log(imgStr)
  600. html += '<li data-id="' + files[key].id + '">\n\
  601. <div><input type="hidden" name="uploadFiles[]" value="' + files[key].id + '"></div>\n' +
  602. '<div style="width: 70%;">' + files[key].orignName + '</div>\n' +
  603. '<div style="width: 10%;">' + imgStr + '</div>\n' +
  604. '<div style="width: 20%;">' + btn + '</div>\n\
  605. </li>';
  606. }
  607. html = html + '</ul>';
  608. that.find("tr[data-index='" + k + "']").attr("data-rel", data[k]["rel"]);
  609. that.find("tr[data-index='" + k + "']").attr("data-option", data[k]["option"]);
  610. that.find("tr[data-index='" + k + "']").after('<tr class="detail-view"><td colspan="5">' + html + '</td></tr>');
  611. if (typeof data[k].hidden != "undefined") {
  612. that.find("tr[data-index='" + k + "']").css("display", "none");
  613. that.find("tr[data-index='" + k + "']").next("tr.detail-view").css("display", "none");
  614. }
  615. }
  616. $("td.uitd_showTip").bind("mouseover", function () {
  617. //var htm = $(this).html();
  618. //$(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  619. });
  620. },
  621. });
  622. }
  623. //$(".ibox-content").viewer({fullscreen: false});
  624. }, function (data) {
  625. Feng.error("查询失败!" + data.responseJSON.message + "!");
  626. });
  627. var queryData = {};
  628. queryData["mainId"] = $("#id").val();
  629. queryData['project'] = CONFIG.project_rcrd;
  630. queryData['type'] = $("#type").val();
  631. queryData["talent_condition"] = $("#talent_condition option:selected").val();
  632. queryData['checkState'] = $("#checkState").val();
  633. ajax.set(queryData);
  634. ajax.start();
  635. }
  636. //校验是否保存基础信息
  637. TalentInfoInfoDlg.validId = function () {
  638. var id = $("#id").val();
  639. if (id != null && id != '') {
  640. $("#fileLi").removeAttr("style");
  641. } else {
  642. $("#fileLi").attr("style", "pointer-events: none");
  643. }
  644. }
  645. //选择附件并显示附件名
  646. TalentInfoInfoDlg.checkFile = function (content, fileTypeId, fileId, tableIndex, trIndex) {
  647. if (!TalentInfoInfoDlg.validateIsEdit())
  648. return;
  649. $("#upload_file ").unbind("change");
  650. $("#upload_file ").change(function () {
  651. TalentInfoInfoDlg.upload(fileTypeId, fileId, tableIndex, trIndex);
  652. });
  653. $('#upload_file').val("");
  654. $('#upload_file').click();
  655. }
  656. //上传附件
  657. TalentInfoInfoDlg.upload = function (fileTypeId, fileId, tableIndex, trIndex) {
  658. var id = $("#id").val();
  659. if (!TalentInfoInfoDlg.validateIsEdit())
  660. return;
  661. if (fileId != null && fileId != 'null') {
  662. $("#fileId").val(fileId)
  663. } else {
  664. $("#fileId").val("");
  665. }
  666. $("#mainId").val(id);
  667. $("#fileTypeId").val(fileTypeId);
  668. $("#tableIndex").val(tableIndex);
  669. $("#trIndex").val(trIndex);
  670. var index = layer.load(0, {shade: false, time: 0});
  671. $("#index").val(index);
  672. $("#uploadForm").submit();
  673. }
  674. //删除附件
  675. TalentInfoInfoDlg.deleteFile = function (id, state) {
  676. if (!TalentInfoInfoDlg.validateIsEdit())
  677. return;
  678. var operation = function () {
  679. var ajax = new $ax(Feng.ctxPath + "/common/api/deleteFile", function (data) {
  680. if (data.code = 200) {
  681. Feng.success(data.msg);
  682. $("input[name='uploadFiles[]'][value='" + id + "']").parents("li").remove();
  683. //$("#fileTable").bootstrapTable("refresh", {});
  684. } else {
  685. Feng.error(data.msg);
  686. }
  687. }, function (data) {
  688. Feng.error("删除失败!" + data.responseJSON.message + "!");
  689. });
  690. ajax.set("id", id);
  691. ajax.set("type", 1);
  692. ajax.start();
  693. }
  694. Feng.confirm("删除后无法恢复,确认删除吗?", operation);
  695. }
  696. /**
  697. * 提交审核
  698. */
  699. TalentInfoInfoDlg.submitToCheck = function () {
  700. var id = $("#id").val();
  701. if (id == null || id == "") {
  702. Feng.info("请先填写基础信息并上传附件");
  703. return;
  704. }
  705. if (!TalentInfoInfoDlg.validateIsEdit())
  706. return;
  707. var operation = function () {
  708. var ajax = new $ax(Feng.ctxPath + "/enterprise/base/submit", function (data) {
  709. if (data.code == 200) {
  710. Feng.success(data.msg);
  711. // $("#checkState").val(data.obj);
  712. window.parent.TalentInfo.table.refresh();
  713. TalentInfoInfoDlg.close();
  714. } else {
  715. Feng.error(data.msg);
  716. }
  717. }, function (data) {
  718. Feng.error("提交审核失败!" + data.responseJSON.message + "!");
  719. });
  720. ajax.set("id", id);
  721. ajax.start();
  722. }
  723. Feng.confirm("请确认基础信息已核对无误,相应附件已上传,一旦提交,无法修改", operation);
  724. }
  725. /**
  726. * 校验是否可以修改/提交审核
  727. */
  728. TalentInfoInfoDlg.validateIsEdit = function () {
  729. var checkState = $("#checkState").val();
  730. if (checkState != 0 && checkState != 1 && checkState != 3 && checkState != 5) {
  731. if (checkState == 13) {
  732. Feng.error("您的申报审核不通过,无法再修改");
  733. return false;
  734. } else if (checkState == 11) {
  735. Feng.error("您的申报已审核通过,无法再修改");
  736. return false;
  737. } else {
  738. Feng.error("您的申报正在审核中,请耐心等待");
  739. return false;
  740. }
  741. }
  742. return true;
  743. }
  744. /**
  745. * 校验是否显示按钮
  746. * @param type 类型 1-上传按钮,2-修改删除按钮
  747. * @param row
  748. * @returns {string}
  749. */
  750. TalentInfoInfoDlg.validUploadButton = function (type, fileTypeId, fileId, tableIndex, trIndex) {
  751. var files = $("#files").val();
  752. files = files.split(",");
  753. var checkState = $("#checkState").val();
  754. var realState = $("#realState").val();
  755. if (Feng.isEmptyStr(checkState) || checkState == 0 || (checkState == 1 && realState != 4) || checkState == 3 || checkState == 5 || (realState == 4 && files.indexOf(fileTypeId.toString()) != -1)) {
  756. if ((checkState == 3 || checkState == 5))
  757. return "";
  758. if (type == 1) { //上传
  759. return "<button type='button' onclick=\"TalentInfoInfoDlg.checkFile(this," + fileTypeId + "," + null + "," + tableIndex + "," + trIndex + ")\" style='margin-right: 10px' class=\"btn btn-xs btn-info\">" +
  760. "<i class=\"fa fa-upload\"></i>上传" +
  761. "</button>";
  762. } else {
  763. return "<button type=\'button\' onclick=\"TalentInfoInfoDlg.checkFile(this," + fileTypeId + "," + fileId + "," + tableIndex + "," + trIndex + ")\" style=\'margin-right: 10px\' class=\"btn btn-xs btn-info\">" +
  764. "<i class=\"fa fa-paste\"></i>修改" +
  765. "</button>" +
  766. "<button type='button' onclick=\"TalentInfoInfoDlg.deleteFile(" + fileId + ")\" class=\"btn btn-xs btn-danger\">" +
  767. "<i class=\"fa fa-times\"></i>删除" +
  768. "</button>";
  769. }
  770. } else {
  771. return type == 1 ? "" : "";
  772. }
  773. }
  774. //回调
  775. TalentInfoInfoDlg.callBack = function (data) {
  776. layer.close(data.obj);
  777. Feng.info(data.msg);
  778. if (data.code == 200) {
  779. var tableIndex = $("#tableIndex").val();
  780. var trIndex = $("#trIndex").val();
  781. var sn = data.info.lastIndexOf(".");
  782. var suffix = data.info.substring(sn + 1, data.info.length);
  783. var imgStr = "";
  784. if (suffix == "pdf" || suffix == "PDF") {
  785. imgStr = "<button type='button' onclick=\"Feng.showPdf('" + data.info + "','" + data.id + "','" + data.orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
  786. } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
  787. imgStr = "<button type='button' onclick=\"Feng.showExcel('" + data.info + "','" + data.id + "','" + data.orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
  788. } else {
  789. imgStr = '<img class="imgUrl" onclick=\"Feng.showImg(this)\" src="' + data.info + '" style="width:25px;height:25px;">';
  790. }
  791. var li = $("input[name='uploadFiles[]'][value='" + data.id + "'").parents("li");
  792. if (li.length > 0) {
  793. li.find("div").eq(1).html(data.orignName);
  794. li.find("div").eq(2).html(imgStr);
  795. } else {
  796. var html = '<li data-id="' + data.id + '">\n\
  797. <div><input type="hidden" name="uploadFiles[]" value="' + data.id + '"></div>\n\
  798. <div style="width: 70%;">' + data.orignName + '</div>\n\
  799. <div style="width: 10%;">' + imgStr + '</div>\n\
  800. <div style="width: 20%;">\n\
  801. <button type="button" onclick="TalentInfoInfoDlg.checkFile(this,' + data.typeId + ',' + data.id + ',' + tableIndex + ',' + trIndex + ')" style="margin-right: 10px" class="btn btn-xs btn-info"><i class="fa fa-paste"></i>修改</button>\n\
  802. <button type="button" onclick="TalentInfoInfoDlg.deleteFile(' + data.id + ')" class="btn btn-xs btn-danger"><i class="fa fa-times"></i>删除</button>\n\
  803. </div></li></ul>';
  804. $(".fileTable").eq(tableIndex).find("tr[data-index='" + trIndex + "']").next("tr.detail-view").find(".imgs").append(html);
  805. }
  806. //$(".fileTable").eq(tableIndex).find("tr[data-index='" + trIndex + "']").next("tr.detail-view").find(".imgs").viewer({fullscreen: false});
  807. }
  808. }
  809. TalentInfoInfoDlg.downloadFile = function (id, type) {
  810. window.location.href = Feng.ctxPath + "/api/common/downloadFile?id=" + id + "&type=" + type;
  811. }
  812. //设置不可修改的字段
  813. TalentInfoInfoDlg.setNoChangeField = function () {
  814. var checkState = $("#checkState").val();
  815. var fields = $("#fields").val();
  816. var realState = $("#realState").val();
  817. if (realState == 4) {
  818. $("input,textarea").each(function () {
  819. $(this).attr("readonly", "readonly");
  820. });
  821. $("select").each(function () {
  822. $(this).attr("disabled", "disabled");
  823. });
  824. if (fields != null && fields != '') {
  825. var arr = fields.split(",");
  826. for (var key in arr) {
  827. var name = $("#" + arr[key]).prop("tagName");
  828. if (name == 'select' || name == 'SELECT') {
  829. $("#" + arr[key]).removeAttr("disabled");
  830. }
  831. if (name == "input" || name == 'textarea' || name == "INPUT" || name == 'TEXTAREA') {
  832. $("#" + arr[key]).removeAttr("readonly");
  833. }
  834. }
  835. }
  836. }
  837. }
  838. TalentInfoInfoDlg.__initValidateCondition = function () {
  839. var step = $("#step").val();
  840. if (step == 1) {
  841. $('#talentInfoForm').bootstrapValidator('addField', "source_county", {validators: {notEmpty: {message: '入选来源县市区不能为空'}}});
  842. $('#talentInfoForm').bootstrapValidator('addField', "talent_type", {validators: {notEmpty: {message: '人才类型不能为空'}}});
  843. $('#talentInfoForm').bootstrapValidator('addField', "name", {validators: {notEmpty: {message: '姓名不能为空'}}});
  844. $('#talentInfoForm').bootstrapValidator('addField', "card_type", {validators: {notEmpty: {message: '证件类型不能为空'}}});
  845. $('#talentInfoForm').bootstrapValidator('addField', "card_number", {validators: {notEmpty: {message: '证件号码不能为空'}}});
  846. $('#talentInfoForm').bootstrapValidator('addField', "sex", {validators: {notEmpty: {message: '性别不能为空'}}});
  847. $('#talentInfoForm').bootstrapValidator('addField', "birthday", {validators: {notEmpty: {message: '出生日期不能为空'}}});
  848. $('#talentInfoForm').bootstrapValidator('addField', "nationality", {validators: {notEmpty: {message: '国籍/地区不能为空'}}});
  849. $('#talentInfoForm').bootstrapValidator('addField', "province", {validators: {notEmpty: {message: '户籍省份不能为空'}}});
  850. $('#talentInfoForm').bootstrapValidator('addField', "city", {validators: {notEmpty: {message: '户籍市不能为空'}}});
  851. $('#talentInfoForm').bootstrapValidator('addField', "nation", {validators: {notEmpty: {message: '民族不能为空'}}});
  852. $('#talentInfoForm').bootstrapValidator('addField', "politics", {validators: {notEmpty: {message: '政治面貌不能为空'}}});
  853. } else {
  854. $('#talentInfoForm').bootstrapValidator('addField', "apply_year", {validators: {notEmpty: {message: '申报年度不能为空'}}});
  855. $('#talentInfoForm').bootstrapValidator('addField', "import_way", {validators: {notEmpty: {message: '引进方式不能为空'}}});
  856. $('#talentInfoForm').bootstrapValidator('addField', "cur_entry_time", {validators: {notEmpty: {message: '本单位入职时间不能为空'}}});
  857. $('#talentInfoForm').bootstrapValidator('addField', "position", {validators: {notEmpty: {message: '本单位现任职务不能为空'}}});
  858. $('#talentInfoForm').bootstrapValidator('addField', "source", {validators: {notEmpty: {message: '申报来源不能为空'}}});
  859. $('#talentInfoForm').bootstrapValidator('addField', "talent_arrange", {validators: {notEmpty: {message: '人才层次不能为空'}}});
  860. $('#talentInfoForm').bootstrapValidator('addField', "talent_condition", {validators: {notEmpty: {message: '认定条件不能为空'}}});
  861. $('#talentInfoForm').bootstrapValidator('addField', "highest_degree", {validators: {notEmpty: {message: '最高学历不能为空'}}});
  862. $('#talentInfoForm').bootstrapValidator('addField', "graduate_school", {validators: {notEmpty: {message: '毕业院校不能为空'}}});
  863. $('#talentInfoForm').bootstrapValidator('addField', "major", {validators: {notEmpty: {message: '专业不能为空'}}});
  864. $('#talentInfoForm').bootstrapValidator('addField', "bank", {
  865. validators: {
  866. notEmpty: {
  867. message: '开户银行不能为空'
  868. },
  869. regexp: {
  870. regexp: /^[\u4e00-\u9fa5]*银行$/,
  871. message: "开户银行格式不正确"
  872. }
  873. }
  874. });
  875. $('#talentInfoForm').bootstrapValidator('addField', "bank_number", {
  876. validators: {
  877. notEmpty: {
  878. message: '银行行号不能为空'
  879. },
  880. regexp: {
  881. regexp: /^\d+$/,
  882. message: "银行行号格式不正确"
  883. }
  884. }
  885. });
  886. $('#talentInfoForm').bootstrapValidator('addField', "bank_branch_name", {
  887. validators: {
  888. notEmpty: {
  889. message: '开户银行网点不能为空'
  890. },
  891. regexp: {
  892. regexp: /^[\u4e00-\u9fa5]*银行[\u4e00-\u9fa5]*省?[\u4e00-\u9fa5]+市[\u4e00-\u9fa5]*$/,
  893. message: "开户银行格式不正确"
  894. }
  895. }
  896. });
  897. $('#talentInfoForm').bootstrapValidator('addField', "bank_account", {
  898. validators: {
  899. notEmpty: {
  900. message: '银行账号不能为空'
  901. },
  902. regexp: {
  903. regexp: /^\d+$/,
  904. message: "银行账号格式不正确"
  905. }
  906. }
  907. });
  908. $('#talentInfoForm').bootstrapValidator('addField', "phone", {
  909. validators: {
  910. notEmpty: {
  911. message: '手机号码不能为空'
  912. },
  913. regexp: {
  914. regexp: /0?(13|14|15|17|18|19)[0-9]{9}/,
  915. message: "手机号码格式不正确"
  916. }
  917. }
  918. });
  919. $('#talentInfoForm').bootstrapValidator('addField', "email", {
  920. validators: {
  921. notEmpty: {
  922. message: '电子邮箱不能为空'
  923. },
  924. emailAddress: {
  925. message: "电子邮箱格式不正确"
  926. }
  927. }
  928. });
  929. }
  930. }
  931. $("#card_type").change(function () {
  932. async_padding($("#card_number").val().trim(), $(this).val());
  933. })
  934. $("#card_number").blur(function () {
  935. async_padding($(this).val().trim(), $("#card_type").val());
  936. })
  937. function async_padding(card_number, card_type) {
  938. if (card_number != "" && card_number.length == 18 && card_type == "1") {
  939. var year = card_number.substring(6, 10);
  940. var month = card_number.substring(10, 12);
  941. var day = card_number.substring(12, 14);
  942. var birthday = year + "-" + month + "-" + day;
  943. var rule = /\d{4}-\d{2}-\d{2}/;
  944. if (rule.test(birthday))
  945. $("#birthday").val(birthday);
  946. var num = card_number.substring(17, 1);
  947. if (num % 2 == 0) {
  948. $("#sex").val(2);
  949. } else {
  950. $("#sex").val(1);
  951. }
  952. }
  953. }
  954. $(function () {
  955. TalentInfoInfoDlg.talentTypeFlag = false;
  956. TalentInfoInfoDlg.talentTypeOneTwo = true;
  957. Feng.initValidatorTip("talentInfoForm", TalentInfoInfoDlg.validateFields);
  958. var id = $("#id").val();
  959. var checkState = $("#checkState").val();
  960. //批量加载字典表数据
  961. var arr = [
  962. {"name": "nation", "code": "nation"},
  963. {"name": "talent_arrange", "code": "talent_arrange"},
  964. {"name": "nationality", "code": "nationality"},
  965. {"name": "politics", "code": "politics"},
  966. {"name": "highest_degree", "code": "highest_degree"},
  967. {"name": "source", "code": "source"},
  968. {"name": "import_way", "code": "import_way"}];
  969. Feng.findChildDictBatch(JSON.stringify(arr))
  970. //加载省份
  971. Feng.addAjaxSelect({
  972. "id": "province",
  973. "displayCode": "code",
  974. "displayName": "name",
  975. "type": "GET",
  976. "url": "/common/tool/getProvinceSelect"
  977. });
  978. //批量加载时间控件
  979. $(".date").each(function () {
  980. laydate.render({
  981. elem: this
  982. , type: 'date'
  983. , trigger: 'click'
  984. });
  985. });
  986. $(".rangedate").each(function () {
  987. laydate.render({
  988. elem: this,
  989. type: "date",
  990. range: true,
  991. trigger: "click"
  992. })
  993. })
  994. $(".rangemonth").each(function () {
  995. laydate.render({
  996. elem: this,
  997. type: "month",
  998. range: true,
  999. trigger: "click"
  1000. })
  1001. })
  1002. if (id != null && id != '') {
  1003. //select初始化
  1004. $("select").each(function () {
  1005. $(this).val($(this).attr("value")).trigger("change");
  1006. });
  1007. Feng.getCheckLog("logTable", {"type": CONFIG.project_rcrd, "mainId": id, "typeFileId": "", "active": 1})
  1008. }
  1009. $("#talent_type").val($("#talent_type").attr("value"));
  1010. $("#card_type").val($("#card_type").attr("value"));
  1011. $("#sex").val($("#sex").attr("value"));
  1012. $("#enterprise_tag").val($("#enterprise_tag").attr("value"));
  1013. $("#address").val($("#address").attr("value"));
  1014. $("#nation").val($("#nation").attr("value"));
  1015. $("#nationality").val($("#nationality").attr("value"));
  1016. $("#industry_field").val($("#industry_field").attr("value"));
  1017. $("#province").val($("#province").attr("value"));
  1018. TalentInfoInfoDlg.afterSelectProvince();
  1019. $("#city").val($("#city").attr("value"));
  1020. TalentInfoInfoDlg.afterSelectCity();
  1021. $("#county").val($("#county").attr("value"));
  1022. TalentInfoInfoDlg.getIdentifyCondition();
  1023. $("#politics").val($("#politics").attr("value"));
  1024. $("#talent_arrange").val($("#talent_arrange").attr("value"));
  1025. $("#talent_condition").val($("#talent_condition").attr("value"));
  1026. $("#tax_insurance_month").val($("#tax_insurance_month").attr("value"));
  1027. $("#labor_contract_rangetime").val($("#labor_contract_rangetime").attr("value"));
  1028. TalentInfoInfoDlg.validId();
  1029. $("#photo").change(function (e) {
  1030. var tag = e.target;
  1031. var file = tag.files[0];
  1032. var imgSrc;
  1033. var reader = new FileReader();
  1034. reader.readAsDataURL(file);
  1035. reader.onload = function () {
  1036. imgSrc = this.result;
  1037. $("#photoImg").attr("src", imgSrc);
  1038. };
  1039. });
  1040. TalentInfoInfoDlg.setNoChangeField();
  1041. $("#talent_condition").on('chosen:ready', function (e, params) {
  1042. $(".chosen-container-single .chosen-single").css("padding", "4px 0px 0px 4px");
  1043. });
  1044. $("#talent_condition").chosen({
  1045. search_contains: true,    //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
  1046. disable_search: false,
  1047. width: "100%",
  1048. enable_split_word_search: true,
  1049. rtl: true
  1050. });
  1051. TalentInfoInfoDlg.initFile();
  1052. });