talentInfo_common.js 9.3 KB

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