IntegralLog.js 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. /**
  2. * 积分记录
  3. */
  4. var IntegralVerify = {
  5. id: "IntegralLogTable", //表格id
  6. seItem: null, //选中的条目
  7. table: null,
  8. layerIndex: -1
  9. };
  10. IntegralVerify.formParams = function () {
  11. var queryData = {};
  12. queryData['card_type'] = $("#card_type").val();
  13. queryData['card_number'] = $("#card_number").val();
  14. queryData['apply_year'] = $("#apply_year").val();
  15. queryData['enterprise_id'] = $("#enterprise_id").val();
  16. queryData['shareholder'] = $("#shareholder").val();
  17. return queryData;
  18. }
  19. /**
  20. * 初始化表格的列
  21. */
  22. IntegralVerify.initColumn = function () {
  23. var type = $("#type").val();
  24. return [
  25. {field: 'selectItem', radio: true},
  26. {title: '申报年度', field: 'apply_year', visible: true, align: 'center', valign: 'middle', width: '80px'},
  27. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "100px",
  28. formatter: function (value, row, index) {
  29. if (row.sex == 1) {
  30. return value + '<span style="color:#6495ED">【男】</span>';
  31. } else if (row.sex == 2) {
  32. return value + '<span style="color:#FF82AB">【女】</span>';
  33. } else {
  34. return value;
  35. }
  36. }
  37. },
  38. {title: '证件号码', field: 'card_number', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
  39. {title: '所属单位', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle', width: "100px"},
  40. {title: '是否股东', field: 'shareholder', visible: true, align: 'center', valign: 'middle', width: "100px",
  41. formatter: function (value, row, index) {
  42. if (value == 1) {
  43. return '是';
  44. }
  45. if (value == 2) {
  46. return '否';
  47. }
  48. }
  49. },
  50. {title: '申报标准', field: 'details', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
  51. {title: '首次提交时间', field: 'first_submit_time', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  52. {title: '最新提交时间', field: 'new_submit_time', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  53. {title: '增加积分', field: 'totalPoints', visible: true, align: 'center', valign: 'middle', width: "100px",
  54. formatter: function (value, row, index) {
  55. return value;
  56. }
  57. },
  58. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "80px",
  59. formatter: function (value, row, index) {
  60. return "<span class='label label-success' onclick=\"IntegralVerify.showLog('" + value + "')\" >" +
  61. "<i class=\"fa fa-book\"></i>日志" +
  62. "</span>";
  63. }
  64. }
  65. ];
  66. };
  67. /**
  68. * 检查是否选中
  69. */
  70. IntegralVerify.check = function () {
  71. var selected = $('#' + this.id).bootstrapTable('getSelections');
  72. if (selected.length != 1) {
  73. Feng.info("请先选中表格中的某一记录!");
  74. return false;
  75. } else {
  76. IntegralVerify.seItem = selected[0];
  77. return true;
  78. }
  79. };
  80. /**
  81. * 查询人才认定申报列表
  82. */
  83. IntegralVerify.search = function () {
  84. IntegralVerify.table.refresh({query: IntegralVerify.formParams()});
  85. };
  86. /**
  87. * 重置
  88. */
  89. IntegralVerify.reset = function () {
  90. $("#name").val("");
  91. $("#card_number").val("");
  92. $("#phone").val("");
  93. $("#email").val("");
  94. $("#checkState").val("");
  95. $("#apply_year").val("");
  96. $("#enterprise_id").val("").trigger("chosen:updated");
  97. $("#shareholder").val("");
  98. }
  99. /**
  100. * 显示导出模态框
  101. */
  102. IntegralVerify.showExportModal = function () {
  103. $("#exportForm")[0].reset();
  104. $("#commonExportModal").modal("show");
  105. }
  106. /**
  107. * 导出提交
  108. */
  109. IntegralVerify.export = function (process) {
  110. var names = '';
  111. var values = '';
  112. var commonExport = "";
  113. $("#field_info li input").each(function (index) {
  114. if ($(this).is(":checked")) {
  115. values = values + $(this).val() + ",";
  116. names = names + $(this).next().text() + ",";
  117. }
  118. });
  119. var queryData = IntegralVerify.formParams();
  120. commonExport = "integralLogListExport";
  121. $("#commonExportModal").modal('hide');
  122. var params = $("#exportForm").serialize();
  123. var url = "/admin/integralVerify/" + commonExport + "?" + params;
  124. window.location.href = url;
  125. }
  126. /**
  127. * 下载
  128. */
  129. IntegralVerify.download = function () {
  130. if (this.check()) {
  131. window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/common/api/downloadZip?type=20&id=" + IntegralVerify.seItem.id));
  132. }
  133. }
  134. IntegralVerify.openCheckIntegralVerify = function () {
  135. if (this.check()) {
  136. var index = layer.open({
  137. type: 2,
  138. title: '积分申报记录',
  139. area: ['800px', '420px'], //宽高
  140. fix: false, //不固定
  141. maxmin: true,
  142. content: '/admin/integralVerify/detail/id/' + IntegralVerify.seItem.id + '/1',
  143. btn: ['<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  144. btnAlign: 'c'
  145. });
  146. layer.full(index);
  147. IntegralVerify.layerIndex = index;
  148. }
  149. }
  150. /**
  151. * 显示审核日志
  152. */
  153. IntegralVerify.showLog = function (id) {
  154. layer.open({
  155. type: 1,
  156. title: "日志",
  157. fixed: false,
  158. content: '<table id="' + id + '"></table>',
  159. area: ['80%', '80%'],
  160. maxmin: true,
  161. success: function (layero, index) {
  162. Feng.getCheckLog(id, {"type": CONFIG.project_integral_apply, "mainId": id, "typeFileId": "", "active": 1})
  163. }
  164. });
  165. }
  166. IntegralVerify.creatFieldCheckModal = function () {
  167. return '<form id="firstCheckForm">\n' +
  168. ' <div class="form-group" style="margin: 10px;">\n' +
  169. ' <div >\n' +
  170. ' <label for="checkMsg" class="control-label">可修改字段</label>\n' +
  171. ' <div id="field_info">\n' +
  172. ' <ul>\n' +
  173. ' </ul>\n' +
  174. ' </div>\n' +
  175. ' <label for="checkMsg" class="control-label">可修改附件</label>\n' +
  176. ' <div id="field_file">\n' +
  177. ' </div>\n' +
  178. ' <div class="form-group" style="text-align: center">\n' +
  179. ' <button type="button" class="btn btn-primary" onclick="IntegralVerify.checkAll()">全选</button>\n' +
  180. ' <button type="button" class="btn btn-success" onclick="IntegralVerify.unCheckAll()">反选</button>\n' +
  181. ' </div>\n' +
  182. ' </div>\n' +
  183. ' </div>\n' +
  184. ' </form>';
  185. }
  186. /**
  187. * 全选
  188. */
  189. IntegralVerify.checkAll = function () {
  190. $("#field_info input").each(function () {
  191. this.checked = true;
  192. })
  193. }
  194. /**
  195. * 反选
  196. */
  197. IntegralVerify.unCheckAll = function () {
  198. $("#field_info input").each(function () {
  199. if (this.checked) {
  200. this.checked = false;
  201. } else {
  202. this.checked = true;
  203. }
  204. })
  205. }
  206. $(function () {
  207. var defaultColunms = IntegralVerify.initColumn();
  208. var process = $("#process").val();
  209. var card_type = $("#card_type").val();
  210. var card_number = $("#card_number").val();
  211. var table = new BSTable(IntegralVerify.id, "/admin/integralVerify/list/process/" + process + "/card_type/" + card_type + "/card_number/" + card_number, defaultColunms);
  212. table.setPaginationType("server");
  213. table.setSingleSelect(false);
  214. table.setOnDblClickRow(function () {
  215. IntegralVerify.openCheckIntegralVerify();
  216. });
  217. IntegralVerify.table = table.init();
  218. $("#enterprise_id").on('chosen:ready', function (e, params) {
  219. $(".chosen-container-single .chosen-single").css("padding", "4px 0px 0px 4px");
  220. });
  221. $("#enterprise_id").val("");
  222. $("#enterprise_id").trigger('chosen:updated');
  223. $("#enterprise_id").chosen({
  224. search_contains: true,    //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
  225. disable_search: false,
  226. width: "100%",
  227. enable_split_word_search: true
  228. });
  229. });