talentInfo_common.js 7.9 KB

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