talentInfo_info.js 49 KB

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