talentInfo_info.js 45 KB

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