talentInfo_info.js 49 KB

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