talentInfo_common.js 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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['idCard'] = $("#idCard").val();
  25. queryData['sex'] = $("#sex").val();
  26. queryData['nation'] = $("#nation").val();
  27. queryData['nationality'] = $("#nationality").val();
  28. queryData['provinceCode'] = $("#provinceCode").val();
  29. queryData['politics'] = $("#politics").val();
  30. queryData['enterpriseId'] = $("#enterpriseId").val();
  31. queryData['industryField'] = $("#industryField").val();
  32. queryData['source'] = $("#source").val();
  33. queryData['fromCity'] = $("#fromCity").val();
  34. queryData['introductionMode'] = $("#introductionMode").val();
  35. queryData['highEducation'] = $("#highEducation").val();
  36. queryData['major'] = $("#major").val();
  37. queryData['title'] = $("#title").val();
  38. queryData['studyAbroad'] = $("#studyAbroad").val();
  39. queryData['phone'] = $("#phone").val();
  40. queryData['email'] = $("#email").val();
  41. queryData['breakFaith'] = $("#breakFaith").val();
  42. queryData['talentType'] = $("#talentType").val();
  43. queryData['talentArrange'] = $("#talentArrange").val();
  44. queryData['address'] = $("#address").val();
  45. if ($("#identifyCondition").val() == null || $("#identifyCondition").val() == '' || $("#identifyCondition").val() == "null") {
  46. queryData['identifyCondition'] = "";
  47. } else {
  48. queryData['identifyCondition'] = $("#identifyCondition").val();
  49. }
  50. queryData['identifyMonth'] = $("#identifyMonth").val();
  51. queryData['checkState'] = $("#checkState").val();
  52. queryData['isPublic'] = $("#isPublic").val();
  53. queryData['active'] = $("#active").val()
  54. queryData['year'] = $("#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. $("#idCard").val("");
  70. $("#sex").val("");
  71. $("#nation").val("");
  72. $("#nationality").val("");
  73. $("#provinceCode").val("");
  74. $("#politics").val("");
  75. $("#enterpriseId").val("").trigger("chosen:updated");
  76. $("#industryField").val("");
  77. $("#source").val("");
  78. $("#fromCity").val("");
  79. $("#introductionMode").val("");
  80. $("#highEducation").val("");
  81. $("#major").val("");
  82. $("#title").val("");
  83. $("#studyAbroad").val("");
  84. $("#phone").val("");
  85. $("#email").val("");
  86. $("#breakFaith").val("");
  87. $("#talentType").val("");
  88. $("#talentArrange").val("");
  89. $("#address").val("");
  90. $("#identifyCondition").val("").trigger("chosen:updated");
  91. ;
  92. $("#checkState").val("");
  93. $("#identifyMonth").val("");
  94. $("#isPublic").val("");
  95. $("#active").val("")
  96. $("#year").val("");
  97. $("#isEffect").val("");
  98. }
  99. /**
  100. * 获取人才认定
  101. */
  102. TalentInfo.getIdentifyCondition = function () {
  103. // var level = $("#talentArrange").val();
  104. // if(level==null||level==''){
  105. // $("#identifyCondition").empty();
  106. // $("#identifyCondition").trigger('chosen:updated');
  107. // return;
  108. // }
  109. Feng.addAjaxSelect({
  110. "id": "identifyCondition",
  111. "displayCode": "id",
  112. "displayName": "name",
  113. "type": "GET",
  114. "url": Feng.ctxPath + "/common/api/findIdentifyConditionByLevel"
  115. });
  116. $("#identifyCondition").trigger('chosen:updated');
  117. }
  118. /**
  119. * 显示导出模态框
  120. */
  121. TalentInfo.showExportModal = function () {
  122. $("#exportForm")[0].reset();
  123. $("#commonExportModal").modal("show");
  124. }
  125. /**
  126. * 导出提交
  127. */
  128. TalentInfo.export = function (process) {
  129. var names = '';
  130. var values = '';
  131. $("#field_info li input").each(function (index) {
  132. if ($(this).is(":checked")) {
  133. values = values + $(this).val() + ",";
  134. names = names + $(this).next().text() + ",";
  135. }
  136. });
  137. var queryData = TalentInfo.formParams();
  138. $("#commonExportModal").modal('hide');
  139. var params = $("#exportForm").serialize();
  140. var url = "/admin/talent/commonExport?" + params;
  141. window.location.href = url;
  142. }
  143. /**
  144. * 页面初始化
  145. */
  146. TalentInfo.init = function () {
  147. //批量加载字典表数据
  148. var arr = [
  149. {"name": "nation", "code": "nation"},
  150. {"name": "nationality", "code": "nationality"},
  151. {"name": "politics", "code": "politics"},
  152. {"name": "industryField", "code": "industry_field"},
  153. {"name": "introductionMode", "code": "introduction_model"},
  154. {"name": "highEducation", "code": "highest_degree"},
  155. {"name": "talentType", "code": "talent_type"},
  156. {"name": "talentArrange", "code": "talent_arrange"},
  157. {"name": "source", "code": "source"},
  158. {"name": "address", "code": "street"}];
  159. Feng.findChildDictBatch(JSON.stringify(arr));
  160. TalentInfo.getIdentifyCondition();
  161. $("#identifyCondition,#enterpriseId").on('chosen:ready', function (e, params) {
  162. $(".chosen-container-single .chosen-single").css("padding", "4px 0px 0px 4px");
  163. });
  164. $("#identifyCondition,#enterpriseId").chosen({
  165. search_contains: true,    //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
  166. disable_search: false,
  167. width: "100%",
  168. enable_split_word_search: true
  169. });
  170. }
  171. /**
  172. * 下载附件
  173. */
  174. TalentInfo.download = function () {
  175. if (this.check()) {
  176. window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/common/api/downloadZip?type=1&id=" + TalentInfo.seItem.id));
  177. }
  178. }
  179. /**
  180. * 批量下载头像
  181. */
  182. TalentInfo.downloadPhoto = function () {
  183. var selected = $('#' + this.id).bootstrapTable('getSelections');
  184. if (selected.length == 0) {
  185. Feng.info("请先选中表格中的某一记录!");
  186. return false;
  187. }
  188. var ids = "";
  189. for (let i = 0; i < selected.length; i++) {
  190. ids = ids + selected[i].id + ",";
  191. }
  192. window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/api/commonDownload/downloadPhotos?type=1&ids=" + ids));
  193. }
  194. /**
  195. * 全选
  196. */
  197. TalentInfo.checkAll = function () {
  198. $("#field_info input").each(function () {
  199. this.checked = true;
  200. })
  201. }
  202. /**
  203. * 反选
  204. */
  205. TalentInfo.unCheckAll = function () {
  206. $("#field_info input").each(function () {
  207. if (this.checked) {
  208. this.checked = false;
  209. } else {
  210. this.checked = true;
  211. }
  212. })
  213. }