integralCommon.js 4.3 KB

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