new_talentInfo_wj_info.js 45 KB

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