integralCommon.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. /**
  2. * 显示审核日志
  3. */
  4. IntegralInfo.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_integral_apply, "mainId": id, "typeFileId": "", "active": 1})
  14. }
  15. });
  16. }
  17. /**
  18. * 查询表单提交参数对象
  19. * @returns {{}}
  20. */
  21. IntegralInfo.formParams = function () {
  22. var queryData = {};
  23. queryData['name'] = $("#name").val();
  24. queryData['card_number'] = $("#card_number").val();
  25. queryData['phone'] = $("#phone").val();
  26. queryData['email'] = $("#email").val();
  27. queryData['checkState'] = $("#checkState").val();
  28. queryData['apply_year'] = $("#apply_year").val();
  29. queryData['enterprise_id'] = $("#enterprise_id").val();
  30. queryData['shareholder'] = $("#shareholder").val();
  31. queryData['veto'] = $("#veto").val();
  32. return queryData;
  33. }
  34. /**
  35. * 查询人才认定申报列表
  36. */
  37. IntegralInfo.search = function () {
  38. IntegralInfo.table.refresh({query: IntegralInfo.formParams()});
  39. };
  40. /**
  41. * 重置
  42. */
  43. IntegralInfo.reset = function () {
  44. $("#name").val("");
  45. $("#card_number").val("");
  46. $("#phone").val("");
  47. $("#email").val("");
  48. $("#checkState").val("");
  49. $("#apply_year").val("");
  50. $("#enterprise_id").val("").trigger("chosen:updated");
  51. $("#shareholder").val("");
  52. $("#veto").val("");
  53. }
  54. /**
  55. * 显示导出模态框
  56. */
  57. IntegralInfo.showExportModal = function () {
  58. $("#exportForm")[0].reset();
  59. $("#commonExportModal").modal("show");
  60. }
  61. /**
  62. * 导出提交
  63. */
  64. IntegralInfo.export = function (process) {
  65. var names = '';
  66. var values = '';
  67. var commonExport = "";
  68. $("#field_info li input").each(function (index) {
  69. if ($(this).is(":checked")) {
  70. values = values + $(this).val() + ",";
  71. names = names + $(this).next().text() + ",";
  72. }
  73. });
  74. var queryData = IntegralInfo.formParams();
  75. var process = parseInt($("#process").val());
  76. switch (process) {
  77. case 1:
  78. commonExport = "fstVerifyListExport";
  79. break;
  80. case 2:
  81. commonExport = "reVerifyListExport";
  82. break;
  83. case 3:
  84. commonExport = "preListExport";
  85. break;
  86. }
  87. $("#commonExportModal").modal('hide');
  88. var params = $("#exportForm").serialize();
  89. var url = "/admin/integralVerify/" + commonExport + "?" + params;
  90. window.location.href = url;
  91. }
  92. /**
  93. * 页面初始化
  94. */
  95. IntegralInfo.init = function () {
  96. //批量加载字典表数据
  97. var arr = [
  98. {"name": "nation", "code": "nation"}];
  99. Feng.findChildDictBatch(JSON.stringify(arr));
  100. $("#enterprise_id").on('chosen:ready', function (e, params) {
  101. $(".chosen-container-single .chosen-single").css("padding", "4px 0px 0px 4px");
  102. });
  103. $("#enterprise_id").val("");
  104. $("#enterprise_id").trigger('chosen:updated');
  105. $("#enterprise_id").chosen({
  106. search_contains: true,    //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
  107. disable_search: false,
  108. width: "100%",
  109. enable_split_word_search: true
  110. });
  111. }
  112. /**
  113. * 下载附件
  114. */
  115. IntegralInfo.download = function () {
  116. if (this.check()) {
  117. window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/common/api/downloadZip?type=20&id=" + IntegralInfo.seItem.id));
  118. }
  119. }
  120. /**
  121. * 批量下载头像
  122. */
  123. IntegralInfo.downloadPhoto = function () {
  124. var selected = $('#' + this.id).bootstrapTable('getSelections');
  125. if (selected.length == 0) {
  126. Feng.info("请先选中表格中的某一记录!");
  127. return false;
  128. }
  129. var ids = "";
  130. for (let i = 0; i < selected.length; i++) {
  131. ids = ids + selected[i].id + ",";
  132. }
  133. window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/api/commonDownload/downloadPhotos?type=20&ids=" + ids));
  134. }
  135. /**
  136. * 全选
  137. */
  138. IntegralInfo.checkAll = function () {
  139. $("#field_info input").each(function () {
  140. this.checked = true;
  141. })
  142. }
  143. /**
  144. * 反选
  145. */
  146. IntegralInfo.unCheckAll = function () {
  147. $("#field_info input").each(function () {
  148. if (this.checked) {
  149. this.checked = false;
  150. } else {
  151. this.checked = true;
  152. }
  153. })
  154. }