talentInfo_common.js 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  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. queryData['industry_field'] = $("#industry_field").val();
  32. queryData['industry_field_old'] = $("#industry_field_old").val();
  33. queryData['enterprise_tag'] = $("#enterprise_tag").val();
  34. queryData['source'] = $("#source").val();
  35. queryData['city'] = $("#city").val();
  36. queryData['import_way'] = $("#import_way").val();
  37. queryData['highest_degree'] = $("#highest_degree").val();
  38. queryData['major'] = $("#major").val();
  39. queryData['title'] = $("#title").val();
  40. queryData['study_abroad'] = $("#study_abroad").val();
  41. queryData['phone'] = $("#phone").val();
  42. queryData['email'] = $("#email").val();
  43. queryData['breakFaith'] = $("#breakFaith").val();
  44. queryData['talent_type'] = $("#talent_type").val();
  45. queryData['isMatchZhiren'] = $("#isMatchZhiren").val();
  46. queryData['talent_arrange'] = $("#talent_arrange").val();
  47. queryData['street'] = $("#street").val();
  48. if ($("#talent_condition").val() == null || $("#talent_condition").val() == '' || $("#talent_condition").val() == "null") {
  49. queryData['talent_condition'] = "";
  50. } else {
  51. queryData['talent_condition'] = $("#talent_condition").val();
  52. }
  53. queryData['identifyMonth'] = $("#identifyMonth").val();
  54. queryData['checkState'] = $("#checkState").val();
  55. queryData['isPublic'] = $("#isPublic").val();
  56. queryData['active'] = $("#active").val()
  57. queryData['apply_year'] = $("#apply_year").val();
  58. queryData['isEffect'] = $("#isEffect").val();
  59. return queryData;
  60. }
  61. /**
  62. * 查询人才认定申报列表
  63. */
  64. TalentInfo.search = function () {
  65. TalentInfo.table.refresh({query: TalentInfo.formParams()});
  66. };
  67. /**
  68. * 重置
  69. */
  70. TalentInfo.reset = function () {
  71. $("#name").val("");
  72. $("#card_number").val("");
  73. $("#sex").val("");
  74. $("#nation").val("");
  75. $("#nationality").val("");
  76. $("#province").val("");
  77. $("#politics").val("");
  78. $("#enterprise_id").val("").trigger("chosen:updated");
  79. $("#industry_field").val("");
  80. $("#industry_field_old").val("");
  81. $("#enterprise_tag").val("");
  82. $("#source").val("");
  83. $("#fromCity").val("");
  84. $("#import_way").val("");
  85. $("#highest_degree").val("");
  86. $("#major").val("");
  87. $("#title").val("");
  88. $("#study_abroad").val("");
  89. $("#phone").val("");
  90. $("#email").val("");
  91. $("#breakFaith").val("");
  92. $("#talent_type").val("");
  93. $("#isMatchZhiren").val("");
  94. $("#talent_arrange").val("");
  95. $("#street").val("");
  96. $("#talent_condition").val("").trigger("chosen:updated");
  97. $("#checkState").val("");
  98. $("#identifyMonth").val("");
  99. $("#isPublic").val("");
  100. $("#active").val("")
  101. $("#apply_year").val("");
  102. $("#isEffect").val("");
  103. }
  104. /**
  105. * 获取人才认定
  106. */
  107. TalentInfo.getIdentifyCondition = function () {
  108. var level = $("#talent_arrange").val();
  109. if (level == null || level == '') {
  110. $("#talent_condition").empty();
  111. $("#talent_condition").trigger('chosen:updated');
  112. return;
  113. }
  114. Feng.addAjaxSelect({
  115. "id": "talent_condition",
  116. "displayCode": "id",
  117. "displayName": "name",
  118. "type": "GET",
  119. "url": Feng.ctxPath + "/common/api/findIdentifyConditionByLevel/level/" + level
  120. });
  121. $("#talent_condition").trigger('chosen:updated');
  122. }
  123. /**
  124. * 获取人才认定
  125. */
  126. TalentInfo.getProvince = function () {
  127. Feng.addAjaxSelect({
  128. "id": "province",
  129. "displayCode": "code",
  130. "displayName": "name",
  131. "type": "GET",
  132. "url": Feng.ctxPath + "/common/tool/getProvinceSelect"
  133. });
  134. }
  135. /**
  136. * 显示导出模态框
  137. */
  138. TalentInfo.showExportModal = function () {
  139. $("#exportForm")[0].reset();
  140. $("#commonExportModal").modal("show");
  141. }
  142. /**
  143. * 导出提交
  144. */
  145. TalentInfo.export = function (process) {
  146. var names = '';
  147. var values = '';
  148. var commonExport = "";
  149. $("#field_info li input").each(function (index) {
  150. if ($(this).is(":checked")) {
  151. values = values + $(this).val() + ",";
  152. names = names + $(this).next().text() + ",";
  153. }
  154. });
  155. var queryData = TalentInfo.formParams();
  156. var process = parseInt($("#process").val());
  157. switch (process) {
  158. case 1:
  159. commonExport = "baseVerifyListExport";
  160. break;
  161. case 2:
  162. commonExport = "baseReverifyListExport";
  163. break;
  164. case 3:
  165. commonExport = "fstVerifyListExport";
  166. break;
  167. case 4:
  168. commonExport = "deptVerifyListExport";
  169. break;
  170. case 5:
  171. commonExport = "reVerifyListExport";
  172. break;
  173. case 6:
  174. commonExport = "preListExport";
  175. break;
  176. case 7:
  177. commonExport = "libraryListExport";
  178. break;
  179. }
  180. $("#commonExportModal").modal('hide');
  181. var params = $("#exportForm").serialize();
  182. var url = "/admin/talent/" + commonExport + "?" + params;
  183. window.location.href = url;
  184. }
  185. /**
  186. * 页面初始化
  187. */
  188. TalentInfo.init = function () {
  189. //批量加载字典表数据
  190. var arr = [
  191. {"name": "nation", "code": "nation"},
  192. {"name": "nationality", "code": "nationality"},
  193. {"name": "politics", "code": "politics"},
  194. {"name": "industry_field", "code": "industry_field"},
  195. {"name": "import_way", "code": "import_way"},
  196. {"name": "highest_degree", "code": "highest_degree"},
  197. {"name": "talent_type", "code": "talent_type"},
  198. {"name": "talent_arrange", "code": "talent_arrange"},
  199. {"name": "source", "code": "source"},
  200. {"name": "street", "code": "street"},
  201. {"name": "enterprise_tag", "code": "enterprise_tag"}, ];
  202. Feng.findChildDictBatch(JSON.stringify(arr));
  203. //TalentInfo.getIdentifyCondition();
  204. TalentInfo.getProvince();
  205. $("#talent_condition,#enterprise_id").on('chosen:ready', function (e, params) {
  206. $(".chosen-container-single .chosen-single").css("padding", "4px 0px 0px 4px");
  207. });
  208. $("#enterprise_id").val("");
  209. $("#enterprise_id").trigger('chosen:updated');
  210. $("#talent_condition,#enterprise_id").chosen({
  211. search_contains: true,    //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
  212. disable_search: false,
  213. width: "100%",
  214. enable_split_word_search: true
  215. });
  216. }
  217. /**
  218. * 下载附件
  219. */
  220. TalentInfo.download = function () {
  221. if (this.check()) {
  222. window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/common/api/downloadZip?type=1&id=" + TalentInfo.seItem.id));
  223. }
  224. }
  225. /**
  226. * 批量下载头像
  227. */
  228. TalentInfo.downloadPhoto = function () {
  229. var selected = $('#' + this.id).bootstrapTable('getSelections');
  230. if (selected.length == 0) {
  231. Feng.info("请先选中表格中的某一记录!");
  232. return false;
  233. }
  234. var ids = "";
  235. for (let i = 0; i < selected.length; i++) {
  236. ids = ids + selected[i].id + ",";
  237. }
  238. window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/api/commonDownload/downloadPhotos?type=1&ids=" + ids));
  239. }
  240. /**
  241. * 全选
  242. */
  243. TalentInfo.checkAll = function () {
  244. $("#field_info input").each(function () {
  245. this.checked = true;
  246. })
  247. }
  248. /**
  249. * 反选
  250. */
  251. TalentInfo.unCheckAll = function () {
  252. $("#field_info input").each(function () {
  253. if (this.checked) {
  254. this.checked = false;
  255. } else {
  256. this.checked = true;
  257. }
  258. })
  259. }