talentInfo_info.js 49 KB

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