talentInfo_common.js 7.7 KB

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