examine_common.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  1. /**
  2. * 显示审核日志
  3. */
  4. TalentInfo.showLog = function (id) {
  5. layer.open({
  6. type: 1,
  7. title: "日志",
  8. fixed: false,
  9. content: '<table id="' + id + '"></table>',
  10. area: ['80%', '80%'],
  11. maxmin: true,
  12. success: function (layero, index) {
  13. Feng.getCheckLog(id, {"type": CONFIG.project_rcrd, "mainId": id, "typeFileId": "", "active": 1})
  14. }
  15. });
  16. }
  17. /**
  18. * 查询表单提交参数对象
  19. * @returns {{}}
  20. */
  21. TalentInfo.formParams = function () {
  22. var queryData = {};
  23. queryData['name'] = $("#name").val();
  24. queryData['card_number'] = $("#card_number").val();
  25. queryData['sex'] = $("#sex").val();
  26. queryData['nation'] = $("#nation").val();
  27. queryData['nationality'] = $("#nationality").val();
  28. queryData['province'] = $("#province").val();
  29. queryData['politics'] = $("#politics").val();
  30. queryData['enterprise_id'] = $("#enterprise_id").val();
  31. if ($("#company_id").length > 0) {
  32. queryData['company_id'] = $("#company_id").val();
  33. }
  34. queryData['industry_field'] = $("#industry_field").val();
  35. queryData['industry_field_old'] = $("#industry_field_old").val();
  36. queryData['enterprise_tag'] = $("#enterprise_tag").val();
  37. queryData['source'] = $("#source").val();
  38. queryData['city'] = $("#city").val();
  39. queryData['import_way'] = $("#import_way").val();
  40. queryData['highest_degree'] = $("#highest_degree").val();
  41. queryData['major'] = $("#major").val();
  42. queryData['study_abroad'] = $("#study_abroad").val();
  43. queryData['phone'] = $("#phone").val();
  44. queryData['email'] = $("#email").val();
  45. queryData['breakFaith'] = $("#breakFaith").val();
  46. queryData['talent_type'] = $("#talent_type").val();
  47. queryData['isMatchZhiren'] = $("#isMatchZhiren").val();
  48. queryData['talent_arrange'] = $("#talent_arrange").val();
  49. queryData['street'] = $("#street").val();
  50. if ($("#talent_condition").val() == null || $("#talent_condition").val() == '' || $("#talent_condition").val() == "null") {
  51. queryData['talent_condition'] = "";
  52. } else {
  53. queryData['talent_condition'] = $("#talent_condition").val();
  54. }
  55. queryData['identifyMonth'] = $("#identifyMonth").val();
  56. queryData['checkState'] = $("#checkState").val();
  57. queryData['isPublic'] = $("#isPublic").val();
  58. queryData['active'] = $("#active").val()
  59. queryData['apply_year'] = $("#apply_year").val();
  60. queryData['isEffect'] = $("#isEffect").val();
  61. //queryData['offset'] = 0;
  62. return queryData;
  63. }
  64. /**
  65. * 查询人才认定申报列表
  66. */
  67. TalentInfo.search = function () {
  68. TalentInfo.table.refresh({query: TalentInfo.formParams()});
  69. };
  70. /**
  71. * 重置
  72. */
  73. TalentInfo.reset = function () {
  74. $("#name").val("");
  75. $("#card_number").val("");
  76. $("#sex").val("");
  77. $("#nation").val("");
  78. $("#nationality").val("");
  79. $("#province").val("");
  80. $("#politics").val("");
  81. $("#enterprise_id").val("").trigger("chosen:updated");
  82. if ($("#company_id").length > 0) {
  83. $("#company_id").val("").trigger("chosen:updated");
  84. }
  85. $("#industry_field").val("");
  86. $("#industry_field_old").val("");
  87. $("#enterprise_tag").val("");
  88. $("#source").val("");
  89. $("#fromCity").val("");
  90. $("#import_way").val("");
  91. $("#highest_degree").val("");
  92. $("#major").val("");
  93. $("#study_abroad").val("");
  94. $("#phone").val("");
  95. $("#email").val("");
  96. $("#breakFaith").val("");
  97. $("#talent_type").val("");
  98. $("#isMatchZhiren").val("");
  99. $("#talent_arrange").val("");
  100. $("#street").val("");
  101. $("#talent_condition").val("").trigger("chosen:updated");
  102. $("#checkState").val("");
  103. $("#identifyMonth").val("");
  104. $("#isPublic").val("");
  105. $("#active").val("")
  106. $("#apply_year").val("");
  107. $("#isEffect").val("");
  108. }
  109. /**
  110. * 获取人才认定
  111. */
  112. TalentInfo.getIdentifyCondition = function () {
  113. var level = $("#talent_arrange").val();
  114. if (level == null || level == '') {
  115. $("#talent_condition").empty();
  116. $("#talent_condition").trigger('chosen:updated');
  117. return;
  118. }
  119. Feng.addAjaxSelect({
  120. "id": "talent_condition",
  121. "displayCode": "id",
  122. "displayName": "name",
  123. "type": "GET",
  124. "url": Feng.ctxPath + "/common/api/findIdentifyConditionByLevel/level/" + level
  125. });
  126. $("#talent_condition").trigger('chosen:updated');
  127. }
  128. /**
  129. * 获取人才认定
  130. */
  131. TalentInfo.getProvince = function () {
  132. Feng.addAjaxSelect({
  133. "id": "province",
  134. "displayCode": "code",
  135. "displayName": "name",
  136. "type": "GET",
  137. "url": Feng.ctxPath + "/common/tool/getProvinceSelect"
  138. });
  139. }
  140. /**
  141. * 显示导出模态框
  142. */
  143. TalentInfo.showExportModal = function () {
  144. $("#exportForm")[0].reset();
  145. $("#commonExportModal").modal("show");
  146. }
  147. /**
  148. * 修改驳回的字段及附件
  149. */
  150. TalentInfo.updateFieldsAndFiles = function () {
  151. if (this.check()) {
  152. var ajax = new $ax("/enterprise/talent/findFieldsAndFiles?id=" + TalentInfo.seItem.id, function (data) {
  153. if (data.code == 200) {
  154. layer.open({
  155. type: 1,
  156. id: "neewFieldFormModel",
  157. title: '修改',
  158. area: ['800px', '450px'], //宽高
  159. fix: false, //不固定
  160. shade: 0,
  161. maxmin: true,
  162. content: TalentInfo.creatFieldCheckModal(),
  163. btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  164. btnAlign: 'c',
  165. zIndex: layer.zIndex,
  166. success: function (layero, index) {
  167. var html1 = '';
  168. if (typeof data.fieldList != "undefined" && data.fieldList.length > 0) {
  169. for (var key in data.fieldList) {
  170. html1 += '<li style="float:left;margin:0 10px 10px 0;"><input type="checkbox" value="' + data.fieldList[key]["key"] + '"><span>' + data.fieldList[key]["value"] + '</span></li>';
  171. }
  172. }
  173. var html2 = '';
  174. for (var key in data.fileList) {
  175. html2 = html2 + '<ul><li style="width: 100%"><input type="checkbox" value="' + data.fileList[key].id + '"><span>' + data.fileList[key].name + '</span></li></ul>';
  176. }
  177. $("#firstCheckForm #field_info ul").css("overflow", "hidden").html(html1);
  178. $("#field_file").css("overflow", "hidden").empty().append(html2);
  179. //$("#field_file").empty().append(html);
  180. if (data.select.fields != null && data.select.fields != '') {
  181. $("#firstCheckForm #field_info li input").each(function () {
  182. if (data.select.fields.indexOf($(this).val()) != -1) {
  183. this.checked = true;
  184. }
  185. });
  186. }
  187. if (data.select.files != null && data.select.files != '') {
  188. $("#field_file input").each(function () {
  189. if (data.select.files.indexOf($(this).val()) != -1) {
  190. this.checked = true;
  191. }
  192. });
  193. }
  194. },
  195. yes: function (index, layero) {
  196. TalentInfo.submitFieldsAndFiles(index, data.id);
  197. }
  198. });
  199. } else {
  200. Feng.error(data.msg);
  201. }
  202. }, function (data) {
  203. Feng.error("查询失败!" + data.responseJSON.message + "!");
  204. });
  205. ajax.start();
  206. }
  207. }
  208. /**
  209. * 修改提交
  210. * @param index
  211. * @param id
  212. */
  213. TalentInfo.submitFieldsAndFiles = function (index, id) {
  214. var fields = '';
  215. var files = '';
  216. $("#firstCheckForm #field_info li input").each(function (index) {
  217. if ($(this).is(":checked")) {
  218. fields = fields + $(this).val() + ",";
  219. }
  220. });
  221. $("#field_file li input").each(function (index) {
  222. if ($(this).is(":checked")) {
  223. files = files + $(this).val() + ",";
  224. }
  225. });
  226. if (fields == '' && files == '') {
  227. Feng.info("请选择可修改的字段或附件!");
  228. return;
  229. }
  230. var ajax = new $ax("/enterprise/talent/updateFieldsAndFiles", function (data) {
  231. if (data.code == 200) {
  232. layer.close(index);
  233. Feng.success(data.msg);
  234. } else {
  235. Feng.error(data.msg);
  236. }
  237. }, function (data) {
  238. Feng.error("修改失败!" + data.responseJSON.message + "!");
  239. });
  240. ajax.setData({"id": id, "fields": fields, "files": files})
  241. ajax.start();
  242. }
  243. /**
  244. * 导出提交
  245. */
  246. TalentInfo.export = function (process, exportAll) {
  247. exportAll = typeof exportAll == "undefined" || exportAll == false ? 0 : 1;
  248. var names = '';
  249. var values = '';
  250. var commonExport = "";
  251. $("#field_info li input").each(function (index) {
  252. if ($(this).is(":checked")) {
  253. values = values + $(this).val() + ",";
  254. names = names + $(this).next().text() + ",";
  255. }
  256. });
  257. var queryData = TalentInfo.formParams();
  258. var process = parseInt($("#process").val());
  259. switch (process) {
  260. case 1:
  261. commonExport = "baseVerifyListExport";
  262. break;
  263. case 2:
  264. commonExport = "baseReverifyListExport";
  265. break;
  266. case 3:
  267. commonExport = "fstVerifyListExport";
  268. break;
  269. case 4:
  270. commonExport = "deptVerifyListExport";
  271. break;
  272. case 5:
  273. commonExport = "reVerifyListExport";
  274. break;
  275. case 6:
  276. commonExport = "preListExport";
  277. break;
  278. case 7:
  279. commonExport = "libraryListExport";
  280. break;
  281. }
  282. $("#commonExportModal").modal('hide');
  283. var params = $("#exportForm").serialize();
  284. var url = "/admin/talent/" + commonExport + "?" + params;
  285. Object.keys(queryData).forEach(function (key, index) {
  286. if (typeof queryData[key] != "undefined" && queryData[key]) {
  287. url += "&" + key + "=" + queryData[key];
  288. }
  289. })
  290. url += "&all=" + exportAll;
  291. window.location.href = url;
  292. }
  293. /**
  294. * 页面初始化
  295. */
  296. TalentInfo.init = function () {
  297. //批量加载字典表数据
  298. var arr = [
  299. {"name": "nation", "code": "nation"},
  300. {"name": "nationality", "code": "nationality"},
  301. {"name": "politics", "code": "politics"},
  302. {"name": "industry_field", "code": "industry_field"},
  303. {"name": "import_way", "code": "import_way"},
  304. {"name": "highest_degree", "code": "highest_degree"},
  305. {"name": "talent_type", "code": "talent_type"},
  306. {"name": "talent_arrange", "code": "talent_arrange"},
  307. {"name": "source", "code": "source"},
  308. {"name": "street", "code": "street"},
  309. {"name": "enterprise_tag", "code": "enterprise_tag"}, ];
  310. Feng.findChildDictBatch(JSON.stringify(arr));
  311. //TalentInfo.getIdentifyCondition();
  312. TalentInfo.getProvince();
  313. $("#talent_condition,#enterprise_id").on('chosen:ready', function (e, params) {
  314. $(".chosen-container-single .chosen-single").css("padding", "4px 0px 0px 4px");
  315. });
  316. $("#enterprise_id").val("");
  317. $("#enterprise_id").trigger('chosen:updated');
  318. $("#talent_condition,#enterprise_id").chosen({
  319. search_contains: true,    //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
  320. disable_search: false,
  321. width: "100%",
  322. enable_split_word_search: true
  323. });
  324. if ($("#company_id").length > 0) {
  325. $("#company_id").on('chosen:ready', function (e, params) {
  326. $(".chosen-container-single .chosen-single").css("padding", "4px 0px 0px 4px");
  327. });
  328. $("#company_id").val("");
  329. $("#company_id").trigger('chosen:updated');
  330. $("#company_id").chosen({
  331. search_contains: true,    //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
  332. disable_search: false,
  333. width: "100%",
  334. enable_split_word_search: true
  335. });
  336. }
  337. }
  338. /**
  339. * 下载附件
  340. */
  341. TalentInfo.download = function () {
  342. if (this.check()) {
  343. window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/common/api/downloadZip?type=1&id=" + TalentInfo.seItem.id));
  344. }
  345. }
  346. /**
  347. * 批量下载头像
  348. */
  349. TalentInfo.downloadPhoto = function () {
  350. var selected = $('#' + this.id).bootstrapTable('getSelections');
  351. if (selected.length == 0) {
  352. Feng.info("请先选中表格中的某一记录!");
  353. return false;
  354. }
  355. var ids = "";
  356. for (let i = 0; i < selected.length; i++) {
  357. ids = ids + selected[i].id + ",";
  358. }
  359. window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/api/commonDownload/downloadPhotos?type=1&ids=" + ids));
  360. }
  361. /**
  362. * 全选
  363. */
  364. TalentInfo.checkAll = function () {
  365. $("#field_info input").each(function () {
  366. this.checked = true;
  367. })
  368. $("#field_file input").each(function () {
  369. this.checked = true;
  370. })
  371. }
  372. /**
  373. * 反选
  374. */
  375. TalentInfo.unCheckAll = function () {
  376. $("#field_info input").each(function () {
  377. if (this.checked) {
  378. this.checked = false;
  379. } else {
  380. this.checked = true;
  381. }
  382. })
  383. $("#field_file input").each(function () {
  384. if (this.checked) {
  385. this.checked = false;
  386. } else {
  387. this.checked = true;
  388. }
  389. })
  390. }