talentInfo_info.js 45 KB

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