talentInfo_common.js 8.5 KB

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