integralCommon.js 3.7 KB

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