talentInfo_info.js 46 KB

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