integralInfo.js 49 KB

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