new_talentInfo_wj_info.js 45 KB

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