new_talentInfo_wj_info.js 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083
  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|16|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. },
  32. validateFields2: {
  33. enterpriseId: {validators: {notEmpty: {message: '所属医院不能为空'}}},
  34. type: {validators: {notEmpty: {message: '人才类别不能为空'}}},
  35. name: {validators: {notEmpty: {message: '姓名不能为空'}}},
  36. sex: {validators: {notEmpty: {message: '性别不能为空'}}},
  37. nation: {validators: {notEmpty: {message: '民族不能为空'}}},
  38. politics: {validators: {notEmpty: {message: '政治面貌不能为空'}}},
  39. card_type: {validators: {notEmpty: {message: '证件类型不能为空'}}},
  40. card_number: {validators: {notEmpty: {message: '证件号码不能为空'}}},
  41. birthday: {validators: {notEmpty: {message: '出生日期不能为空'}}},
  42. talent_type: {validators: {notEmpty: {message: '人才类型不能为空'}}},
  43. highest_degree: {validators: {notEmpty: {message: '最高学历不能为空'}}},
  44. graduate_school: {validators: {notEmpty: {message: '毕业学校不能为空'}}},
  45. major: {validators: {notEmpty: {message: '专业不能为空'}}},
  46. position: {validators: {notEmpty: {message: '职务不能为空'}}},
  47. cur_entry_time: {validators: {notEmpty: {message: '入职时间不能为空'}}},
  48. labor_contract_rangetime: {validators: {notEmpty: {message: '工作合同时间不能为空'}}},
  49. talent_arrange: {validators: {notEmpty: {message: '人才层次不能为空'}}},
  50. talent_arrange_category: {validators: {notEmpty: {message: '人才条款不能为空'}}},
  51. talent_condition: {validators: {notEmpty: {message: '认定条件不能为空'}}},
  52. phone: {
  53. validators: {
  54. regexp: {
  55. regexp: /0?(13|14|15|16|17|18|19)[0-9]{9}/,
  56. message: "手机号码格式不正确"
  57. }
  58. }
  59. },
  60. email: {
  61. validators: {
  62. emailAddress: {
  63. message: "电子邮箱格式不正确"
  64. }
  65. }
  66. },
  67. bank: {
  68. validators: {
  69. notEmpty: {
  70. message: '开户银行不能为空'
  71. },
  72. regexp: {
  73. regexp: /^[\u4e00-\u9fa5]*银行$/,
  74. message: "开户银行格式不正确"
  75. }
  76. }
  77. },
  78. bank_account: {validators: {notEmpty: {message: '银行账号不能为空'}}},
  79. bank_number: {validators: {notEmpty: {message: '银行行号不能为空'}}},
  80. bank_branch_name: {
  81. validators: {
  82. notEmpty: {
  83. message: '开户银行网点不能为空'
  84. }
  85. }
  86. },
  87. }
  88. };
  89. /**
  90. * 清除数据
  91. */
  92. TalentInfoInfoDlg.clearData = function () {
  93. this.talentInfoInfoData = {};
  94. }
  95. /**
  96. * 设置对话框中的数据
  97. *
  98. * @param key 数据的名称
  99. * @param val 数据的具体值
  100. */
  101. TalentInfoInfoDlg.set = function (key, val) {
  102. var dis = $("#" + key).attr("disabled");
  103. if (dis == "disabled") {
  104. $("#" + key).removeAttr("disabled");
  105. }
  106. this.talentInfoInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
  107. if (dis == "disabled") {
  108. $("#" + key).prop("disabled", true);
  109. }
  110. return this;
  111. }
  112. /**
  113. * 设置对话框中的数据
  114. *
  115. * @param key 数据的名称
  116. * @param val 数据的具体值
  117. */
  118. TalentInfoInfoDlg.get = function (key) {
  119. return $("#" + key).val();
  120. }
  121. /**
  122. * 关闭此对话框
  123. */
  124. TalentInfoInfoDlg.close = function () {
  125. parent.layer.close(window.parent.TalentInfo.layerIndex);
  126. }
  127. /**
  128. * 收集数据
  129. */
  130. TalentInfoInfoDlg.collectData = function () {
  131. this
  132. .set('id')
  133. .set('enterprise_id')
  134. .set('type')
  135. .set('card_number')
  136. .set('card_type')
  137. .set('name')
  138. .set('sex')
  139. .set('nation')
  140. .set('nationality')
  141. .set('province')
  142. .set('city')
  143. .set('county')
  144. .set('birthday')
  145. .set('address')
  146. .set('politics')
  147. .set('highest_degree')
  148. .set('graduate_school')
  149. .set('major')
  150. .set('position')
  151. .set('phone')
  152. .set('email')
  153. .set('bank')
  154. .set('bank_branch_name')
  155. .set('bank_account')
  156. .set('bank_number')
  157. .set('cur_entry_time')
  158. .set('labor_contract_rangetime')
  159. .set('is_fujian_talent')
  160. .set('is_jinjiang_talent')
  161. .set('talent_arrange')
  162. .set('talent_condition')
  163. .set('identifyGetTime')
  164. .set('identifyConditionName')
  165. .set('breakFaith')
  166. .set('education')
  167. .set('experience')
  168. .set('industryField')
  169. .set('title')
  170. .set('pro_qua')
  171. .set('study_abroad')
  172. .set('studyAbroadCountry')
  173. .set('studyAbroadTime')
  174. .set('description');
  175. }
  176. /**
  177. * 验证数据
  178. */
  179. TalentInfoInfoDlg.validate = function () {
  180. $('#talentInfoForm').data("bootstrapValidator").resetForm();
  181. $('#talentInfoForm').bootstrapValidator('validate');
  182. return $("#talentInfoForm").data('bootstrapValidator').isValid();
  183. }
  184. /**
  185. * 初始化表格的列
  186. */
  187. TalentInfoInfoDlg.initFileTypeColumn = function () {
  188. return [
  189. {field: 'selectItem', checkbox: false, visible: false},
  190. {title: '名称', field: 'name', visible: true, align: 'left', valign: 'middle', width: "70%", 'class': 'uitd_showTip',
  191. formatter: function (value, row, index) {
  192. let str = '<div class="word-wrap">';
  193. let highlights_by_api = ["crz"];
  194. let description = row.description == null ? "" : row.description;
  195. if (highlights_by_api.indexOf(row.api) > -1) {
  196. value = '<span style="font-weight:bold;color:red;">' + value + '</span>';
  197. description = '<span style="font-weight:bold;color:red;">' + description + '</span>';
  198. }
  199. if (row.must == 1) {
  200. str = str + '<i class="fa fa-paste"></i><span style="font-weight:bold;color:red;font-size:14px;font-family:宋体"> * </span> ' + value;
  201. }
  202. if (row.must == 2) {
  203. str = str + '<i class="fa fa-paste"></i>' + value;
  204. }
  205. str = str + '<br /><span id="desc_' + row.rel + '">' + description + '</span></div>'
  206. return str;
  207. }
  208. },
  209. {title: '模板', field: 'templateUrl', visible: true, align: 'center', valign: 'middle', width: "10%",
  210. formatter: function (value, row, index) {
  211. if (value == null || value == '' || value == 'null') {
  212. return '无';
  213. }
  214. return "<button type='button' onclick=\"TalentInfoInfoDlg.downloadFile('" + row.id + "',5)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
  215. "<i class=\"fa fa-download\"></i>下载" +
  216. "</button>";
  217. }
  218. },
  219. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "20%",
  220. formatter: function (value, row, index) {
  221. return TalentInfoInfoDlg.validUploadButton(1, value, '', row.tableIndex, row.trIndex);
  222. }
  223. }
  224. ]
  225. };
  226. TalentInfoInfoDlg.initFileTable = function () {
  227. var ajax = new $ax("/common/api/findCommonFileType", function (data) {
  228. if (data == null || data.length == 0) {
  229. return;
  230. }
  231. var datas = new Array();
  232. for (var i = 0; i < $(".fileTable").length; i++) {
  233. datas.push([]);//创建空的多维数组,等下用来存每个附件表的各自的列
  234. }
  235. var enterpriseTag = $("#enterprise_tag").val();
  236. for (var k in data["rows"]) {
  237. if (data["rows"][k].enterprise_tag != "" && data["rows"][k].enterprise_tag != null && data["rows"][k].enterprise_tag.indexOf(enterpriseTag) == -1) {
  238. continue;
  239. }
  240. var rel = data["rows"][k].rel;
  241. if ($("#" + rel).length > 0) {
  242. var tableIndex = 0;
  243. if ($("#" + rel).parents(".table").length > 0) {
  244. tableIndex = $("#" + rel).parents(".table").find("table.fileTable").index(".fileTable");
  245. } else {
  246. tableIndex = $("#" + rel).parents(".row").next(".row").find("table.fileTable").index(".fileTable");
  247. }
  248. data["rows"][k].tableIndex = tableIndex;
  249. data["rows"][k].trIndex = datas[tableIndex].length;
  250. datas[tableIndex].push(data["rows"][k]);
  251. if (data["rows"][k].option) {
  252. //指定了选项
  253. if (rel == "birthday") {
  254. let age = 0;
  255. if ($("#" + rel).val()) {
  256. let birthDate = new Date($("#" + rel).val());//生日日期
  257. let birthYear = birthDate.getFullYear();
  258. let birthMonth = birthDate.getMonth() + 1;
  259. let currentDate = new Date();//当前日期
  260. let currentYear = currentDate.getFullYear();
  261. let currentMonth = currentDate.getMonth() + 1;
  262. age = (currentYear * 12 + currentMonth - birthYear * 12 - birthMonth) / 12;
  263. }
  264. if (age < data["rows"][k].option)
  265. data["rows"][k].hidden = true;
  266. } else {
  267. let selectVal = $("#" + rel).data("value").toString();
  268. let options = data["rows"][k].option.split(",");
  269. if (options.indexOf(selectVal) == -1) {
  270. data["rows"][k].hidden = true;
  271. }
  272. }
  273. }
  274. } else {
  275. if (data["rows"][k].isConditionFile) {
  276. var tableIndex = 0;
  277. if ($("#talent_condition").parents(".table").length > 0) {
  278. tableIndex = $("#talent_condition").parents(".table").find("table.fileTable").index(".fileTable");
  279. } else {
  280. tableIndex = $("#talent_condition").parents(".row").next(".row").find("table.fileTable").index(".fileTable");
  281. }
  282. data["rows"][k].tableIndex = tableIndex;
  283. data["rows"][k].trIndex = datas[tableIndex].length;
  284. datas[tableIndex].push(data["rows"][k]);//放入人才条件后面的附件表
  285. } else {
  286. var tableIndex = $(".fileTable").length - 2;
  287. data["rows"][k].tableIndex = tableIndex;
  288. data["rows"][k].trIndex = datas[tableIndex].length;
  289. datas[$(".fileTable").length - 2].push(data["rows"][k]);//没有归属,放入最后一个附件表
  290. }
  291. }
  292. }
  293. for (var i = 0; i < $(".fileTable").length; i++) {
  294. var that = $(".fileTable").eq(i);
  295. that.bootstrapTable({
  296. columns: TalentInfoInfoDlg.initFileTypeColumn(),
  297. data: datas[i],
  298. showHeader: false,
  299. rowStyle: function (row, index) {
  300. return {classes: ""};
  301. },
  302. onPostBody: function (data) {
  303. for (var k in data) {
  304. var files = data[k].files;
  305. 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>';
  306. for (var key in files) {
  307. var btn = "";
  308. btn = TalentInfoInfoDlg.validUploadButton(2, data[k].id, files[key].id, i, k);
  309. var sn = files[key].url.lastIndexOf(".");
  310. var suffix = files[key].ext;//files[key].url.substring(sn + 1, files[key].url.length);
  311. var imgStr = "";
  312. if (suffix == "pdf" || suffix == "PDF") {
  313. 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>";
  314. } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS' || suffix == 'docx' || suffix == 'doc' || suffix == 'DOCX' || suffix == 'DOC') {
  315. 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>";
  316. } else {
  317. imgStr = '<img class=\"imgUrl\" onclick=\"Feng.showImg(this)\" src=\"' + files[key].url + '\" style=\"width:25px;height:25px;\">';
  318. }
  319. html += '<li data-id="' + files[key].id + '">\n\
  320. <div>' + (data[k].step != 1 ? '<input type="hidden" name="uploadFiles[]" value="' + files[key].id + '">' : "") + '</div>\n' +
  321. '<div style="width: 70%;">' + files[key].orignName + '</div>\n' +
  322. '<div style="width: 10%;">' + imgStr + '</div>\n' +
  323. '<div style="width: 20%;">' + btn + '</div>\n\
  324. </li>';
  325. }
  326. html = html + '</ul>';
  327. that.find("tr[data-index='" + k + "']").attr("data-rel", data[k]["rel"]);
  328. that.find("tr[data-index='" + k + "']").attr("data-option", data[k]["option"]);
  329. that.find("tr[data-index='" + k + "']").after('<tr class="detail-view"><td colspan="5">' + html + '</td></tr>');
  330. if (typeof data[k].hidden != "undefined") {
  331. that.find("tr[data-index='" + k + "']").css("display", "none");
  332. that.find("tr[data-index='" + k + "']").next("tr.detail-view").css("display", "none");
  333. }
  334. }
  335. $("td.uitd_showTip").bind("mouseover", function () {
  336. var htm = $(this).html();
  337. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  338. });
  339. },
  340. });
  341. }
  342. }, function (data) {
  343. Feng.error("查询失败!" + data.responseJSON.message + "!");
  344. });
  345. var queryData = {};
  346. queryData["mainId"] = $("#id").val();
  347. queryData['project'] = CONFIG.project_rcrd;
  348. queryData["source"] = $("#source").val();
  349. queryData['type'] = $("#type").val();
  350. queryData["talent_condition"] = $("#talent_condition option:selected").val();
  351. queryData['checkState'] = $("#checkState").val();
  352. queryData['isMix'] = 1;
  353. ajax.set(queryData);
  354. ajax.start();
  355. }
  356. /**
  357. * 提交添加
  358. */
  359. TalentInfoInfoDlg.addSubmit = function () {
  360. this.clearData();
  361. this.collectData();
  362. if (!TalentInfoInfoDlg.validate()) {
  363. return;
  364. }
  365. var id = $('#id').val();
  366. var name = $("#name").val().trim();
  367. var cardNumber = $("#card_number").val().trim();
  368. if (name == "" || cardNumber == "") {
  369. layer.alert("姓名和证件号码不能为空");
  370. return;
  371. }
  372. if (id != null && id != '') {
  373. if (!TalentInfoInfoDlg.validateIsEdit())
  374. return;
  375. }
  376. $("select").each(function () {
  377. $(this).removeAttr("disabled");
  378. });
  379. if (locked) {
  380. return;
  381. }
  382. locked = true;
  383. $("#talentInfoForm").attr("action", "/enterprise/talent/apply");
  384. $("#talentInfoForm")[0].submit();
  385. }
  386. //回调
  387. TalentInfoInfoDlg.infoCallback = function (data) {
  388. locked = false;
  389. TalentInfoInfoDlg.setNoChangeField();
  390. Feng.info(data.msg);
  391. if (data.code == 200) {
  392. window.parent.TalentInfo.table.refresh();
  393. $("#id").val(data.obj.id);
  394. $("#fileLi").removeAttr("style");
  395. $("#checkState").val(data.obj.checkState);
  396. }
  397. return;
  398. }
  399. /**
  400. * 获取人才认定
  401. */
  402. TalentInfoInfoDlg.getIdentifyCondition = function () {
  403. $("#talent_condition").parents(".table").find(".fileTable").find("tbody").html("");
  404. $('#talentInfoForm').bootstrapValidator('removeField', "annual_salary");
  405. var level = $("#talent_arrange").val();
  406. var id = $('#id').val();
  407. Feng.addAjaxSelect({
  408. "id": "talent_condition",
  409. "displayCode": "id",
  410. "displayName": "name",
  411. "type": "GET",
  412. "url": Feng.ctxPath + "/common/api/findIdentifyConditionByLevel/level/" + level + "/id/" + id
  413. });
  414. $("#talent_condition").trigger('chosen:updated');
  415. }
  416. TalentInfoInfoDlg.getIdentifyNeedsFileTypes = function () {
  417. $("#talent_condition").parents(".table").find(".fileTable").find("tbody").html("");
  418. TalentInfoInfoDlg.ajaxGetConditionFile();
  419. }
  420. TalentInfoInfoDlg.ajaxGetConditionFile = function (source) {
  421. var condition = $("#talent_condition option:selected").val();
  422. if (condition != "") {
  423. var ajax = new $ax("/common/api/getTalentCondtionUploadFile", function (data) {
  424. if (data == null || data.length == 0) {
  425. return;
  426. }
  427. var conditionFileTable = $("#talent_condition").parents(".table").find(".fileTable");
  428. var tableIndex = conditionFileTable.index(".fileTable");
  429. var tbody = conditionFileTable.find("tbody");
  430. var html = "";
  431. for (var key in data.rows) {
  432. var filetype = data.rows[key];
  433. var name = "";
  434. if (filetype.must == 1) {
  435. name = '<i class="fa fa-paste"></i><span style="font-weight:bold;color:red;font-size:14px;font-family:宋体"> * </span> ' + filetype.name;
  436. }
  437. if (filetype.must == 2) {
  438. name = '<i class="fa fa-paste"></i>' + filetype.name;
  439. }
  440. var uploadbtn = TalentInfoInfoDlg.validUploadButton(1, filetype.id, '', tableIndex, key, true);
  441. var templateUrl = '<button type="button" onclick="TalentInfoInfoDlg.downloadFile("' + filetype.id + '",5)" style="margin-right: 10px" class="btn btn-xs btn-primary">\n\
  442. <i class=\"fa fa-download\"></i>下载""</button>"';
  443. html += '<tr data-index="' + key + '">\n\
  444. <td class="uitd_showTip" style="text-align: center; vertical-align: middle; width: 70%; ">' + name + '<br />' + (filetype.description == null ? "" : filetype.description) + '</td> \n\
  445. <td style="text-align: center; vertical-align: middle; width: 10%; ">' + (filetype.templateUrl ? templateUrl : "无") + '</td> \n\
  446. <td style="text-align: center; vertical-align: middle; width: 20%; ">' + uploadbtn + '</td> </tr></tr>';
  447. 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>';
  448. for (var k in filetype.files) {
  449. var file = filetype.files[k];
  450. var btn = TalentInfoInfoDlg.validUploadButton(2, filetype.id, file.id, tableIndex, key, true);
  451. var sn = file.url.lastIndexOf(".");
  452. var suffix = file.ext;//file.url.substring(sn + 1, file.url.length);
  453. var imgStr = "";
  454. if (suffix == "pdf" || suffix == "PDF") {
  455. 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>";
  456. } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS' || suffix == 'docx' || suffix == 'doc' || suffix == 'DOCX' || suffix == 'DOC') {
  457. 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>";
  458. } else {
  459. imgStr = '<img class=\"imgUrl\" onclick=\"Feng.showImg(this)\" src=\"' + file.url + '\" style=\"width:25px;height:25px;\">';
  460. }
  461. html += '<li data-id="' + file.id + '">\n\
  462. <div>' + (filetype.step != 1 ? '<input type="hidden" name="uploadFiles[]" value="' + file.id + '">' : "") + '</div>\n' +
  463. '<div style="width: 80%;">' + file.orignName + '</div>\n' +
  464. '<div style="width: 10%;">' + imgStr + '</div>\n' +
  465. '<div style="width: 10%;">' + btn + '</div>\n\
  466. </li>';
  467. }
  468. html += '</ul></td></tr>';
  469. }
  470. tbody.html(html);
  471. }, function (data) {
  472. Feng.error("查询失败!" + data.responseJSON.message + "!");
  473. });
  474. var queryData = {};
  475. queryData["mainId"] = $("#id").val();
  476. queryData['project'] = CONFIG.project_rcrd;
  477. queryData["source"] = source;
  478. queryData['type'] = $("#type").val();
  479. queryData["talent_condition"] = condition;
  480. ajax.set(queryData);
  481. ajax.start();
  482. }
  483. }
  484. TalentInfoInfoDlg.onTalentRuleChange = function(){
  485. var is_fujian_talent = $("#is_fujian_talent").val();
  486. var is_jinjiang_talent = $("#is_jinjiang_talent").val();
  487. if(is_fujian_talent == 1 && is_jinjiang_talent == 2){
  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. });