talentInfo_common.js 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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.export = function (process, exportAll) {
  151. exportAll = typeof exportAll == "undefined" || exportAll == false ? 0 : 1;
  152. var names = '';
  153. var values = '';
  154. var commonExport = "";
  155. $("#field_info li input").each(function (index) {
  156. if ($(this).is(":checked")) {
  157. values = values + $(this).val() + ",";
  158. names = names + $(this).next().text() + ",";
  159. }
  160. });
  161. var queryData = TalentInfo.formParams();
  162. var process = parseInt($("#process").val());
  163. switch (process) {
  164. case 1:
  165. commonExport = "baseVerifyListExport";
  166. break;
  167. case 2:
  168. commonExport = "baseReverifyListExport";
  169. break;
  170. case 3:
  171. commonExport = "fstVerifyListExport";
  172. break;
  173. case 4:
  174. commonExport = "deptVerifyListExport";
  175. break;
  176. case 5:
  177. commonExport = "reVerifyListExport";
  178. break;
  179. case 6:
  180. commonExport = "preListExport";
  181. break;
  182. case 7:
  183. commonExport = "libraryListExport";
  184. break;
  185. }
  186. $("#commonExportModal").modal('hide');
  187. var params = $("#exportForm").serialize();
  188. var url = "/admin/talent/" + commonExport + "?" + params;
  189. Object.keys(queryData).forEach(function (key, index) {
  190. if (typeof queryData[key] != "undefined" && queryData[key]) {
  191. url += "&" + key + "=" + queryData[key];
  192. }
  193. })
  194. url += "&all=" + exportAll;
  195. window.location.href = url;
  196. }
  197. /**
  198. * 页面初始化
  199. */
  200. TalentInfo.init = function () {
  201. //批量加载字典表数据
  202. var arr = [
  203. {"name": "nation", "code": "nation"},
  204. {"name": "nationality", "code": "nationality"},
  205. {"name": "politics", "code": "politics"},
  206. {"name": "industry_field", "code": "industry_field"},
  207. {"name": "import_way", "code": "import_way"},
  208. {"name": "highest_degree", "code": "highest_degree"},
  209. {"name": "talent_type", "code": "talent_type"},
  210. {"name": "talent_arrange", "code": "talent_arrange"},
  211. {"name": "source", "code": "source"},
  212. {"name": "street", "code": "street"},
  213. {"name": "enterprise_tag", "code": "enterprise_tag"}, ];
  214. Feng.findChildDictBatch(JSON.stringify(arr));
  215. //TalentInfo.getIdentifyCondition();
  216. TalentInfo.getProvince();
  217. $("#talent_condition,#enterprise_id").on('chosen:ready', function (e, params) {
  218. $(".chosen-container-single .chosen-single").css("padding", "4px 0px 0px 4px");
  219. });
  220. $("#enterprise_id").val("");
  221. $("#enterprise_id").trigger('chosen:updated');
  222. $("#talent_condition,#enterprise_id").chosen({
  223. search_contains: true,    //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
  224. disable_search: false,
  225. width: "100%",
  226. enable_split_word_search: true
  227. });
  228. if ($("#company_id").length > 0) {
  229. $("#company_id").on('chosen:ready', function (e, params) {
  230. $(".chosen-container-single .chosen-single").css("padding", "4px 0px 0px 4px");
  231. });
  232. $("#company_id").val("");
  233. $("#company_id").trigger('chosen:updated');
  234. $("#company_id").chosen({
  235. search_contains: true,    //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
  236. disable_search: false,
  237. width: "100%",
  238. enable_split_word_search: true
  239. });
  240. }
  241. }
  242. /**
  243. * 下载附件
  244. */
  245. TalentInfo.download = function () {
  246. if (this.check()) {
  247. window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/common/api/downloadZip?type=1&id=" + TalentInfo.seItem.id));
  248. }
  249. }
  250. /**
  251. * 批量下载头像
  252. */
  253. TalentInfo.downloadPhoto = function () {
  254. var selected = $('#' + this.id).bootstrapTable('getSelections');
  255. if (selected.length == 0) {
  256. Feng.info("请先选中表格中的某一记录!");
  257. return false;
  258. }
  259. var ids = "";
  260. for (let i = 0; i < selected.length; i++) {
  261. ids = ids + selected[i].id + ",";
  262. }
  263. window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/api/commonDownload/downloadPhotos?type=1&ids=" + ids));
  264. }
  265. /**
  266. * 全选
  267. */
  268. TalentInfo.checkAll = function () {
  269. $("#field_info input").each(function () {
  270. this.checked = true;
  271. })
  272. $("#field_file input").each(function () {
  273. this.checked = true;
  274. })
  275. }
  276. /**
  277. * 反选
  278. */
  279. TalentInfo.unCheckAll = function () {
  280. $("#field_info input").each(function () {
  281. if (this.checked) {
  282. this.checked = false;
  283. } else {
  284. this.checked = true;
  285. }
  286. })
  287. $("#field_file input").each(function () {
  288. if (this.checked) {
  289. this.checked = false;
  290. } else {
  291. this.checked = true;
  292. }
  293. })
  294. }