new_talentInfo_wj_info.js 45 KB

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